#Orders
Entity: order | Scope: sale | Base path: /v1/orders
SPA entity (camelCase field names) — field names pass through without transformation.
#Operations
| Method | Path | Description | Bitrix24 Method |
|---|---|---|---|
GET |
/v1/orders |
List all (with filter, sort, pagination) | sale.order.list |
GET |
/v1/orders/:id |
Get by ID | sale.order.get |
POST |
/v1/orders |
Create new | sale.order.add |
PATCH |
/v1/orders/:id |
Update by ID | sale.order.update |
DELETE |
/v1/orders/:id |
Delete by ID | sale.order.delete |
GET |
/v1/orders/fields |
Get available fields | sale.order.getFields |
#Fields
| API Name | Bitrix24 Name | Type | Readonly | Description |
|---|---|---|---|---|
id |
id |
number | yes | Идентификатор записи |
accountNumber |
accountNumber |
string | ||
price |
price |
number | ||
currency |
currency |
string | ||
statusId |
statusId |
string | ||
userId |
userId |
number | ||
dateInsert |
dateInsert |
datetime | yes | |
dateUpdate |
dateUpdate |
datetime | yes | |
payed |
payed |
boolean | ||
canceled |
canceled |
boolean |
#Aggregatable Fields
These fields can be used with the aggregation engine for analytics:
pricestatusIdpayedcanceled
#Examples
#List
curl -X GET '/v1/orders?limit=10' \
-H 'X-Api-Key: YOUR_KEY'
#Get by ID
curl -X GET '/v1/orders/123' \
-H 'X-Api-Key: YOUR_KEY'
#Create
curl -X POST '/v1/orders' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"accountNumber":"value","price":1,"currency":"value"}'
#Update
curl -X PATCH '/v1/orders/123' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"title":"updated"}'
#Delete
curl -X DELETE '/v1/orders/123' \
-H 'X-Api-Key: YOUR_KEY'
#Batch
curl -X POST '/v1/batch' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"calls":[{"entity":"orders","action":"list","params":{"limit":5}}]}'