Skip to main content

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}
AttributeTypeDescriptionRequiredLocationExample
Public-TokenstringJWE authorization token for the RuStore Public API.
How to get an authorization token
YesheaderN/A
packageNamestringApplication package name.Yespathcom.MashaAndTheBear.HairSalon
subscriptionIdstringSubscription product code.
Specified by the developer when creating the product in the RuStore Console.

How to create a subscription.
Yespathdaily_sub
purchaseIdstringPurchase ID in UUID format. Can be obtained from the purchase result via SDK, from a server notification, or by requesting purchase information.Yespath3aa0c7bd-964e-4562-b218-fe365adb4ae3

Response parameters

AttributeTypeDescriptionRequiredLocationExample
codestringResponse code.YesbodyOK / ERROR
messagestringResponse code description.NobodyBad request
body{}objectResponse body.NobodyN/A
timestampstringResponse time.Yesbody2024-07-29T12:00:00.000Z

body{}

AttributeTypeDescriptionRequiredExample
startTimeMillisstringSubscription provision time in milliseconds since the epoch.Yes1694431707000
expiryTimeMillisstringSubscription expiry time in milliseconds since the epoch.Yes1697083457000
autoRenewingbooleanWhether the subscription will automatically renew upon expiry of the current term.Yesfalse
developerPayloadstringA string with additional order information that you can set when confirming the purchase in the SDK.NoExternal id = 1
priceCurrencyCodestringISO 4217 currency code for the subscription price.YesRUB
priceAmountMicrosstringSubscription 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.Yes749000000
countryCodestringUser's billing country/region code at the time of subscription provision.YesRU
paymentStatenumberSubscription payment state. Possible values:
0 — payment pending
1 — payment received;
2 — free trial.

Absent for cancelled subscriptions with expired terms.
No, only for active subscriptions1
cancelReasonnumberReason 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 status0
userCancellationTimeMillisstringTime of user cancellation in milliseconds since the epoch.No, only for cancelled subscriptions with CLOSED status1697083457000
orderIdstringIdentifier 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.Yes3352..1
acknowledgementStatestringSubscription product acknowledgement state. Possible values:
"PENDING" — not yet acknowledged;
"ACKNOWLEDGED" — acknowledged;
"UNKNOWN" — unknown state.
Yes"ACKNOWLEDGED"
externalAccountIdstringUser identifier in the external application.No, only if appUserId was set when starting the purchaseany_string
kindstringAlways androidpublisher#subscriptionPurchase.Yesandroidpublisher#subscriptionPurchase
purchaseTypenumberPurchase type: 0 — test subscription.No, only for test subscriptions, not passed for real ones0
introductoryPriceInfo{}objectInformation 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 configuredsee below
promoPriceInfo{}objectInformation 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 configuredsee below

introductoryPriceInfo{}

AttributeTypeDescriptionExample
introductoryPriceCurrencyCodestringISO-4217 currency code for the introductory price.RUB
introductoryPriceAmountMicrosstringCost of the period (in micro-units). For a free trial period, the value is 0.0
introductoryPricePeriodstringFree trial period duration in ISO-8601 format (P1W, P1M, P3M, P6M, P1Y).P1Y
introductoryPriceCyclesstringNumber of billing periods the offer applies to.1

promoPriceInfo{}

AttributeTypeDescriptionExample
promoPriceCurrencyCodestringISO-4217 currency code for the promo price.RUB
promoPriceAmountMicrosstringCost of the period (in micro-units).59900000
promoPricePeriodstringPromo period duration in ISO-8601 format (P1W, P1M, P3M, P6M, P1Y).P1Y
promoPriceCyclesstringNumber 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

MessageDescription
Purchase not foundPurchase not found. Make sure the correct purchase ID is specified.
ForbiddenForbidden. Check the authorization token and request parameters.
Something went wrongSomething went wrong. Try again later or contact support.