Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

GET /orders/{chain}/{orderId}

This endpoint returns the full state and details for a single order. It is only applicable to orders routed through the limit-order provider.

On-chain fields are authoritative. Indexer-only fields (openTx, fillCount, fillReportCount, resolvedAt, fills) may be absent if the indexer has not yet caught up or is unavailable.

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/{chain}/{orderId}

Headers

x-api-key: YOUR_API_KEY

Path Parameters

FieldTypeRequiredDescription
chainChainYesThe chain where the order was placed
orderIdstringYesThe order ID to retrieve

Example Request

import type { components } from './m0-swap';
 
type Order = components['schemas']['Order'];
 
const chain = 'Ethereum';
const orderId = '0xabc123';
 
const response = await fetch(`https://gateway.m0.xyz/v1/orchestration/orders/${chain}/${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 status failed: ${error}`);
}
 
const order: Order = await response.json();

Response

Success Response (200)

Returns an Order object.

import type { components } from './m0-swap';
 
type Order = components['schemas']['Order'];
type OrderStatus = components['schemas']['OrderStatus'];
type Fill = components['schemas']['Fill'];

Response Fields

FieldTypeDescription
orderIdstringUnique order identifier
versionnumberOrder schema version
noncestringOrder nonce
senderstringSender wallet address
recipientstringRecipient wallet address
originChainIdnumberOrigin chain ID
destChainIdnumberDestination chain ID
tokenInstringInput token address
tokenOutstringOutput token address
amountInstringInput amount (smallest unit)
amountOutstringTarget output amount (smallest unit)
designatedSolverstringAssigned solver address
createdAtnumberCreation timestamp (unix seconds)
fillDeadlinenumberFill deadline (unix seconds)
statusOrderStatusCurrent status (CREATED, COMPLETED, CANCELLED)
amountOutFilledstringTotal output filled so far
amountInReleasedstringInput amount released so far
amountRefundedstringAmount refunded
openTxstring | nullTransaction hash that opened the order
fillCountnumber | nullNumber of fills
fillReportCountnumber | nullNumber of fill reports
resolvedAtnumber | nullResolution timestamp (unix seconds) when resolved
fillsFill[] | nullChronological list of fill events for the order

Fill

A single fill event recorded by the indexer. An order may have multiple fills when filled by multiple solvers or in multiple transactions; entries are ordered chronologically.

FieldTypeDescription
filledAtnumberFill timestamp (unix seconds)
chainIdnumberChain ID where the fill occurred
transactionHashstringTransaction hash of the fill
solverstringAddress of the solver that filled this portion
amountInToReleasestringInput amount to release for this fill
amountOutFilledstringOutput amount filled in this event

💡 Further inspect the response fields on the API reference.

Error Responses

StatusDescription
400Invalid chain or request
404Order not found

Example Response

{
  "orderId": "0xabc123",
  "version": 1,
  "nonce": "42",
  "sender": "0xYourWalletAddress",
  "recipient": "0xRecipientAddress",
  "originChainId": 1,
  "destChainId": 8453,
  "tokenIn": "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b",
  "tokenOut": "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b",
  "amountIn": "1000000",
  "amountOut": "999500",
  "designatedSolver": "0xSolverAddress",
  "createdAt": 1740000663,
  "fillDeadline": 1740001263,
  "status": "COMPLETED",
  "amountOutFilled": "999500",
  "amountInReleased": "1000000",
  "amountRefunded": "0",
  "openTx": "0xOpenTxHash",
  "fillCount": 1,
  "fillReportCount": 1,
  "resolvedAt": 1740000980,
  "fills": [
    {
      "filledAt": 1740000900,
      "chainId": 8453,
      "transactionHash": "0xFillTxHash",
      "solver": "0xSolverAddress",
      "amountInToRelease": "1000000",
      "amountOutFilled": "999500"
    }
  ]
}