Sign in

External Event: Create Reward

POST https://{organization}.myguper.com/api/loyalty/external-event

Issues reward cards driven by external-events campaigns — used when an outside system (CRM, app, e-mail) decides when and how much to reward, and Guper just creates the cards under the campaign's identity (validity, tags, sequence, messaging).

The campaign supplies the structure; the request body supplies the value. Internally the call overrides the campaign's aliquot with the value you send, so each entry in campaigns[] produces exactly one reward card of the requested amount. Optional startsAt / expiresAt per entry override the default availability window of the resulting card.

Accepts a single campaign object { id, value } or an array of objects — a single object is auto-wrapped.

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": "generic",
    "client": {
        "id": "123123",                                         // optional
        "countryCallingCode": 55,                               // optional
        "cellphone": "19954264546",                             // optional
        "email": "tintim@guper.co",                             // optional
        "document": "<document>",                               // optional
        "name": "Tintim"                                        // optional
    },
    "campaigns": [
        {
            "id": 7,
            "value": 5000,                                      // cents
            "startsAt": "2026-05-08",                           // optional
            "expiresAt": "2027-05-08"                           // optional
        }
    ],
    "storeId": "<storeId>"                                      // optional
}

Responses

{
    "reward": [
        { "TID": "54eb6281…", "campaign": 7,  "rewardValue": 5000 },
        { "TID": "54eb6281…", "campaign": 12, "rewardValue": 1000 }
    ],
    "total": 6000
}

Related

Copied to clipboard