Get Orders History
Learn how to retrieve order history using the Okto SDK.
The getOrdersHistory
function retrieves the transaction history of orders placed by the authenticated user.
Available on





To enable these chains for your application, please configure them in the Okto Dashboard.
Not available on
Example
Important: Transaction Lifecycle
The getOrderHistory
function fetches the current status of a transaction on the Okto chain. However, the transaction status will continue to update on the Okto chain as it progresses through various stages in the Distributed Transaction Network (DTN).
To track a transaction to completion:
- Keep fetching the order history for your specific
jobId
until the status shows "SUCCESSFUL" - Once successful, the transaction hash will be available in the response
- Use this transaction hash to verify the transaction on the destination chain's explorer
Note
For error handling:
- Use the error code to debug issues. Check out the SDK errors and warnings documentation
- For help, navigate to the troubleshooting guide to contact support
Method Overview
Method | Description |
---|---|
async getOrdersHistory | Get order history for the user |
Get Orders History
async getOrdersHistory(oktoClient: OktoClient, filters?: OrderFilterRequest)
retrieves the transaction history of orders placed by the user.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
oktoClient | OktoClient | Instance of OktoClient obtained from useOkto hook | Yes |
filters | OrderFilterRequest | Optional filters for the orders query | No |
Where OrderFilterRequest
contains:
Field | Type | Description |
---|---|---|
intentId | string | Optional ID to filter specific order/transaction |
status | STATUS_TYPE | Optional status to filter orders by (e.g., "SUCCESSFUL", "FAILED", "PENDING", "REJECTED") |
intentType | INTENT_TYPE | Optional type to filter orders by (e.g., "TOKEN_TRANSFER", "NFT_TRANSFER", "RAW_TRANSACTION") |
Response
Success Response
Field Name | Type | Description |
---|---|---|
orders | Promise<Order[]> | Array of order history items |