Sign in

Reserve

POST https://{organization}.myguper.com/api/loyalty/coupon/{transactionId}/reserve

Reserves a coupon code from a coupon batch (couponBatchId) for a specific transaction. Picks an available code from the batch, computes the discount based on the batch configuration (fixed or percent over total_item), and reserves the redemption against the transaction (transactionId is the confirmToken).

Use Coupon search first to find a compatible batch for the cart, then call this endpoint with the chosen couponBatchId. Settle the coupon with Coupon settlement after the order is placed.

Monetary fields (total_item) are sent as integer cents — see Monetary values.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header. Endpoints that support a Public mode (e.g. acúmulo and resgate previews) accept the same request without the header — Private mode adds customer data and a confirmation token to the response.

Headers

Name Type Description
x-guper-authorization * string User token issued by Guper. Omit only on endpoints that explicitly support a Public mode.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Path parameters

Name Type Description
transactionId * string Transaction ID — the `confirmToken` of the prediction the reservation is bound to.

Request body

Content-Type: application/json

{
    "couponBatchId": 123,
    "interface": "generic",
    "storeId": "2",
    "clientId": 123,
    "total_item": 96390                                         // cents
}

Responses

Copied to clipboard