Sign in

Promotion by Order

POST https://{organization}.myguper.com/api/loyalty/getPromotion

Calculates promotional discounts that apply to a given order. Each organization may have one or more active campaigns evaluated in priority order — the response lists every discount that fired for the cart.

This endpoint accepts the same body shape as rewardByOrder (see Reward by Order) and operates in two modes: Public (omit x-guper-authorization) and Private. Monetary fields (price, listPrice, tax) 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.

Request body

Content-Type: application/json

{
    "interface": "sip",
    "storeId": "1",
    "client": "<client>",                                       // optional
    "items": [
        {
            "id": "2",
            "productId": "1",                                   // optional
            "name": "Smartphone Guper MK1",                     // optional
            "categoryId": "20",                                 // optional
            "brandId": "20",                                    // optional
            "sellerId": "1",                                    // optional
            "collection": [                                     // optional
                347,
                336
            ],
            "tax": 1232,                                        // optional, cents
            "quantity": 2,
            "price": 96390,                                     // cents
            "listPrice": 100000                                 // optional, cents
        }
    ],
    "shipping": "<shipping>"                                    // optional
}

Responses

{
    "discount": [
        {
            "campaign": "NEWPROGRESSIVE2025",
            "description": "Desconto por quantidade de itens",
            "total": 38556,
            "item": [
                { "id": "2", "position": 0, "value": 19278, "quantity": 2 },
                { "id": "3", "position": 1, "value": 19278, "quantity": 1 }
            ]
        }
    ]
}
Copied to clipboard