Order statuses
An order’s status is one of the following:Get the order ID
The order ID is the wallet action ID of a deposit’s conversion. Not every wallet action ID is an order ID. Your app can get the order ID in any of the following ways:- Automation webhook: the
action_idfield of thewallet_automation.submittedwebhook. This webhook’swallet_idis the source wallet. Fetch the order with the destination wallet ID. - Swap webhooks: the
wallet_action_idfield of the conversion’swallet_action.swap.*webhooks. These webhooks also report status changes. - Polling: if your app has no order ID, get the next order after a timestamp.
order_id. Pass the wallet action ID as its value.
Get an order
Fetch an order by its order ID. Use the destination wallet ID from create, not the source wallet ID.Use
getOrder from the useHeadlessCryptoDeposit hook. The authenticated user must own the destination wallet.getOrder accepts an object with walletId, the destination wallet ID, and orderId. It returns a Promise for an order. It rejects when the wallet or order cannot be found.Order
string
Order ID. This is the wallet action ID of the deposit’s conversion.
'pending' | 'succeeded' | 'rejected' | 'failed'
Order status. See order statuses.
Get the next order
Fetch the earliest order into the destination wallet after a timestamp. Use this to poll for a deposit’s order when your app has no order ID. For example, record the time before showing a deposit address, then poll with that time.Use
getNextOrder from the useHeadlessCryptoDeposit hook.getNextOrder accepts an object with walletId and after. It returns a Promise for {order}, where order is null when no order exists after after.string
required
ISO 8601 timestamp in UTC, ending in
Z. Returns the earliest order strictly after this time.Related
Create a deposit account
Get deposit addresses for a destination wallet
Automation webhooks
Receive the order ID when a deposit is detected
Get order API
GET /v1/wallets/{wallet_id}/deposit_accounts/crypto/orders/{order_id}Get next order API
GET /v1/wallets/{wallet_id}/deposit_accounts/crypto/next_order
