Overview
You can query the status of any deBridge order using its order ID. The status response includes detailed information about the order’s current state, chain information, token amounts, and more.Prerequisites
- Node.js installed
- An order ID from a previous transaction
API Endpoint
Parameters
| Parameter | Type | Description |
|---|---|---|
orderId | string | The unique order identifier (32-byte hex string) |
Response
The endpoint returns detailed order information including:- Order state and timestamps
- Source and destination chain details
- Token addresses and amounts
- Transaction hashes
- Fulfillment information
Implementation
Utility Function
The example repository provides a utility function for querying order status:Complete Example
Here’s a complete example script that queries an order’s status:src/scripts/orders/queries/get-order-status.ts
Running the Example
Update the order ID
Open
src/scripts/orders/queries/get-order-status.ts and replace the orderId value with your order ID.Example Response
A successful response includes comprehensive order details:Error Handling
The utility function includes comprehensive error handling:HTTP Error Response
HTTP Error Response
If the API returns a non-200 status code:
API Error Response
API Error Response
If the API returns an error in the response body:
Network Error
Network Error
If the network request fails:
Order States
TheorderState field can have the following values:
Order has been created on the source chain but not yet fulfilled.
Order has been successfully completed on the destination chain.
The unlock transaction has been sent (for orders that weren’t immediately fulfilled).
The unlock funds have been claimed by the user.
The order was cancelled before fulfillment.
Orders in
Fulfilled, SentUnlock, or ClaimedUnlock states are considered successfully completed from the user’s perspective.Polling for Updates
You can poll the endpoint to track order progress:Next Steps
Get Order ID
Learn how to retrieve order IDs from transaction hashes.
Cancel Order
Understand how to cancel pending orders.