Three axes and when a payment is done
A flow has no single status field. Instead, it reports three:
A payment is done when
settlementState is completed. A payment has failed when executionState or settlementState is failed.
Settlement starts only after execution reaches source_confirmed. Reaching source_confirmed means the payer’s funds arrived, but delivery to your destination can still be in progress or can still fail, so do not fulfill an order on source_confirmed alone.
Execution states
cancelled, expired, and failed are final. source_confirmed is final on the execution axis, and the flow continues on the settlement axis.
The states initiated, source_attached, quoted, and signing come before the payment is sent. In those states the payer can switch source, and the flow can be cancelled or can expire. Once a flow reaches broadcasted or source_detected, neither the payer nor your server can change it, and the flow ends in source_confirmed or failed.
The following diagram shows how a payment moves forward on the execution axis. Any state before the payment is sent can also move to cancelled or expired, and any state other than initiated and source_confirmed can move to failed.
Settlement states
A payment that needs a swap or bridge moves from
none to settling and then to completed or failed. A direct wallet transfer, a deposit-address payment, and an exchange payment move from none straight to completed.
Risk states
cleared on an exchange or deposit-address payment does not mean the funder was screened. A blocked result does not change the execution state, so the payer can attach a different source to the same flow. Screening explains when screening runs.
Paths by payment source
A deposit-address flow can also move from
quoted straight to source_confirmed without reporting source_detected. In a withdraw flow, your platform’s wallet is the wallet source and signs the payment.
What can change and until when
Resuming a flow
A payer can leave and come back, and how the payment resumes depends on where they come back. When the payer attaches a source, the flow issues a session token, and the SDK stores it on the payer’s device. That token is required for every step after attaching: quoting, approving, reporting the transaction, and cancelling. Reading the flow needs only the flow ID.- Same browser or app. The stored token is still there, so the payer resumes from the flow’s current state.
- Another device, or cleared storage. The page can read the flow, but it has no token. Before the payment is sent, the payer attaches a source again. That issues a new token on the new device, and the token on the old device stops working. After the payment is sent, nothing is left for the payer to do, and the page only shows progress.
signing cannot tell whether the payer already approved the payment in their wallet. Treat the payment as processing and keep reading the flow instead of asking the payer to approve again, because a second approval could send a second payment.
To resume correctly, read the flow and act on its current state instead of repeating the last request. A request that is not valid from the current state is rejected.
Amounts you will see
A flow reports three kinds of amount: what was requested, what was quoted, and what was delivered. They can differ, so show the one that matches the question the payer is asking.Short payments depend on the mode
The mode decides what happens when less than the requested amount arrives.depositmode accepts the smaller amount. The flow settles, andsettlement.amountandsettledAmountrecord what actually arrived. Show the payer that amount, and credit that amount, not the flow’samount.paymentmode does not accept it. A short deposit-address payment is not settled, and the deposit provider attempts to return it to the payer’s refund address. A short exchange payment fails. In this mode,completedmeans the payment was accepted in full.
Limits of the delivered amount
- The
settlementobject is written only when settlement reachescompleted. Before that, it is absent. settlement.amountandsettledAmountare present only when the provider or the chain reports the delivered amount. Dynamic does not estimate it.amountUsdcan be absent even whenamountis present.
deposit flow, verify the settlement transaction (settlementTxHash) on chain before you credit an amount.
Observing progress
Your server learns about state changes from webhooks: one event type per axis, each with the previous and new state. Your server can also read the full flow at any time with its API token. A payer’s page reads the flow again while it waits for the payment to move forward. The JavaScript and Flutter SDKs handle this for you. Use your server’s view, not the page’s, to decide whether to fulfill an order. Access and data explains why.Next
Expiry and cancellation
How long a flow and a quote last, and who can cancel.
Failures and refunds
Failure codes, refunds, and what to show the payer.