Skip to main content

Getting subscription status

This method allows retrieving subscription status using a subscription token.

Interaction parameters

GET

https://public-api.rustore.ru/public/subscription/{subscriptionToken}/state

AttributeTypeDescriptionRequiredLocationExample
Public-TokenstringJwe token to Public API Rustore
How to get an authorization token.
YesheaderN/A
subscriptionTokenstringHow to get a subscription token Billing SDK Documentation.Yespath111.123

Response example

AttributeTypeDescriptionRequiredLocationExample
codenumberResponse codeYesbodyОК;
ERROR;
BAD_REQUEST;
NOT_FOUND.
messagedateDecoded response codeNobodyJwe token is expired
body{}objectResponse bodyNobodyN/A
timestampstringResponse timeYesbody2023-08-02T10:11:04.655684723+03:00

body{}

AttributeTypeDescriptionRequiredLocationExample
is_activebooleanSubscription activity flag. Calculated by subscription status:
true — subscription active, in one of the following periods: PROMO, START, STANDARD, GRACE;
false — subscription is inactive: in HOLD— period or terminated.
Yesbody.bodytrue

Successful response

{
"code": "OK",
"message": null,
"body":
{
"is_active": true
},
"timestamp": "2024-01-21T14:08:33.548812228+03:00"
}

Error response

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

Response verification

The security token is generated by the security token method and then verified while getting the response:

  • Owner and/or app should not be blocked;

  • Token should be valid;

  • subscription should be purchased in an application owned by a company that has received a Public API access token.