Skip to main content
This guide walks through the complete order submission flow: check authorization, fetch quote calldata, sign, and broadcast the transaction.

Prerequisites

  • A route identified from Route Discovery
  • Wallet with sufficient offer asset balance (at least the route’s minOrderSize)
  • Native token (ETH) for gas, plus the messaging fee on cross-chain routes

Step 0: Check Authorization

Before submitting an order, check whether the offer token requires approval for the quote’s transaction.to. This endpoint requires the x-api-key header.
The spender is the quote’s transaction.to. To get it, first request a quote without permit parameters (Step 1), then run this check against its transaction.to.
GET /v3/core/authorization

Response

Handling Each Path

Every quote expires at the deadline in its Quote struct, a Unix timestamp in seconds. Before you submit, read the deadline from the decoded args (request the quote with responseFormat=full or responseFormat=structured, see Response Formats) or decode transaction.data yourself. If the deadline has passed, for example while you waited for an approval receipt, request a new quote. A submission after the deadline reverts on-chain and still costs gas. A quote lasts at most 15 minutes, and at most 2 minutes on a dynamically priced route.

Step 1: Get Order Quote

GET /v1/transit/orders/quote This endpoint returns everything needed to submit the transaction: the contract address, ABI-encoded calldata, and the native token value to send (the messaging fee on cross-chain routes, "0" on same-chain routes).

Parameters

Example Request

Response

Step 2: Understand the Response

Some routes are priced dynamically per order against live liquidity. A quote on such a route is specific to its offerAmount and is not cached: request a new quote if the amount changes.

Step 2b (Optional): Verify Quote Integrity

The returned calldata is bound to your exact quote parameters and is verified on-chain when you submit your order, so if any parameters differ from the quote, the order submission will result in an error. The quote expires at the deadline in its Quote struct, a Unix timestamp in seconds. If you’d like additional security guarantees, you can decode the transaction.data returned from the Quote endpoint and verify that the decoded parameters match the parameters you requested. Use responseFormat=full or responseFormat=structured to access the decoded args array and inspect the Quote struct directly.

Step 3: Submit the Transaction

Broadcast the transaction using the returned to, data, and value fields. Send exactly transaction.value.

Code Example (viem)

Step 4: Record the Order ID

The transaction receipt contains an OrderSubmitted event with the order ID (0x + 64 hex chars). Use this ID to track fulfillment via the Order Tracking endpoints.

Response Formats

Control the transaction response structure with responseFormat:

Distributor Codes

The optional distributorCode parameter accepts a 32-byte hex string (0x + 64 chars) for tracking order sources on-chain. If omitted, the quote uses your organization’s configured distributor code when called with an API key, otherwise the zero hash.

Common Errors

Next Steps

Order Tracking

Monitor order status and view execution history.