Skip to main content

Getting payment data by ID (v2)

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

GET
https://public-api.rustore.ru/public/v2/purchase/{invoiceId}
AttributeTypeDescriptionMandatoryLocationExample
Public-TokenstringJwe token to Public API Rustore.
How to get an authorization token.
YesheaderN/A
invoceIdnumberHow to get invoceId, see. SDK payments documentation.Yesquery

Response parameters

AttributeTypeDescriptionMandatoryLocationExample
codestringResponse codeYesbodyOK;
ERROR;
BAD_REQUEST;
NOT_FOUND.
messagestringDecoded response codeNo, nullablebodyJwe token is expired
bodyobjectResponse bodyNobodyN/A
timestampstringResponse timeYesbody2023-08-02T10:11:04.655684723+03:00

body

AttributeTypeDescriptionMandatoryExample
invoiceIdstringInvoice No.Yes12345
invoiceDatestringInvoice dateYes2020-04-29T08:18:03+03:00
refundDatestringRefund date. Returns value only for payments in the REFUNDED status.No, nullable2020-04-29T08:18:03+03:00
invoiceStatusstringInvoice statusYesPayment statuses that will be included in the list.
  • CREATED - payment created;
  • EXECUTED - payment process started;
  • CONFIRMED — final status of a successful payment, the money is withdrawn from the buyer's account;
  • CANCELLED - canceled by the user before payment process started;
  • REJECTED - rejected payment (insufficient funds, invalid CVC, or other reasons);
  • EXPIRED - payment time expired;
  • PAID - for consumable goods, the money is put on hold, the purchase is awaiting confirmation from the developer;
  • REVERSED - for consumable products, no confirmation received, hold canceled, the money is returned to the buyer;
  • REFUNDED - the order is refunded.
developerPayloadstringString with additional information about the order that you can set during purchase initialization in SDK.No, nullableN/A
appIdintApplicatio conde (see SDK documentation).Yes3399750
ownerCodeintApp owner codeYes4384191
paymentInfoobjectPayment infoNo, if the payment tool is not selected (invoice is in the CREATED status)N/A

paymentInfo

AttributeTypeDescriptionMandatoryExample
paymentDatestringPayment date and time.No2024-10-24T14:31:33+03:00
maskedPanstringMasked card numberNo**1111
paymentSystemstringPayment system.NoVisa
paymentWaystringPayment Method.NoSberPay
paymentWayCodestringPayment Method ID.NoSberPay
bankNamestringIssuing bank name.NoSberbank

order

AttributeTypeDescriptionMandatoryExample
orderIdstringUnique order IDYesd290f1ee-6c54-4b01-90e6-d701748f0851
orderNumberstringOrder No.No145
visualNamestringOperation name.YesPurchase of digital content
amountCreateintegerOrder amount in minimum currency units.Yes10000
amountCurrentnumberPurchase amount with discounts in minimum currency units.Yes9000
currencystringCurrency codeYesRUB
itemCodestringProduct code specified in the RuStore Console on product creation.Yes1day
descriptionstringOrder DescriptionYesMash and the Bear in-app purchase — 100 crystals
languagestringDescription language.Yesru-RU

Successful response

{
"code": "OK",
"message": null,
"body":
{
"invoiceId": "2850",
"invoiceDate": "2023-07-18T14:31:33+03:00",
"refundDate": null,
"invoiceStatus": "confirmed",
"developerPayload": null,
"appId": "3399750",
"ownerCode": "4384191",
"paymentInfo": {
"paymentDate": "2024-10-24T14:31:33+03:00",
"maskedPan": "XX1111",
"paymentSystem": "Visa",
"paymentWay": "Payment with a saved card",
"paymentWayCode": "CARD_BINDING",
"bankName": "Sberbank"
},
"order": {
"orderId": "a090a93c-ca06-493d-a90a-ce2bac722358",
"orderNumber": "311",
"visualName": "Masha and the Bear in-app purchase — 100 crystals",
"amountCreate": 10000,
"amountCurrent": 9000,
"currency": "RUB",
"itemCode": "1day",
"description": "1day",
"language": "en-US",
},
},
"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 appId matches to the token owner.