Skip to main content

Getting payment data by ID

This method allows requesting payment data based on purchase invoceId.

tip

If you are in doubt read the instruction in the usage scenarios.

Interaction parameters

For actual payments:

GET
https://public-api.rustore.ru/public/purchase
caution

For test payments use the following method:

GET
https://public-api.rustore.ru/public/sandbox/purchase

To work with test payments you'll need a new key — specify the methods you'll need for testing when you create this key.

AttributeTypeDescriptionMandatoryLocatedExample
Public-TokenstringJwe authorization token in Public API Rustore.
How to get authorization token.
YesheaderN/A
invoceIdnumberHow to get invoceId, see SDK payments documentation.Yesquery

Response parameters

AttributeTypeDescriptionMandatoryLocatedExample
codestringResponse code.YesbodyОК;
ERROR;
BAD_REQUEST;
NOT_FOUND.
messagestringMessage of the response.NobodyJwe token is expired
body{}objectResponse body.NobodyN/A
timestampstringResponse time and date.Yesbody2023-08-02T10:11:04.655684723+03:00

body{}

AttributeTypeDescriptionExample
error {}objectError message.N/A
invoice_idstringInvoice ID.12345
invoice_datestringInvoice creation date.2020-04-29T08:18:03+03
invoice_statusstringInvoice status.created — invoice created;
executed — the user selected a payment method, the payment is being processed;
cancelled — canceled by user;
paid — user funds are put on hold, the invoice needs to be confirmed (only for consumable products);
confirmed — payment successful;
reversed, refunded — amount is returned to the buyer.
invoice {}objectInformation about invoice.N/A
imagestringImage link.https://i-love-png.com/images/grim-reaper-icon.png
application_codestringApplication code.com.MashaAndTheBear.HairSalon
application_namestringApplication name."Masha and the Bear" hair salon
owner_codestringApplication owner code.com.MashaAndTheBear
owner_namestringApplication owner name.Masha and the Bear
payment_info {}objectPayment information.N/A
payment_methods{}objectPayment tools.N/A

body.error {}

AttributeTypeDescriptionExample
user_messagestringError text.Invoice confirmed
error_descriptionobjectError description.N/A
error_codenumberNumeric error code.0

body.invoice {}

AttributeTypeDescriptionExample
purchaser{}objectBuyer information.N/A
delivery_info{}objectDelivery information.N/A
invoice_params[]arrayAdditional parameters of the order.N/A
order{}objectOrder information.N/A

body.invoice.purchaser {}

AttributeTypeDescriptionExample
emailstringBuyer's email.qq@dd.eof
phonestringPhone number9123456789
contactstringPreferred contact method.email

body.invoice.delivery_info {}

AttributeTypeDescriptionExample
address{}objectAddress.N/A
delivery_typestringDelivery method.courier
descriptionstringAdditional information.Call 1,5 hours in advance.

body.invoice.delivery_info.address {}

AttributeTypeDescriptionExample
countrystringCountry ID.RU
citystringCity.Moscow
addressstringAddress.st. Vavilova, 19, office 1

body.invoice.invoice_params []

AttributeTypeDescriptionExample
keystringParameter name.packageName
valuestringParameter value.com.MashaAndTheBear.HairSalon

body.invoice.order {}

AttributeTypeDescriptionExample
order_idstringOrder ID.d290f1ee-6c54-4b01-90e6-d701748f0851
order_numberstringOrder number.145
order_datestringOrder date.2020-04-29T08:17:03+03
service_idstringService ID.223
amountnumberPurchase amount in minimum currency units.11836
currencystringCurrency code.RUB
purposestringShort payment purpose description.“Masha and the Bear Hair Salon” in-game purchase
descriptionstringOrder description.In-game item purchase in “Masha and the Bear Hair Salon”
languagestringLanguage.en-US
expiration_datestringInvoice expiration date and time.2022-10-11T14:05:44.741Z
tax_systemnumberTax system.0
trade_namestringOrganization trade name.Romashka
visual_namestringOperation name.Purchase/subscription prolongation
org_namestringOrganization name.OOO Romashka
org_innstringOrganization TIN.1234567890
visual_amountstringSum.1 500,45 ₽
order_bundle []arrayOrder bundle.N/A

