For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/gateway/execute-cancel-order.md.

Execute a resting DeFi order cancellation

Organization tokenNo token

POST
/orders/{id}/cancel/execute

Submits the client's signatures over the payloads returned by POST /orders/{id}/cancel to cancel a resting DeFi limit or TP/SL order. The order moves to canceled once the venue confirms, keeping any quantity that filled before the cancel in executed_qty/executed_vwap. An order that filled before the cancel landed moves to complete. An order that is no longer open, including one the venue reports closed before it can say how, returns 422 with code order_not_open.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

An access token from POST /v1/auth/api-key/token. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.

Path Parameters

id*string

Order ID

Header Parameters

TM-On-Behalf-Of?string

Act as one of your organization's users. The value is the user_id returned when the user was created; the request then reads and writes that user's account. Requires an organization token and a user your organization created: 400 for a personal token, a repeated header or a non-UUID, 403 for a user outside your organization. Not accepted on organization-scoped routes.

Formatuuid

Request Body

application/json
  1. body

Request to execute an order that is in initialized status. The client must sign each payload returned by the create endpoint and submit the signatures in the same order.

signatures*array<string>

One stamp per payload, in the same order as the payloads returned by the create endpoint. With auth_type: api_key, an entry is the base64url encoding, without padding, of the JSON {"publicKey": "<compressed P-256 public key, hex>", "signature": "<DER signature, hex>", "scheme": "SIGNATURE_SCHEME_TK_API_P256"}, signed as UnsignedPayload describes. With auth_type: web_authn, an entry is the browser's WebAuthn stamp.

Items1 <= items
auth_type*SigningMethod

The authentication method used to sign transaction payloads.

  • web_authn — Signed using a passkey (WebAuthn/FIDO2 credential) via the browser.
  • api_key — Signed using an API key. Suitable for programmatic/headless access.
Value in"web_authn""api_key"

Response Body

Cancellation submitted

application/json
  1. response

Response from executing an order. For DeFi orders, a successful execution transitions the order to complete (an immediate fill) or active (a limit order resting on-chain). For CeFi orders, the order moves to pending while it is processed by the CeFi exchange.

status?OrderStatus

The current status of the order.

  • initialized — Order has been created but not yet submitted. For DeFi orders, the client must sign the returned payloads and call the execute endpoint. For CeFi buy orders with insufficient balance, a funding bridge is prepared first.
  • pending — Order has been submitted but is not yet confirmed by the CeFi exchange or on-chain.
  • active — Order was accepted by the CeFi exchange and is open for trading. Applies to limit orders that are working in the order book.
  • cancel_pending — A cancellation request has been sent to the CeFi exchange and is awaiting confirmation.
  • complete — Order has been fully executed. For CeFi orders this means the CeFi exchange reported a fill; for DeFi orders the on-chain swap was confirmed.
  • canceled — Order was successfully canceled via a cancel request or by exchange/market conditions.
  • failed — Order was rejected by the CeFi exchange or DeFi execution failed (e.g. on-chain transaction reverted, balance check failed).
Value in"initialized""pending""cancel_pending""complete""canceled""active""failed"
Example Request
curl -X POST 'https://api.truemarkets.co/v1/gateway/orders/string/cancel/execute' \  -H 'TM-On-Behalf-Of: 3f6d2c0e-8a41-4c2b-9f1e-2b7d5c0a9e11' \  -H 'Content-Type: application/json' \  -d '{  "signatures": [    "string"  ],  "auth_type": "api_key"}'
Example Response
{  "status": "complete"}