Create binding
/api/v3/projects/YOUR_PROJECT_ID/contractsDescription
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: 2SignatureVersion: 3
Request and response
Examples come from OpenAPI and are read-only here. Run requests in the Sandbox section.
/api/v3/projects/YOUR_PROJECT_ID/contractsPRODUCTIONcurl -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"}'{ "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 fields | Type | Req. | Description |
|---|---|---|---|
client_ip | string | optional | |
customer | object | optional | Polymorphic customer block. The actual subset of fields depends on
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:
|
type | string | optional | mobile_phonebank_cardundefined_bank_card |
msisdn | string | optional | Customer's MSISDN in international E.164 format (no |
email | string (email) | optional | Customer's email |
country | string | optional | Country code (ISO 3166-1 alpha-2). Required for |
network | object | optional | +2 |
id | integer (int32) | optional | Network ID (see operators reference) |
name | string | optional | |
operator | object | optional | +2 |
id | integer (int32) | optional | Operator ID (see operators reference) |
name | string | optional | |
source | string | optional | Source name in the merchant's system (unique per partner). Required for |
merchant_customer_id | string | optional | Unique customer ID in the merchant's system. Required for |
bank_card | unknown | optional | |
merchant_contract_id | string | optional | Contract ID in the merchant's system. Contract is created by the key customer + merchant_contract_id. |
binding_type | string | optional | What is bound to the contract. Optional; omitted means
cardsbp |
XML 2.9 request fields
createCustomerContract| Request fields | Type | Req. | Description |
|---|---|---|---|
CreateCustomerContractRequest | object & object | required | |
ProjectID | integer (int32) | required | Project ID in the Platform system. Assigned during project setup. |
UndefinedMobilePhoneCustomer | object & object | optional | +2 |
NetworkID | integer (int32) | required | |
Email | string | optional | |
MobilePhoneCustomer | object & object | optional | Customer identification by mobile phone number. MSISDN is the primary identifier. |
MSISDN | string | required | Client's MSISDN (Mobile Subscriber Integrated Services Digital Number) in international format without '+' sign |
Email | string (email) | optional | Client's e-mail address |
BankCardCustomer | object & object | optional | Customer identification by bank card. Used for card payment scenarios. |
Email | string (email) | optional | Client's e-mail address |
Source | string | required | Source Name in Merchant's system (unique for Partner Service). Should be a unique identifier (e.g. resource/brand name) guaranteeing global uniqueness for parameters source+MerchantCustomerId in all systems. |
Country | string | required | Country code (ISO 3166-1 alpha-2, lowercase) |
MerchantCustomerId | string | required | Customer ID in Merchant's system (unique) |
UndefinedBankCardCustomer | object & object | optional | Bank card customer identification without full data set. Used for initial card payment when card details are not yet known. |
Source | string | optional | Source Name in Merchant's system (unique for Partner Service). Should guarantee global uniqueness for parameters source+MerchantCustomerId. |
Country | string | required | Country code (ISO 3166-1 alpha-2, lowercase) |
MerchantCustomerId | string | required | Customer ID in Merchant's system (unique) |
Email | string (email) | optional | Client's e-mail address |
UndefinedCustomer | object & object | optional | +2 |
Country | string | optional | |
Email | string | optional | |
ClientIP | string | optional | IP address from which the client makes the request. Mandatory by default (configurable in project settings). |
CustomerContractInfo | object | optional | Contract creation parameters for CreateInvoice request. |
MerchantContractID | string | optional | The ID of the contract in the Merchant's system. If the value is set, a contract will be created using the MSISDN + MerchantContractID key. If not specified, only by MSISDN. Unique within a single MSISDN. |
CreateIfNotExists | boolean | optional | If "true" and the project supports contract scheme, and user has no contract — a new contract will be created for the user. |
BindingType | string | optional | What is bound to the contract:
CardSbp |
AuthorizationInfo | object | optional | Authorization data — PIN code entered by the subscriber to confirm the payment or contract. |
PinCode | string | required | PIN code entered by the subscriber to confirm the contract/invoice |
Header | object | required | Request header with authentication. Included in every API request. |
Authentication | object | required | Request authentication data. All three fields are mandatory for every request. |
Login | string | required | Merchant Login assigned by the Platform |
NowUtc | string | required | Current UTC time in yyyyMMddHHmmss format. Must not differ from platform system time by more than 20 minutes. |
Signature | string | required | HMAC request signature. Calculated as: LOWERCASE(HMACSHA256(Password, Login + LOWERCASE(HMACSHA256(Password, NowUtc)))) |
RequestAttempt | integer (int32) | optional | Ordinal invoice request number (for idempotency). Starting from 0. |
Gateway | object | optional | +3 |
Signature | string | optional | |
ContractInfo | object | optional | +1 |
DesiredExpirationTimeUtc | string (date-time) | optional |
Parameters and headers
| Name | In | Required | Description |
|---|---|---|---|
projectId | path | yes | Project ID assigned by the platform during onboarding. |
Responses
exampleFull error codes are in Error codes.