body.invoice.order.order_bundle []

AttributeTypeDescriptionExample
position_idnumberProduct position ID.1
namestringProduct name or description.Crystals
item_params[]arrayAdditional order parameters.N/A
quantity{}objectTotal product quantity description.N/A
item_amountnumberTotal sum of all items in minimum currency units.11836
currencystringCurrency code.RUB
item_codestringItem code.com.MashaAndTheBear.HairSalon.crystal100
item_pricenumberItem price in minimum currency units.11836
discount_typestringDiscount type.percent
discount_valuefloatDiscount value.5.25
interest_typestringAgent fee typeagentPercent
interest_valuefloatAgent fee type value.15.105
tax_typenumberVAT rate.6
tax_sumnumberTax sum in minimum currency units.2367
imagestringImage link.https://i-love-png.com/images/grim-reaper-icon.png

body.invoice.order.order_bundle.item_params []

AttributeTypeDescriptionExample
keystringParameter name.packageName
valuestringParameter value.com.MashaAndTheBear.HairSalon

body.invoice.order.order_bundle.quantity {}

AttributeTypeDescriptionExample
valuefloatValue.1.05
measurestringMeasure unit.kg

body.payment_info {}

AttributeTypeDescriptionExample
payment_datenumberPayment date and time.2022-10-11T14:05:44.741Z
payment_idstringPayment ID.82022-123456
payment_params{}objectPayment additional parameters.N/A
device_info{}objectDevice information.N/A
loyalty_info{}objectLoyalty program information.N/A
card_idstringCard ID.ad454ffg-6c54-4b01-90e6-d701748f0851
namestringCard alias.Main
paysys_codestringN/ARBS-shortname
masked_panstringMasked card name.**1111
expiry_datestringCard expiry date.201912
cardholderstringCardholder name.Ivan Petrov
payment_systemstringPayment system.Visa
payment_system_imagestringLink to a payment service provider logo.https://smartmarkettestift.online.sberbank.ru/icons/logo_visa.png
imagestringLink to a card logo.https://smartmarkettestift.online.sberbank.ru/icons/sberbank_mastercard_league_legends.jpeg
paysysstringPayment system name.RBS
paysys_imagestringLink to a payment system logo.https://www.sberbank.ru/common/img/uploaded/redirected/s_m_business/acquiring/assets/images/intro@2x.png
payment_waystringPayment method.SberPay
payment_way_codestringPayment method ID.SberPay
payment_way_logostringLink to a payment method log.https://cdn1.telegram.one/i/f7640dada78306b1c993e04001b8738d/828b1eb30921659e22e53a9edc92c4c4/24e01830d213d75deb99c22b9cd91ddd
bank_info{}objectBank information.N/A

body.payment_info.payment_params {}

AttributeTypeDescriptionExample
keystringParameter name.googlePurchaseToken
valuestringParameter value.ameinkbophchljaejnocadib

body.payment_info.device_info {}

AttributeTypeDescriptionExample
device_platform_typestringDevice platform.Android
device_platform_versionstringPlatform OS version.Android 13
device_modelstringDevice model.Samsung Galaxy A14
device_manufacturerstringVendor.Samsung
device_idstringDevice serial number.83c3f257-46d8-41fe-951b-f79d04e288c2
surfacestringN/ARuStore
surface_versionstringSoftware version.11.5.0

body.payment_info.loyalty_info {}

AttributeTypeDescriptionExample
service_codestringBonus program code.sbrf_spasibo
service_namestringBonus program name.Sberbanl Spasibo
change_ratenumberBonus point exchange rate to rubles.1
payment_bonusnumberAmount of bonus points used in payment — in minimum currency units.19800
award_bonusnumberAmount used for receiving bonus point. Indicated in minimum units (kopecks)21850
imagestringImage link.https://i-love-png.com/images/grim-reaper-icon.png

body.payment_info.bank_info {}

AttributeTypeDescriptionExample
bank_namestringEmitting bank name.Loyalty program
bank_country_codestringEmitting bank country code.RU
bank_country_namestringEmitting bank country name.Russia
bank_imagestringLink to a bank logo.https://emoji.slack-edge.com/TKK9DHNCV/sber/ad2df81a6cd9812d.png

body.payment_methods {}

