Payment acceptance phase of the order lifecycle for pay with crypto
Order Creation or Update
API Response
serializedTransaction
that your
application uses to request payment from the user’s wallet.User Confirms Transaction
Poll for Status
quote
phase of the order the payment status will be requires-quote
.awaiting-payment
, which indicates that the order is ready to be paid. However, it can also begin with requires-crypto-payer-address
if this information is missing.
See below the full list of possible statuses:
Payment Status | Explanation |
---|---|
requires-quote | still in the quote phase |
requires-crypto-payer-address | payment.payerAddress is missing |
crypto-payer-insufficient-funds | payerAddress cannot cover purchase for chain/currency given |
awaiting-payment | ready to submit payment |
completed | order is in the delivery or order completion phase |
completed with payment.refunded | payment was completed but has been refunded |
PATCH
/api/2022-06-09/orders/<orderId>
payerAddress
is the wallet the user will be sending the payment from. Note that you must send the entire payment object even if the currency and/or method values are not changing.
awaiting-payment
you’ll have everything necessary to request the crypto payment from your user. The details will be returned in the order.payment.preparation
property.
Example response
order.payment.preparation
property contains details about the chain that Crossmint is expecting the payment to be received on, the payer address, and a serializedTransaction
that you can use to open a payment request in the user’s wallet. See examples of how to parse the response and request transaction confirmation from the user below:
signAndSendTransaction
function in the code snippet(s) above will open the user’s wallet and enable them to confirm the crypto payment.
payment.status
is completed
but the order also contains a payment.refunded
property. This indicates that the payment was initially successful but has since been refunded.
payment.refunded
object includes the following fields:
amount
: The amount that was refundedcurrency
: The currency of the refundtxId
: The on-chain transaction ID the refund was sent inchain
: The blockchain where the refund transaction occurredtxId
) so users can verify the refund on-chain