For AI agents: markdown of this page — /docs-content-en/entities/crm-payments/available-products.md documentation index — /llms.txt

Product rows available for CRM payment

GET /v1/crm-payments/available-products

Returns the product rows of a CRM entity, such as a deal, with the quantity not yet included in payments.

Pass a row ID from this response as rowId when adding an item to a payment.

Parameters

Parameter Type Required Description
ParameterentityTypeId (query) Typenumber Requiredyes DescriptionCRM entity type. For a deal, 2
ParameterentityId (query) Typenumber Requiredyes DescriptionCRM entity ID. For a deal, an ID from GET /v1/deals

The generic filter parameter is not applied by this endpoint. By default, the API preserves the previous HTTP 200 response and data, adds Warning: 299 - "filter is not supported on this endpoint and was ignored", and records unsupported-filter use in the server log.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-payments/available-products?entityTypeId=2&entityId=8761" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-payments/available-products?entityTypeId=2&entityId=8761" \
  -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/crm-payments/available-products?entityTypeId=2&entityId=8761', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
for (const row of data.productRows) {
  console.log(`${row.id}: ${row.productName} — ${row.quantity} ${row.measureName} available`)
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/available-products?entityTypeId=2&entityId=8761', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata.productRows Typearray DescriptionProduct rows of the entity
Fielddata.productRows[].id Typenumber DescriptionID of the entity's product row. Pass it as rowId to POST /v1/crm-payments/:id/products
Fielddata.productRows[].ownerId Typenumber DescriptionCRM entity ID
Fielddata.productRows[].ownerType Typestring DescriptionCRM entity type as a letter code, D for a deal
Fielddata.productRows[].productId Typenumber DescriptionProduct ID. Catalog: GET /v1/products. 0 means the row has no catalog product
Fielddata.productRows[].productName Typestring DescriptionProduct name
Fielddata.productRows[].price Typenumber DescriptionPrice
Fielddata.productRows[].priceAccount Typenumber DescriptionPrice in the reporting currency
Fielddata.productRows[].priceExclusive Typenumber DescriptionPrice excluding tax, with discount
Fielddata.productRows[].priceNetto Typenumber DescriptionNet price
Fielddata.productRows[].priceBrutto Typenumber DescriptionGross price
Fielddata.productRows[].quantity Typenumber DescriptionQuantity not yet included in the entity's payments
Fielddata.productRows[].discountTypeId Typenumber DescriptionHow the discount is set: 1 as an amount, 2 as a percentage
Fielddata.productRows[].discountRate Typenumber DescriptionDiscount percentage
Fielddata.productRows[].discountSum Typenumber DescriptionDiscount amount
Fielddata.productRows[].taxRate Typenumber | null DescriptionTax rate in percent. null means no tax is set
Fielddata.productRows[].taxIncluded Typestring DescriptionTax included in the price: Y or N
Fielddata.productRows[].customized Typestring DescriptionRow edited manually: Y or N
Fielddata.productRows[].measureCode Typenumber DescriptionUnit of measure code
Fielddata.productRows[].measureName Typestring DescriptionUnit of measure
Fielddata.productRows[].sort Typenumber DescriptionSort order
Fielddata.productRows[].xmlId Typestring DescriptionExternal row code
Fielddata.productRows[].type Typenumber DescriptionProduct type
Fielddata.productRows[].taxName Typestring DescriptionTax name

Response example

JSON
{
  "success": true,
  "data": {
    "productRows": [
      {
        "id": 2355,
        "ownerId": 8761,
        "ownerType": "D",
        "productId": 0,
        "productName": "TEST item for payment",
        "price": 1500,
        "priceAccount": 1500,
        "priceExclusive": 1500,
        "priceNetto": 1500,
        "priceBrutto": 1500,
        "quantity": 1,
        "discountTypeId": 2,
        "discountRate": 0,
        "discountSum": 0,
        "taxRate": null,
        "taxIncluded": "N",
        "customized": "Y",
        "measureCode": 796,
        "measureName": "pcs",
        "sort": 0,
        "xmlId": "",
        "type": 1,
        "taxName": "No VAT"
      }
    ]
  }
}

Error response example

400: entityTypeId holds an unknown CRM entity type:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_ENTITY_TYPE",
    "message": "This CRM entity type has no payable product rows."
  }
}

Errors

HTTP Code Description
HTTP200 CodeWarning: 299 DescriptionThe filter is ignored by default; previous data is preserved and the warning is sent in the Warning header.
HTTP400 (strict mode only) CodeUNSUPPORTED_FILTER DescriptionThe server mode is disabled by default; until it is enabled, the endpoint preserves HTTP 200 and the previous data.
HTTP400 CodeMISSING_REQUIRED_FIELDS DescriptionentityTypeId or entityId is missing, or the value is not a positive integer
HTTP400 CodeINVALID_ENTITY_TYPE DescriptionentityTypeId is not a CRM entity type, for example 999
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo CRM entity with this entityTypeId and entityId exists
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the request. The reason is in error.message
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe key's user has no access to the CRM entity or payment in Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the crm scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionX-Api-Key is missing

Full list of common API errors: Errors.

Known specifics

The remainder is counted across all payments of the entity. For a row with quantity 3, of which 2 are already added to a payment, quantity is 1. After that payment is deleted, the remainder returns to 3.

See also