{
  "info": {
    "_postman_id": "paylater-api-collection-2026",
    "name": "PayLater API",
    "description": "Official Postman collection for the PayLater BNPL API (v2).\n\nHow to use:\n1. Import this collection AND a PayLater environment (Sandbox or Production).\n2. Select the environment (top-right in Postman).\n3. Run Authentication > Get Access Token first — it saves {{access_token}} to the environment automatically.\n4. Every other request inherits Bearer {{access_token}} and uses {{base_url}} + the environment variables.\n\nFull docs: https://docs.paylaterapp.com",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{access_token}}", "type": "string" }]
  },
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Get Access Token",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var json = pm.response.json();",
                  "if (json && json.access_token) {",
                  "  pm.environment.set('access_token', json.access_token);",
                  "  console.log('access_token saved to the active environment');",
                  "}",
                  "pm.test('200 OK', function () { pm.response.to.have.status(200); });",
                  "pm.test('access_token present', function () { pm.expect(json).to.have.property('access_token'); });"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/x-www-form-urlencoded" }],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                { "key": "grant_type", "value": "client_credentials" },
                { "key": "client_id", "value": "{{client_id}}" },
                { "key": "client_secret", "value": "{{client_secret}}" }
              ]
            },
            "url": {
              "raw": "{{base_url}}/auth/realms/api/protocol/openid-connect/token",
              "host": ["{{base_url}}"],
              "path": ["auth", "realms", "api", "protocol", "openid-connect", "token"]
            },
            "description": "Exchange your client credentials for a short-lived OAuth 2.0 bearer token. The test script saves access_token automatically, so run this first."
          }
        }
      ]
    },
    {
      "name": "Payments",
      "item": [
        {
          "name": "Generate Payment Link",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"outlet_id\": {{outlet_id}},\n  \"currency\": \"QAR\",\n  \"amount\": {{amount}},\n  \"order_id\": \"{{order_id}}\",\n  \"success_redirect_url\": \"https://example.com/success\",\n  \"fail_redirect_url\": \"https://example.com/fail\",\n  \"expiry_duration\": {{expiry_duration}}\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout"]
            },
            "description": "Create a hosted checkout link. Returns paymentLinkUrl. amount range 300-25,000 QAR; expiry_duration 1-1440 minutes."
          }
        },
        {
          "name": "Request to Pay (POS)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"outlet_id\": {{outlet_id}},\n  \"mobile_number\": \"{{mobile_number}}\",\n  \"order_amount\": {{amount}},\n  \"merchant_order_reference\": \"{{merchant_order_reference}}\",\n  \"expiry_minutes\": 20\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/request-to-pay",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "request-to-pay"]
            },
            "description": "Push a payment request to a registered shopper's PayLater app by mobile number."
          }
        }
      ]
    },
    {
      "name": "Status & Lookup",
      "item": [
        {
          "name": "Check Payment Status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/status?order_id={{order_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "status"],
              "query": [{ "key": "order_id", "value": "{{order_id}}" }]
            },
            "description": "Poll the live status of an order. status: 0 = not proceeded, 1 = pending, 2 = success, 3 = failed."
          }
        },
        {
          "name": "Get Shopper Information",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/shopper?mobile_number={{mobile_number}}&email={{email}}",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "shopper"],
              "query": [
                { "key": "mobile_number", "value": "{{mobile_number}}" },
                { "key": "email", "value": "{{email}}" }
              ]
            },
            "description": "Look up a shopper's current and allowed spending limits."
          }
        },
        {
          "name": "Get Transaction by Order ID",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/transactions/{{order_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "transactions", "{{order_id}}"]
            },
            "description": "Retrieve full customer, loan and status details for one order."
          }
        },
        {
          "name": "Get Transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/transactions?size={{size}}&page={{page}}",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "transactions"],
              "query": [
                { "key": "size", "value": "{{size}}" },
                { "key": "page", "value": "{{page}}" }
              ]
            },
            "description": "Paginated, filterable list of transactions. Optional: search_text, start_date, end_date, status."
          }
        }
      ]
    },
    {
      "name": "Refunds",
      "item": [
        {
          "name": "Full Refund",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"order_id\": \"{{order_id}}\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/refund",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "refund"]
            },
            "description": "Refund an entire order. Allowed within 29 days and no sooner than 10 minutes after the transaction."
          }
        },
        {
          "name": "Partial Refund",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"order_id\": \"{{order_id}}\",\n  \"amount\": \"100.00\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/paylater/merchant-portal/v2/web-checkout/refund",
              "host": ["{{base_url}}"],
              "path": ["api", "paylater", "merchant-portal", "v2", "web-checkout", "refund"]
            },
            "description": "Refund part of an order. amount must be less than the order value."
          }
        }
      ]
    }
  ],
  "variable": [
    { "key": "base_url", "value": "https://connect.uat.paylaterapp.com" }
  ]
}
