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
id (path) number yes Payment 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
success boolean true on success
data object Payment object. Key payment fields are on the CRM payments page
data.id number Payment ID
data.accountNumber string Payment number: the linked order number and the payment sequence number separated by /, for example 1029/1
data.paid string Paid mark: Y — paid, N — not paid
data.datePaid string | null Time of the last "paid" mark, ISO 8601 with a time zone offset. null if the payment was never marked
data.empPaidId number | null ID of the employee who last marked the payment. List: GET /v1/users
data.paySystemId number Payment system ID. List: GET /v1/pay-systems
data.sum number Payment amount. Made up of the payment items
data.currency string Currency code. List: GET /v1/currencies
data.paySystemName string Payment 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
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

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