Getting subscription data (V3)
This method allows retrieving subscription info using a subscription token.
Interaction parameters
GET
https://public-api.rustore.ru/public/v3/subscription/{packageName}/{subscriptionId}/{subscriptionToken}
Attribute | Type | Description | Required | Location | Example |
---|---|---|---|---|---|
Public-Token | string | Jwe token to Public API Rustore How to get an authorization token. | Yes | header | N/A |
packageName | string | App package name | Yes | path | com.MashaAndTheBear.HairSalon |
subscriptionId | string | Product/subscription code To be specified by the developer when creating the product in RuStore Console. How to create an app subscription. | Yes | path | daily_sub |
subscriptionToken | string | How to get a subscription token Billing SDK Documentation. | Yes | path | 111.123 |
Successful response
Attribute | Type | Description | Required | Example |
---|---|---|---|---|
startTimeMillis | string | Subscription provisioning time in milliseconds since epoch start. | Yes | 1577826955637 |
expiryTimeMillis | string | Subscription expiration time in milliseconds from the epoch start. | Yes | 1609456386128 |
autoRenewing | boolean | Whether the subscription will automatically renew at the end of the current expiry date. | Yes | false |
priceCurrencyCode | string | ISO 4217 currency code for the subscription price. | Yes | RUB |
priceAmountMicros | string | Subscription 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. | Yes | 749000000 |
countryCode | string | The user's billing country/region code at the time the subscription is granted. | Yes | RU |
paymentState | int | Subscription Payment Status. Available values: • 0 — awaiting payment • 1 — receiving payment; • 2 — free trial. Not available for cancelled expired subscriptions. | No, for active subscriptions only | 1 |
cancelReason | int | The 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 CLOSED | 0 |
orderId | string | Last 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 0 | Yes | 41456..3 |
acknowledgementState | int | Subscription Confirmation Status. Available values: • 0 — not yet confirmed; • 1 — confirmed. | Yes | 1 |
introductoryPriceInfo{} | object | Information 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 |
kind | string | It always passes the value androidpublisher#subscriptionPurchase | Yes | androidpublisher#subscriptionPurchase |
purchaseType | int | It always passes 0 . | Yes | 0 |
introductoryPriceInfo
Attribute | Type | Description | Required | Example |
---|---|---|---|---|
introductoryPriceCurrencyCode | string | ISO 4217 currency code for the initial subscription price. | No, only for subscriptions with a PROMO period. | RUB |
introductoryPriceAmountMicros | string | Initial 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 |
introductoryPricePeriod | string | Initial 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 |
introductoryPriceCycles | string | Number of billing 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
Attribute | Type | Description | Required | Example |
---|---|---|---|---|
code | string | Response code | Yes | ERROR |
message | string | Decoded response code | No | Jwe token is expired |
body{} | object | Response body | No | N/A |
timestamp | string | Response time | Yes | 2024-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"
}