For AI agents: markdown of this page — /docs-content-en/entities/order-statuses/search.md documentation index — /llms.txt

Search order statuses

POST /v1/order-statuses/search

Search statuses with filtering. Equivalent to GET /v1/order-statuses, but the filter conditions are passed in the request body — this lets you specify several conditions at once.

Request fields (body)

Parameter Type Required Default Description
Parameterfilter Typeobject Requiredno Default— DescriptionFiltering by status fields.
Filtering syntax
Parameterlimit Typenumber Requiredno Default50 DescriptionNumber of records (up to 5000)
Parameterselect Typestring[] Requiredno Default— DescriptionField selection: ["id", "type", "sort", "color"]
Parameterorder Typeobject Requiredno Default— DescriptionSorting: { "sort": "asc" }

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/order-statuses/search" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "type": "O", "notify": true },
    "select": ["id", "type", "sort", "color"]
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/order-statuses/search" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": { "type": "O", "notify": true },
    "select": ["id", "type", "sort", "color"]
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/order-statuses/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { type: 'O', notify: true },
    select: ['id', 'type', 'sort', 'color'],
  }),
})

const { success, data, meta } = await res.json()
console.log('Statuses with notification:', meta.total)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/order-statuses/search', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    filter: { type: 'O', notify: true },
    select: ['id', 'type', 'sort', 'color'],
  }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionArray of statuses. Full schema: Status fields
Fieldmeta.total Typenumber DescriptionTotal number of records matching the filter
Fieldmeta.hasMore Typeboolean DescriptionWhether there are more records beyond limit
Fieldmeta.durationMs Typenumber DescriptionRequest duration in milliseconds

The meta fields sit next to data, not inside it. Page through the results using meta.hasMore: a data length equal to limit does not rule out the last page.

Response example

JSON
{
  "success": true,
  "data": [
    { "id": "T", "type": "O", "sort": 30, "color": "#ACE9FB" },
    { "id": "N", "type": "O", "sort": 100, "color": "#ACE9FB" },
    { "id": "S", "type": "O", "sort": 110, "color": "#ACE9FB" },
    { "id": "P", "type": "O", "sort": 130, "color": "#ACE9FB" },
    { "id": "D", "type": "O", "sort": 140, "color": "#FFBEBD" },
    { "id": "F", "type": "O", "sort": 200, "color": "#DBF199" }
  ],
  "meta": {
    "total": 6,
    "hasMore": false,
    "durationMs": 300
  }
}

Error response example

400 — filter by a nonexistent field:

JSON
{
  "success": false,
  "error": {
    "code": "UNKNOWN_FILTER_FIELD",
    "message": "Unknown filter field 'foo' for entity 'order-statuses'. Available: id, type, sort, notify, color, xmlId"
  }
}

Errors

HTTP Code Description
HTTP400 CodeUNKNOWN_FILTER_FIELD DescriptionFilter by a field that is not in the status schema
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the sale scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP429 CodeRATE_LIMITED DescriptionRate 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.

Known specifics

select limits the fields in the response. If select is passed, each element of data[] will have only the listed fields. Without select, all status fields are returned.

See also