ORCHESTRATION API
GET /orders/{originChain}/{orderId}
Returns the full on-chain state plus indexer enrichment for a single order.
This endpoint returns the full on-chain state plus indexer enrichment for a single order.
TypeScript Types: Generate types for this API with a single command. See
Type Generation.
API Reference: For detailed schema definitions and interactive testing,
see the API Reference.
Request
Endpoint
GET /orders/{originChain}/{orderId}
Headers
x-api-key: YOUR_API_KEY
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
originChain | Chain | Yes | The chain where the order was created (e.g., Ethereum) |
orderId | string | Yes | The order ID to retrieve |
Example Request
import type { components } from "./m0-swap";
type Order = components["schemas"]["Order"];
const originChain = "Ethereum";
const orderId = "0xabc123";
const response = await fetch(
`https://gateway.m0.xyz/v1/orchestration/orders/${originChain}/${orderId}`,
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
},
);
if (response.status === 404) {
throw new Error("Order not found");
}
if (!response.ok) {
const error = await response.text();
throw new Error(`Get order failed: ${error}`);
}
const order: Order = await response.json();
Response
Success Response (200)
Returns an Order object. On-chain fields are authoritative; indexer-only fields (openTx,
fillCount, fillReportCount, resolvedAt, fills) are optional and may be absent if the
indexer has not yet caught up or is unavailable.
import type { components } from "./m0-swap";
type Order = components["schemas"]["Order"];
type OrderStatus = components["schemas"]["OrderStatus"];
type Fill = components["schemas"]["Fill"];
Response Fields
| Field | Type | Description |
|---|---|---|
orderId | string | Unique order identifier |
version | number | Order version |
nonce | string | Order nonce |
sender | string | Sender wallet address |
recipient | string | Recipient wallet address |
originChainId | number | Origin chain ID |
destChainId | number | Destination chain ID |
tokenIn | string | Input token address |
tokenOut | string | Output token address |
amountIn | string | Input amount (smallest unit) |
amountOut | string | Target output amount (smallest unit) |
designatedSolver | string | Assigned solver address |
createdAt | number | Creation timestamp (Unix seconds) |
fillDeadline | number | Fill deadline timestamp (Unix seconds) |
status | OrderStatus | Current status (CREATED, COMPLETED, CANCELLED) |
amountOutFilled | string | Total output filled so far |
amountInReleased | string | Input amount released so far |
amountRefunded | string | Amount refunded |
openTx | string | null | Transaction hash that opened the order |
fillCount | number | null | Number of fills |
fillReportCount | number | null | Number of fill reports |
resolvedAt | number | null | Resolution timestamp when applicable |
fills | Fill[] | null | Fill events recorded by the indexer, chronological |
Fill Fields
An order may have multiple fills when filled by multiple solvers or in multiple transactions.
| Field | Type | Description |
|---|---|---|
filledAt | number | Fill timestamp (Unix seconds) |
chainId | number | Chain ID where the fill occurred |
transactionHash | string | Fill transaction hash |
solver | string | Solver address that filled |
amountInToRelease | string | Input amount released by this fill |
amountOutFilled | string | Output amount filled by this fill |
Further inspect the response fields on the API
reference.
Error Responses
All errors share the { code, message, requestId } body shape. Branch on code rather than on
the HTTP status.
| Status | Code | Description |
|---|---|---|
400 | BadOrderRequest | Malformed request (unknown chain, malformed orderId, etc.) |
404 | OrderNotFound | The referenced order does not exist on-chain |
Example Response
{
"orderId": "0xabc123",
"version": 1,
"nonce": "42",
"sender": "0xYourWalletAddress",
"recipient": "0xYourWalletAddress",
"originChainId": 1,
"destChainId": 8453,
"tokenIn": "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b",
"tokenOut": "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b",
"amountIn": "1000000",
"amountOut": "999500",
"designatedSolver": "0xSolverAddress",
"createdAt": 1771511463,
"fillDeadline": 1771515063,
"status": "COMPLETED",
"amountOutFilled": "999500",
"amountInReleased": "1000000",
"amountRefunded": "0",
"openTx": "0xOpenTxHash",
"fillCount": 1,
"fillReportCount": 1,
"resolvedAt": 1771511780,
"fills": [
{
"filledAt": 1771511700,
"chainId": 8453,
"transactionHash": "0xFillTxHash",
"solver": "0xSolverAddress",
"amountInToRelease": "1000000",
"amountOutFilled": "999500"
}
]
}