{
    "info": {
        "_postman_id": "f41cfdf4-addc-4a5a-a6e4-b0fc13165508",
        "name": "Guper · Middlewares",
        "description": "Guper Middlewares API reference. Generated from the documentation portal.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "CLIP",
            "item": [
                {
                    "name": "Devices (enroll & auth)",
                    "item": [
                        {
                            "name": "Auth token (deviceToken → accessToken)",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/auth-token",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "auth-token"
                                    ]
                                },
                                "description": "**Public** (the `deviceToken` is the credential). Exchanges the stored\n`deviceToken` for a short-lived **HS256 JWT** (`accessToken`, ~15 min) used as\n`Authorization: Bearer` on all loyalty endpoints and `device-rename`.\n\nThe BFF hashes the `deviceToken`, looks up the active device and validates that\nthe device, store and organization are all active. A revoked device fails here\nimmediately. Call this whenever the access token is missing or expired.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"deviceToken\": \"bUja5ghRIrUw1kc_c05BpebqgKx1Ds1XAvTiK6wy45s\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Token issued. `expiresIn` is in seconds.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/auth-token",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "auth-token"
                                            ]
                                        },
                                        "description": "**Public** (the `deviceToken` is the credential). Exchanges the stored\n`deviceToken` for a short-lived **HS256 JWT** (`accessToken`, ~15 min) used as\n`Authorization: Bearer` on all loyalty endpoints and `device-rename`.\n\nThe BFF hashes the `deviceToken`, looks up the active device and validates that\nthe device, store and organization are all active. A revoked device fails here\nimmediately. Call this whenever the access token is missing or expired.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"deviceToken\": \"bUja5ghRIrUw1kc_c05BpebqgKx1Ds1XAvTiK6wy45s\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n    \"expiresIn\": 900,\n    \"deviceId\": \"1e58528b-8f84-40be-9359-c423a0774be6\",\n    \"storeId\": \"c32cad3d-1ad5-4e41-95f1-9c06e965af58\"\n}"
                                },
                                {
                                    "name": "Missing `deviceToken`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/auth-token",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "auth-token"
                                            ]
                                        },
                                        "description": "**Public** (the `deviceToken` is the credential). Exchanges the stored\n`deviceToken` for a short-lived **HS256 JWT** (`accessToken`, ~15 min) used as\n`Authorization: Bearer` on all loyalty endpoints and `device-rename`.\n\nThe BFF hashes the `deviceToken`, looks up the active device and validates that\nthe device, store and organization are all active. A revoked device fails here\nimmediately. Call this whenever the access token is missing or expired.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"deviceToken\": \"bUja5ghRIrUw1kc_c05BpebqgKx1Ds1XAvTiK6wy45s\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required fields\", \"missingFields\": [\"deviceToken\"] }"
                                },
                                {
                                    "name": "Unknown/revoked device, or store/organization inactive.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/auth-token",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "auth-token"
                                            ]
                                        },
                                        "description": "**Public** (the `deviceToken` is the credential). Exchanges the stored\n`deviceToken` for a short-lived **HS256 JWT** (`accessToken`, ~15 min) used as\n`Authorization: Bearer` on all loyalty endpoints and `device-rename`.\n\nThe BFF hashes the `deviceToken`, looks up the active device and validates that\nthe device, store and organization are all active. A revoked device fails here\nimmediately. Call this whenever the access token is missing or expired.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"deviceToken\": \"bUja5ghRIrUw1kc_c05BpebqgKx1Ds1XAvTiK6wy45s\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Unauthorized",
                                    "code": 401,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"device_inactive_or_unknown\" }"
                                }
                            ]
                        },
                        {
                            "name": "Enroll a device (activate terminal)",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/devices-enroll",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "devices-enroll"
                                    ]
                                },
                                "description": "**Public.** First call a terminal makes. The operator types the **organization\nslug** and a short **8-digit pairing code** (generated in the Guper panel for a\nspecific store, valid ~15 min). The BFF validates the code **scoped to that org**,\ncreates the `device` and returns an opaque `deviceToken`.\n\nThe `deviceToken` is returned **only here** — store it in the device Keystore\n(hardware-backed). The BFF keeps only its sha-256 hash. The code is **single-use**\nand expires fast. The store (and therefore the Guper organization) is fixed by the\ncode — the app does not choose it.\n\nErrors are **generic** (`invalid_or_expired_code`) on purpose, to not reveal whether\na code exists/expired/was used. Enroll is **rate-limited per (org, IP)**: after 10\nfailed attempts in 15 min it returns `429`.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"org\": \"cloe\",\n    \"code\": \"73129045\",\n    \"fingerprint\": \"a1b2c3-device-fingerprint\",\n    \"name\": \"Caixa 01\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Device created and code consumed. Persist `deviceToken` securely.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/devices-enroll",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "devices-enroll"
                                            ]
                                        },
                                        "description": "**Public.** First call a terminal makes. The operator types the **organization\nslug** and a short **8-digit pairing code** (generated in the Guper panel for a\nspecific store, valid ~15 min). The BFF validates the code **scoped to that org**,\ncreates the `device` and returns an opaque `deviceToken`.\n\nThe `deviceToken` is returned **only here** — store it in the device Keystore\n(hardware-backed). The BFF keeps only its sha-256 hash. The code is **single-use**\nand expires fast. The store (and therefore the Guper organization) is fixed by the\ncode — the app does not choose it.\n\nErrors are **generic** (`invalid_or_expired_code`) on purpose, to not reveal whether\na code exists/expired/was used. Enroll is **rate-limited per (org, IP)**: after 10\nfailed attempts in 15 min it returns `429`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"org\": \"cloe\",\n    \"code\": \"73129045\",\n    \"fingerprint\": \"a1b2c3-device-fingerprint\",\n    \"name\": \"Caixa 01\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Created",
                                    "code": 201,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"deviceToken\": \"bUja5ghRIrUw1kc_c05BpebqgKx1Ds1XAvTiK6wy45s\",\n    \"deviceId\": \"1e58528b-8f84-40be-9359-c423a0774be6\",\n    \"storeId\": \"c32cad3d-1ad5-4e41-95f1-9c06e965af58\",\n    \"name\": \"Caixa 01\"\n}"
                                },
                                {
                                    "name": "Missing `org`, `code` or `fingerprint`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/devices-enroll",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "devices-enroll"
                                            ]
                                        },
                                        "description": "**Public.** First call a terminal makes. The operator types the **organization\nslug** and a short **8-digit pairing code** (generated in the Guper panel for a\nspecific store, valid ~15 min). The BFF validates the code **scoped to that org**,\ncreates the `device` and returns an opaque `deviceToken`.\n\nThe `deviceToken` is returned **only here** — store it in the device Keystore\n(hardware-backed). The BFF keeps only its sha-256 hash. The code is **single-use**\nand expires fast. The store (and therefore the Guper organization) is fixed by the\ncode — the app does not choose it.\n\nErrors are **generic** (`invalid_or_expired_code`) on purpose, to not reveal whether\na code exists/expired/was used. Enroll is **rate-limited per (org, IP)**: after 10\nfailed attempts in 15 min it returns `429`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"org\": \"cloe\",\n    \"code\": \"73129045\",\n    \"fingerprint\": \"a1b2c3-device-fingerprint\",\n    \"name\": \"Caixa 01\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required fields\", \"missingFields\": [\"org\"] }"
                                },
                                {
                                    "name": "Unknown organization, or invalid/expired/used code (generic).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/devices-enroll",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "devices-enroll"
                                            ]
                                        },
                                        "description": "**Public.** First call a terminal makes. The operator types the **organization\nslug** and a short **8-digit pairing code** (generated in the Guper panel for a\nspecific store, valid ~15 min). The BFF validates the code **scoped to that org**,\ncreates the `device` and returns an opaque `deviceToken`.\n\nThe `deviceToken` is returned **only here** — store it in the device Keystore\n(hardware-backed). The BFF keeps only its sha-256 hash. The code is **single-use**\nand expires fast. The store (and therefore the Guper organization) is fixed by the\ncode — the app does not choose it.\n\nErrors are **generic** (`invalid_or_expired_code`) on purpose, to not reveal whether\na code exists/expired/was used. Enroll is **rate-limited per (org, IP)**: after 10\nfailed attempts in 15 min it returns `429`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"org\": \"cloe\",\n    \"code\": \"73129045\",\n    \"fingerprint\": \"a1b2c3-device-fingerprint\",\n    \"name\": \"Caixa 01\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Not Found",
                                    "code": 404,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"invalid_or_expired_code\" }"
                                },
                                {
                                    "name": "Too many failed attempts for this (org, IP) — try again later.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/devices-enroll",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "devices-enroll"
                                            ]
                                        },
                                        "description": "**Public.** First call a terminal makes. The operator types the **organization\nslug** and a short **8-digit pairing code** (generated in the Guper panel for a\nspecific store, valid ~15 min). The BFF validates the code **scoped to that org**,\ncreates the `device` and returns an opaque `deviceToken`.\n\nThe `deviceToken` is returned **only here** — store it in the device Keystore\n(hardware-backed). The BFF keeps only its sha-256 hash. The code is **single-use**\nand expires fast. The store (and therefore the Guper organization) is fixed by the\ncode — the app does not choose it.\n\nErrors are **generic** (`invalid_or_expired_code`) on purpose, to not reveal whether\na code exists/expired/was used. Enroll is **rate-limited per (org, IP)**: after 10\nfailed attempts in 15 min it returns `429`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"org\": \"cloe\",\n    \"code\": \"73129045\",\n    \"fingerprint\": \"a1b2c3-device-fingerprint\",\n    \"name\": \"Caixa 01\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 429,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"too_many_attempts\" }"
                                }
                            ]
                        },
                        {
                            "name": "Rename device",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/device-rename",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "device-rename"
                                    ]
                                },
                                "description": "Updates the friendly name of the device that owns the access token. Useful for\nsettings screens (\"Caixa 01\" → \"Balcão\"). Requires `Authorization: Bearer`.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"name\": \"Balcão Principal\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Device renamed.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/device-rename",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "device-rename"
                                            ]
                                        },
                                        "description": "Updates the friendly name of the device that owns the access token. Useful for\nsettings screens (\"Caixa 01\" → \"Balcão\"). Requires `Authorization: Bearer`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"name\": \"Balcão Principal\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"name\": \"Balcão Principal\" }"
                                },
                                {
                                    "name": "Missing `name`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/device-rename",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "device-rename"
                                            ]
                                        },
                                        "description": "Updates the friendly name of the device that owns the access token. Useful for\nsettings screens (\"Caixa 01\" → \"Balcão\"). Requires `Authorization: Bearer`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"name\": \"Balcão Principal\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required fields\", \"missingFields\": [\"name\"] }"
                                },
                                {
                                    "name": "Missing/invalid/expired Bearer token, or device revoked.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/device-rename",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "device-rename"
                                            ]
                                        },
                                        "description": "Updates the friendly name of the device that owns the access token. Useful for\nsettings screens (\"Caixa 01\" → \"Balcão\"). Requires `Authorization: Bearer`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"name\": \"Balcão Principal\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Unauthorized",
                                    "code": 401,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Invalid or expired accessToken\" }"
                                }
                            ]
                        }
                    ]
                },
                {
                    "name": "Loyalty (sale flow)",
                    "item": [
                        {
                            "name": "Customer balance",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-balance",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "loyalty-balance"
                                    ]
                                },
                                "description": "Looks the customer up by phone and returns their cashback balance. The BFF calls\nGuper `/register/customer` (exact match on the phone) to get the `customerId`, then\n`/loyalty/report/rewardBalances` over a wide window.\n\nThe phone is matched **literally** (E.164, e.g. `+52...`) — the BFF builds E.164 from\n`cellphone` + `countryCallingCode`. If the customer is not found, `found` is `false`\nand the other fields are omitted. Amounts in **cents**.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Customer found.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-balance",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-balance"
                                            ]
                                        },
                                        "description": "Looks the customer up by phone and returns their cashback balance. The BFF calls\nGuper `/register/customer` (exact match on the phone) to get the `customerId`, then\n`/loyalty/report/rewardBalances` over a wide window.\n\nThe phone is matched **literally** (E.164, e.g. `+52...`) — the BFF builds E.164 from\n`cellphone` + `countryCallingCode`. If the customer is not found, `found` is `false`\nand the other fields are omitted. Amounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"found\": true,\n    \"customerId\": 542510,\n    \"name\": \"Marta Sauer\",\n    \"totalCents\": 1850,\n    \"availableCents\": 1850\n}"
                                },
                                {
                                    "name": "No customer for this phone.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-balance",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-balance"
                                            ]
                                        },
                                        "description": "Looks the customer up by phone and returns their cashback balance. The BFF calls\nGuper `/register/customer` (exact match on the phone) to get the `customerId`, then\n`/loyalty/report/rewardBalances` over a wide window.\n\nThe phone is matched **literally** (E.164, e.g. `+52...`) — the BFF builds E.164 from\n`cellphone` + `countryCallingCode`. If the customer is not found, `found` is `false`\nand the other fields are omitted. Amounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"found\": false }"
                                },
                                {
                                    "name": "Missing `cellphone`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-balance",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-balance"
                                            ]
                                        },
                                        "description": "Looks the customer up by phone and returns their cashback balance. The BFF calls\nGuper `/register/customer` (exact match on the phone) to get the `customerId`, then\n`/loyalty/report/rewardBalances` over a wide window.\n\nThe phone is matched **literally** (E.164, e.g. `+52...`) — the BFF builds E.164 from\n`cellphone` + `countryCallingCode`. If the customer is not found, `found` is `false`\nand the other fields are omitted. Amounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"cellphone é obrigatório\" }"
                                }
                            ]
                        },
                        {
                            "name": "Cancel a sale",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-cancel",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "loyalty-cancel"
                                    ]
                                },
                                "description": "Cancels a confirmed sale. The BFF reads the checkout's `tid` and calls Guper\n`/loyalty/cancelOrderByTransaction/{tid}`, then marks the checkout `canceled`.\n\n**Idempotent:** canceling an already-canceled sale still returns `200`\n(`alreadyCanceled: true`). The card refund on CLIP is handled separately (CLIP\n`refunds`), not by this endpoint.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Canceled (or already canceled).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-cancel",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-cancel"
                                            ]
                                        },
                                        "description": "Cancels a confirmed sale. The BFF reads the checkout's `tid` and calls Guper\n`/loyalty/cancelOrderByTransaction/{tid}`, then marks the checkout `canceled`.\n\n**Idempotent:** canceling an already-canceled sale still returns `200`\n(`alreadyCanceled: true`). The card refund on CLIP is handled separately (CLIP\n`refunds`), not by this endpoint.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"canceled\": true, \"alreadyCanceled\": false }"
                                },
                                {
                                    "name": "Missing `checkoutId`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-cancel",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-cancel"
                                            ]
                                        },
                                        "description": "Cancels a confirmed sale. The BFF reads the checkout's `tid` and calls Guper\n`/loyalty/cancelOrderByTransaction/{tid}`, then marks the checkout `canceled`.\n\n**Idempotent:** canceling an already-canceled sale still returns `200`\n(`alreadyCanceled: true`). The card refund on CLIP is handled separately (CLIP\n`refunds`), not by this endpoint.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"checkoutId é obrigatório\" }"
                                },
                                {
                                    "name": "Checkout has no `tid` (was never confirmed).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-cancel",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-cancel"
                                            ]
                                        },
                                        "description": "Cancels a confirmed sale. The BFF reads the checkout's `tid` and calls Guper\n`/loyalty/cancelOrderByTransaction/{tid}`, then marks the checkout `canceled`.\n\n**Idempotent:** canceling an already-canceled sale still returns `200`\n(`alreadyCanceled: true`). The card refund on CLIP is handled separately (CLIP\n`refunds`), not by this endpoint.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 409,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"checkout sem tid (não confirmado)\" }"
                                }
                            ]
                        },
                        {
                            "name": "Confirm a sale",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-confirm",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "loyalty-confirm"
                                    ]
                                },
                                "description": "Second step. Call it **after the card is charged** by the CLIP terminal. The BFF\nrecovers the checkout's `confirmToken` (must belong to the same device) and calls\nGuper `/loyalty/confirmOrder/{confirmToken}`, then marks the checkout `confirmed`\nand stores the `tid`.\n\n**Idempotent:** if the checkout is already `confirmed` locally, or Guper returns\n`409`, the BFF responds `200` with `alreadyConfirmed: true`. On failure the checkout\nis marked `failed` for reconciliation. `orderId` is the CLIP charge **receiptNumber**.\n\n`redeemCents` (optional) is the amount to redeem; `card`/`payments` enrichment via\nCLIP is optional and not required to confirm.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"orderId\": \"CLIP-RCPT-88231\",\n    \"redeemCents\": 0,\n    \"finalCents\": 10000\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Confirmed (or already confirmed). `accumulatedOrderCents` is the awarded cashback.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-confirm",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-confirm"
                                            ]
                                        },
                                        "description": "Second step. Call it **after the card is charged** by the CLIP terminal. The BFF\nrecovers the checkout's `confirmToken` (must belong to the same device) and calls\nGuper `/loyalty/confirmOrder/{confirmToken}`, then marks the checkout `confirmed`\nand stores the `tid`.\n\n**Idempotent:** if the checkout is already `confirmed` locally, or Guper returns\n`409`, the BFF responds `200` with `alreadyConfirmed: true`. On failure the checkout\nis marked `failed` for reconciliation. `orderId` is the CLIP charge **receiptNumber**.\n\n`redeemCents` (optional) is the amount to redeem; `card`/`payments` enrichment via\nCLIP is optional and not required to confirm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"orderId\": \"CLIP-RCPT-88231\",\n    \"redeemCents\": 0,\n    \"finalCents\": 10000\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"accumulatedOrderCents\": 2000,\n    \"tid\": \"ee01a92adcce9dbd4fc8d0fe470e8f88678309d1b702300fd1698809f7e83112\",\n    \"confirmedAt\": \"2026-06-06T11:57:29-06:00\",\n    \"alreadyConfirmed\": false\n}"
                                },
                                {
                                    "name": "`checkoutId` or `orderId` missing.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-confirm",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-confirm"
                                            ]
                                        },
                                        "description": "Second step. Call it **after the card is charged** by the CLIP terminal. The BFF\nrecovers the checkout's `confirmToken` (must belong to the same device) and calls\nGuper `/loyalty/confirmOrder/{confirmToken}`, then marks the checkout `confirmed`\nand stores the `tid`.\n\n**Idempotent:** if the checkout is already `confirmed` locally, or Guper returns\n`409`, the BFF responds `200` with `alreadyConfirmed: true`. On failure the checkout\nis marked `failed` for reconciliation. `orderId` is the CLIP charge **receiptNumber**.\n\n`redeemCents` (optional) is the amount to redeem; `card`/`payments` enrichment via\nCLIP is optional and not required to confirm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"orderId\": \"CLIP-RCPT-88231\",\n    \"redeemCents\": 0,\n    \"finalCents\": 10000\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"checkoutId e orderId são obrigatórios\" }"
                                },
                                {
                                    "name": "Checkout belongs to a different device.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-confirm",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-confirm"
                                            ]
                                        },
                                        "description": "Second step. Call it **after the card is charged** by the CLIP terminal. The BFF\nrecovers the checkout's `confirmToken` (must belong to the same device) and calls\nGuper `/loyalty/confirmOrder/{confirmToken}`, then marks the checkout `confirmed`\nand stores the `tid`.\n\n**Idempotent:** if the checkout is already `confirmed` locally, or Guper returns\n`409`, the BFF responds `200` with `alreadyConfirmed: true`. On failure the checkout\nis marked `failed` for reconciliation. `orderId` is the CLIP charge **receiptNumber**.\n\n`redeemCents` (optional) is the amount to redeem; `card`/`payments` enrichment via\nCLIP is optional and not required to confirm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"orderId\": \"CLIP-RCPT-88231\",\n    \"redeemCents\": 0,\n    \"finalCents\": 10000\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Forbidden",
                                    "code": 403,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"checkout_belongs_to_another_device\" }"
                                },
                                {
                                    "name": "Checkout has no `confirmToken` (preview missing/expired).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-confirm",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-confirm"
                                            ]
                                        },
                                        "description": "Second step. Call it **after the card is charged** by the CLIP terminal. The BFF\nrecovers the checkout's `confirmToken` (must belong to the same device) and calls\nGuper `/loyalty/confirmOrder/{confirmToken}`, then marks the checkout `confirmed`\nand stores the `tid`.\n\n**Idempotent:** if the checkout is already `confirmed` locally, or Guper returns\n`409`, the BFF responds `200` with `alreadyConfirmed: true`. On failure the checkout\nis marked `failed` for reconciliation. `orderId` is the CLIP charge **receiptNumber**.\n\n`redeemCents` (optional) is the amount to redeem; `card`/`payments` enrichment via\nCLIP is optional and not required to confirm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"orderId\": \"CLIP-RCPT-88231\",\n    \"redeemCents\": 0,\n    \"finalCents\": 10000\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 409,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"checkout sem confirm_token (preview ausente/expirado)\" }"
                                }
                            ]
                        },
                        {
                            "name": "List movements",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-movements",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "loyalty-movements"
                                    ]
                                },
                                "description": "Lists the store's recent sales (`confirmed`/`canceled`) from the BFF's own\n`loyalty_checkout` table, newest first. Use it for the terminal's \"history\" screen.\nRead straight from the BFF (no Guper call). Amounts in **cents**.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"limit\": 50\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Movements for the store of the authenticated device.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-movements",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-movements"
                                            ]
                                        },
                                        "description": "Lists the store's recent sales (`confirmed`/`canceled`) from the BFF's own\n`loyalty_checkout` table, newest first. Use it for the terminal's \"history\" screen.\nRead straight from the BFF (no Guper call). Amounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"limit\": 50\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"movements\": [\n        {\n            \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n            \"orderId\": \"CLIP-RCPT-88231\",\n            \"tid\": \"ee01a92adcce9dbd4fc8d0fe470e8f88678309d1b702300fd1698809f7e83112\",\n            \"finalCents\": 10000,\n            \"accumulateCents\": 2000,\n            \"redeemCents\": null,\n            \"status\": \"confirmed\",\n            \"confirmedAt\": \"2026-06-06T17:57:29.773Z\"\n        }\n    ]\n}"
                                },
                                {
                                    "name": "Missing/invalid Bearer token.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-movements",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-movements"
                                            ]
                                        },
                                        "description": "Lists the store's recent sales (`confirmed`/`canceled`) from the BFF's own\n`loyalty_checkout` table, newest first. Use it for the terminal's \"history\" screen.\nRead straight from the BFF (no Guper call). Amounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"limit\": 50\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Unauthorized",
                                    "code": 401,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Invalid or expired accessToken\" }"
                                }
                            ]
                        },
                        {
                            "name": "Preview cashback for a sale",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-preview",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "loyalty-preview"
                                    ]
                                },
                                "description": "First step of the 2-phase flow. Call it **before charging the card** to show the\nshopper what they'll earn (and, if identified, how much they can redeem). The app\ngenerates a `checkoutId` (UUID) and reuses it through confirm/cancel.\n\nThe BFF wraps Guper `/loyalty/rewardByOrder` (with the store's `guper_interface`\nand `guper_store_id`) and persists a `loyalty_checkout` row as `previewed` with the\nreturned `confirmToken`. Without `cellphone` you get accrual only (no customer\nbalance / redeemable).\n\nAll amounts are in **cents**. `baseCents` is the **consumption base** (no tip —\naccrual is computed over the base; the tip is added separately by the CLIP terminal).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"baseCents\": 10000,\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Preview computed and checkout saved as `previewed`. Amounts in cents.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-preview",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-preview"
                                            ]
                                        },
                                        "description": "First step of the 2-phase flow. Call it **before charging the card** to show the\nshopper what they'll earn (and, if identified, how much they can redeem). The app\ngenerates a `checkoutId` (UUID) and reuses it through confirm/cancel.\n\nThe BFF wraps Guper `/loyalty/rewardByOrder` (with the store's `guper_interface`\nand `guper_store_id`) and persists a `loyalty_checkout` row as `previewed` with the\nreturned `confirmToken`. Without `cellphone` you get accrual only (no customer\nbalance / redeemable).\n\nAll amounts are in **cents**. `baseCents` is the **consumption base** (no tip —\naccrual is computed over the base; the tip is added separately by the CLIP terminal).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"baseCents\": 10000,\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"accumulateCents\": 2000,\n    \"redeemableCents\": 0,\n    \"userBalanceCents\": 0,\n    \"expiresAt\": \"2026-06-16T11:57:27-06:00\"\n}"
                                },
                                {
                                    "name": "`checkoutId` missing or `baseCents` not an integer.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-preview",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-preview"
                                            ]
                                        },
                                        "description": "First step of the 2-phase flow. Call it **before charging the card** to show the\nshopper what they'll earn (and, if identified, how much they can redeem). The app\ngenerates a `checkoutId` (UUID) and reuses it through confirm/cancel.\n\nThe BFF wraps Guper `/loyalty/rewardByOrder` (with the store's `guper_interface`\nand `guper_store_id`) and persists a `loyalty_checkout` row as `previewed` with the\nreturned `confirmToken`. Without `cellphone` you get accrual only (no customer\nbalance / redeemable).\n\nAll amounts are in **cents**. `baseCents` is the **consumption base** (no tip —\naccrual is computed over the base; the tip is added separately by the CLIP terminal).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"baseCents\": 10000,\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"checkoutId e baseCents (inteiro, centavos) são obrigatórios\" }"
                                },
                                {
                                    "name": "Missing/invalid Bearer token.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-preview",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-preview"
                                            ]
                                        },
                                        "description": "First step of the 2-phase flow. Call it **before charging the card** to show the\nshopper what they'll earn (and, if identified, how much they can redeem). The app\ngenerates a `checkoutId` (UUID) and reuses it through confirm/cancel.\n\nThe BFF wraps Guper `/loyalty/rewardByOrder` (with the store's `guper_interface`\nand `guper_store_id`) and persists a `loyalty_checkout` row as `previewed` with the\nreturned `confirmToken`. Without `cellphone` you get accrual only (no customer\nbalance / redeemable).\n\nAll amounts are in **cents**. `baseCents` is the **consumption base** (no tip —\naccrual is computed over the base; the tip is added separately by the CLIP terminal).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"checkoutId\": \"d1fc9c2e-67e4-40fa-b3a9-3750af5f208b\",\n    \"baseCents\": 10000,\n    \"cellphone\": \"+5215512345678\",\n    \"countryCallingCode\": \"52\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Unauthorized",
                                    "code": 401,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Invalid or expired accessToken\" }"
                                }
                            ]
                        },
                        {
                            "name": "Customer statement (cashback cards)",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-statement",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "clip",
                                        "loyalty-statement"
                                    ]
                                },
                                "description": "Returns the customer's cashback cards (batches) — campaign, initial/available\nbalance, validity window and status — ordered newest to oldest. The BFF wraps\nGuper `/loyalty/cards/full?q[client]={customerId}`. Get `customerId` from\n[Customer balance](/docs/{lang}/api-reference/middlewares/clip/loyalty/balance).\nAmounts in **cents**.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"customerId\": 542510\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Cards listed (may be empty).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-statement",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-statement"
                                            ]
                                        },
                                        "description": "Returns the customer's cashback cards (batches) — campaign, initial/available\nbalance, validity window and status — ordered newest to oldest. The BFF wraps\nGuper `/loyalty/cards/full?q[client]={customerId}`. Get `customerId` from\n[Customer balance](/docs/{lang}/api-reference/middlewares/clip/loyalty/balance).\nAmounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"customerId\": 542510\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"cards\": [\n        {\n            \"cardId\": 101,\n            \"campaignName\": \"Cashback CLIP\",\n            \"initialBalanceCents\": 5000,\n            \"availableBalanceCents\": 2500,\n            \"startsAt\": \"2026-06-01T00:00:00-06:00\",\n            \"expiresAt\": \"2026-12-31T23:59:59-06:00\",\n            \"status\": \"active\"\n        }\n    ]\n}"
                                },
                                {
                                    "name": "Missing `customerId`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/clip/loyalty-statement",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "clip",
                                                "loyalty-statement"
                                            ]
                                        },
                                        "description": "Returns the customer's cashback cards (batches) — campaign, initial/available\nbalance, validity window and status — ordered newest to oldest. The BFF wraps\nGuper `/loyalty/cards/full?q[client]={customerId}`. Get `customerId` from\n[Customer balance](/docs/{lang}/api-reference/middlewares/clip/loyalty/balance).\nAmounts in **cents**.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"customerId\": 542510\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"customerId é obrigatório\" }"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "name": "Shopify",
            "item": [
                {
                    "name": "Loyalty (balance & redeem)",
                    "item": [
                        {
                            "name": "Get customer cashback balance",
                            "request": {
                                "method": "GET",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/balance",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "loyalty",
                                        "balance"
                                    ]
                                },
                                "description": "Returns the customer's lifetime cashback ledger from Guper. Use this\non the storefront (\"My Account\" / cart drawer) to display how much\nthe shopper can spend right now (`available`) versus what's already\nbeen used or expired.\n\nWraps Guper [`/loyalty/report/rewardBalances`](/docs/{lang}/api-reference/loyalty/report/reward-balances)\nwith a fixed time window (`2020-01-01` → `2030-12-31`) — i.e. effectively\n\"all time\". Requires the customer to have been linked first via\n[Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)."
                            },
                            "response": [
                                {
                                    "name": "Balance fetched. Amounts are in cents.",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/balance",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "balance"
                                            ]
                                        },
                                        "description": "Returns the customer's lifetime cashback ledger from Guper. Use this\non the storefront (\"My Account\" / cart drawer) to display how much\nthe shopper can spend right now (`available`) versus what's already\nbeen used or expired.\n\nWraps Guper [`/loyalty/report/rewardBalances`](/docs/{lang}/api-reference/loyalty/report/reward-balances)\nwith a fixed time window (`2020-01-01` → `2030-12-31`) — i.e. effectively\n\"all time\". Requires the customer to have been linked first via\n[Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"data\": {\n        \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n        \"guperCustomerId\": 8842,\n        \"total\": 1850,\n        \"available\": 1850,\n        \"expired\": 0,\n        \"used\": 0\n    }\n}"
                                },
                                {
                                    "name": "Missing one of the query params.",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/balance",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "balance"
                                            ]
                                        },
                                        "description": "Returns the customer's lifetime cashback ledger from Guper. Use this\non the storefront (\"My Account\" / cart drawer) to display how much\nthe shopper can spend right now (`available`) versus what's already\nbeen used or expired.\n\nWraps Guper [`/loyalty/report/rewardBalances`](/docs/{lang}/api-reference/loyalty/report/reward-balances)\nwith a fixed time window (`2020-01-01` → `2030-12-31`) — i.e. effectively\n\"all time\". Requires the customer to have been linked first via\n[Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)."
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required: shop, shopifyCustomerId\" }"
                                },
                                {
                                    "name": "No mapping for this Shopify customer. Front-end should prompt the shopper to connect their Guper account.",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/balance",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "balance"
                                            ]
                                        },
                                        "description": "Returns the customer's lifetime cashback ledger from Guper. Use this\non the storefront (\"My Account\" / cart drawer) to display how much\nthe shopper can spend right now (`available`) versus what's already\nbeen used or expired.\n\nWraps Guper [`/loyalty/report/rewardBalances`](/docs/{lang}/api-reference/loyalty/report/reward-balances)\nwith a fixed time window (`2020-01-01` → `2030-12-31`) — i.e. effectively\n\"all time\". Requires the customer to have been linked first via\n[Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)."
                                    },
                                    "status": "Not Found",
                                    "code": 404,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Customer not linked to Guper\" }"
                                }
                            ]
                        },
                        {
                            "name": "Redeem cashback as discount",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/redeem",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "loyalty",
                                        "redeem"
                                    ]
                                },
                                "description": "Spends the customer's available cashback on a Shopify order in a\nsingle call. The endpoint orchestrates four Guper calls:\n\n1. `rewardByOrder` to compute the redeemable amount for the cart.\n2. `redeem/reserve/{confirmToken}` to reserve the spend.\n3. `redeem/reserve/{confirmToken}` (settle) — same URL as reserve at\n   the moment. Tracked as a known gotcha; see [services/mdw_shopify/DEPLOY.md](https://github.com/MyGuper/ai_suport/blob/main/services/mdw_shopify/DEPLOY.md).\n4. Persists a `Redemption` row with status `SUCCESS`.\n\nAmount redeemed equals `cashback.thisOrder.redeemable.total` from the\nfirst call — clients cannot choose a partial amount today. Fails\nwith `400` if the redeemable amount is `0`.\n\nRequires the customer to have a mapping (see [Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"orderId\": \"#4521\",\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Cashback redeemed. The `discountAmount` is in cents and should be applied as a discount line on the Shopify order.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/redeem",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "redeem"
                                            ]
                                        },
                                        "description": "Spends the customer's available cashback on a Shopify order in a\nsingle call. The endpoint orchestrates four Guper calls:\n\n1. `rewardByOrder` to compute the redeemable amount for the cart.\n2. `redeem/reserve/{confirmToken}` to reserve the spend.\n3. `redeem/reserve/{confirmToken}` (settle) — same URL as reserve at\n   the moment. Tracked as a known gotcha; see [services/mdw_shopify/DEPLOY.md](https://github.com/MyGuper/ai_suport/blob/main/services/mdw_shopify/DEPLOY.md).\n4. Persists a `Redemption` row with status `SUCCESS`.\n\nAmount redeemed equals `cashback.thisOrder.redeemable.total` from the\nfirst call — clients cannot choose a partial amount today. Fails\nwith `400` if the redeemable amount is `0`.\n\nRequires the customer to have a mapping (see [Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"orderId\": \"#4521\",\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"Points redeemed successfully!\",\n    \"data\": {\n        \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n        \"pointsRedeemed\": 600,\n        \"discountAmount\": 600,\n        \"status\": \"SUCCESS\"\n    }\n}"
                                },
                                {
                                    "name": "Missing field, customer has no redeemable amount, or one of the Guper sub-calls failed (reserve/settle).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/redeem",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "redeem"
                                            ]
                                        },
                                        "description": "Spends the customer's available cashback on a Shopify order in a\nsingle call. The endpoint orchestrates four Guper calls:\n\n1. `rewardByOrder` to compute the redeemable amount for the cart.\n2. `redeem/reserve/{confirmToken}` to reserve the spend.\n3. `redeem/reserve/{confirmToken}` (settle) — same URL as reserve at\n   the moment. Tracked as a known gotcha; see [services/mdw_shopify/DEPLOY.md](https://github.com/MyGuper/ai_suport/blob/main/services/mdw_shopify/DEPLOY.md).\n4. Persists a `Redemption` row with status `SUCCESS`.\n\nAmount redeemed equals `cashback.thisOrder.redeemable.total` from the\nfirst call — clients cannot choose a partial amount today. Fails\nwith `400` if the redeemable amount is `0`.\n\nRequires the customer to have a mapping (see [Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"orderId\": \"#4521\",\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"No redeemable points available\" }"
                                },
                                {
                                    "name": "Customer not linked to Guper yet.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/redeem",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "redeem"
                                            ]
                                        },
                                        "description": "Spends the customer's available cashback on a Shopify order in a\nsingle call. The endpoint orchestrates four Guper calls:\n\n1. `rewardByOrder` to compute the redeemable amount for the cart.\n2. `redeem/reserve/{confirmToken}` to reserve the spend.\n3. `redeem/reserve/{confirmToken}` (settle) — same URL as reserve at\n   the moment. Tracked as a known gotcha; see [services/mdw_shopify/DEPLOY.md](https://github.com/MyGuper/ai_suport/blob/main/services/mdw_shopify/DEPLOY.md).\n4. Persists a `Redemption` row with status `SUCCESS`.\n\nAmount redeemed equals `cashback.thisOrder.redeemable.total` from the\nfirst call — clients cannot choose a partial amount today. Fails\nwith `400` if the redeemable amount is `0`.\n\nRequires the customer to have a mapping (see [Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect)).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"orderId\": \"#4521\",\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Not Found",
                                    "code": 404,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Customer not linked to Guper\" }"
                                }
                            ]
                        },
                        {
                            "name": "Refund order (reverse cashback)",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/refund",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "loyalty",
                                        "refund"
                                    ]
                                },
                                "description": "Cancels the cashback transaction associated with a previously\nconfirmed order. Call this when Shopify issues a refund (full or\npartial — we currently treat both as full reversal).\n\nWraps Guper [`/loyalty/cancelOrderByTransaction/{TID}`](/docs/{lang}/api-reference/loyalty/transaction/cancel-by-transaction).\nRequires the order to have been confirmed (i.e. have a `guperTID`).\n\nIdempotency: if the order is already `REFUNDED`, returns `409` instead\nof double-cancelling.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyOrderId\": \"#4521\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Cashback transaction cancelled. The order is now `REFUNDED` and the cashback amount is removed from the customer wallet on the Guper side.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/refund",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "refund"
                                            ]
                                        },
                                        "description": "Cancels the cashback transaction associated with a previously\nconfirmed order. Call this when Shopify issues a refund (full or\npartial — we currently treat both as full reversal).\n\nWraps Guper [`/loyalty/cancelOrderByTransaction/{TID}`](/docs/{lang}/api-reference/loyalty/transaction/cancel-by-transaction).\nRequires the order to have been confirmed (i.e. have a `guperTID`).\n\nIdempotency: if the order is already `REFUNDED`, returns `409` instead\nof double-cancelling.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyOrderId\": \"#4521\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"Order refunded. Points reversed!\",\n    \"data\": {\n        \"orderId\": \"#4521\",\n        \"status\": \"REFUNDED\",\n        \"pointsReversed\": 600\n    }\n}"
                                },
                                {
                                    "name": "Either a required field is missing, or the order has no `guperTID` (not confirmed yet — call [Confirm Order](/docs/{lang}/api-reference/middlewares/shopify/reward/confirm) first), or Guper rejected the cancellation.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/refund",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "refund"
                                            ]
                                        },
                                        "description": "Cancels the cashback transaction associated with a previously\nconfirmed order. Call this when Shopify issues a refund (full or\npartial — we currently treat both as full reversal).\n\nWraps Guper [`/loyalty/cancelOrderByTransaction/{TID}`](/docs/{lang}/api-reference/loyalty/transaction/cancel-by-transaction).\nRequires the order to have been confirmed (i.e. have a `guperTID`).\n\nIdempotency: if the order is already `REFUNDED`, returns `409` instead\nof double-cancelling.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyOrderId\": \"#4521\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Order not confirmed yet - cannot refund\" }"
                                },
                                {
                                    "name": "No order in the local DB with this `shopifyOrderId`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/refund",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "refund"
                                            ]
                                        },
                                        "description": "Cancels the cashback transaction associated with a previously\nconfirmed order. Call this when Shopify issues a refund (full or\npartial — we currently treat both as full reversal).\n\nWraps Guper [`/loyalty/cancelOrderByTransaction/{TID}`](/docs/{lang}/api-reference/loyalty/transaction/cancel-by-transaction).\nRequires the order to have been confirmed (i.e. have a `guperTID`).\n\nIdempotency: if the order is already `REFUNDED`, returns `409` instead\nof double-cancelling.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyOrderId\": \"#4521\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Not Found",
                                    "code": 404,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Order not found\" }"
                                },
                                {
                                    "name": "Order is already in `REFUNDED` state. Treat as a successful no-op on retries.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/loyalty/refund",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "loyalty",
                                                "refund"
                                            ]
                                        },
                                        "description": "Cancels the cashback transaction associated with a previously\nconfirmed order. Call this when Shopify issues a refund (full or\npartial — we currently treat both as full reversal).\n\nWraps Guper [`/loyalty/cancelOrderByTransaction/{TID}`](/docs/{lang}/api-reference/loyalty/transaction/cancel-by-transaction).\nRequires the order to have been confirmed (i.e. have a `guperTID`).\n\nIdempotency: if the order is already `REFUNDED`, returns `409` instead\nof double-cancelling.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyOrderId\": \"#4521\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 409,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Order already refunded\" }"
                                }
                            ]
                        }
                    ]
                },
                {
                    "name": "Members",
                    "item": [
                        {
                            "name": "Connect Shopify customer to Guper",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/members/connect",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "members",
                                        "connect"
                                    ]
                                },
                                "description": "Bridges a Shopify customer to a Guper person:\n\n1. Calls `findOrCreate` on the Guper register service using the chosen\n   `identifierType` / `identifierValue` (and optionally name + phone).\n2. Persists the resulting Guper `id` on a `customer_mappings` row\n   keyed by `(shop, shopifyCustomerId)`.\n\nIdempotent: calling it twice with the same `(shop, shopifyCustomerId)`\nupdates the existing row instead of creating a duplicate.\n\n**Identifier priority on Guper side:** `cellphone` is the strongest\nmatch key in most organizations — see [Person matching](/docs/{lang}/guides/authentication#person-match)\nfor the matching algorithm.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"identifierType\": \"email\",\n    \"identifierValue\": \"ana@example.com\",\n    \"customerName\": \"Ana López\",\n    \"customerPhone\": \"+5215512345678\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Linked. `guperCustomerId` is the Guper person id you should reference on every subsequent call (balance, reward, redemption).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/members/connect",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "members",
                                                "connect"
                                            ]
                                        },
                                        "description": "Bridges a Shopify customer to a Guper person:\n\n1. Calls `findOrCreate` on the Guper register service using the chosen\n   `identifierType` / `identifierValue` (and optionally name + phone).\n2. Persists the resulting Guper `id` on a `customer_mappings` row\n   keyed by `(shop, shopifyCustomerId)`.\n\nIdempotent: calling it twice with the same `(shop, shopifyCustomerId)`\nupdates the existing row instead of creating a duplicate.\n\n**Identifier priority on Guper side:** `cellphone` is the strongest\nmatch key in most organizations — see [Person matching](/docs/{lang}/guides/authentication#person-match)\nfor the matching algorithm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"identifierType\": \"email\",\n    \"identifierValue\": \"ana@example.com\",\n    \"customerName\": \"Ana López\",\n    \"customerPhone\": \"+5215512345678\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"GUPER account connected successfully\",\n    \"data\": {\n        \"guperCustomerId\": 8842,\n        \"identifierType\": \"email\",\n        \"identifierValue\": \"ana@example.com\"\n    }\n}"
                                },
                                {
                                    "name": "Missing one of the 4 required fields.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/members/connect",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "members",
                                                "connect"
                                            ]
                                        },
                                        "description": "Bridges a Shopify customer to a Guper person:\n\n1. Calls `findOrCreate` on the Guper register service using the chosen\n   `identifierType` / `identifierValue` (and optionally name + phone).\n2. Persists the resulting Guper `id` on a `customer_mappings` row\n   keyed by `(shop, shopifyCustomerId)`.\n\nIdempotent: calling it twice with the same `(shop, shopifyCustomerId)`\nupdates the existing row instead of creating a duplicate.\n\n**Identifier priority on Guper side:** `cellphone` is the strongest\nmatch key in most organizations — see [Person matching](/docs/{lang}/guides/authentication#person-match)\nfor the matching algorithm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"identifierType\": \"email\",\n    \"identifierValue\": \"ana@example.com\",\n    \"customerName\": \"Ana López\",\n    \"customerPhone\": \"+5215512345678\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"All fields required: shop, shopifyCustomerId, identifierType, identifierValue\" }"
                                },
                                {
                                    "name": "`findOrCreate` failed on the Guper side (e.g. invalid cellphone format, org rejected the payload). Body carries the upstream message when available.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/members/connect",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "members",
                                                "connect"
                                            ]
                                        },
                                        "description": "Bridges a Shopify customer to a Guper person:\n\n1. Calls `findOrCreate` on the Guper register service using the chosen\n   `identifierType` / `identifierValue` (and optionally name + phone).\n2. Persists the resulting Guper `id` on a `customer_mappings` row\n   keyed by `(shop, shopifyCustomerId)`.\n\nIdempotent: calling it twice with the same `(shop, shopifyCustomerId)`\nupdates the existing row instead of creating a duplicate.\n\n**Identifier priority on Guper side:** `cellphone` is the strongest\nmatch key in most organizations — see [Person matching](/docs/{lang}/guides/authentication#person-match)\nfor the matching algorithm.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n    \"identifierType\": \"email\",\n    \"identifierValue\": \"ana@example.com\",\n    \"customerName\": \"Ana López\",\n    \"customerPhone\": \"+5215512345678\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Internal Server Error",
                                    "code": 500,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Failed to find or create Guper customer\" }"
                                }
                            ]
                        }
                    ]
                },
                {
                    "name": "Merchant onboarding",
                    "item": [
                        {
                            "name": "List merchant customers",
                            "request": {
                                "method": "GET",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/customers/{{shop}}",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "merchant",
                                        "customers",
                                        "{{shop}}"
                                    ]
                                },
                                "description": "Returns every `customer_mappings` row for a shop — i.e. every Shopify\ncustomer that has been linked to a Guper person via [Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect).\nReturns an empty list when the shop has no mappings or doesn't exist\nyet (no 404 — this is a discovery endpoint)."
                            },
                            "response": [
                                {
                                    "name": "Mappings (possibly empty).",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/customers/{{shop}}",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "customers",
                                                "{{shop}}"
                                            ]
                                        },
                                        "description": "Returns every `customer_mappings` row for a shop — i.e. every Shopify\ncustomer that has been linked to a Guper person via [Connect Member](/docs/{lang}/api-reference/middlewares/shopify/members/connect).\nReturns an empty list when the shop has no mappings or doesn't exist\nyet (no 404 — this is a discovery endpoint)."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"data\": {\n        \"shop\": \"demoshop.myshopify.com\",\n        \"totalCustomers\": 2,\n        \"customers\": [\n            {\n                \"id\": 17,\n                \"shopifyCustomerId\": \"gid://shopify/Customer/5829304912\",\n                \"guperCustomerId\": 8842,\n                \"identifierType\": \"email\",\n                \"identifierValue\": \"ana@example.com\",\n                \"customerName\": \"Ana López\",\n                \"customerEmail\": \"ana@example.com\",\n                \"customerPhone\": null,\n                \"createdAt\": \"2026-05-14T03:24:01.000Z\"\n            }\n        ]\n    }\n}"
                                }
                            ]
                        },
                        {
                            "name": "Save merchant credentials",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/save",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "merchant",
                                        "save"
                                    ]
                                },
                                "description": "Verifies the Guper credentials and upserts the merchant row keyed by\n`shop`. Triggers `invalidateTokenCache(shop)` so the next API call\nre-authenticates with the new credentials instead of using a stale\ncached token.\n\nThe `storeId` must match an existing Guper store the credentials have\naccess to — it is sent verbatim as `storeId` in [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"account\": \"demoshop\",\n    \"storeId\": \"1\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Merchant saved (created or updated). `isActive` is forced to `true` on save.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/save",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "save"
                                            ]
                                        },
                                        "description": "Verifies the Guper credentials and upserts the merchant row keyed by\n`shop`. Triggers `invalidateTokenCache(shop)` so the next API call\nre-authenticates with the new credentials instead of using a stale\ncached token.\n\nThe `storeId` must match an existing Guper store the credentials have\naccess to — it is sent verbatim as `storeId` in [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"account\": \"demoshop\",\n    \"storeId\": \"1\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"Credentials verified and saved successfully\",\n    \"data\": {\n        \"shop\": \"demoshop.myshopify.com\",\n        \"account\": \"demoshop\",\n        \"storeId\": \"1\",\n        \"isActive\": true\n    }\n}"
                                },
                                {
                                    "name": "Guper rejected the credentials (same shape as [Verify](/docs/{lang}/api-reference/middlewares/shopify/merchant/verify)).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/save",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "save"
                                            ]
                                        },
                                        "description": "Verifies the Guper credentials and upserts the merchant row keyed by\n`shop`. Triggers `invalidateTokenCache(shop)` so the next API call\nre-authenticates with the new credentials instead of using a stale\ncached token.\n\nThe `storeId` must match an existing Guper store the credentials have\naccess to — it is sent verbatim as `storeId` in [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"account\": \"demoshop\",\n    \"storeId\": \"1\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Unauthorized",
                                    "code": 401,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Invalid API Key or API Secret\" }"
                                },
                                {
                                    "name": "Missing one of the required fields.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/save",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "save"
                                            ]
                                        },
                                        "description": "Verifies the Guper credentials and upserts the merchant row keyed by\n`shop`. Triggers `invalidateTokenCache(shop)` so the next API call\nre-authenticates with the new credentials instead of using a stale\ncached token.\n\nThe `storeId` must match an existing Guper store the credentials have\naccess to — it is sent verbatim as `storeId` in [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"account\": \"demoshop\",\n    \"storeId\": \"1\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required fields\", \"missingFields\": [\"shop\", \"storeId\"] }"
                                }
                            ]
                        },
                        {
                            "name": "Merchant stats",
                            "request": {
                                "method": "GET",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/stats/{{shop}}",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "merchant",
                                        "stats",
                                        "{{shop}}"
                                    ]
                                },
                                "description": "Aggregate counters for the embedded admin dashboard. Reads only the\nlocal `mdw_shopify` tables — does **not** hit the Guper API — so it's\ncheap to poll. `totalPointsAwarded` is the sum of `cashbackAmount`\nover all `CONFIRMED` orders."
                            },
                            "response": [
                                {
                                    "name": "Aggregates over the shop.",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/stats/{{shop}}",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "stats",
                                                "{{shop}}"
                                            ]
                                        },
                                        "description": "Aggregate counters for the embedded admin dashboard. Reads only the\nlocal `mdw_shopify` tables — does **not** hit the Guper API — so it's\ncheap to poll. `totalPointsAwarded` is the sum of `cashbackAmount`\nover all `CONFIRMED` orders."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"data\": {\n        \"shop\": \"demoshop.myshopify.com\",\n        \"totalCustomers\": 142,\n        \"totalOrders\": 88,\n        \"totalPointsAwarded\": 12450,\n        \"totalRedemptions\": 17,\n        \"totalRefunds\": 3\n    }\n}"
                                }
                            ]
                        },
                        {
                            "name": "Get merchant status",
                            "request": {
                                "method": "GET",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/status/{{shop}}",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "merchant",
                                        "status",
                                        "{{shop}}"
                                    ]
                                },
                                "description": "Returns the persisted merchant row for a given Shopify shop. Use it\nfrom the Shopify app embedded admin to render the connection state\nafter the merchant comes back. Does **not** call Guper."
                            },
                            "response": [
                                {
                                    "name": "Merchant exists.",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/status/{{shop}}",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "status",
                                                "{{shop}}"
                                            ]
                                        },
                                        "description": "Returns the persisted merchant row for a given Shopify shop. Use it\nfrom the Shopify app embedded admin to render the connection state\nafter the merchant comes back. Does **not** call Guper."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"data\": {\n        \"shop\": \"demoshop.myshopify.com\",\n        \"account\": \"demoshop\",\n        \"isActive\": true,\n        \"createdAt\": \"2026-05-14T03:21:14.000Z\"\n    }\n}"
                                },
                                {
                                    "name": "No merchant row for this shop. Treat this as \"not connected yet\" in the Shopify app UI and surface the credentials form.",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/status/{{shop}}",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "status",
                                                "{{shop}}"
                                            ]
                                        },
                                        "description": "Returns the persisted merchant row for a given Shopify shop. Use it\nfrom the Shopify app embedded admin to render the connection state\nafter the merchant comes back. Does **not** call Guper."
                                    },
                                    "status": "Not Found",
                                    "code": 404,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Merchant not found\" }"
                                }
                            ]
                        },
                        {
                            "name": "Verify Guper credentials",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/verify",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "merchant",
                                        "verify"
                                    ]
                                },
                                "description": "Validates a pair of Guper `apiKey` / `apiSecret` against the merchant's\nGuper account without persisting anything. Use this from the Shopify app\nonboarding wizard to give the merchant immediate feedback that their\ncredentials are correct before calling [Save Credentials](/docs/{lang}/api-reference/middlewares/shopify/merchant/save).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"account\": \"demoshop\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Credentials valid. The returned `accessToken` is informational — `mdw_shopify` does **not** persist it from this endpoint; call [Save Credentials](/docs/{lang}/api-reference/middlewares/shopify/merchant/save) to register the merchant.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/verify",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "verify"
                                            ]
                                        },
                                        "description": "Validates a pair of Guper `apiKey` / `apiSecret` against the merchant's\nGuper account without persisting anything. Use this from the Shopify app\nonboarding wizard to give the merchant immediate feedback that their\ncredentials are correct before calling [Save Credentials](/docs/{lang}/api-reference/middlewares/shopify/merchant/save).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"account\": \"demoshop\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"Guper credentials verified successfully\",\n    \"data\": {\n        \"account\": \"demoshop\",\n        \"accessToken\": \"eyJhbGciOiJSUzI1NiIs...\",\n        \"expiresIn\": \"3600\"\n    }\n}"
                                },
                                {
                                    "name": "Guper rejected the credentials. The `message` mirrors the upstream `reason_phrase` (\"Invalid API Key or API Secret\", \"Account not found\", etc.).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/verify",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "verify"
                                            ]
                                        },
                                        "description": "Validates a pair of Guper `apiKey` / `apiSecret` against the merchant's\nGuper account without persisting anything. Use this from the Shopify app\nonboarding wizard to give the merchant immediate feedback that their\ncredentials are correct before calling [Save Credentials](/docs/{lang}/api-reference/middlewares/shopify/merchant/save).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"account\": \"demoshop\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Unauthorized",
                                    "code": 401,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Invalid API Key or API Secret\" }"
                                },
                                {
                                    "name": "Missing one of `account` / `apiKey` / `apiSecret`.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/merchant/verify",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "merchant",
                                                "verify"
                                            ]
                                        },
                                        "description": "Validates a pair of Guper `apiKey` / `apiSecret` against the merchant's\nGuper account without persisting anything. Use this from the Shopify app\nonboarding wizard to give the merchant immediate feedback that their\ncredentials are correct before calling [Save Credentials](/docs/{lang}/api-reference/middlewares/shopify/merchant/save).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"account\": \"demoshop\",\n    \"apiKey\": \"pk_live_2f3a...\",\n    \"apiSecret\": \"sk_live_8c1e...\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required fields\", \"missingFields\": [\"apiSecret\"] }"
                                }
                            ]
                        }
                    ]
                },
                {
                    "name": "Reward (accumulate)",
                    "item": [
                        {
                            "name": "Calculate reward for an order",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/award",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "reward",
                                        "award"
                                    ]
                                },
                                "description": "First step of the 2-phase accumulate flow. Call this when the order\nenters a pending state (Shopify `checkout completed` event or the\nstorefront \"thank you\" page) to get the cashback Guper will award if\nthe order is confirmed.\n\nWraps Guper [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order)\nand additionally:\n\n- Looks up `merchant.storeId` and sends it as `storeId` (no longer\n  hardcoded to `\"1\"` since v0.0.2).\n- Persists an `Order` row in `mdw_shopify` with status `PENDING` and\n  the returned `confirmToken`. Subsequent calls with the same\n  `orderId` return `409` — Award is **not** idempotent at the API\n  level; idempotency comes from the DB unique constraint on\n  `shopifyOrderId`.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"orderId\": \"#4521\",\n    \"client\": {\n        \"id\": \"8842\",\n        \"email\": \"ana@example.com\",\n        \"name\": \"Ana López\"\n    },\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Reward calculated and order persisted as `PENDING`. Keep the `confirmToken` — it goes into [Confirm Order](/docs/{lang}/api-reference/middlewares/shopify/reward/confirm) when the order is actually paid.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/award",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "reward",
                                                "award"
                                            ]
                                        },
                                        "description": "First step of the 2-phase accumulate flow. Call this when the order\nenters a pending state (Shopify `checkout completed` event or the\nstorefront \"thank you\" page) to get the cashback Guper will award if\nthe order is confirmed.\n\nWraps Guper [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order)\nand additionally:\n\n- Looks up `merchant.storeId` and sends it as `storeId` (no longer\n  hardcoded to `\"1\"` since v0.0.2).\n- Persists an `Order` row in `mdw_shopify` with status `PENDING` and\n  the returned `confirmToken`. Subsequent calls with the same\n  `orderId` return `409` — Award is **not** idempotent at the API\n  level; idempotency comes from the DB unique constraint on\n  `shopifyOrderId`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"orderId\": \"#4521\",\n    \"client\": {\n        \"id\": \"8842\",\n        \"email\": \"ana@example.com\",\n        \"name\": \"Ana López\"\n    },\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"Reward calculated and order saved\",\n    \"data\": {\n        \"orderId\": \"#4521\",\n        \"customerId\": 8842,\n        \"cashback\": {\n            \"thisOrder\": {\n                \"redeemable\": { \"total\": 0, \"item\": [] },\n                \"accumulating\": { \"total\": 600, \"points\": 600, \"item\": [] }\n            },\n            \"userBalance\": { \"total\": 1850, \"availableAmount\": 1850, \"points\": 1850 }\n        },\n        \"confirmToken\": \"rwt_2c19a1f3...\",\n        \"status\": \"PENDING\"\n    }\n}"
                                },
                                {
                                    "name": "Missing required field, empty `items`, or Guper rejected the payload.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/award",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "reward",
                                                "award"
                                            ]
                                        },
                                        "description": "First step of the 2-phase accumulate flow. Call this when the order\nenters a pending state (Shopify `checkout completed` event or the\nstorefront \"thank you\" page) to get the cashback Guper will award if\nthe order is confirmed.\n\nWraps Guper [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order)\nand additionally:\n\n- Looks up `merchant.storeId` and sends it as `storeId` (no longer\n  hardcoded to `\"1\"` since v0.0.2).\n- Persists an `Order` row in `mdw_shopify` with status `PENDING` and\n  the returned `confirmToken`. Subsequent calls with the same\n  `orderId` return `409` — Award is **not** idempotent at the API\n  level; idempotency comes from the DB unique constraint on\n  `shopifyOrderId`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"orderId\": \"#4521\",\n    \"client\": {\n        \"id\": \"8842\",\n        \"email\": \"ana@example.com\",\n        \"name\": \"Ana López\"\n    },\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Missing required fields: shop, orderId, client, items\" }"
                                },
                                {
                                    "name": "An order with this `shopifyOrderId` already exists. Returns the existing record so the caller can decide whether to retry or skip.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/award",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "reward",
                                                "award"
                                            ]
                                        },
                                        "description": "First step of the 2-phase accumulate flow. Call this when the order\nenters a pending state (Shopify `checkout completed` event or the\nstorefront \"thank you\" page) to get the cashback Guper will award if\nthe order is confirmed.\n\nWraps Guper [`/loyalty/rewardByOrder`](/docs/{lang}/api-reference/loyalty/checkout/reward-by-order)\nand additionally:\n\n- Looks up `merchant.storeId` and sends it as `storeId` (no longer\n  hardcoded to `\"1\"` since v0.0.2).\n- Persists an `Order` row in `mdw_shopify` with status `PENDING` and\n  the returned `confirmToken`. Subsequent calls with the same\n  `orderId` return `409` — Award is **not** idempotent at the API\n  level; idempotency comes from the DB unique constraint on\n  `shopifyOrderId`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"orderId\": \"#4521\",\n    \"client\": {\n        \"id\": \"8842\",\n        \"email\": \"ana@example.com\",\n        \"name\": \"Ana López\"\n    },\n    \"items\": [\n        {\n            \"id\": \"SKU-001\",\n            \"name\": \"Camiseta\",\n            \"quantity\": 1,\n            \"price\": 12000\n        }\n    ]\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 409,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": false,\n    \"message\": \"Order already processed\",\n    \"data\": { \"orderId\": \"#4521\", \"status\": \"PENDING\" }\n}"
                                }
                            ]
                        },
                        {
                            "name": "Confirm reward for an order",
                            "request": {
                                "method": "POST",
                                "header": [
                                    {
                                        "key": "Content-Type",
                                        "value": "{{Content-Type}}",
                                        "type": "text",
                                        "description": "Always `application/json` for endpoints with a JSON body."
                                    }
                                ],
                                "url": {
                                    "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/confirm",
                                    "protocol": "https",
                                    "host": [
                                        "{{organization}}",
                                        "myguper",
                                        "com"
                                    ],
                                    "path": [
                                        "mdw",
                                        "shopify",
                                        "api",
                                        "reward",
                                        "confirm"
                                    ]
                                },
                                "description": "Second step of the 2-phase accumulate flow. Call this when Shopify\ntransitions the order to `paid` / `fulfilled` (your choice — pick the\nearliest terminal state for your business). The Guper transaction\nmoves from pending to settled and the cashback is credited to the\ncustomer's wallet.\n\nWraps Guper [`/loyalty/confirmOrder/{confirmToken}`](/docs/{lang}/api-reference/loyalty/checkout/confirm-order)\nand additionally:\n\n- Updates the local `Order.status` to `CONFIRMED`.\n- Persists the Guper `TID` so [Refund Order](/docs/{lang}/api-reference/middlewares/shopify/loyalty/refund)\n  can cancel the transaction later.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"confirmToken\": \"rwt_2c19a1f3...\",\n    \"orderId\": \"#4521\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "Order confirmed. The `cashback` block carries the actual amounts that landed on the customer (redeemed and accumulated). `TID` is the Guper transaction id and should be retained if you ever need to refund.",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/confirm",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "reward",
                                                "confirm"
                                            ]
                                        },
                                        "description": "Second step of the 2-phase accumulate flow. Call this when Shopify\ntransitions the order to `paid` / `fulfilled` (your choice — pick the\nearliest terminal state for your business). The Guper transaction\nmoves from pending to settled and the cashback is credited to the\ncustomer's wallet.\n\nWraps Guper [`/loyalty/confirmOrder/{confirmToken}`](/docs/{lang}/api-reference/loyalty/checkout/confirm-order)\nand additionally:\n\n- Updates the local `Order.status` to `CONFIRMED`.\n- Persists the Guper `TID` so [Refund Order](/docs/{lang}/api-reference/middlewares/shopify/loyalty/refund)\n  can cancel the transaction later.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"confirmToken\": \"rwt_2c19a1f3...\",\n    \"orderId\": \"#4521\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"success\": true,\n    \"message\": \"Order confirmed. Points credited!\",\n    \"data\": {\n        \"orderId\": \"#4521\",\n        \"status\": \"CONFIRMED\",\n        \"cashback\": {\n            \"redeemedOrder\": 0,\n            \"accumulatedOrder\": 600\n        }\n    }\n}"
                                },
                                {
                                    "name": "Missing field, or Guper rejected confirmation (token expired, already confirmed, etc.).",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [
                                            {
                                                "key": "Content-Type",
                                                "value": "{{Content-Type}}",
                                                "type": "text",
                                                "description": "Always `application/json` for endpoints with a JSON body."
                                            }
                                        ],
                                        "url": {
                                            "raw": "https://{{organization}}.myguper.com/mdw/shopify/api/reward/confirm",
                                            "protocol": "https",
                                            "host": [
                                                "{{organization}}",
                                                "myguper",
                                                "com"
                                            ],
                                            "path": [
                                                "mdw",
                                                "shopify",
                                                "api",
                                                "reward",
                                                "confirm"
                                            ]
                                        },
                                        "description": "Second step of the 2-phase accumulate flow. Call this when Shopify\ntransitions the order to `paid` / `fulfilled` (your choice — pick the\nearliest terminal state for your business). The Guper transaction\nmoves from pending to settled and the cashback is credited to the\ncustomer's wallet.\n\nWraps Guper [`/loyalty/confirmOrder/{confirmToken}`](/docs/{lang}/api-reference/loyalty/checkout/confirm-order)\nand additionally:\n\n- Updates the local `Order.status` to `CONFIRMED`.\n- Persists the Guper `TID` so [Refund Order](/docs/{lang}/api-reference/middlewares/shopify/loyalty/refund)\n  can cancel the transaction later.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"shop\": \"demoshop.myshopify.com\",\n    \"confirmToken\": \"rwt_2c19a1f3...\",\n    \"orderId\": \"#4521\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Bad Request",
                                    "code": 400,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{ \"success\": false, \"message\": \"Failed to confirm order\" }"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "name": "VTEX",
            "item": [
                {
                    "name": "Giftcards (giftCardHub)",
                    "item": [
                        {
                            "name": "Cancel transaction (VTEX callback)",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/giftcards/{{giftcards}}/transactions/{{transactions}}/cancellations",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "giftcards",
                                        "{{giftcards}}",
                                        "transactions",
                                        "{{transactions}}",
                                        "cancellations"
                                    ]
                                },
                                "description": "VTEX releases the reservation (checkout abandoned, payment failed, etc). Guper restores the balance to the wallet."
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/giftcards/{{giftcards}}/transactions/{{transactions}}/cancellations",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "giftcards",
                                                "{{giftcards}}",
                                                "transactions",
                                                "{{transactions}}",
                                                "cancellations"
                                            ]
                                        },
                                        "description": "VTEX releases the reservation (checkout abandoned, payment failed, etc). Guper restores the balance to the wallet."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"cancellationId\": \"guper-cancel-uvw\"}"
                                }
                            ]
                        },
                        {
                            "name": "Authorize transaction (VTEX callback)",
                            "request": {
                                "method": "POST",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/giftcards/{{giftcards}}/transactions",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "giftcards",
                                        "{{giftcards}}",
                                        "transactions"
                                    ]
                                },
                                "description": "VTEX calls this to **reserve** part of the giftcard balance during checkout. Guper validates the amount, locks the reservation against the cashback wallet and returns an `authorizationId` that VTEX will use to confirm (settlement) or release (cancellation).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"value\": 1500,\n    \"requestId\": \"vtex-req-123\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/giftcards/{{giftcards}}/transactions",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "giftcards",
                                                "{{giftcards}}",
                                                "transactions"
                                            ]
                                        },
                                        "description": "VTEX calls this to **reserve** part of the giftcard balance during checkout. Guper validates the amount, locks the reservation against the cashback wallet and returns an `authorizationId` that VTEX will use to confirm (settlement) or release (cancellation).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"value\": 1500,\n    \"requestId\": \"vtex-req-123\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Created",
                                    "code": 201,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"authorizationId\": \"guper-auth-abc\", \"value\": 1500, \"requestId\": \"vtex-req-123\"}"
                                }
                            ]
                        },
                        {
                            "name": "Get giftcard (VTEX callback)",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/giftcards/{{giftcards}}",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "giftcards",
                                        "{{giftcards}}"
                                    ]
                                },
                                "description": "VTEX requests the current state of a specific giftcard (typically called between search and transaction)."
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/giftcards/{{giftcards}}",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "giftcards",
                                                "{{giftcards}}"
                                            ]
                                        },
                                        "description": "VTEX requests the current state of a specific giftcard (typically called between search and transaction)."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"id\": \"cashback-wallet-1\", \"value\": 5000, \"balance\": 5000, \"caption\": \"Cashback\"}"
                                }
                            ]
                        },
                        {
                            "name": "Search giftcards (VTEX callback)",
                            "request": {
                                "method": "POST",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/giftcards/_search",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "giftcards",
                                        "_search"
                                    ]
                                },
                                "description": "VTEX calls this when the customer reaches the checkout payment step. Guper looks up the customer by `userEmail` and/or `userProfileId`, computes their available cashback balance and returns one virtual giftcard per available wallet. **Called by VTEX checkout, not by orgs.**",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"userEmail\": \"cliente@example.com\",\n    \"userProfileId\": \"profile-uuid\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/giftcards/_search",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "giftcards",
                                                "_search"
                                            ]
                                        },
                                        "description": "VTEX calls this when the customer reaches the checkout payment step. Guper looks up the customer by `userEmail` and/or `userProfileId`, computes their available cashback balance and returns one virtual giftcard per available wallet. **Called by VTEX checkout, not by orgs.**",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"userEmail\": \"cliente@example.com\",\n    \"userProfileId\": \"profile-uuid\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Created",
                                    "code": 201,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "[\n    {\n        \"id\": \"cashback-wallet-1\",\n        \"redemptionCode\": \"...\",\n        \"value\": 5000,\n        \"balance\": 5000,\n        \"caption\": \"Cashback\",\n        \"profileId\": \"profile-uuid\",\n        \"groupName\": \"loyalty\",\n        \"provider\": \"giftcard-provider-guper\"\n    }\n]"
                                }
                            ]
                        },
                        {
                            "name": "Settle transaction (VTEX callback)",
                            "request": {
                                "method": "POST",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/giftcards/{{giftcards}}/transactions/{{transactions}}/settlements",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "giftcards",
                                        "{{giftcards}}",
                                        "transactions",
                                        "{{transactions}}",
                                        "settlements"
                                    ]
                                },
                                "description": "VTEX confirms the reserved transaction (order was placed). Guper consumes the balance from the wallet (movement = redeem).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"value\": 1500\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/giftcards/{{giftcards}}/transactions/{{transactions}}/settlements",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "giftcards",
                                                "{{giftcards}}",
                                                "transactions",
                                                "{{transactions}}",
                                                "settlements"
                                            ]
                                        },
                                        "description": "VTEX confirms the reserved transaction (order was placed). Guper consumes the balance from the wallet (movement = redeem).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"value\": 1500\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Created",
                                    "code": 201,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"settleId\": \"guper-settle-xyz\", \"value\": 1500}"
                                }
                            ]
                        }
                    ]
                },
                {
                    "name": "Ping",
                    "request": {
                        "method": "GET",
                        "header": [],
                        "url": {
                            "raw": "/mdw/vtex/ping",
                            "path": [
                                "mdw",
                                "vtex",
                                "ping"
                            ]
                        },
                        "description": "Liveness probe — returns simple pong response. Requires user token auth."
                    },
                    "response": [
                        {
                            "name": "OK",
                            "originalRequest": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/ping",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "ping"
                                    ]
                                },
                                "description": "Liveness probe — returns simple pong response. Requires user token auth."
                            },
                            "status": "OK",
                            "code": 200,
                            "_postman_previewlanguage": "json",
                            "header": [
                                {
                                    "key": "Content-Type",
                                    "value": "application/json"
                                }
                            ],
                            "body": "{\"pong\":true}"
                        }
                    ]
                },
                {
                    "name": "Settings",
                    "item": [
                        {
                            "name": "Create setting",
                            "request": {
                                "method": "POST",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/setting",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "setting"
                                    ]
                                },
                                "description": "Creates a VTEX setting row for the org. `appKey` and `account` are required — get them from the VTEX admin (`/admin/storeconfig` and `vtexAppKey`).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"account\": \"mystore\",\n    \"appKey\": \"vtexappkey-mystore-XXXX\",\n    \"appToken\": \"AAA...\",\n    \"integrateBrand\": 1,\n    \"integrateCategory\": 1,\n    \"integrateOrder\": 1,\n    \"sellersAvailableReward\": null,\n    \"giftcardProvider\": \"https://mystore.myguper.com/mdw/vtex\",\n    \"giftcardApiKey\": \"XXX\"\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/setting",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "setting"
                                            ]
                                        },
                                        "description": "Creates a VTEX setting row for the org. `appKey` and `account` are required — get them from the VTEX admin (`/admin/storeconfig` and `vtexAppKey`).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"account\": \"mystore\",\n    \"appKey\": \"vtexappkey-mystore-XXXX\",\n    \"appToken\": \"AAA...\",\n    \"integrateBrand\": 1,\n    \"integrateCategory\": 1,\n    \"integrateOrder\": 1,\n    \"sellersAvailableReward\": null,\n    \"giftcardProvider\": \"https://mystore.myguper.com/mdw/vtex\",\n    \"giftcardApiKey\": \"XXX\"\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Created",
                                    "code": 201,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"id\": 1, \"account\": \"mystore\", \"appKey\": \"vtexappkey-mystore-XXXX\", \"integrateBrand\": 1, \"integrateCategory\": 1, \"integrateOrder\": 1}"
                                }
                            ]
                        },
                        {
                            "name": "Delete setting",
                            "request": {
                                "method": "DELETE",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/setting",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "setting"
                                    ]
                                },
                                "description": "Removes a VTEX setting row. After delete, all VTEX integration for the org stops (no callbacks accepted, no sync).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"id\": 1\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "DELETE",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/setting",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "setting"
                                            ]
                                        },
                                        "description": "Removes a VTEX setting row. After delete, all VTEX integration for the org stops (no callbacks accepted, no sync).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"id\": 1\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"deleted\": true}"
                                }
                            ]
                        },
                        {
                            "name": "List settings",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/setting",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "setting"
                                    ]
                                },
                                "description": "Returns the VTEX settings of the org. Supports the standard listing query params."
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/setting",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "setting"
                                            ]
                                        },
                                        "description": "Returns the VTEX settings of the org. Supports the standard listing query params."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"list\": [\n        {\n            \"id\": 1,\n            \"account\": \"mystore\",\n            \"appKey\": \"vtexappkey-mystore-XXXX\",\n            \"appToken\": \"AAA...\",\n            \"integrateBrand\": 1,\n            \"integrateCategory\": 1,\n            \"integrateOrder\": 1,\n            \"giftcardProvider\": \"https://mystore.myguper.com/api/middleware/vtex\",\n            \"sellersAvailableReward\": null,\n            \"feedStatus\": null\n        }\n    ],\n    \"total\": 1,\n    \"pagination\": {\"entries\": 50, \"currentPage\": 1, \"totalPages\": 1}\n}"
                                }
                            ]
                        },
                        {
                            "name": "Update setting",
                            "request": {
                                "method": "PUT",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/setting",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "setting"
                                    ]
                                },
                                "description": "Updates a VTEX setting row. `id`, `appKey` and `account` are required (body-level).",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"id\": 1,\n    \"account\": \"mystore\",\n    \"appKey\": \"vtexappkey-mystore-XXXX\",\n    \"appToken\": \"AAA...\",\n    \"integrateBrand\": 1,\n    \"integrateCategory\": 1,\n    \"integrateOrder\": 1\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "PUT",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/setting",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "setting"
                                            ]
                                        },
                                        "description": "Updates a VTEX setting row. `id`, `appKey` and `account` are required (body-level).",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"id\": 1,\n    \"account\": \"mystore\",\n    \"appKey\": \"vtexappkey-mystore-XXXX\",\n    \"appToken\": \"AAA...\",\n    \"integrateBrand\": 1,\n    \"integrateCategory\": 1,\n    \"integrateOrder\": 1\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\"id\": 1, \"account\": \"mystore\", \"appKey\": \"vtexappkey-mystore-XXXX\"}"
                                }
                            ]
                        }
                    ]
                },
                {
                    "name": "Sync Order",
                    "item": [
                        {
                            "name": "Trigger sync",
                            "request": {
                                "method": "POST",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/sync-order",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "sync-order"
                                    ]
                                },
                                "description": "Schedules a sync period. The CRON walks the period in chunks (`steps`), fetching orders from VTEX day-by-day. Already-imported orders are deduped by VTEX `orderId`.",
                                "body": {
                                    "mode": "raw",
                                    "raw": "{\n    \"interface\": \"vtex\",\n    \"start\": \"2026-06-01\",\n    \"end\": \"2026-06-25\",\n    \"steps\": 4\n}",
                                    "options": {
                                        "raw": {
                                            "language": "json"
                                        }
                                    }
                                }
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "POST",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/sync-order",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "sync-order"
                                            ]
                                        },
                                        "description": "Schedules a sync period. The CRON walks the period in chunks (`steps`), fetching orders from VTEX day-by-day. Already-imported orders are deduped by VTEX `orderId`.",
                                        "body": {
                                            "mode": "raw",
                                            "raw": "{\n    \"interface\": \"vtex\",\n    \"start\": \"2026-06-01\",\n    \"end\": \"2026-06-25\",\n    \"steps\": 4\n}",
                                            "options": {
                                                "raw": {
                                                    "language": "json"
                                                }
                                            }
                                        }
                                    },
                                    "status": "Created",
                                    "code": 201,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"exists\": true,\n    \"active\": true,\n    \"start\": \"2026-06-01T00:00:00-03:00\",\n    \"end\": \"2026-06-25T23:59:59-03:00\",\n    \"current\": null,\n    \"steps\": 4,\n    \"attempt\": 0\n}"
                                }
                            ]
                        },
                        {
                            "name": "Sync status",
                            "request": {
                                "method": "GET",
                                "header": [],
                                "url": {
                                    "raw": "/mdw/vtex/sync-order",
                                    "path": [
                                        "mdw",
                                        "vtex",
                                        "sync-order"
                                    ]
                                },
                                "description": "Returns the current sync period state for the given `interface` query param. If no period exists, returns `{exists: false}`."
                            },
                            "response": [
                                {
                                    "name": "OK",
                                    "originalRequest": {
                                        "method": "GET",
                                        "header": [],
                                        "url": {
                                            "raw": "/mdw/vtex/sync-order",
                                            "path": [
                                                "mdw",
                                                "vtex",
                                                "sync-order"
                                            ]
                                        },
                                        "description": "Returns the current sync period state for the given `interface` query param. If no period exists, returns `{exists: false}`."
                                    },
                                    "status": "OK",
                                    "code": 200,
                                    "_postman_previewlanguage": "json",
                                    "header": [
                                        {
                                            "key": "Content-Type",
                                            "value": "application/json"
                                        }
                                    ],
                                    "body": "{\n    \"exists\": true,\n    \"active\": true,\n    \"start\": \"2026-06-01T00:00:00-03:00\",\n    \"end\": \"2026-06-25T23:59:59-03:00\",\n    \"current\": \"2026-06-20T00:00:00-03:00\",\n    \"steps\": 4,\n    \"attempt\": 0\n}"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "variable": [
        {
            "key": "scheme",
            "value": "https",
            "type": "string"
        },
        {
            "key": "organization",
            "value": "acme",
            "type": "string"
        },
        {
            "key": "TID",
            "value": "tx_demo_a1b2c3d4",
            "type": "string"
        },
        {
            "key": "confirmToken",
            "value": "54eb6281f4e3e13671a5e4c95609f4a69247a5f38d01bef99768399bb6645c49",
            "type": "string"
        },
        {
            "key": "hash",
            "value": "h_demo_abc123def456",
            "type": "string"
        },
        {
            "key": "id",
            "value": "42",
            "type": "string"
        },
        {
            "key": "personId",
            "value": "1234",
            "type": "string"
        },
        {
            "key": "couponCode",
            "value": "DEMO20",
            "type": "string"
        },
        {
            "key": "transactionId",
            "value": "tx_demo_a1b2c3d4",
            "type": "string"
        },
        {
            "key": "dateStart",
            "value": "2024-04-01",
            "type": "string"
        },
        {
            "key": "dateEnd",
            "value": "2024-04-30",
            "type": "string"
        },
        {
            "key": "x-guper-authorization",
            "value": "48c70a3d6bc1d15104abfaee80c6010f348713f5315bfd12028c2455667685a2",
            "type": "string"
        },
        {
            "key": "Content-Type",
            "value": "application/json",
            "type": "string"
        },
        {
            "key": "User-Agent",
            "value": "guper-docs/2.x",
            "type": "string"
        },
        {
            "key": "environment",
            "value": "",
            "type": "string"
        }
    ]
}