> For the complete documentation index, see [llms.txt](https://docs.zert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zert.com/api-reference/limit-orders/limit-order-get-cancel.md).

# Get or Cancel Limit Order

Retrieve a limit order by ID or cancel it. Only the authenticated owner can access or cancel.

**Auth:** Required (`Authorization: Bearer YOUR_API_KEY`)

***

## Get limit order by id

**Endpoint:** `GET /api/v1/limit-orders/limit/{limitOrderId}`

### Path parameters

| Parameter      | Type   | Required | Description    | Example      |
| -------------- | ------ | -------- | -------------- | ------------ |
| `limitOrderId` | string | Yes      | Limit order ID | `lim_abc123` |

### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET 'https://api.gateway.zert.com/api/v1/limit-orders/limit/e896c19b-fccd-466c-9b6d-eca6d7a6cd5a' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

{% endtab %}

{% tab title="Example Response" %}

```json
{
  "data": {
    "limitOrderId": "lim_abc123",
    "status": "open",
    "timeInForce": "GTC",
    "createdAtMs": 1745396400000,
    "updatedAtMs": 1745396400000,
    "expiresAtMs": 1745403600000,
    "minAmountOut": "1"
  },
  "meta": { "requestId": "...", "timestamp": "..." }
}
```

{% endtab %}
{% endtabs %}

***

## Cancel limit order by id

**Endpoint:** `DELETE /api/v1/limit-orders/limit/{limitOrderId}`

### Headers

| Header            | Type   | Required | Description                                                                                                                   |
| ----------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `Idempotency-Key` | string | Yes      | Required opaque dedupe token. Use UUIDv4 or ULID. Allowed characters: `A-Z`, `a-z`, `0-9`, `.`, `_`, `:`, `-`. Max 200 chars. |

### Path parameters

| Parameter      | Type   | Required | Description    | Example      |
| -------------- | ------ | -------- | -------------- | ------------ |
| `limitOrderId` | string | Yes      | Limit order ID | `lim_abc123` |

### Request body (optional)

| Field    | Type   | Description            | Example        |
| -------- | ------ | ---------------------- | -------------- |
| `reason` | string | Optional cancel reason | `user_request` |

### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X DELETE 'https://api.gateway.zert.com/api/v1/limit-orders/limit/e896c19b-fccd-466c-9b6d-eca6d7a6cd5a' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: limit-cancel-001' \
  -H 'Content-Type: application/json' \
  -d '{"reason": "user_request"}'
```

{% endtab %}

{% tab title="Example Response" %}

```json
{
  "data": {
    "limitOrderId": "lim_abc123",
    "status": "canceled"
  },
  "meta": { "requestId": "...", "timestamp": "..." }
}
```

{% endtab %}
{% endtabs %}

## Responses

| Code | Description                               |
| ---- | ----------------------------------------- |
| 200  | OK                                        |
| 401  | Unauthorized (missing or invalid API key) |
| 403  | Forbidden (not owner)                     |
| 404  | Not found                                 |
| 503  | PG unavailable                            |

{% embed url="<https://api.gateway.zert.com/docs>" %}
Zert API — Limit Order Get/Cancel
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zert.com/api-reference/limit-orders/limit-order-get-cancel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
