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 two-stage purchases 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-m.rustore.ru/public/applications/{appId}/purchases/{purchaseId}:cancel
For test purchases:
PUT
https://public-api-m.rustore.ru/public/sandbox/applications/{appId}/purchases/{purchaseId}:cancel
| Attribute | Type | Description | Mandatory | Location | Example |
|---|---|---|---|---|---|
Public-Token | string | JWE authorization token for the RuStore Public API. How to get an authorization token. | Yes | header | N/A |
appId | number | The application ID from the RuStore Console. 1. Go to the Applications tab and select the desired application. 2. Copy the ID from the application page URL — it is the set of digits between apps/ and /versions. | 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 purchase information. | Yes | path | 3aa0c7bd-964e-4562-b218-fe365adb4ae3 |
note
The server response time for this request can take up to 30 seconds. We recommend setting the read timeout value in your HTTP client to at least 30 seconds.
Response Parameters
| Attribute | Type | Description | Mandatory | Location | Example |
|---|---|---|---|---|---|
code | string | Response code. | Yes | body | OK, ERROR, BAD_REQUEST, NOT_FOUND, etc. |
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 Example
{
"code": "OK",
"message": null,
"body": {},
"timestamp": "2025-04-01T15:02:09.427Z"
}
Error Response Example
{
"code": "ERROR",
"message": "Purchase status must be PAID",
"body": null,
"timestamp": "2025-04-01T15:02:09.427Z"
}
Error List
| Message | Description |
|---|---|
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. |