Cancelling Purchase
This method allows you to cancel a purchase (i.e., cancel the hold on the user's card funds) by using the purchase and application identifiers. It applies only to consumable purchases (two-stage payment) in the PAID
status.
tip
If you don't know where to start, read the guide in the usage scenarios.
Interaction Parameters
For real purchases:
PUT
https://public-api.rustore.ru/public/applications/{appId}/purchases/{purchaseId}:cancel
For test purchases:
PUT
https://public-api.rustore.ru/public/sandbox/applications/{appId}/purchases/{purchaseId}:cancel
Attribute | Type | Description | Обязательность | Расположение | Пример |
---|---|---|---|---|---|
appId | number | The application ID from the RuStore console, where the refund is processed. 1. Go to the Applications tab and select the desired application. 2. Copy the ID from the application's URL – it is the set of digits between apps/ and /versions. For example, for the URL https://console.rustore.ru/apps/123456/versions, the application ID is 123456. | Yes | path | 1704024 |
purchaseId | string | The purchase identifier in UUID format. It can be obtained from the purchase result via the SDK, from the server notification, or by querying the purchase information. | Yes | path | 3aa0c7bd-964e-4562-b218-fe365adb4ae3 |
Response Parameters
Attribute | Type | Description | Mandatory | Location | Example |
---|---|---|---|---|---|
code | string | Response code. | Yes | body | • ОК ;• ERROR ;• BAD_REQUEST ;• NOT_FOUND . |
message | string | Explanation of the response code | No | body | Purchase status must be PAID |
body | object | Response body | No | body | {} |
timestamp | string | Response time | Yes | body | 2025-04-01T15:02:09.427Z |
Successful response
{
"code": "OK",
"message": null,
"body": {},
"timestamp": "2025-04-01T15:02:09.427Z"
}
Error response
{
"code": "ERROR",
"message": "Purchase status must be PAID",
"body": null,
"timestamp": "2025-04-01T15:02:09.427Z"
}
Error list
Message | Расшифровка |
---|---|
Purchase status must be PAID | The purchase status must be PAID. Make sure that the correct purchase identifier is provided. |
Purchase not found | Purchase not found. Make sure that the correct purchase identifier is provided. |
Forbidden | Forbidden. Check the validity of the authorization token and the request parameters. |
Something went wrong | Something went wrong. Please try again later or contact support. |