For AI agents: markdown of this page — /docs-content-en/entities/crm-payments/products-list.md documentation index — /llms.txt
List CRM payment line items
GET /v1/crm-payments/:id/products
Returns the line items of a CRM payment: how many units of each product the payment includes. Use it to get a line item id before changing the quantity or deleting the line item.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id (path) |
number | yes | Payment ID. Payments of a CRM item: GET /v1/crm-payments |
There are no query string parameters: all line items arrive at once, without pagination or filters.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/crm-payments/573/products" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/crm-payments/573/products" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/573/products', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { data, meta } = await res.json()
console.log(`Line items in the payment: ${meta.total}`)
for (const item of data) {
console.log(`Line item ${item.id}: ${item.quantity} pcs`)
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/573/products', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data, meta } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | true on success |
data |
array | Payment line items. An empty array for a payment without line items |
data[].id |
number | Payment line item ID. Passed as itemId to PATCH /v1/crm-payments/:id/products/:itemId and DELETE /v1/crm-payments/:id/products/:itemId |
data[].paymentId |
number | Payment ID |
data[].quantity |
number | Number of product units in the line item |
data[].entityId |
number | ID of the basket item in the linked order. List: GET /v1/basket-items with filter[orderId] set to the order ID from the payment's orderId field in GET /v1/payments/:id |
meta.total |
number | Number of line items in the payment |
Response example
{
"success": true,
"data": [
{
"id": 445,
"paymentId": 573,
"quantity": 2,
"entityId": 1391
}
],
"meta": {
"total": 1
}
}
Error response example
404 — no payment with this ID:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Payment has not been found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 404 | ENTITY_NOT_FOUND |
No payment with this id |
| 400 | INVALID_ID |
id is not a positive integer |
| 422 | BITRIX_ERROR |
Bitrix24 rejected the request. The reason is in error.message |
| 403 | BITRIX_ACCESS_DENIED |
The key's user has no access to the CRM item or the payment in Bitrix24 |
| 403 | SCOPE_DENIED |
The API key does not have the crm scope |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
| 401 | MISSING_API_KEY |
X-Api-Key is not provided |
Full list of common API errors — Errors.
Known specifics
A line item does not contain the deal product row ID. entityId points to the basket item of the order, not to the deal product row that was passed as rowId when adding the line item. To get the line item's name, price and product, look up the basket item by entityId.