Subscriptions: access and scenarios
Endpoint, demo credentials, PIN, TestInfo and Subscription Service sandbox limits.
The Subscription Service sandbox mirrors the production contract — method addresses, request structure, signature and response format — but not billing. No money is charged and no SMS is sent.
Access
| Parameter | Value |
|---|---|
| Endpoint | https://subs-sandbox.digitalspb.com/Http/Services/{Method}.aspx |
| SubscriptionProjectID | 2001 — any other value is rejected with SECURITY_ERROR |
| SecretKey | subs_secret_key |
| Approval PIN | 1234 — fixed, three attempts |
| Error cards | last 4 digits 0001…0005 |
| Declined numbers | endings 0001, 0002, 0003 |
{Method} is the method name, case-insensitive: for example CreateSubscription.aspx. The request body is XML or application/x-www-form-urlencoded with the same fields.
Subscriptions use their own signature: HMAC-SHA256 over SubscriptionProjectID + Now, where Now is yyyyMMddHHmmss UTC. Do not confuse it with the Callisto signature.
Quick start
Create a subscription with
CreateSubscription. The response containsSubscriptionID,SubscriberAcceptanceChannel=SMS_PINand statusPending.Approve it with
ApproveSubscriptionand PIN1234. The sandbox does not send SMS; three attempts are allowed, after which the subscription staysApprovingFailedforever.Check the status with
GetSubscriptionStatus— it returnsActive. KeepSubscriptionID: it identifies the subscription in every other method.Wait for the
SubscriptionStatusNotificationcallback withEventType=APPROVED; it reaches the project callback URL 15 seconds later.
Example: create a subscription
Request headers
When running, the server substitutes demo_login and the signature.
curl -X POST "https://subs-sandbox.digitalspb.com/Http/Services/CreateSubscription.aspx" \ -H "Content-Type: text/xml" \ --data-binary @- <<'BODY_IFM'<?xml version="1.0" encoding="utf-8"?><Request> <SubscriptionProjectID>2001</SubscriptionProjectID> <Subscriber_MSISDN>79600000000</Subscriber_MSISDN> <Now>YOUR_TIMESTAMP</Now> <Signature>YOUR_SIGNATURE</Signature></Request> BODY_IFM<Response> <StatusName>REQUEST_ACCEPTED</StatusName> <SubscriptionID>1000000001</SubscriptionID> <SubscriberAcceptanceRequired>true</SubscriberAcceptanceRequired> <SubscriberAcceptanceChannel>SMS_PIN</SubscriberAcceptanceChannel> <OperatorID>22</OperatorID> <PaidUntil>2026-09-21T12:00:00Z</PaidUntil></Response>Example: approve with PIN
Use the SubscriptionID from the CreateSubscription response.
Request headers
When running, the server substitutes demo_login and the signature.
curl -X POST "https://subs-sandbox.digitalspb.com/Http/Services/ApproveSubscription.aspx" \ -H "Content-Type: text/xml" \ --data-binary @- <<'BODY_IFM'<?xml version="1.0" encoding="utf-8"?><Request> <SubscriptionProjectID>2001</SubscriptionProjectID> <SubscriptionID>{subscriptionId}</SubscriptionID> <PinCode>1234</PinCode> <Now>YOUR_TIMESTAMP</Now> <Signature>YOUR_SIGNATURE</Signature></Request> BODY_IFM<Response> <StatusName>REQUEST_ACCEPTED</StatusName> <SubscriptionID>1000000001</SubscriptionID> <OperatorID>22</OperatorID> <PaidUntil>2026-09-21T12:00:00Z</PaidUntil></Response>Example: check status
Request headers
When running, the server substitutes demo_login and the signature.
curl -X POST "https://subs-sandbox.digitalspb.com/Http/Services/GetSubscriptionStatus.aspx" \ -H "Content-Type: text/xml" \ --data-binary @- <<'BODY_IFM'<?xml version="1.0" encoding="utf-8"?><Request> <SubscriptionProjectID>2001</SubscriptionProjectID> <SubscriptionID>{subscriptionId}</SubscriptionID> <Now>YOUR_TIMESTAMP</Now> <Signature>YOUR_SIGNATURE</Signature></Request> BODY_IFM<Response> <StatusName>REQUEST_ACCEPTED</StatusName> <SubscriptionStatus>Active</SubscriptionStatus> <Country>ru</Country> <OperatorID>22</OperatorID> <SubscriptionID>1000000001</SubscriptionID> <SubscriptionProjectID>2001</SubscriptionProjectID> <PaidUntilUtc>2026-09-21T12:00:00Z</PaidUntilUtc></Response>Other methods
Subscription methods not covered by the quick start, as ready requests on the demo credentials. Put the SubscriptionID from the CreateSubscription response into the body (Edit body) and press Run. Card/SBP and WAP subscription examples are in the Example selector of CreateSubscription above.
TestInfo: billing loop
In production a subscription is billed on the project schedule — every 30 days for several cycles. In the sandbox the loop is compressed by the <TestInfo> block in CreateSubscription; without it there are no charges at all.
| Field | Values | What it does |
|---|---|---|
BillingPeriodSeconds | 1…86400 | Enables the loop and sets both the billing interval and the retry interval after a decline |
MaxIterations | 1…100, 3 by default | How many successful charges run before FINISHED / Closed |
ExpectedBillingResult | Success (default) or Failed | Outcome of every charge attempt |
BillingAmount | 10.00 by default | Charge amount in the CustomerPrice notification |
OperatorID | 22 by default | Subscription operator. 20 enables MegaFon behaviour: operation_status in the WAP redirect and CancelUrl in the CancelSubscription response |
After every successful charge, right after APPROVED_BILLING, a ContentRequest arrives — a request for the service SMS text. Reply with StatusName=REQUEST_ACCEPTED and a ContentMessage block; the reply is stored in the callback log.
The first charge counts from subscription activation — PIN approval or payment — not from creation.
Loop events
| ExpectedBillingResult | What arrives |
|---|---|
Success | APPROVED_BILLING with a growing BillingIteration and a shifted PaidUntil. On the last iteration — FINISHED, and the subscription becomes Closed |
Failed | REJECTED_BILLING_ATTEMPT, status Redelivering, BillingErrorCode=210. The next attempt comes after one period; after the third failure REJECTED_BILLING and RenewingFailed |
Declines
An error arrives with StatusName ≠ REQUEST_ACCEPTED and the ErrorReasonName and ErrorDescription fields. The HTTP code is 200, except two cases: 400 when the body is not XML or is empty, and 503 when the rate limit is exceeded.
| ErrorReasonName | When |
|---|---|
InvalidSubscriberMsisdn | The number is not in 7XXXXXXXXXX format |
SubscriberMustBeSpecified | No number, ClientIP or CustomerType=Card |
SubscriptionAlreadyCreated | The subscriber already has an open subscription in this project |
SubscriberNotSupported | The subscriber operator does not support billing; number ending 0001 |
SubscriberInBlacklist | The number is blacklisted; ending 0002 |
ClientIPMSISDNCountryNotEqual | Number and IP countries differ; number ending 0003 with ClientIP |
InvalidClientIP | ClientIP is not a valid IP address |
InvalidPinCode | Wrong PIN; the description contains the attempts left |
ExceededSubscriptionApprovingAttempts | Three wrong PINs or the 3-hour approval window expired |
SubscriptionAlreadyApproved | The subscription is already approved |
Limits
| Counter | Thresholds | Methods |
|---|---|---|
ClientIP | 50 per 10 minutes, 200 per 60 minutes | all |
Subscriber_MSISDN | 6 per 2 minutes, 10 per 20 minutes | CreateSubscription, CancelSubscription |
SubscriptionProjectID | 1000 per 1 minute, 3000 per 5 minutes | all |
The thresholds are the same as in production. Counters are independent: exceeding one number does not block other subscribers of the project.
Callbacks
Loop notifications and ContentRequest go to the project callback URL; sandbox administrators configure the address. You cannot pass your own address in the request — subscriptions have no counterpart of test_info.callback_url.
| Parameter | Value |
|---|---|
| First callback delay | 15 seconds after a status change |
| Maximum attempts | 7 — the sandbox minute window |
| Backoff | 2 → 2 → 5 → 5 → 10 → 10 seconds, then delivery stops |
| HTTP timeout | 60 seconds |
Payment widget
The widget also works in the sandbox: the SDK is https://subs-sandbox.digitalspb.com/Cards/Sbp/embed.js and the token comes from the CreateSubscription AuthorizeUrl. There are no real banks: a simulation button inside the widget completes the initial step. After success only APPROVED arrives; there is no separate first-charge notification.