Statuses
A payment starts as
pending and ends in one of the other three. Only completed payments count towards a checkout.
How a payment changes its checkout
- While a payment is
pending, the checkout’s status isconfirming. - When a payment is
completed, its USDC is added to the checkout’sreceived. If the checkout is now paid in full it becomescompleted. If not, it becomespartial. - If a payment ends as
refundedorfailed, it adds nothing. A checkout with no other payments goes back topending, or becomesexpiredif it is pastexpires_at.
share: how much of the checkout it covered. 1 is the full amount and 0.4 is 40%. A checkout is paid in full when the shares of its completed payments add up to 1, or fall short by no more than your underpayment allowance.
Read payments
Get a checkout returns its payments along with the checkout. To get payments on their own, list them, optionally for one checkout:network and token are what the customer paid with. The amounts are explained in Fees and settlement.
Transactions
A payment records two transactions:
Look either one up in a block explorer for its network.
Events
Payments send three webhook events:payment.pending, payment.completed and payment.refunded. No event is sent when a payment ends as failed.
To decide whether an order is paid, use the checkout’s events and status, not the payment’s. A completed payment can still leave its checkout partial.