A PayOrder is the core unit of work in CoinVoyage. Every payment — whether a user depositing funds to a wallet, a merchant collecting a sale, or a merchant issuing a refund — is represented as a PayOrder. You create one before showing the payment UI, and CoinVoyage updates it as the payment moves through detection, confirmation, execution, and settlement. Understanding the PayOrder object helps you handle each stage correctly in your integration.Documentation Index
Fetch the complete documentation index at: https://coinvoyage-3c99945b.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
PayOrder modes
CoinVoyage supports three PayOrder modes. You choose the mode when you create the order, and it determines how settlement is handled.- DEPOSIT
- SALE
- REFUND
A
DEPOSIT PayOrder moves funds directly to a wallet address you specify on a target chain. Use this when a user is topping up a wallet, funding an account, or making a transfer where you control the destination address.You specify toChain, toAddress, and either toAmount (token units) or a fiat equivalent. CoinVoyage handles conversion from whatever the user pays with.DEPOSIT PayOrders do not require an API secret for authorization. You can create them from client-side or server-side code using only your API key.PayOrder statuses
A PayOrder moves through a series of statuses as the payment progresses. Your webhook handler and any polling logic should account for each of these states.| Status | Description |
|---|---|
PENDING | The PayOrder has been created but is not yet ready for payment. |
AWAITING_PAYMENT | The PayOrder is ready. CoinVoyage is waiting for the user to send funds. |
AWAITING_CONFIRMATION | A payment transaction has been detected on-chain and is pending confirmation. |
OPTIMISTIC_CONFIRMED | The transaction is optimistically confirmed; execution can begin before full finality. |
EXECUTING_ORDER | Payment is confirmed and CoinVoyage is routing funds through the provider chain. |
COMPLETED | Funds have arrived at the destination. The PayOrder is complete. |
EXPIRED | The payment window elapsed before the user sent funds. |
REFUNDED | Execution failed and funds were automatically returned to the user’s refund address. |
FAILED | The PayOrder encountered an unrecoverable error during processing. |
PARTIAL_PAYMENT | The user sent less than the required amount; the order is in a terminal partial-payment state. |
Webhook subscription event types use uppercase
ORDER_* identifiers (e.g., ORDER_COMPLETED), but the JSON type field in the delivered payload uses lowercase payorder_* values (e.g., payorder_completed).EXPIRED, REFUNDED, FAILED, or PARTIAL_PAYMENT depending on where the problem occurs.
PayOrder metadata
You can attach structured metadata to any PayOrder when you create it. Metadata is visible in the dashboard and included in webhook payloads, making it useful for reconciliation, analytics, and displaying order context to the user.Items
Use theitems array to describe what the user is paying for. Each item can include a name, description, image URL, quantity, and unit price. This data surfaces in the payment modal and in dashboard order views.
Refund details
ForREFUND PayOrders, populate the refund object to record the reason and amount being refunded: