{
  "info": {
    "name": "Kashu POS API",
    "description": "Kashu Company Limited — fintech POS API (Laravel 11). Set {{base_url}} and run Auth > Login first; the token is auto-saved to {{auth_token}}.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{auth_token}}", "type": "string" }]
  },
  "variable": [
    { "key": "base_url", "value": "http://localhost:8000/api/v1" },
    { "key": "auth_token", "value": "" }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Login",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('200 OK', () => pm.response.code === 200);",
                  "const json = pm.response.json();",
                  "if (json.data && json.data.token) {",
                  "  pm.collectionVariables.set('auth_token', json.data.token);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/auth/login",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": \"agent@kashucompany.com\",\n  \"password\": \"Demo@1234\",\n  \"device_name\": \"postman\"\n}"
            }
          }
        },
        {
          "name": "Verify PIN",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/auth/verify-pin",
            "body": { "mode": "raw", "raw": "{\n  \"pin\": \"1234\"\n}" }
          }
        },
        { "name": "Refresh", "request": { "method": "POST", "url": "{{base_url}}/auth/refresh" } },
        { "name": "Logout", "request": { "method": "POST", "url": "{{base_url}}/auth/logout" } },
        {
          "name": "Forgot PIN",
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/auth/forgot-pin",
            "body": { "mode": "raw", "raw": "{\n  \"identifier\": \"agent@kashucompany.com\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Agent",
      "item": [
        { "name": "Profile", "request": { "method": "GET", "url": "{{base_url}}/agent/profile" } },
        { "name": "Dashboard", "request": { "method": "GET", "url": "{{base_url}}/agent/dashboard" } },
        { "name": "Float", "request": { "method": "GET", "url": "{{base_url}}/agent/float" } },
        { "name": "Commissions", "request": { "method": "GET", "url": "{{base_url}}/agent/commissions" } },
        { "name": "Notifications", "request": { "method": "GET", "url": "{{base_url}}/agent/notifications" } },
        {
          "name": "Change PIN",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/agent/change-pin",
            "body": { "mode": "raw", "raw": "{\n  \"old_pin\": \"1234\",\n  \"new_pin\": \"4321\",\n  \"new_pin_confirmation\": \"4321\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Airtime",
      "item": [
        { "name": "Networks", "request": { "method": "GET", "url": "{{base_url}}/airtime/networks" } },
        {
          "name": "Buy",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/airtime/buy",
            "body": { "mode": "raw", "raw": "{\n  \"network\": \"MTN\",\n  \"recipient_phone\": \"+256712345678\",\n  \"amount\": 5000,\n  \"pin\": \"1234\"\n}" }
          }
        },
        { "name": "History", "request": { "method": "GET", "url": "{{base_url}}/airtime/history" } }
      ]
    },
    {
      "name": "Utilities",
      "item": [
        { "name": "Providers", "request": { "method": "GET", "url": "{{base_url}}/utilities/providers" } },
        {
          "name": "Pay (UMEME)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/utilities/pay",
            "body": { "mode": "raw", "raw": "{\n  \"provider\": \"UMEME\",\n  \"account_number\": \"01234567890\",\n  \"amount\": 20000,\n  \"pin\": \"1234\"\n}" }
          }
        }
      ]
    },
    {
      "name": "School Fees",
      "item": [
        {
          "name": "Pay",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/school-fees/pay",
            "body": { "mode": "raw", "raw": "{\n  \"school_name\": \"Kings College Budo\",\n  \"student_name\": \"John Doe\",\n  \"student_id\": \"STD-001\",\n  \"amount\": 500000,\n  \"pin\": \"1234\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Taxes",
      "item": [
        {
          "name": "Pay",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/taxes/pay",
            "body": { "mode": "raw", "raw": "{\n  \"prn\": \"PRN1234567890\",\n  \"tax_type\": \"VAT\",\n  \"amount\": 300000,\n  \"pin\": \"1234\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Mobile Money",
      "item": [
        {
          "name": "MTN Send",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/mobile-money/mtn/send",
            "body": { "mode": "raw", "raw": "{\n  \"recipient_phone\": \"+256712345678\",\n  \"amount\": 10000,\n  \"pin\": \"1234\"\n}" }
          }
        },
        {
          "name": "M-Pesa STK Push",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/mobile-money/mpesa/stk-push",
            "body": { "mode": "raw", "raw": "{\n  \"customer_phone\": \"254712345678\",\n  \"amount\": 1000\n}" }
          }
        }
      ]
    },
    {
      "name": "Goods (POS)",
      "item": [
        {
          "name": "Create Product",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/products",
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"Sugar 1kg\",\n  \"barcode\": \"6001234567890\",\n  \"price\": 4500,\n  \"stock_quantity\": 50,\n  \"track_stock\": true\n}" }
          }
        },
        {
          "name": "Checkout",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/orders",
            "body": { "mode": "raw", "raw": "{\n  \"customer_name\": \"Walk-in\",\n  \"amount_paid\": 10000,\n  \"payment_method\": \"cash\",\n  \"items\": [\n    { \"product_name\": \"Sugar 1kg\", \"unit_price\": 4500, \"quantity\": 2 }\n  ]\n}" }
          }
        }
      ]
    },
    {
      "name": "Salary",
      "item": [
        {
          "name": "Bulk",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/salary/bulk",
            "body": { "mode": "raw", "raw": "{\n  \"company_name\": \"Acme Ltd\",\n  \"payments\": [\n    { \"employee_name\": \"Jane\", \"recipient_phone\": \"+256712000001\", \"amount\": 500000, \"provider\": \"MTN\" },\n    { \"employee_name\": \"Bob\", \"recipient_phone\": \"+256712000002\", \"amount\": 450000, \"provider\": \"Airtel\" }\n  ]\n}" }
          }
        }
      ]
    },
    {
      "name": "Reports",
      "item": [
        { "name": "Summary", "request": { "method": "GET", "url": "{{base_url}}/reports/summary" } },
        { "name": "Export CSV", "request": { "method": "POST", "url": "{{base_url}}/reports/export" } }
      ]
    },
    {
      "name": "Transactions",
      "item": [
        { "name": "List", "request": { "method": "GET", "url": "{{base_url}}/transactions" } }
      ]
    }
  ]
}
