{
  "info": {
    "name": "Cardy Loyalty API",
    "description": "Generated from openapi/public-loyalty-api.yaml by `pnpm postman:generate` — do not edit by hand.\n\nSet `apiKey` to the TEST key issued for your sandbox tenant. `baseUrl` already points at the sandbox.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://sandbox.getcardy.net/api/v1"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "cardId",
      "value": ""
    },
    {
      "key": "enrollmentId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Customers",
      "description": "Look a customer up at the till, or sign a new one up.",
      "item": [
        {
          "name": "identifyCustomer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/customers/identify"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"96599901001\"\n}"
            },
            "description": "Resolve a customer and their cards/balances by any identifier"
          }
        },
        {
          "name": "enrollCustomer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/customers/enroll"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"external_ref\": \"signup-90210\",\n  \"phone\": \"96599901234\",\n  \"name\": \"Noura Al-Sabah\"\n}"
            },
            "description": "Create a customer and issue a wallet card"
          }
        },
        {
          "name": "verifyEnrollment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/customers/enroll/verify"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enrollment_id\": \"{{enrollmentId}}\",\n  \"otp\": \"123456\"\n}"
            },
            "description": "Complete a strict-OTP enrollment"
          }
        },
        {
          "name": "listCustomerTransactions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/customers/{customer_id}/transactions?limit=25"
            },
            "description": "Paginated transaction history for a customer"
          }
        }
      ]
    },
    {
      "name": "Transactions",
      "description": "Earn, redeem, reverse, and find a sale again by its receipt number.",
      "item": [
        {
          "name": "earn",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transactions/earn"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": {\n    \"phone\": \"96599901001\"\n  },\n  \"external_ref\": \"receipt-1001\",\n  \"amount_minor\": 12500,\n  \"currency\": \"KWD\"\n}"
            },
            "description": "Record a purchase / grant loyalty value (accept-then-commit)"
          }
        },
        {
          "name": "redeem",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transactions/redeem"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": {\n    \"phone\": \"96599901001\"\n  },\n  \"external_ref\": \"receipt-1002\",\n  \"card_id\": \"{{cardId}}\",\n  \"points\": 5\n}"
            },
            "description": "Redeem loyalty value (synchronous — cashier/customer is waiting)"
          }
        },
        {
          "name": "reverseByRef",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transactions/reverse"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"external_ref\": \"receipt-1001\",\n  \"intent\": \"earn\",\n  \"reversal_ref\": \"refund-1001\",\n  \"reason\": \"customer returned the item\"\n}"
            },
            "description": "Reverse a prior transaction by your external_ref (refund/void)"
          }
        },
        {
          "name": "reverseById",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transactions/{transaction_id}/reverse"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reversal_ref\": \"refund-1003\",\n  \"reason\": \"partial refund\",\n  \"amount_minor\": 2500\n}"
            },
            "description": "Reverse a prior transaction by its Cardy transaction id"
          }
        },
        {
          "name": "getTransaction",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transactions/{transaction_id}"
            },
            "description": "Poll a transaction's status/result"
          }
        },
        {
          "name": "findTransactions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transactions?external_ref=receipt-1001"
            },
            "description": "Look up transactions by your external_ref"
          }
        }
      ]
    },
    {
      "name": "Reservations",
      "description": "Hold a balance while a basket is open, then commit or release it.",
      "item": [
        {
          "name": "reserveRedemption",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/redemptions/reserve"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": {\n    \"phone\": \"96599901001\"\n  },\n  \"external_ref\": \"basket-77\",\n  \"card_id\": \"{{cardId}}\",\n  \"points\": 5,\n  \"ttl_minutes\": 15\n}"
            },
            "description": "Hold points against an online checkout (no balance moves yet)"
          }
        },
        {
          "name": "commitRedemption",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/redemptions/{reservation_id}/commit"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"external_ref\": \"receipt-1004\"\n}"
            },
            "description": "Commit a reservation once the order is paid"
          }
        },
        {
          "name": "releaseRedemption",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/redemptions/{reservation_id}/release"
            },
            "body": {
              "mode": "raw",
              "raw": "{}"
            },
            "description": "Release a reservation (cart abandoned / customer changed mind)"
          }
        }
      ]
    }
  ]
}
