Skip to Content

Quick start

Three requests from zero to an active subscription, on demo credentials, no sign-up.

Message exchange
Merchant Subscription Service Subscriber │ │ │ │ 1. CreateSubscription ──────►│ │ │◄── SubscriptionID + SMS_PIN ─│ ~~~ SMS with PIN ~~~~~~~~►│ │ │ (not sent in sandbox) │ │ 2. ApproveSubscription ─────►│◄── subscriber tells PIN ──│ │◄── REQUEST_ACCEPTED ─────────│ │ │ │ │ │ 3. GetSubscriptionStatus ───►│ │ │◄── SubscriptionStatus=Active │ │ │ │ │ │◄─ SubscriptionStatusNotification ─│ 15 s after confirmation
  1. Take the project credentials — SubscriptionProjectID and SecretKey. In the sandbox these are published demo credentials and no sign-up is needed: they are listed in “Access and test data”.
  2. Compute the signature. Subscriptions have their own scheme, different from one-time payments: HMAC-SHA256 over SubscriptionProjectID + Now. The breakdown is in “Request signature”.
  3. Create a subscription with CreateSubscription. The response carries SubscriptionID and SubscriberAcceptanceChannel=SMS_PIN — the subscription is waiting for the subscriber to confirm.
  4. Confirm it with ApproveSubscription. The sandbox sends no SMS, the PIN is fixed — 1234; three attempts are allowed, after which the subscription moves to ApprovingFailed permanently.
  5. Check the status with GetSubscriptionStatus — you get Active. After confirmation the SubscriptionStatusNotification callback with EventType=APPROVED is delivered to your callback URL (15 second delay). See “Callbacks”.

Card or SBP instead of SMS. Send CustomerType=Card and CustomerId in CreateSubscription — the response carries AuthorizeUrl, the payment page. ApproveSubscription is not needed in that flow: the subscription is activated once the payment completes. See “Card and SBP subscription”.

Keep the SubscriptionID returned by CreateSubscription. It identifies the subscription in every other method — both in the sandbox and in production.

Step 2 — signature

# the key is SecretKey, the message is SubscriptionProjectID + Now PROJECT=2001 SECRET=subs_secret_key NOW=$(date -u +%Y%m%d%H%M%S) SIG=$(printf '%s' "$PROJECT$NOW" | openssl dgst -sha256 -hmac "$SECRET" -r | cut -d' ' -f1)
Step 3 — CreateSubscription response
<Response> <StatusName>REQUEST_ACCEPTED</StatusName> <SubscriptionID>83159745</SubscriptionID> <SubscriberAcceptanceRequired>true</SubscriberAcceptanceRequired> <SubscriberAcceptanceChannel>SMS_PIN</SubscriberAcceptanceChannel> <OperatorID>22</OperatorID> <PaidUntil>2026-09-05T18:16:55+03:00</PaidUntil> </Response>
Steps 4 and 5
<!-- recompute the signature, Now is new --> <Request> <SubscriptionProjectID>2001</SubscriptionProjectID> <SubscriptionID>83159745</SubscriptionID> <PinCode>1234</PinCode> <Now>…</Now><Signature>…</Signature> </Request> <!-- GetSubscriptionStatus --> <SubscriptionStatus>Active</SubscriptionStatus> <PaidUntil>2026-09-05T18:16:55+03:00</PaidUntil>
Callback — arrives on its own
<Request> <SubscriptionID>83159745</SubscriptionID> <SubscriptionProjectID>2001</SubscriptionProjectID> <Subscriber_MSISDN>79600000000</Subscriber_MSISDN> <EventType>APPROVED</EventType> <SubscriptionStatus>Active</SubscriptionStatus> <BillingIteration>1</BillingIteration> <CustomerPrice currency="RUB" amount="0.00"/> </Request>