Entrar

Criar regra

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

Cria uma nova regra de campanha. A regra restringe a audiência ou os itens que a campanha pai considera — por exemplo, "itens da categoria 12" ou "clientes marcados como VIP".

Cada regra tem um code (tipo da regra) e um params com os valores avaliados. Os códigos de regra estão definidos no serviço de loyalty (veja a listagem loyalty/rule).

Try-it values populated from environment ACME (Demo)


Autenticação

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.

Cabeçalhos

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.

Corpo da requisição

Content-Type: application/json

{
    "campaign": 1,
    "code": 1,                                                  // 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 16 | 19 | 20 | 17 | 18
    "params": [
        "250001"
    ],
    "reverse": false                                            // optional
}

Respostas

Copied to clipboard