For AI agents: markdown of this page — /docs-content-en/entities/pay-systems/create.md documentation index — /llms.txt

Create a pay system

POST /v1/pay-systems

Creates a pay system using a registered REST handler. Send the fields directly in the JSON body, without a fields wrapper.

Request body fields

Field Type Required Description
Fieldname Typestring Requiredyes DescriptionPay system name. Must not be empty.
FieldpersonTypeId Typeinteger Requiredyes DescriptionPayer type ID from GET /v1/person-types. Must belong to the registry specified in entityRegistryType.
FieldbxRestHandler Typestring Requiredyes DescriptionHandler code from the code field returned by GET /v1/pay-systems/handlers. The handler must already be registered.
Fielddescription Typestring Requiredno DescriptionPay system description.
Fieldactive Typestring Requiredno DescriptionActivity flag: Y for active, N for inactive.
FieldnewWindow Typestring Requiredno DescriptionOpen the payment page in a new window: Y or N.
FieldxmlId Typestring Requiredno DescriptionExternal ID.
Fieldlogo Typearray Requiredno DescriptionLogo as [filename, base64]. Decoded file size must not exceed 2 MiB.
Fieldsettings Typeobject | array Requiredno DescriptionHandler settings with the original business keys. Each entry must be an object or array using TYPE and VALUE.
FieldentityRegistryType Typestring Requiredno DescriptionRegistry: ORDER, CRM_INVOICE or CRM_QUOTE. Use ORDER for orders.

Send a nonempty JSON object. Fields outside the table are rejected.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/pay-systems" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Invoice payment",
    "personTypeId": 5,
    "bxRestHandler": "my_payment_handler",
    "entityRegistryType": "ORDER",
    "active": "N",
    "xmlId": "invoice-20261014"
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/pay-systems" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Invoice payment",
    "personTypeId": 5,
    "bxRestHandler": "my_payment_handler",
    "entityRegistryType": "ORDER",
    "active": "N",
    "xmlId": "invoice-20261014"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/pay-systems', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Invoice payment",
    "personTypeId": 5,
    "bxRestHandler": "my_payment_handler",
    "entityRegistryType": "ORDER",
    "active": "N",
    "xmlId": "invoice-20261014"
  }),
})

const { success, data } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/pay-systems', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Invoice payment",
    "personTypeId": 5,
    "bxRestHandler": "my_payment_handler",
    "entityRegistryType": "ORDER",
    "active": "N",
    "xmlId": "invoice-20261014"
  }),
})

const { success, data } = await res.json()

Response fields

HTTP 201. Returns the created pay system.

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success.
Fielddata Typeobject DescriptionCreated pay system. Full field reference: Pay system fields.

Response example

Main fields are shown. Full field reference: Pay system fields.

JSON
{
  "success": true,
  "data": {
    "id": 41,
    "name": "Invoice payment",
    "actionFile": "my_payment_handler",
    "newWindow": "N",
    "active": "N",
    "entityRegistryType": "ORDER",
    "personTypeId": 5,
    "xmlId": "invoice-20261014"
  }
}

Error response example

400 — the request body contains the unsupported field unexpected:

JSON
{
  "success": false,
  "error": {
    "code": "READONLY_FIELD",
    "message": "Field 'unexpected' is not writable for this operation"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA field has an invalid type, the logo has an invalid format, or a settings entry is not an object or array.
HTTP400 CodeMISSING_REQUIRED_FIELDS DescriptionThe JSON body is empty, a required field is missing, or name is empty.
HTTP400 CodeREADONLY_FIELD DescriptionThe body contains a field not supported by this operation.
HTTP413 CodePAYLOAD_TOO_LARGE DescriptionThe decoded logo exceeds 2 MiB or the JSON body exceeds 3 MiB.
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe created pay system was not found during the subsequent read.
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionAccess to the create operation is denied.
HTTP422 CodeBITRIX_ERROR DescriptionA business error occurred. Details are in error.message.
HTTP502 CodeBITRIX_RESPONSE_INVALID DescriptionThe response to the operation or subsequent read has an invalid structure.
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the pay_system scope.
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is restricted to read operations.
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no configured Bitrix24 credentials.

For common API errors, see Error codes.

See also