v3 upgrade is breaking. Keep your v2 integration running until you have tested order creation, payment completion, webhooks, refunds, swaps, and any off-ramp workflows in your target environment.
What changes
Migration checklist
- Upgrade CoinVoyage dependencies to v3, including
@coin-voyage/paykit@^3. - Update
ApiClientPayOrder helper names with the v3 Order helper names. - Update
PayButtonandPayButton.CustomfrompayIdtoorderId. - Replace
onPaymentStartedwith the more specific payment lifecycle callbacks. - Update webhook handlers to read
{ event, delivered_at, order }. - Run a full test payment and verify that webhook fulfillment remains idempotent.
Upgrade PayKit
Update ApiClient initialization
ApiClient is now called as a factory function from @coin-voyage/paykit/server.
/v3 prefix:
Rename order methods
Replace v2 PayOrder helper names with v3 Order helper names.Deposit order before and after
Sale order before and after
Update PayButton
UseorderId for server-created orders. Client-side deposit buttons still use toChain, toToken, toAmount, and toAddress.
Update provider configuration
PayKitProvider no longer documents the v2 theme preset prop or options.embedGoogleFonts. Use mode and customTheme instead.
config.sui.rpcUrl to config.sui.grpcUrl:
Update swaps
Standalone swaps still useswapQuote() for the quote step. Use swapExecute() for execution data.
Update off-ramp flows
v3 names the fiat payout workflow as off-ramp verification, bank accounts, and off-ramp intents.
Bank-account helpers remain part of the off-ramp workflow:
listBankAccounts(apiSecret), getBankAccount(bankAccountId, apiSecret), and addBankAccount(params, apiSecret).
Update webhooks and WebSockets
v3 webhook and/v3/ws deliveries use the same event envelope:
type values such as payorder_completed.
ORDER_CREATEDORDER_AWAITING_PAYMENTORDER_CONFIRMINGORDER_EXECUTINGORDER_COMPLETEDORDER_ERRORORDER_REFUNDEDORDER_EXPIREDORDER_PARTIAL_PAYMENT
Test before switching production traffic
Before you route production users to v3:- Create a
DEPOSITorder and verify the destination wallet receives funds. - Create a server-side
SALEorder and render it withorderId. - Verify
ORDER_COMPLETED, failed, expired, refunded, and partial-payment webhook handling. - Run a refund through
createRefundOrder(). - Run
swapQuote()andswapExecute()if your product exposes standalone swaps. - Run the off-ramp verification and off-ramp intent flow if you use fiat payouts.
- Confirm your webhook handler is idempotent by
event,delivered_at,order.id, and your internal ID inorder.metadata.