Flow map
Example 1: Let users deposit to their own wallet
Use this pattern when a user wants to fund a wallet or account on a destination chain while paying from a different chain or token.Best for
Order mode
DEPOSITFlow
Collect the destination
Create a Deposit order
DEPOSIT order with the destination chain, destination token, amount, and recipient address.Open the payment modal
PayButton or pass the generated orderId to your own checkout UI.Track completion
ORDER_COMPLETED, ORDER_EXPIRED, ORDER_REFUNDED, and ORDER_ERROR events.Implementation notes
DEPOSITcan use the public API key because the user-provided destination defines where funds go.- Store your internal account or session ID in order metadata if the deposit credits an app balance.
- Use webhooks for final crediting. Browser callbacks are useful for UI updates, but they should not be your only fulfillment signal.
- This flow does not require off-ramp verification, a linked bank account, or a fiat payout unless you later add a fiat off-ramp experience.
Example 2: Accept merchant checkout payments
Use this pattern when your application sells products, bookings, subscriptions, credits, or services and you want settlement to your configured merchant wallet or a specific settlement asset.Best for
Order mode
SALEFlow
Create an internal order
Create a Sale order on the server
ApiClient.createSaleOrder() with your API secret. Include your internal order ID in metadata.Pass only the order ID to the client
orderId. Do not expose the API secret.Fulfill from webhooks
ORDER_COMPLETED.Implementation notes
SALEmust be created server-side because it authorizes settlement to your merchant configuration.- Make fulfillment idempotent by internal order ID and CoinVoyage order ID.
- Handle
EXPIRED,FAILED,REFUNDED, andPARTIAL_PAYMENTstates so unpaid orders do not remain ambiguous. - Fiat off-ramp payout is a separate, optional follow-up flow. If you settle to your EOA or another configured wallet, you can move funds directly on-chain without using bank-account payouts.
Example 3: Swap between supported assets
Use this pattern when you want a wallet to exchange one supported on-chain asset for another. For checkout and deposit flows, CoinVoyage can route swaps as part of payment execution; use the standalone swap APIs when the swap itself is the user action.Best for
API methods
swapQuote(), swapExecute()Flow
Collect swap intent
Get a swap quote
ApiClient.swapQuote() with the source and destination details so the user can review the expected output and route.Get execution data
ApiClient.swapExecute() to create the payment instructions required to fund and execute the swap.Sign and submit
Implementation notes
- Standalone swaps create an internal
SWAPorder and return payment instructions for funding the swap. - Treat quotes as time-sensitive. Refresh the quote if the user waits, changes wallets, or changes the source amount.
- Show slippage, fees, source asset, destination asset, and destination chain before the user signs.
- Keep swap execution separate from fiat off-ramp payouts. A swap changes on-chain assets; an off-ramp intent moves eligible settlement funds to a linked bank account.
Example 4: Off-ramp settlement funds to a bank account
Use this pattern only when you want CoinVoyage to help move an on-chain settlement balance to fiat through a linked bank account. The off-ramp verification, bank-account, and off-ramp intent APIs belong here because they prepare and execute the optional off-ramp path.Best for
API areas
Flow
Complete KYC or KYB
ApiClient.createOffRampVerification() and check the organization’s verification status with ApiClient.getOffRampVerificationStatus().Add a bank account
ApiClient.addBankAccount(), then use listBankAccounts() or getBankAccount() when an operator selects where funds should go.Create an off-ramp intent
ApiClient.createOffRampIntent() from your server with the source currency, amount, linked bank account ID, withdrawal currency, payment rail, and sender wallet address.Execute and reconcile
listOffRampIntents() and your internal ledger.Implementation notes
- Off-ramp verification, bank account, and off-ramp intent methods are signed server-side operations. Never expose the API secret to the browser.
- Bank account details must match the verified individual or business profile for the organization.
- Keep payment settlement and fiat payout as separate ledger events. A completed order means funds reached the destination wallet; a completed off-ramp intent means a later fiat payout finished.
- Use Supported regions to choose the correct fiat rail and recipient fields before adding bank-account forms.
Example 5: Send no-code payment invoices
Use this pattern when an operator wants to request payment without building a custom checkout flow.Best for
Interface
Flow
Create the invoice
Send the payment request
Customer pays with crypto
Reconcile the invoice
Implementation notes
- Invoices are useful when you do not need an embedded checkout or SDK integration.
- Use clear line items and due dates so finance and support can reconcile payments later.
- If invoices need to update an internal system, subscribe to webhook events and store invoice identifiers in metadata.
Example 6: Pay protected resources with x402 (Preview)
Use this pattern when an agent, server, or automation flow needs to fetch a protected resource, satisfy an x402PAYMENT-REQUIRED challenge, and retry the request with a PAYMENT-SIGNATURE header.
Flow
Request the protected resource
PAYMENT-REQUIRED challenge with one or more acceptable payment requirements.Select an acceptable payment requirement
@coin-voyage/paykit-headless to decode the challenge and choose a supported chain, network, asset, and amount.Sign and retry
PAYMENT-SIGNATURE header.