For AI agents: markdown of this page — /docs-content-en/entities/shipments/search.md documentation index — /llms.txt
Search shipments
POST /v1/shipments/search
Searches online store order shipments with filtering, sorting, and automatic pagination. Parameters are passed in the body of the POST request. Suited to complex filters and wide date ranges. For simple selections of up to 5000 records, the shipment list is enough.
Request fields (body)
| Field | Type | Default | Description |
|---|---|---|---|
Fieldfilter |
Typeobject | Default— | DescriptionFiltering by the fields from GET /v1/shipments/fields.Filtering syntax. Example: { "orderId": 1027, "deducted": false } |
Fieldselect |
Typestring[] | Default— | DescriptionField selection: ["id", "orderId", "deliveryName", "priceDelivery", "trackingNumber"]. A comma-separated string is also accepted. An unknown field does not cause an error: it is absent from the data items, and meta.warnings carries an UNKNOWN_SELECT_FIELD warning with the field name in field |
Fieldsort |
Typestring | Default— | DescriptionSorting via the short syntax: "-id", the minus means descending |
Fieldorder |
Typeobject | Default— | DescriptionSorting as an object: { "id": "desc" }. If sort is also passed, sort takes effect |
Fieldlimit |
Typenumber | Default50 |
DescriptionNumber of records, up to 5000 |
Fieldoffset |
Typenumber | Default0 |
DescriptionSkip N records. Rejected when combined with a date range filter wider than 14 days — see UNSTABLE_OFFSET_PAGINATION in the "Errors" section |
FieldautoWindow |
Typeboolean | Defaulttrue |
DescriptionSplit the selection into weekly windows when filtering by a date range wider than 14 days. false disables splitting |
FieldwithTotal |
Typeboolean | Default— | DescriptionWhether to return the record count in meta.total. Details — Paging and record counts |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/shipments/search" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": { "orderId": 1027, "deducted": false },
"select": ["id", "orderId", "deliveryName", "priceDelivery", "trackingNumber"],
"sort": "-id",
"limit": 10
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/shipments/search" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filter": { "orderId": 1027, "deducted": false },
"select": ["id", "orderId", "deliveryName", "priceDelivery", "trackingNumber"],
"sort": "-id",
"limit": 10
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/shipments/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { orderId: 1027, deducted: false },
select: ['id', 'orderId', 'deliveryName', 'priceDelivery', 'trackingNumber'],
sort: '-id',
limit: 10,
}),
})
const { success, data, meta } = await res.json()
console.log('Not marked as shipped:', data.length)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/shipments/search', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
filter: { orderId: 1027, deducted: false },
select: ['id', 'orderId', 'deliveryName', 'priceDelivery', 'trackingNumber'],
sort: '-id',
limit: 10,
}),
})
const { success, data, meta } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typearray | DescriptionArray of shipments. All fields — Shipment fields |
Fieldmeta.total |
Typenumber | DescriptionHow many records matched the filter. May be absent — see the withTotal field |
Fieldmeta.hasMore |
Typeboolean | DescriptionWhether there are more records beyond limit |
Fieldmeta.durationMs |
Typenumber | DescriptionRequest duration in milliseconds |
Fieldmeta.autoWindowed |
Typeboolean | Descriptiontrue if the selection was split into time windows |
Fieldmeta.windowCount |
Typenumber | DescriptionNumber of windows. Returned when autoWindowed is true |
Fieldmeta.windowErrors |
Typenumber | DescriptionHow many windows ended with an error. Returned if some windows failed |
Fieldmeta.windowErrorSample |
Typeobject | DescriptionError code and message of the first failed window. Returned with windowErrors |
Fieldmeta.batchWaves |
Typenumber | DescriptionNumber of waves of parallel requests. Returned when autoWindowed is true |
Fieldmeta.warnings |
Typearray | DescriptionWarnings about request parameters: code, message, field. Returned only when there are warnings |
Fieldmeta.pageErrorSample |
Typeobject | DescriptionCode and message of the error that stopped automatic pagination early. Returned only if data contains fewer records than limit |
Response example
A request with select returns only the listed fields:
{
"success": true,
"data": [
{
"id": 1205,
"orderId": 1027,
"deliveryName": "Courier delivery",
"priceDelivery": 500,
"trackingNumber": "VIBE-DOC-1"
}
],
"meta": {
"total": 1,
"hasMore": false,
"durationMs": 278
}
}
Error response example
400 — filter by a nonexistent field:
{
"success": false,
"error": {
"code": "UNKNOWN_FILTER_FIELD",
"message": "Unknown filter field 'unknownField' for entity 'shipments'. Available: accountNumber, allowDelivery, basePriceDelivery, canceled, comments, companyId, currency, customPriceDelivery, dateAllowDelivery, dateCanceled, dateDeducted, dateInsert, dateMarked, dateResponsibleId, deducted, deliveryDocDate, deliveryDocNum, deliveryId, deliveryName, deliveryXmlId, discountPrice, empAllowDeliveryId, empCanceledId, empDeductedId, empMarkedId, empResponsibleId, externalDelivery, id, id1c, marked, orderId, priceDelivery, reasonMarked, reasonUndoDeducted, responsibleId, statusId, statusXmlId, system, trackingDescription, trackingLastCheck, trackingNumber, trackingStatus, updated1c, version1c, xmlId, shipmentItems"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeUNKNOWN_FILTER_FIELD |
DescriptionFilter by a field that is not in the schema. Field list: GET /v1/shipments/fields |
| HTTP400 | CodeINVALID_FILTER_FIELD |
DescriptionThe field name in the filter starts with the unsupported prefix @ or !@ |
| HTTP400 | CodeINVALID_FILTER_OPERATOR |
DescriptionUnknown filter operator, an empty object as a condition value, or the logical condition $or |
| HTTP400 | CodeINVALID_FILTER_SHAPE |
Descriptionfilter is not an object of conditions, for example a string, number, or array |
| HTTP400 | CodeINVALID_DUPLICATE_FILTER_FIELD |
DescriptionTwo filter conditions reduce to one Bitrix24 condition, for example $ne and $nin on the same field. Pass only one of them |
| HTTP400 | CodeUNKNOWN_SORT_FIELD |
DescriptionSorting by a field that is not in the schema or cannot be sorted on |
| HTTP400 | CodeINVALID_SORT_TYPE |
Descriptionsort or order is passed as a value of an unsuitable type, for example a number |
| HTTP400 | CodeINVALID_SORT_DIRECTION |
DescriptionThe direction in order is not one of asc, desc, ASC, DESC, 1, -1 |
| HTTP400 | CodeINVALID_LIMIT |
Descriptionlimit is not a number |
| HTTP400 | CodeINVALID_SELECT_TYPE |
Descriptionselect is not a string or an array of strings |
| HTTP400 | CodeINVALID_REQUEST |
DescriptionThe request body is not a JSON object |
| HTTP400 | CodeUNSTABLE_OFFSET_PAGINATION |
Descriptionoffset greater than zero together with a filter by a date range wider than 14 days. Fetch everything in one request with limit up to 5000, or pass autoWindow: false with sorting by id, or split the date range into parts yourself |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the sale scope |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
| 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 common API errors, see Errors.
Known specifics
Splitting into time windows. A filter by a date field (dateInsert, dateDeducted, dateAllowDelivery, and others) with a range wider than 14 days is split into weekly windows that run in parallel waves. This lets the selection get past the cap of 5000 records per call.
A partial window failure does not abort the request. If some of the windows failed, the response arrives with success: true and records only from the successful windows. Before treating the selection as complete, check that meta.windowErrors is absent.