Sandbox

Subscriptions: access and scenarios

XML 2.9 onlyOpenAPI

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

ParameterValue
Endpointhttps://subs-sandbox.digitalspb.com/Http/Services/{Method}.aspx
SubscriptionProjectID2001 — any other value is rejected with SECURITY_ERROR
SecretKeysubs_secret_key
Approval PIN1234 — fixed, three attempts
Error cardslast 4 digits 0001…0005
Declined numbersendings 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

  1. Create a subscription with CreateSubscription. The response contains SubscriptionID, SubscriberAcceptanceChannel=SMS_PIN and status Pending.

  2. Approve it with ApproveSubscription and PIN 1234. The sandbox does not send SMS; three attempts are allowed, after which the subscription stays ApprovingFailed forever.

  3. Check the status with GetSubscriptionStatus — it returns Active. Keep SubscriptionID: it identifies the subscription in every other method.

  4. Wait for the SubscriptionStatusNotification callback with EventType=APPROVED; it reaches the project callback URL 15 seconds later.

Example: create a subscription

POSThttps://subs-sandbox.digitalspb.com/Http/Services/CreateSubscription.aspxSANDBOXReference ↗
This step is currently described in XML 2.9 only.
Request
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
The code already has the demo credentials and a fresh signature; the button refreshes it. “Prepare data” creates a test object without running the request, while Run refreshes test numbers and order ids and fills in missing ids.
200
<?xml version="1.0" encoding="utf-8"?><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.

POSThttps://subs-sandbox.digitalspb.com/Http/Services/ApproveSubscription.aspxSANDBOXReference ↗
This step is currently described in XML 2.9 only.
Request
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
The code already has the demo credentials and a fresh signature; the button refreshes it. “Prepare data” creates a test object without running the request, while Run refreshes test numbers and order ids and fills in missing ids.
200
<?xml version="1.0" encoding="utf-8"?><Response>  <StatusName>REQUEST_ACCEPTED</StatusName>  <SubscriptionID>1000000001</SubscriptionID>  <OperatorID>22</OperatorID>  <PaidUntil>2026-09-21T12:00:00Z</PaidUntil></Response>

Example: check status

POSThttps://subs-sandbox.digitalspb.com/Http/Services/GetSubscriptionStatus.aspxSANDBOXReference ↗
This step is currently described in XML 2.9 only.
Request
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
The code already has the demo credentials and a fresh signature; the button refreshes it. “Prepare data” creates a test object without running the request, while Run refreshes test numbers and order ids and fills in missing ids.
200
<?xml version="1.0" encoding="utf-8"?><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.

Reference
Reference
Reference
Reference

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.

FieldValuesWhat it does
BillingPeriodSeconds1…86400Enables the loop and sets both the billing interval and the retry interval after a decline
MaxIterations1…100, 3 by defaultHow many successful charges run before FINISHED / Closed
ExpectedBillingResultSuccess (default) or FailedOutcome of every charge attempt
BillingAmount10.00 by defaultCharge amount in the CustomerPrice notification
OperatorID22 by defaultSubscription 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

ExpectedBillingResultWhat arrives
SuccessAPPROVED_BILLING with a growing BillingIteration and a shifted PaidUntil. On the last iteration — FINISHED, and the subscription becomes Closed
FailedREJECTED_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.

ErrorReasonNameWhen
InvalidSubscriberMsisdnThe number is not in 7XXXXXXXXXX format
SubscriberMustBeSpecifiedNo number, ClientIP or CustomerType=Card
SubscriptionAlreadyCreatedThe subscriber already has an open subscription in this project
SubscriberNotSupportedThe subscriber operator does not support billing; number ending 0001
SubscriberInBlacklistThe number is blacklisted; ending 0002
ClientIPMSISDNCountryNotEqualNumber and IP countries differ; number ending 0003 with ClientIP
InvalidClientIPClientIP is not a valid IP address
InvalidPinCodeWrong PIN; the description contains the attempts left
ExceededSubscriptionApprovingAttemptsThree wrong PINs or the 3-hour approval window expired
SubscriptionAlreadyApprovedThe subscription is already approved

Limits

CounterThresholdsMethods
ClientIP50 per 10 minutes, 200 per 60 minutesall
Subscriber_MSISDN6 per 2 minutes, 10 per 20 minutesCreateSubscription, CancelSubscription
SubscriptionProjectID1000 per 1 minute, 3000 per 5 minutesall

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.

ParameterValue
First callback delay15 seconds after a status change
Maximum attempts7 — the sandbox minute window
Backoff2 → 2 → 5 → 5 → 10 → 10 seconds, then delivery stops
HTTP timeout60 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.