API · Bindings (contracts)

Create binding

PCI DSS requiredProtocol: JSON v3 · XML 2.9POST/api/v3/projects/YOUR_PROJECT_ID/contracts

Description

Initiates binding of a customer (mobile phone number or bank card) for repeat payments within the project.

On the PCI DSS contour host the request may additionally carry customer.bank_card — the card is bound to the contract directly, without sending the payer to a payment page.

v4 signature payload: {merchant_contract_id}{customerPayload}{pin_code}{client_ip}

XML 2.9 description

Creates a contract (subscription) for a customer. XML request type: <CreateCustomerContractRequest>.

Initiating a payment authorization process by Merchant for client MSISDN. After creation, the Platform will send an SMS with a PIN code for user authorization (depending on settings).

HTTP Headers:

  • Callisto-Protocol-Version: 2
  • SignatureVersion: 3

Request and response

Examples come from OpenAPI and are read-only here. Run requests in the Sandbox section.

POST/api/v3/projects/YOUR_PROJECT_ID/contractsPRODUCTION
Request
curl -X POST "https://pay-api.digitalspb.com/api/v3/projects/YOUR_PROJECT_ID/contracts" \  -H "Content-Type: application/json" \  -H "X-Login: YOUR_LOGIN" \  -H "X-Timestamp: YOUR_TIMESTAMP" \  -H "X-Signature-Version: 3" \  -H "X-Signature: YOUR_SIGNATURE" \  -d '{  "client_ip": "10.20.30.40",  "customer": {    "type": "mobile_phone",    "msisdn": "79600000000"  },  "merchant_contract_id": "1234567890"}'
Read-only example. Runnable examples are available in the Sandbox section.
201
{  "success": true,  "data": {    "contract_id": "16449203-0000-009b-a125-351b7bfbd207",    "authorization_type": "SMS_PIN",    "expires_at": "2025-03-29T20:00:08Z",    "merchant_contract_id": "1234567890",    "customer": {      "type": "mobile_phone",      "msisdn": "79600000000",      "country": "RU",      "network": {        "id": 3,        "name": "Beeline"      },      "operator": {        "id": 42,        "name": "Beeline"      }    }  }}

JSON v3 request fields

Contracts_Create
Request fieldsTypeReq.Description
client_ipstringoptional
customerobjectoptional

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.url. 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.
typestringoptional
mobile_phonebank_cardundefined_bank_card
msisdnstringoptional

Customer's MSISDN in international E.164 format (no +). Required for mobile_phone.

emailstring (email)optional

Customer's email

countrystringoptional

Country code (ISO 3166-1 alpha-2). Required for bank_card.

networkobjectoptional+2
operatorobjectoptional+2
sourcestringoptional

Source name in the merchant's system (unique per partner). Required for bank_card.

merchant_customer_idstringoptional

Unique customer ID in the merchant's system. Required for bank_card.

bank_cardunknownoptional
merchant_contract_idstringoptional

Contract ID in the merchant's system. Contract is created by the key customer + merchant_contract_id.

binding_typestringoptional

What is bound to the contract. Optional; omitted means card, the behaviour that existed before the field was introduced.

  • card — the payer's bank card is bound and can be charged later
  • sbp — an SBP account is bound: the payer confirms the binding in their bank app, so the response carries authorization_url and authorization_type is AUTH_PAGE Only meaningful for bank_card customers — those are the card-gateway customers that support contracts. An unknown value is rejected with a validation error.
cardsbp

XML 2.9 request fields

createCustomerContract
Request fieldsTypeReq.Description
CreateCustomerContractRequestobject & objectrequired
ProjectIDinteger (int32)required

Project ID in the Platform system. Assigned during project setup.

UndefinedMobilePhoneCustomerobject & objectoptional+2
MobilePhoneCustomerobject & objectoptional

Customer identification by mobile phone number. MSISDN is the primary identifier.

+2
BankCardCustomerobject & objectoptional

Customer identification by bank card. Used for card payment scenarios.

+4
UndefinedBankCardCustomerobject & objectoptional

Bank card customer identification without full data set. Used for initial card payment when card details are not yet known.

+4
UndefinedCustomerobject & objectoptional+2
ClientIPstringoptional

IP address from which the client makes the request. Mandatory by default (configurable in project settings).

CustomerContractInfoobjectoptional

Contract creation parameters for CreateInvoice request.

+3
AuthorizationInfoobjectoptional

Authorization data — PIN code entered by the subscriber to confirm the payment or contract.

+1
Headerobjectrequired

Request header with authentication. Included in every API request.

Authenticationobjectrequired

Request authentication data. All three fields are mandatory for every request.

+3
RequestAttemptinteger (int32)optional

Ordinal invoice request number (for idempotency). Starting from 0.

Gatewayobjectoptional+3

Parameters and headers

NameInRequiredDescription
projectIdpathyesProject ID assigned by the platform during onboarding.

Responses

201
Contract createdexample
400
401
403
500
503

Full error codes are in Error codes.