Skip to content

Build path by ID

POST /build-path-by-id

Exchange a quoteId returned by GET /quote for an executable transaction. The quote must still be within its expiry window; expired or unknown quote ids return 404. Set simulation to true to flag the returned transaction for simulation instead of live submission.

Authentication

Send your API key in the api-key header.

Request body (application/json)

{
  "quoteId": "8c6f1d0b8a9e4f2c5d3b7a1908e6c4f2d0b8a6e4c2f0d8b6a4e2c0f8d6b4a2e0",
  "simulation": false
}

Responses

Status Description
200 Executable transaction for the stored quote.
400 Invalid stored quote data, e.g. a malformed token address. Plausible catalog codes behind the numeric status include VALIDATION_001 (invalid input) and VALIDATION_002 (invalid address format).
401 Missing or invalid API key. Plausible catalog codes behind the numeric status are AUTH_001 (unauthorized access) and AUTH_002 (invalid API key).
404 Quote not found or expired. Plausible catalog code behind the numeric status is RESOURCE_001 (requested resource not found).
500 Unexpected server-side failure. Plausible catalog codes behind the numeric status include SYSTEM_002 (internal server error) and SYSTEM_001 (database operation failed).
200 response
{
  "code": 0,
  "message": "success",
  "data": {
    "allowanceTarget": "0x2B4c6E9A1d3F5b7C9E0a2C4E6a8B0d2F4A6C8E01",
    "chain": 8453,
    "data": "0x38ed1739000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000420000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000003b9aca00",
    "expiry": 1785283500,
    "gasLimit": "250000",
    "simulation": false,
    "to": "0x2B4c6E9A1d3F5b7C9E0a2C4E6a8B0d2F4A6C8E01",
    "value": "0"
  }
}
400 response
{
  "code": 400,
  "data": null,
  "message": "bad fromToken"
}
401 response
{
  "code": 401,
  "data": null,
  "message": "missing api-key header"
}
404 response
{
  "code": 404,
  "data": null,
  "message": "quote not found or expired"
}
500 response
{
  "code": 500,
  "data": null,
  "message": "internal server error"
}