Create customer contract
JSON API v3
POST /api/v3/projects/{projectId}/contracts
Initiates binding of a customer (typically mobile phone number) for repeat payments within the project.
v4 signature payload:
{merchant_contract_id}{customerPayload}{pin_code}{client_ip}
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
projectId | integer (int32) | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
client_ip | string | — | |
customer | object | — | Polymorphic customer block. The actual subset of fields depends on type: - mobile_phone: msisdn, email - bank_card: source, country, merchant_customer_id, email, and — on the PCI DSS contour host only — bank_card with the card details - undefined_bank_card: same fields as bank_card, minus the card details Choosing between the two card types. They are different payment routes, so the type is always stated explicitly — it is never inferred from other fields: - undefined_bank_card — the payer enters the card on the payment page opened by authorization.. The card is not bound, contracts are not supported. - bank_card — the card is bound to a contract and can be charged again later. Requires approved bank card settings for the project and the payer’s country; on the PCI DSS contour the card details are sent with the request. |
customer. | mobile_phone · bank_card · undefined_bank_card | — | |
customer. | string | — | Customer’s MSISDN in international E.164 format (no +). Required for mobile_phone. |
customer. | string (email) | — | Customer’s email |
customer. | string | — | Country code (ISO 3166-1 alpha-2). Required for bank_card. |
customer. | object | — | |
customer. | integer (int32) | — | Network ID (see operators reference) |
customer. | string | — | |
customer. | object | — | |
customer. | integer (int32) | — | Operator ID (see operators reference) |
customer. | string | — | |
customer. | string | — | Source name in the merchant’s system (unique per partner). Required for bank_card. |
customer. | string | — | Unique customer ID in the merchant’s system. Required for bank_card. |
customer. | object | — | |
merchant_contract_id | string | — | Contract ID in the merchant’s system. Contract is created by the key customer + merchant_contract_id. |
Request example — Mobile phone (DCB)
{
"client_ip": "10.20.30.40",
"customer": {
"type": "mobile_phone",
"msisdn": "79600000000"
},
"merchant_contract_id": "1234567890"
}Request example — Bank card with card details (PCI DSS contour host only)
{
"client_ip": "10.20.30.40",
"customer": {
"type": "bank_card",
"source": "my_app",
"country": "RU",
"merchant_customer_id": "client_12345",
"email": "test@test.com",
"bank_card": {
"pan": "4111111111111111",
"expiration_month": "12",
"expiration_year": "2030",
"security_code": "123",
"cardholder": "IVAN IVANOV"
}
},
"merchant_contract_id": "1234567890"
}Request example — Contracts_Create / duplicate (HTTP 409)
{
"client_ip": "127.0.0.1",
"customer": {
"type": "bank_card",
"source": "app",
"country": "RU",
"merchant_customer_id": "CUSTOMER-000000001",
"email": "test@test.com",
"bank_card": {
"pan": "1111222233334444",
"expiration_month": "12",
"expiration_year": "2030",
"security_code": "123",
"cardholder": "IVAN IVANOV"
}
},
"contract": {
"merchant_contract_id": "CONTRACT-000000001"
}
}Request example — Contracts_Create / mobile_phone (HTTP 201)
{
"merchant_contract_id": "CONTRACT-000000001",
"customer": {
"type": "mobile_phone",
"msisdn": "79600000000"
},
"client_ip": "127.0.0.1"
}Response example
{
"success": true,
"data": {
"contract_id": "0d0f3c58-9b1e-4a77-9a0c-000000000002",
"authorization_type": "SMS_PIN",
"expires_at": "2026-09-21T12:00:00Z",
"merchant_contract_id": "CONTRACT-000000001",
"customer": {
"type": "mobile_phone",
"msisdn": "79600000000"
}
}
}Response codes
| Code | Description |
|---|---|
201 | Contract created |
400 | Validation or business request error |
401 | Authentication failed (missing/invalid signature or timestamp) |
403 | Project access denied or IP not whitelisted |
409 | Contract already exists or contract draft already exists |
422 | Business validation error |
500 | Unexpected platform error |
503 | Service temporarily unavailable |