Sign in

Update Transaction

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

Updates a pending transaction (items, totals, customer, payments) before confirmation. Recalculates redeemable and accumulating cashback so the next confirmOrder uses the new values.

Both recalculateReward and recalculateRedemption default to true — set them to false to keep the original calculation when sending only metadata changes (e.g. updating items without re-running the cashback rules). Monetary fields (price, listPrice, tax, amountToRedeem) 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.

Path parameters

Name Type Description
confirmToken * string Token returned by Reward by Order. Identifies the pending prediction to update.

Request body

Content-Type: application/json

{
    "recalculateReward": true,                                  // optional
    "recalculateRedemption": true,                              // optional
    "amountToRedeem": null,                                     // optional, cents
    "items": [                                                  // optional
        {
            "skuId": "1",                                       // optional
            "quantity": 1,                                      // optional
            "price": 90000,                                     // optional, cents
            "listPrice": 100000,                                // optional, cents
            "tax": 1232                                         // optional, cents
        }
    ],
    "payments": "<payments>"                                    // optional
}

Responses

{
    "organization": "xpto",
    "interface": "generic",
    "customerId": 2157344,
    "cashback": {
        "thisOrder": {
            "redeemable": {
                "total": 55059,
                "item": [
                    { "skuId": "2",  "value": 18353 },
                    { "skuId": "10", "value": 18353 },
                    { "skuId": "10", "value": 18353 }
                ]
            },
            "accumulating": {
                "total": 54464,
                "item": [
                    { "skuId": "2",  "value": 18155 },
                    { "skuId": "10", "value": 18155 },
                    { "skuId": "10", "value": 18154 }
                ]
            }
        },
        "userBalance": { "total": 55059, "availableAmount": 54464 }
    },
    "coupon": [],
    "confirmToken": "ca93b522eb10c42dff16ce8d5b3ad86d962a610184db68643158eec9bb10747f",
    "expiresAt": "2025-07-25T00:52:14-06:00",
    "smartpos": "https://xpto.myguper.com/smartpos/ca93b522eb10c42dff16ce8d5b3ad86d962a610184db68643158eec9bb10747f",
    "dateTime": "2025-07-24T12:52:14-06:00"
}

Notes

The wallet rules are re-applied to the new cart. If the wallet has a dynamic minimum (minOrderRate) and the cart shrank below it, the redemption already reserved is dropped: redeemable.total comes back 0 with redeemable.blocked explaining why (same shape as in Reward by order).

Always charge the customer by the redeemable.total of this response — not by the one quoted before the cart changed.

Copied to clipboard