AttributeTypeDescriptionExample
user_messagestringUser message (optional).To activate the subscription, save your bank card in the mobile app.
methods[]arrayPayment methods.N/A

body.payment_methods.methods []

AttributeTypeDescriptionExample
methodstringCode.QR
actionstringName.Pay with QR code

Response example

{
"code": "OK",
"message": null,
"body": {
"invoice_id": "2850",
"invoice_date": "2023-07-18T14:31:33+03",
"invoice_status": "confirmed",
"application_code": "3399750",
"application_name": "Masha and the Bear",
"owner_code": "4384191",
"owner_name": "Narana\ LLC",
"payment_info": {
"payment_date": "2023-07-18T14:31:42+03",
"payment_id": "82022-123456",
"payment_params": null,
"loyalty_info": null,
"card_id": "193",
"paysys_code": "RBS-shortname",
"masked_pan": "XX1111",
"expiry_date": "202412",
"payment_system": "Visa",
"payment_system_image": "https://smartmarket.online.sberbank.ru/image/visa.png",
"paysys_image": null,
"payment_way": "Pay with a saved card",
"payment_way_code": "CARD_BINDING",
"payment_way_logo": "https://static.tildacdn.com/tild6236-3530-4235-b966-326630656238/___14_-removebg-prev.png",
"bank_info": {
"bank_name": "Sberbank",
"bank_country_code": "SU",
"bank_country_name": null,
"bank_image": null
},
"device_info": null,
"name": null,
"cardholder": "CARDHOLDER NAME",
"image": null,
"paysys": "RBS"
},
"payment_methods": null,
"error": {
"user_message": "Verified",
"error_description": "",
"error_code": 0
},
"invoice": {
"delivery_info": {
"delivery_type": null,
"address": {
"country": null,
"city": null,
"address": null
},
"description": null
},
"invoice_params": [
{
"key": "inapp_serviceparam_message_about_loyalty",
"value": "You can now pay for your subscription with bonuses. Subscription renewal is available for rubles only."
},
{
"key": "inapp_serviceparam_action_name",
"value": "Enable subscription"
},
{
"key": "inapp_serviceparam_features",
"value": "VERIFY"
},
{
"key": "period_type",
"value": "DAY"
},
{
"key": "period_duration",
"value": "1"
},
{
"key": "current_period",
"value": "STANDARD"
},
{
"key": "payment_type",
"value": "INITIAL"
}
],
"purchaser": {
"email": null,
"phone": null,
"contact": null
},
"order": {
"order_id": "a090a93c-ca06-493d-a90a-ce2bac722358",
"order_number": "311",
"order_date": "2023-07-18T14:31:33+03",
"service_id": "4720",
"expiration_date": "2023-07-18T14:51:33+03",
"tax_system": null,
"trade_name": null,
"visual_name": "Purchasing/Renewing a Subscription",
"org_name": "Super LLC",
"org_inn": "4419198349",
"visual_amount": "1 ₽",
"order_bundle": [
{
"position_id": 1,
"item_params": [
{
"key": "_auto_itemAttributes_agent_info.type",
"value": "7"
},
{
"key": "_auto_itemAttributes_supplier_info.name",
"value": "LLC \"Narana\"
},
{
"key": "_auto_itemAttributes_supplier_info.inn",
"value": "4419198349"
}
],
"item_amount": 100,
"item_code": "1day",
"item_price": 100,
"discount_type": null,
"discount_value": null,
"interest_type": null,
"interest_value": null,
"tax_type": 6,
"tax_sum": null,
"name": "Payment for purchasing a \"1day\". Провайдер: Provider: \"Purchase/Renewal of Subscription\",
"quantity": {
"value": 1,
"measure": "pcs"
},
"currency": "RUB",
"image": ""
}
],
"amount": 100,
"currency": "RUB",
"purpose": "1day",
"description": "1day",
"language": "ru-RU"
}
},
"image": ""
},
"timestamp": "2023-08-02T10:11:04.655684723+03:00"
}

Error response example

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

Response verification

On receiving a request the authorization token is checked (see [generating a security token] (/work-with-rustore-api/api-authorization-token)):

  • the owner and/or app must not be blocked;
  • the token must be valid;
  • the application_code matches to the token owner.