Skip to main content

Consume an In-App Purchase with the API

This API is intended for exceptional support scenarios—for example, when a user completed a purchase but did not receive the product, and support delivers it manually. After delivering the product, you can consume the purchase for that user from your server.

Note

You generally do not need this API when the app's purchase and delivery flow is implemented correctly. Use it only for consumable products and support scenarios. Do not consume non-consumable products.

Security

This API is for server-to-server calls only. Do not put the X-Access-Token in a client app.

Request​

curl --request PUT \
'https://developer.myket.ir/api/partners/applications/{PACKAGE_NAME}/purchases/products/{SKU_ID}/tokens/{TOKEN}/consume' \
--header 'X-Access-Token: {ACCESS_TOKEN}'
ParameterDescription
PACKAGE_NAMEApp package name
SKU_IDID of the consumable product
TOKENIn-app purchase token
ACCESS_TOKENApp access token from the Developer Panel

Successful response​

On success, the API returns HTTP 200 and a body similar to:

{
"code": 200,
"messageCode": "Successful",
"translatedMessage": "The operation completed successfully"
}

Error responses​

StatusMessage codeDescription
400SkuAlreadyConsumedThe product has already been consumed
404PurchasedSkuNotFoundThe purchase or token was not found
404SkuIdNotFoundThe in-app product was not found
500InternalErrorInternal server error