Skip to main content

Getting subscription data (V2)

This method allows retrieving subscription info using a subscription token.

note

We recommend using the new method version for better performance. This version will no longer be supported since 06/30/2024.

Interaction parameters

GET

https://public-api.rustore.ru/public/glike/subscription/{packageName}/{subscriptionId}/{subscriptionToken}

AttributeTypeDescriptionRequiredLocationExample
Public-TokenstringJwe token to Public API Rustore
How to get an authorization token.
YesheaderN/A
packageNamestringApp package nameYespathcom.MashaAndTheBear.HairSalon
subscriptionIdstringProduct/subscription code
To be specified by the developer when creating the product in RuStore Console.

How to create an app subscription.
Yespathdaily_sub
subscriptionTokenstringHow to get a subscription token Billing SDK Documentation.Yespath111.123

Successful response

AttributeTypeDescriptionRequiredExample
startTimeMillisstringSubscription provisioning time in milliseconds since epoch start.Yes1577826955637
expiryTimeMillisstringSubscription expiration time in milliseconds from the epoch start.Yes1609456386128
autoRenewingbooleanWhether the subscription will automatically renew at the end of the current expiry date.Yesfalse
priceCurrencyCodestringISO 4217 currency code for the subscription price.YesRUB
priceAmountMicrosstringSubscription price. Price is expressed in micro units, where 1,000,000 micro units represents one unit of currency. For example, if the subscription price is 100 rubles, the price of AmountMicros is 100000000.Yes749000000
countryCodestringThe user's billing country/region code at the time the subscription is granted.YesRU
paymentStateintSubscription Payment Status. Available values:
0 — awaiting payment
1— receiving payment;
• 2 — free trial.

Not available for cancelled expired subscriptions.
No, for active subscriptions only1
cancelReasonintThe reason why the subscription was cancelled or not renewed automatically. Available values:
0 — subscription cancelled by the user
1 — subscription cancelled by the system, e.g. due to a payment problem.
No, only for cancelled subscriptions with a status of CLOSED0
orderIdstringLast invoice ID associated with the subscription purchase. If there is more than one subscription account, their number is added to the identifier using the separator "...", starting from 0Yes41456..3
acknowledgementStateintSubscription Confirmation Status. Available values:
0 — not yet confirmed;
1 — confirmed.
Yes1
introductoryPriceInfo{}objectInformation about the promotional subscription period. This field does not indicate that the subscription is currently in a promotional period.No, only for subscriptions with a PROMO period.N/A
kindstringIt always passes the value androidpublisher#subscriptionPurchaseYesandroidpublisher#subscriptionPurchase
purchaseTypeintIt always passes 0.Yes0

introductoryPriceInfo

AttributeTypeDescriptionRequiredExample
introductoryPriceCurrencyCodestringISO 4217 currency code for the initial subscription price.No, only for subscriptions with a PROMO period.RUB
introductoryPriceAmountMicrosstringInitial subscription price. Currency corresponds to priceCurrencyCode. Price is expressed in micro units, where 1,000,000 micro units represents one unit of currency. For example, if the subscription price is 100 rubles, the price of AmountMicros is 100000000.No, only for subscriptions with a PROMO period.599000000
introductoryPricePeriodstringInitial price period specified in ISO 8601 format. For example, P1W (one week), P1M (one month), P3M (three months), P6M (six months), and P1Y (one year).No, only for subscriptions with a PROMO period.P1Y
introductoryPriceCyclesstringNumber of settlement periods for the initial price offer.No, only for subscriptions with a PROMO period.1

Successful response

{
"startTimeMillis": "1694431707000",
"expiryTimeMillis": "1697034507000",
"autoRenewing": true,
"priceCurrencyCode": "RUB",
"priceAmountMicros": "749000000",
"countryCode": "RU",
"paymentState": 1,
"orderId": "33252..1",
"acknowledgementState": 1,
"kind": "androidpublisher#subscriptionPurchase",
"purchaseType": 0,
"introductoryPriceInfo":
{
"introductoryPriceCurrencyCode": "RUB",
"introductoryPriceAmountMicros": "599000000",
"introductoryPricePeriod": "P1M",
"introductoryPriceCycles": "1"
}
}

Error parameters

AttributeTypeDescriptionRequiredExample
codestringResponse codeYesERROR
messagestringDecoded response codeNoJwe token is expired
body{}objectResponse bodyNoN/A
timestampstringResponse timeYes2024-01-21T13:34:31.067240345+03:00

Error response

{
"code": "ERROR",
"message": "Jwe token is expired",
"body": null,
"timestamp": "2024-01-21T13:51:59.654427798+03:00"
}