Get subscription data (V5)
Important
The method only works with subscriptions purchased via Pay SDK.
The method allows you to retrieve information about a user's subscription by purchase ID.
tip
If you don't know where to start, read the guide in the usage scenarios.
Request parameters
For real subscriptions:
GET
https://public-api.rustore.ru/public/v5/subscription/{packageName}/{subscriptionId}/{purchaseId}
For test subscriptions, use a separate method:
GET
https://public-api.rustore.ru/public/sandbox/v5/subscription/{packageName}/{subscriptionId}/{purchaseId}
| Attribute | Type | Description | Required | Location | Example |
|---|---|---|---|---|---|
Public-Token | string | JWE authorization token for the RuStore Public API. How to get an authorization token | Yes | header | N/A |
packageName | string | Application package name. | Yes | path | com.MashaAndTheBear.HairSalon |
subscriptionId | string | Subscription product code. Specified by the developer when creating the product in the RuStore Console. How to create a subscription. | Yes | path | daily_sub |
purchaseId | string | Purchase ID in UUID format. Can be obtained from the purchase result via SDK, from a server notification, or by requesting purchase information. | Yes | path | 3aa0c7bd-964e-4562-b218-fe365adb4ae3 |
Response parameters
| Attribute | Type | Description | Required | Location | Example |
|---|---|---|---|---|---|
code | string | Response code. | Yes | body | OK / ERROR |
message | string | Response code description. | No | body | Bad request |
body{} | object | Response body. | No | body | N/A |
timestamp | string | Response time. | Yes | body | 2024-07-29T12:00:00.000Z |
body{}
| Attribute | Type | Description | Required | Example |
|---|---|---|---|---|
startTimeMillis | string | Subscription provision time in milliseconds since the epoch. | Yes | 1694431707000 |
expiryTimeMillis | string | Subscription expiry time in milliseconds since the epoch. | Yes | 1697083457000 |
autoRenewing | boolean | Whether the subscription will automatically renew upon expiry of the current term. | Yes | false |
developerPayload | string | A string with additional order information that you can set when confirming the purchase in the SDK. | No | External id = 1 |
priceCurrencyCode | string | ISO 4217 currency code for the subscription price. | Yes | RUB |
priceAmountMicros | string | Subscription price. The price is expressed in micro-units, where 1,000,000 micro-units represent one currency unit. For example, if the subscription price is 100 rubles, the AmountMicros price is 100,000,000. | Yes | 749000000 |
countryCode | string | User's billing country/region code at the time of subscription provision. | Yes | RU |
paymentState | number | Subscription payment state. Possible values: • 0 — payment pending • 1 — payment received; • 2 — free trial. Absent for cancelled subscriptions with expired terms. | No, only for active subscriptions | 1 |
cancelReason | number | Reason why the subscription was cancelled. Possible values: • 0 — subscription cancelled by user • 1 — subscription was cancelled by the system, e.g., due to a payment issue • 3 — subscription cancelled by developer | No, only for cancelled subscriptions with CLOSED status | 0 |
userCancellationTimeMillis | string | Time of user cancellation in milliseconds since the epoch. | No, only for cancelled subscriptions with CLOSED status | 1697083457000 |
orderId | string | Identifier of the last invoice associated with the subscription purchase. If there is more than one invoice for the subscription, the count is appended to the ID via a ".." separator, starting from 0. | Yes | 3352..1 |
acknowledgementState | string | Subscription product acknowledgement state. Possible values: • "PENDING" — not yet acknowledged; • "ACKNOWLEDGED" — acknowledged; • "UNKNOWN" — unknown state. | Yes | "ACKNOWLEDGED" |
externalAccountId | string | User identifier in the external application. | No, only if appUserId was set when starting the purchase | any_string |
kind | string | Always androidpublisher#subscriptionPurchase. | Yes | androidpublisher#subscriptionPurchase |
purchaseType | number | Purchase type: 0 — test subscription. | No, only for test subscriptions, not passed for real ones | 0 |
introductoryPriceInfo{} | object | Information about the subscription's free trial period. This field does not indicate that the subscription is currently in a free trial period. | No, only if the subscription has a free trial configured | see below |
promoPriceInfo{} | object | Information about the subscription's introductory offer period. Populated only when an introductory offer exists. This field does not indicate that the subscription is currently in an introductory offer period. | No, only if the subscription has an introductory offer configured | see below |
introductoryPriceInfo{}
| Attribute | Type | Description | Example |
|---|---|---|---|
introductoryPriceCurrencyCode | string | ISO-4217 currency code for the introductory price. | RUB |
introductoryPriceAmountMicros | string | Cost of the period (in micro-units). For a free trial period, the value is 0. | 0 |
introductoryPricePeriod | string | Free trial period duration in ISO-8601 format (P1W, P1M, P3M, P6M, P1Y). | P1Y |
introductoryPriceCycles | string | Number of billing periods the offer applies to. | 1 |
promoPriceInfo{}
| Attribute | Type | Description | Example |
|---|---|---|---|
promoPriceCurrencyCode | string | ISO-4217 currency code for the promo price. | RUB |
promoPriceAmountMicros | string | Cost of the period (in micro-units). | 59900000 |
promoPricePeriod | string | Promo period duration in ISO-8601 format (P1W, P1M, P3M, P6M, P1Y). | P1Y |
promoPriceCycles | string | Number of billing periods the promo offer applies to. | 1 |
Example of a successful response
{
"code": "OK",
"message": "Successful result",
"body": {
"startTimeMillis": "1694431707000",
"expiryTimeMillis": "1697083457000",
"autoRenewing": true,
"developerPayload": "External id = 1",
"priceCurrencyCode": "RUB",
"priceAmountMicros": "749000000",
"countryCode": "RU",
"paymentState": 1,
"cancelReason": 0,
"userCancellationTimeMillis": "1697083457000",
"orderId": "3352..1",
"acknowledgementState": "ACKNOWLEDGED",
"externalAccountId": "any_string",
"kind": "androidpublisher#subscriptionPurchase",
"purchaseType": 0,
"introductoryPriceInfo": {
"introductoryPriceCurrencyCode": "RUB",
"introductoryPriceAmountMicros": "0",
"introductoryPricePeriod": "P1Y",
"introductoryPriceCycles": "1"
},
"promoPriceInfo": {
"promoPriceCurrencyCode": "RUB",
"promoPriceAmountMicros": "59900000",
"promoPricePeriod": "P1Y",
"promoPriceCycles": "1"
}
},
"timestamp": "2025-08-11T14:16:02.236Z"
}
Example of an error response
{
"code": "ERROR",
"message": "Bad request",
"body": null,
"timestamp": "2024-07-29T12:00:00.000Z"
}
Error list
| Message | Description |
|---|---|
Purchase not found | Purchase not found. Make sure the correct purchase ID is specified. |
Forbidden | Forbidden. Check the authorization token and request parameters. |
Something went wrong | Something went wrong. Try again later or contact support. |