Payment Intents
Payment intents are the core payment object. Every checkout session creates a payment intent under the hood when the customer pays. You can also create payment intents directly for more control over the payment flow.
Payment intent lifecycle
CREATED → AUTHORIZED → CAPTURED → SETTLED. It can also be CANCELLED (before capture) or REFUNDED (after capture). If a dispute is raised, it moves to DISPUTED and then DISPUTE_RESOLVED or DISPUTE_LOST.Create a payment intent
Retrieve a payment intent
Check a payment intent's status at any time. Useful for polling or verifying the state after receiving a webhook.
List payment intents
Cancel a payment intent
Cancel a payment that hasn't been captured yet. This releases the authorized funds back to the customer.
Refund a payment
Refund a captured payment. The funds are sent back to the customer's wallet on-chain.
Refund timing
refundTxHash and webhook events to confirm completion.Webhooks
Listen for these events to track payment intent state changes:
| Event | Description |
|---|---|
payment.authorized | Customer gave approval to pull money from their wallet |
payment.captured | Funds taken from wallet, locked in escrow, and confirmed on-chain |
payment.settled | Funds released to your merchant wallet |
payment.refunded | Refund completed on-chain |
payment.disputed | Customer raised a dispute |
Methods reference
| Method | Description |
|---|---|
create(params) | Create a new payment intent |
retrieve(id) | Retrieve a payment intent by ID |
list(params?) | List payment intents with optional filters |
cancel(id) | Cancel an authorized payment |
refund(id, params?) | Refund a captured payment |
TypeScript types
Response body reference
All responses are wrapped in { success: true, data: ... }. The fields below describe what's inside data.
create() response
Returns all scalar fields only (no relations):
PaymentIntent (create)
idstringUnique payment intent ID (UUID)appIdstringYour app IDcustomerAccountIdstring | nullLinked customerexternalIdstring | nullYour external reference IDamountstringFiat amount (Decimal as string, e.g. "100.00")currencystringCurrency code, e.g. "USD"allowedChainsstring | number[]"ALL" or array of chain IDsallowedTokensstring | string[]"ALL" or array of token symbolscaptureModestring"AUTOMATIC" or "MANUAL"timelockDurationnumberEscrow timelock in seconds (default 604800 = 7 days)disputeStartDurationnumberDispute window in seconds (default 86400 = 1 day)statusstring"CREATED" at creationauthorizationMethodnullSet when customer authorizesauthorizationChainIdnullChain used for paymentauthorizationTokenKeynullToken key used (e.g. "USDC-8453")authorizationWalletAddressnullCustomer wallet addressauthorizationTxHashnullAuthorization transaction hashauthorizedAtnullTimestamp when authorizedcryptoAmountnullCrypto amount in smallest unitcryptoTokenKeynullToken key of crypto usedcryptoTokenDecimalsnullToken decimalsexchangeRatenullUSD-to-crypto exchange rate usedcaptureTxHashnullCapture transaction hashcapturedAtnullTimestamp when capturedcaptureAttemptsnumberNumber of capture attempts (0)timelockEndsAtnullWhen escrow timelock expiressettledAtnullTimestamp when settledrefundedAtnullTimestamp when refundedrefundTxHashnullRefund transaction hashrefundReasonnullReason for refundplatformFeeBpsnullPlatform fee in basis pointsexpiresAtstring | nullISO 8601 expiration timestampsourceTypestring | nullWhat created this intent (CHECKOUT_SESSION, INVOICE, etc.)sourceIdstring | nullID of the source entitysuccessUrlstring | nullRedirect URL after paymentcancelUrlstring | nullRedirect URL if cancelledmetadataobjectYour metadata key-value pairsidempotencyKeystring | nullIdempotency key if providedcreatedAtstringISO 8601 creation timestampupdatedAtstringISO 8601 last update timestampretrieve() response
Returns all scalar fields from create() above, plus three nested relations:
Additional fields on retrieve
transactionsTransaction[]On-chain transactions for this intentdisputeDispute | nullDispute details if one existscustomerAccountCustomerAccount | nullCustomer who paidTransaction (nested in transactions[])
idstringTransaction record ID (UUID)paymentIntentIdstring | nullLinked payment intentmtxmTxIdstring | nullMTXM service transaction IDtxHashstring | nullOn-chain transaction hashchainstringChain identifiertypestringAUTHORIZE, CAPTURE, SETTLE, DISPUTE, REFUND, or PAYOUTstatusstringPENDING, CONFIRMED, or FAILEDblockNumbernumber | nullBlock number when confirmedgasUsedstring | nullGas used for the transactionerrorstring | nullError message if failedcreatedAtstringISO 8601 timestampconfirmedAtstring | nullWhen the transaction was confirmedDispute (nested in dispute)
idstringDispute ID (UUID)paymentIntentIdstringLinked payment intentreasonstringReason for the disputeevidencestring | nullEvidence submittedstatusstringOPEN, RESOLVED_MERCHANT, or RESOLVED_PAYERresolvedBystring | nullWho resolved the disputedeadlinestringDispute resolution deadlinecreatedAtstringISO 8601 timestampresolvedAtstring | nullWhen it was resolvedlist() response
Returns an array of payment intents. Each has all scalar fields plus transactions[]. No dispute or customerAccount in list.
cancel() response
Returns all scalar fields only (no relations). The status field will be "CANCELLED".
refund() response
Returns the updated PaymentIntent object (same scalar shape as create()):
Key refund fields
idstringPayment intent IDstatusstringUpdated payment status (typically "REFUNDED" once finalized)refundReasonstring | nullRefund reason you providedrefundTxHashstring | nullOn-chain refund tx hash (when available)refundedAtstring | nullTimestamp when refund is finalized