Get Order Details

Fetch detailed information about a previously registered swap intent using the order ID. This API returns the status, route, fee, swapper inputs/outputs, and execution steps associated with the order. It is typically used to track the progress or outcome of a swap intent. Check out the orderDetails API template script for implementation details.

Understanding Order Status

The orderData.status field in the response indicates your order’s current state:

Status CodeDescription
-1Order expired. The order did not register on-chain. Terminal state.
0Order received by the backend but not yet registered on-chain.
1Order registered on-chain but not yet filled.
2Order settled successfully. Terminal state.
3Order in dispute. The order was filled but not yet settled.
4Order refunded. The order was not filled, and user was refunded. Terminal state.
POST
/vpc/v1/order-details

Authorization

x-authorization-secret<token>

Trade Service Secret (set this to the value of TRADE_SERVICE_SECRET from .env)

In: header

Request Body

application/jsonRequired
orderIdstring
caipIdstring
curl -X POST "https://okto-trade-service.oktostage.com//vpc/v1/order-details" \
  -H "x-authorization-secret: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "orderId": "0x9262a7731f07f74e7746f682220a3a8e2d51ca8fcc33f0cd08c469d79a2814e8",
    "caipId": "eip155:42161"
  }'

Fetched

{
  "status": "1",
  "filler": "0x31Fd17cf0E242C38456E34c1245fDdD426b6fcdf",
  "fillDeadline": "1751961723",
  "orderDataType": "0",
  "user": "0x8aaf1F5A168EE78D1b96df345eCaf0098607B8F6",
  "destinationTx": "",
  "orderData": {
    "integrator": "0x0000000000000000000000000000000000000000",
    "integratorFeeBps": "0",
    "minReceived": [
      {
        "token": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
        "amount": "500000",
        "recipient": "0x31Fd17cf0E242C38456E34c1245fDdD426b6fcdf",
        "chainId": "43376495806317063146517865045423980218291426573811029661813620785995169497246"
      }
    ],
    "fillInstructions": [
      {
        "destinationChainId": "30623935521215732608318225916586969493646139388472508660171461673454691529708",
        "destinationSettler": "0x080eE0f7519b805c41153CC51d79b0C755f76006",
        "originData": {
          "originChainId": "",
          "fillOutputs": {}
        }
      }
    ]
  },
  "permitDataToSign": "",
  "routeExpiry": "1m0s"
}