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

Get a CRM payment

GET /v1/crm-payments/:id

Returns one CRM payment by ID, for example to check the amount after adding items or to find out whether the payment is marked as paid.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionPayment ID. Payments of a CRM item: GET /v1/crm-payments

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-payments/563" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/crm-payments/563" \
  -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/563', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
console.log(`Payment ${data.accountNumber}: ${data.sum} ${data.currency}, paid: ${data.paid}`)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-payments/563', {
  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 Typeobject DescriptionPayment object. Key payment fields are on the CRM payments page
Fielddata.id Typenumber DescriptionPayment ID
Fielddata.accountNumber Typestring DescriptionPayment number: the linked order number and the payment sequence number separated by /, for example 1029/1
Fielddata.paid Typestring DescriptionPaid mark: Y — paid, N — not paid
Fielddata.datePaid Typestring | null DescriptionTime of the last "paid" mark, ISO 8601 with a time zone offset. null if the payment was never marked
Fielddata.empPaidId Typenumber | null DescriptionID of the employee who last marked the payment. List: GET /v1/users
Fielddata.paySystemId Typenumber DescriptionPayment system ID. List: GET /v1/pay-systems
Fielddata.sum Typenumber DescriptionPayment amount. Made up of the payment items
Fielddata.currency Typestring DescriptionCurrency code. List: GET /v1/currencies
Fielddata.paySystemName Typestring DescriptionPayment system name

Response example

JSON
{
  "success": true,
  "data": {
    "id": 563,
    "accountNumber": "1029/1",
    "paid": "N",
    "datePaid": null,
    "empPaidId": null,
    "paySystemId": 19,
    "sum": 0,
    "currency": "USD",
    "paySystemName": "Card payment"
  }
}

Error response example

404 — no payment with this ID:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Payment has not been found"
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo payment with this id
HTTP400 CodeINVALID_ID Descriptionid is not a positive integer
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 item or the payment in Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the crm scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionX-Api-Key is not provided

Full list of common API errors — Errors.

Known specifics

Removing the "paid" mark does not clear the time and author of the last mark. After the mark is removed, the datePaid and empPaidId fields keep the values of the last mark. Only paid reflects the current state.

See also