Tidepooltestnet

Cancel an order

POST /v0/orders/{orderId}/cancel · 1Click-compatible

POST/v0/orders/{orderId}/cancel

Needs Authorization: Bearer <accessToken> (or any X-API-Key). Returns HTTP 201 with the order in PENDING_CANCEL; it moves to CANCELED once the cancellation is processed. Cancelling a finished order returns 400 (below). Real response.

Requests asynchronous cancellation. Unspent input is refunded and successfully filled output is withdrawn. Errors. Branch on code, never on title or detail. New codes arrive without a major version, so treat an unrecognized code as the HTTP status alone. | Status | Codes | | --- | --- | | 400 | order-rejected | | 401 | authentication-required | | 404 | order-not-found | | 429 | rate-limit-exceeded | | 500 | internal-error | | 503 | service-unavailable | Tidepool: returns 201 with PENDING_CANCEL; the deposit is refunded, then the order becomes CANCELED.

Operation id: cancelOrder · Auth: optional (X-API-Key or Authorization: Bearer, any value)

Request

curl -X POST "https://www.usetidepool.tech/v0/orders/ord_30bcf13f028ef83ae6dd9a64/cancel" \
  -H 'Authorization: Bearer <accessToken>'

Responses

201 Cancellation requested.

{
  "data": {
    "type": "orders",
    "id": "ord_30bcf13f028ef83ae6dd9a64",
    "attributes": {
      "orderType": "LIMIT",
      "depositAddress": "b3e013f41cee40b33296f5e0185feae34c2f95059a05482e07cb610acd067322",
      "depositMode": "SIMPLE",
      "depositType": "INTENTS",
      "fillStatus": "PENDING_CANCEL",
      "payoutStatus": "NOT_STARTED",
      "isPayoutStatusFinal": false,
      "payouts": {
        "withdrawal": null,
        "allWithdrawals": [],
        "refund": null
      },
      "depositedAmount": "0",
      "depositedAmountFormatted": "0",
      "baseAsset": "nep141:wnear.tidepool-sandbox.testnet",
      "quoteAsset": "nep141:usdc.tidepool-sandbox.testnet",
      "quantity": "1000000000000000000000000",
      "swapView": {
        "swapType": "EXACT_INPUT",
        "originAsset": "nep141:wnear.tidepool-sandbox.testnet",
        "destinationAsset": "nep141:usdc.tidepool-sandbox.testnet",
        "amountIn": "1000000000000000000000000",
        "minAmountOut": "3465000"
      },
      "side": "SELL",
      "price": "3.5",
      "appFees": [
        {
          "recipient": "fees.testnet",
          "fee": 100
        }
      ],
      "recipient": "9cf39ad040a13205c3ab109a8566fd779394a548f76b1aed5107efcdfe6c7ceb",
      "recipientType": "INTENTS",
      "refundTo": "9cf39ad040a13205c3ab109a8566fd779394a548f76b1aed5107efcdfe6c7ceb",
      "refundType": "INTENTS",
      "estimatedWithdrawFee": "0",
      "estimatedWithdrawFeeFormatted": "0",
      "estimatedRefundFee": "0",
      "estimatedRefundFeeFormatted": "0",
      "confidentiality": "public",
      "timeInForce": "GTC",
      "deadline": "2026-11-20T00:00:00.000Z",
      "createdAt": "2026-10-30T16:31:25.898Z",
      "partialFills": []
    },
    "links": {
      "self": "/v0/orders/ord_30bcf13f028ef83ae6dd9a64"
    }
  },
  "meta": {
    "correlationId": "8ce9e739-267c-4f3c-ba92-ede7496933ea",
    "timestamp": "2026-10-30T16:31:33.517Z"
  }
}

400 Order rejected

{
  "errors": [
    {
      "status": "400",
      "code": "order-rejected",
      "title": "Order rejected",
      "detail": "order is already CANCELED"
    }
  ],
  "meta": {
    "correlationId": "d5d46511-e17f-4b95-b78f-93483fa7480c",
    "timestamp": "2026-10-30T16:32:44.120Z"
  }
}

401 Authentication required

{
  "errors": [
    {
      "status": "401",
      "code": "authentication-required",
      "title": "Authentication required",
      "detail": "Send Authorization: Bearer <accessToken> (from /v0/auth/authenticate) or x-api-key"
    }
  ],
  "meta": {
    "correlationId": "fea594fc-2409-45eb-aa08-72421258265a",
    "timestamp": "2026-10-30T16:31:33.908Z"
  }
}

404 Order not found

{
  "errors": [
    {
      "status": "404",
      "code": "order-not-found",
      "title": "Order not found",
      "detail": "No order ord_nope"
    }
  ],
  "meta": {
    "correlationId": "1e074bf6-cb0c-4568-b909-a569ffe2550d",
    "timestamp": "2026-10-30T16:31:34.300Z"
  }
}

429 Rate limit exceeded

JSON:API error document. Not returned in testing.

500 Internal error

JSON:API error document, code: "internal-error". Not returned in testing.

503 Service unavailable

JSON:API error document. Not returned in testing.

Community-built · not affiliated with NEAR. Tidepool is community-built and not affiliated with NEAR, Defuse or 1Click. Testnet only; test tokens have no value. Built by @realchriswilder.

On this page