Sign in

List Campaign Attributions

GET https://{organization}.myguper.com/api/order/campaign

Campaigns a sale is attributed to. Answers both directions: filter by order for "which campaigns is this sale attributed to", or by campaign for "which sales did this campaign generate".

A sale is attributed to a campaign in two ways: the customer redeemed balance from it (cashback, point, coupon), or the customer received a message from it and bought within the attribution window (notification). A campaign that rewarded the sale is not an attribution — the reward is a consequence of the sale, not its cause.

The same sale may be attributed to the same campaign through more than one origin, and through more than one redeemed card. Each is a separate row. Count distinct orders, not rows, to measure conversion.

This mirrors customerCampaignAttribution in loyalty, which is the authoritative record — the redemption attribution is written by a database trigger when the redemption is confirmed. Rows arrive here right after that, through a call from loyalty.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header.

Headers

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

Query parameters

Name Type Description
q[order] integer Guper order id. Returns every campaign this sale is attributed to.
q[campaign] integer Loyalty campaign id. Returns every sale attributed to this campaign.
q[origin] string `cashback`, `point` or `coupon` (balance from the campaign was redeemed) or `notification` (the customer received a message from it and bought within the window). Same vocabulary as loyalty `attributionType`.
p integer Page number. Default 1.
e integer Rows per page. Use 0 for no pagination.

Responses

{
    "list": [
        {
            "order": 6021077,
            "campaign": 457,
            "origin": "notification",
            "assetId": "B1BCBD0518B3F93C9E47A59971C0E304FD7BEA806E01A6A45CC438F692232684",
            "campaignType": "monetary",
            "value": 0,
            "attributedAt": "2026-08-13 16:11:03",
            "notifiedAt": "2026-07-31 23:21:30",
            "windowEndsAt": "2026-09-01 02:59:59",
            "createdAt": "2026-08-13 16:11:03"
        },
        {
            "order": 6021077,
            "campaign": 457,
            "origin": "cashback",
            "assetId": "CD24D2E0AF5DDF020BCCEE84195226DF0813CB7563B2ECFF8A23D6D2A95049C6C3",
            "campaignType": "monetary",
            "value": 76485,
            "attributedAt": "2026-08-13 16:11:02",
            "notifiedAt": null,
            "windowEndsAt": null,
            "createdAt": "2026-08-13 16:11:03"
        }
    ],
    "total": 2,
    "pages": 1,
    "page": 1
}
Copied to clipboard