Skip to main content
When funds arrive at a deposit address, Privy creates a wallet action that converts them and delivers the target asset to the destination wallet. This wallet action is the deposit’s order. The order ID is that wallet action’s ID. Tracking orders is optional. Deposits are converted and delivered whether or not an app tracks them. Your app does not need to create, store, or show order IDs. Use orders to show conversion status to users or to reconcile deposits.

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_id field of the wallet_automation.submitted webhook. This webhook’s wallet_id is the source wallet. Fetch the order with the destination wallet ID.
  • Swap webhooks: the wallet_action_id field of the conversion’s wallet_action.swap.* webhooks. These webhooks also report status changes.
  • Polling: if your app has no order ID, get the next order after a timestamp.
The order endpoints keep the name 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.
useHeadlessCryptoDeposit is experimental and requires @privy-io/react-auth 3.46.0 or later. The interface may change without a major SDK version bump.
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.
useHeadlessCryptoDeposit is experimental and requires @privy-io/react-auth 3.46.0 or later. The interface may change without a major SDK version bump.
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.
object | null
An order with id and status, or null if no order exists after after.

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