Entrar

Promoción por pedido

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

Calcula los descuentos promocionales que se aplican a un pedido. Cada organización puede tener una o varias campañas activas evaluadas en orden de prioridad — la respuesta lista todos los descuentos que se dispararon para el carrito.

Este endpoint acepta el mismo cuerpo que rewardByOrder (véase Acumulación por pedido) y opera en dos modos: Público (omite el header x-guper-authorization) y Privado. Los campos monetarios (price, listPrice, tax) se envían como enteros en centavos — véase Valores monetarios.

Try-it values populated from environment ACME (Demo)


Autenticación

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.

Encabezados

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.

Cuerpo de la petición

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
}

Respuestas

{
    "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