Skip to main content

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
AttributeTypeDescriptionОбязательностьРасположениеПример
appIdnumberThe 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.
Yespath1704024
purchaseIdstringThe 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.Yespath3aa0c7bd-964e-4562-b218-fe365adb4ae3

Response Parameters

AttributeTypeDescriptionMandatoryLocationExample
codestringResponse code.YesbodyОК;
ERROR;
BAD_REQUEST;
NOT_FOUND.
messagestringExplanation of the response codeNobodyPurchase status must be PAID
bodyobjectResponse bodyNobody{}
timestampstringResponse timeYesbody2025-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 PAIDThe purchase status must be PAID. Make sure that the correct purchase identifier is provided.
Purchase not foundPurchase not found. Make sure that the correct purchase identifier is provided.
ForbiddenForbidden. Check the validity of the authorization token and the request parameters.
Something went wrongSomething went wrong. Please try again later or contact support.