
## List order statuses

`GET /v1/order-statuses`

Returns a list of order and delivery statuses with filtering support.

## Parameters

| Parameter | Type | Default | Description |
|----------|-----|-----------|---------|
| `limit` | number | `50` | Number of records (up to 5000) |
| `offset` | number | `0` | Skip N records |
| `select` | string | — | Field selection: `?select=id,type,sort,color` |
| `sort` | string | — | Sort using the short syntax: `?sort=-sort`; a minus sign indicates descending order |
| `order` | object | — | Sorting: `?order[sort]=asc`. If `sort` is also passed, `sort` applies |
| `filter` | object | — | Filtering by status fields.<br>[Filtering syntax](/docs/filtering). Example: `?filter[type]=O` |
| `withTotal` | boolean | — | Accepted but has no effect on the response: `meta.total` is returned even with `withTotal=false` |

## Examples

### curl — personal key

```bash
curl -g "https://vibecode.bitrix24.com/v1/order-statuses?limit=3&order[sort]=asc" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -g "https://vibecode.bitrix24.com/v1/order-statuses?limit=3&order[sort]=asc" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/order-statuses?limit=3&order[sort]=asc', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(`Total statuses: ${meta.total}`)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/order-statuses?limit=3&order[sort]=asc', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data, meta } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data` | array | Array of statuses |
| `data[].id` | string | Status code |
| `data[].type` | string | Status type: `O` — order, `D` — delivery |
| `data[].sort` | number \| null | Sort order |
| `data[].notify` | boolean | Whether to send a notification to the customer |
| `data[].color` | string \| null | HEX color code or `null` |
| `data[].xmlId` | string \| null | External identifier or `null` |
| `meta.total` | number | Total number of records matching the filter |
| `meta.hasMore` | boolean | Whether there are more records beyond `limit` |

## Response example

```json
{
  "success": true,
  "data": [
    { "id": "T", "type": "O", "sort": 30, "notify": true, "color": "#ACE9FB", "xmlId": null },
    { "id": "N", "type": "O", "sort": 100, "notify": true, "color": "#ACE9FB", "xmlId": null },
    { "id": "S", "type": "O", "sort": 110, "notify": true, "color": "#ACE9FB", "xmlId": null }
  ],
  "meta": {
    "total": 9,
    "hasMore": true
  }
}
```

## Error response example

403 — no scope:

```json
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'sale' scope"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `UNKNOWN_FILTER_FIELD` | Filter by a field that is not in the status schema |
| 403 | `SCOPE_DENIED` | The API key does not have the `sale` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |

For the full list of general API errors, see [Errors](/docs/errors).

## Known specifics

**Separation by type.** By default the response includes statuses of both types — order and delivery. To get only order statuses, add `filter[type]=O`. For delivery — `filter[type]=D`.

## See also

- [Search statuses](./search.md)
- [Get status](./get.md)
- [Create status](./create.md)
- [Status fields](./fields.md)
- [Orders in this status](../orders/list.md)
- [Filtering syntax](/docs/filtering)
- [Entity API](/docs/entity-api)
- [Batch](/docs/batch)
- [Limits and optimization](/docs/optimization)
