{
  "info": {
    "_postman_id": "zenpays-api-collection",
    "name": "ZenPays API",
    "description": "Complete Postman collection for ZenPays API endpoints.\n\nAll requests go through the API Gateway at `api.zenpayz.com`.\n\n## Authentication\n\nAll API requests use **API Key + HMAC Signature** authentication.\n\n### Required Headers (auto-generated)\n- `Authorization: Bearer {api_key}`\n- `X-Signature`: HMAC-SHA256 signature\n- `X-Timestamp`: ISO 8601 UTC timestamp\n- `Content-Type`: application/json\n\n### Signature Formula\n```\nsignature = HMAC-SHA256(timestamp + JSON.stringify(body), secret_salt)\n```\nFor GET requests, use `{}` as the body.\n\n## Getting Started\n1. Set `baseUrl` to your environment (`https://api.zenpayz.com` or `http://localhost:3009`)\n2. Set `apiKey` and `secretSalt` from your ZenPays Dashboard\n3. The pre-request script auto-generates all auth headers — just click Send!\n\n## Routing\n- `/payment/api/v1/*` — Payment Engine (payment intents, refunds)\n- `/merchant/api/v1/*` — Merchant Service (transactions, customers, payouts, settlements, wallet, ledger, analytics, reports, profile, API keys)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.zenpayz.com",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "string"
    },
    {
      "key": "secretSalt",
      "value": "",
      "type": "string"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Auto-generate auth headers for every request",
          "const apiKey = pm.collectionVariables.get('apiKey');",
          "const secretSalt = pm.collectionVariables.get('secretSalt');",
          "",
          "if (apiKey && secretSalt) {",
          "    const timestamp = new Date().toISOString();",
          "    const body = pm.request.body && pm.request.body.raw ? pm.request.body.raw : '{}';",
          "",
          "    const CryptoJS = require('crypto-js');",
          "    const signature = CryptoJS.HmacSHA256(timestamp + body, secretSalt).toString();",
          "",
          "    pm.request.headers.upsert({ key: 'Authorization', value: 'Bearer ' + apiKey });",
          "    pm.request.headers.upsert({ key: 'X-Timestamp', value: timestamp });",
          "    pm.request.headers.upsert({ key: 'X-Signature', value: signature });",
          "    pm.request.headers.upsert({ key: 'Content-Type', value: 'application/json' });",
          "}"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "Payment Intents",
      "description": "Create and manage payment intents for collecting payments.\n\nRoutes to **Payment Engine** (`/payment/api/v1/`).",
      "item": [
        {
          "name": "Create Payment Intent",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-Idempotency-Key", "value": "{{$guid}}", "description": "Unique key to prevent duplicate payments" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 1000,\n  \"currency\": \"USD\",\n  \"description\": \"Order #123\",\n  \"customerEmail\": \"john@example.com\",\n  \"customerPhone\": \"+1234567890\",\n  \"customerFirstName\": \"John\",\n  \"customerLastName\": \"Doe\",\n  \"customerCountry\": \"US\",\n  \"paymentMethod\": \"credit_card\",\n  \"requestId\": \"req_order_123_unique\",\n  \"returnUrl\": \"https://mystore.com/payment-complete\",\n  \"metadata\": {\n    \"orderId\": \"order_123\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/payment-intent",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "payment-intent"]
            },
            "description": "Create a new payment intent to initiate a payment flow.\n\n**Required fields:** `amount`, `currency`, `paymentMethod`\n\n**Payment methods:** `credit_card`, `debit_card`, `upi`, `net_banking`, `wallet`, `emi`, `bnpl`\n\n**Customer fields** (flat, not nested):\n- `customerEmail` — required if no `customerId`\n- `customerPhone`, `customerFirstName`, `customerLastName`, `customerCountry`\n- `customerId` — use for existing customers\n\n**Optional:** `description`, `requestId`, `returnUrl`, `metadata`, `customerBank`"
          }
        },
        {
          "name": "Get Payment Intent",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/payment-intent/:intentId",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "payment-intent", ":intentId"],
              "variable": [
                { "key": "intentId", "value": "pi_xxxxx", "description": "Payment intent ID" }
              ]
            },
            "description": "Get details and current status of a payment intent.\n\nStatuses: `requires_payment_method`, `processing`, `succeeded`, `failed`, `cancelled`, `expired`"
          }
        },
        {
          "name": "Confirm Payment",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"customerDetails\": {\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\",\n    \"phone\": \"+1234567890\"\n  },\n  \"deviceInfo\": {\n    \"ipAddress\": \"192.168.1.1\",\n    \"userAgent\": \"Mozilla/5.0\"\n  },\n  \"paymentMethodDetails\": {\n    \"type\": \"credit_card\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/payment-intent/:intentId/confirm",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "payment-intent", ":intentId", "confirm"],
              "variable": [
                { "key": "intentId", "value": "pi_xxxxx", "description": "Payment intent ID" }
              ]
            },
            "description": "Confirm a payment intent with customer and payment method details"
          }
        }
      ]
    },
    {
      "name": "Transactions",
      "description": "View and manage payment transactions.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "List Transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/transactions?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "transactions"],
              "query": [
                { "key": "page", "value": "1", "description": "Page number" },
                { "key": "limit", "value": "20", "description": "Items per page (max 100)" },
                { "key": "status", "value": "succeeded", "description": "Filter: succeeded, failed, pending, processing", "disabled": true },
                { "key": "currency", "value": "USD", "description": "ISO 4217 currency code", "disabled": true },
                { "key": "paymentMethod", "value": "credit_card", "description": "Filter by payment method", "disabled": true },
                { "key": "customerId", "value": "cus_xxxxx", "description": "Filter by customer ID", "disabled": true },
                { "key": "startDate", "value": "2024-01-01", "description": "Start date (ISO 8601)", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "description": "End date (ISO 8601)", "disabled": true },
                { "key": "minAmount", "value": "100", "description": "Minimum amount filter", "disabled": true },
                { "key": "maxAmount", "value": "10000", "description": "Maximum amount filter", "disabled": true },
                { "key": "search", "value": "", "description": "Search by email, name, or order ID", "disabled": true }
              ]
            },
            "description": "List transactions with filtering and pagination"
          }
        },
        {
          "name": "Get Transaction",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/transactions/:transactionId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "transactions", ":transactionId"],
              "variable": [
                { "key": "transactionId", "value": "txn_xxxxx", "description": "Transaction ID" }
              ]
            },
            "description": "Get detailed information about a specific transaction"
          }
        },
        {
          "name": "Customer Transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/transactions/customer/:customerId?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "transactions", "customer", ":customerId"],
              "variable": [
                { "key": "customerId", "value": "cus_xxxxx", "description": "Customer ID" }
              ],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" }
              ]
            },
            "description": "Get all transactions for a specific customer"
          }
        },
        {
          "name": "Transaction Analytics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/transactions/analytics/overview?period=month&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "transactions", "analytics", "overview"],
              "query": [
                { "key": "period", "value": "month", "description": "Period: day, week, month, year" },
                { "key": "currency", "value": "USD", "description": "Currency for analytics" }
              ]
            },
            "description": "Get transaction analytics overview for a given period"
          }
        },
        {
          "name": "Export Transactions",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"format\": \"csv\",\n  \"startDate\": \"2024-01-01\",\n  \"endDate\": \"2024-12-31\",\n  \"status\": [\"succeeded\", \"refunded\"],\n  \"currency\": \"USD\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/transactions/export",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "transactions", "export"]
            },
            "description": "Export transactions to CSV or Excel"
          }
        }
      ]
    },
    {
      "name": "Customers",
      "description": "Create and manage customer records.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Create Customer",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"john@example.com\",\n  \"phone\": \"+1234567890\",\n  \"firstName\": \"John\",\n  \"lastName\": \"Doe\",\n  \"dateOfBirth\": \"1990-01-15\",\n  \"country\": \"US\",\n  \"metadata\": {\n    \"source\": \"web\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers"]
            },
            "description": "Create a new customer record for tracking payments and transactions"
          }
        },
        {
          "name": "List Customers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "search", "value": "", "description": "Search by name or email", "disabled": true },
                { "key": "status", "value": "active", "description": "Filter: active, blocked", "disabled": true },
                { "key": "riskLevel", "value": "low", "description": "Filter: low, medium, high, critical", "disabled": true },
                { "key": "currency", "value": "USD", "disabled": true }
              ]
            },
            "description": "List customers with filtering and pagination"
          }
        },
        {
          "name": "Get Customer",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers/:customerId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers", ":customerId"],
              "variable": [
                { "key": "customerId", "value": "cus_xxxxx", "description": "Customer ID" }
              ]
            },
            "description": "Get detailed information about a specific customer"
          }
        },
        {
          "name": "Update Customer",
          "request": {
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"john.updated@example.com\",\n  \"phone\": \"+1234567890\",\n  \"firstName\": \"John\",\n  \"lastName\": \"Doe\",\n  \"country\": \"US\",\n  \"metadata\": {\n    \"source\": \"mobile\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers/:customerId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers", ":customerId"],
              "variable": [
                { "key": "customerId", "value": "cus_xxxxx", "description": "Customer ID" }
              ]
            },
            "description": "Update customer details"
          }
        },
        {
          "name": "Customer Transaction History",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers/:customerId/history?limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers", ":customerId", "history"],
              "variable": [
                { "key": "customerId", "value": "cus_xxxxx", "description": "Customer ID" }
              ],
              "query": [
                { "key": "limit", "value": "20" }
              ]
            },
            "description": "Get transaction history for a specific customer"
          }
        },
        {
          "name": "Customer Risk Profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers/:customerId/risk",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers", ":customerId", "risk"],
              "variable": [
                { "key": "customerId", "value": "cus_xxxxx", "description": "Customer ID" }
              ]
            },
            "description": "Get risk assessment for a specific customer"
          }
        },
        {
          "name": "Customer Analytics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers/analytics?currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers", "analytics"],
              "query": [
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get customer analytics and insights"
          }
        },
        {
          "name": "Top Customers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/customers/top?limit=10&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "customers", "top"],
              "query": [
                { "key": "limit", "value": "10" },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get top customers by transaction volume"
          }
        }
      ]
    },
    {
      "name": "Payouts",
      "description": "Create and manage payouts to beneficiaries.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Get Payout Methods",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts/methods",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts", "methods"]
            },
            "description": "Get available payout methods for the merchant"
          }
        },
        {
          "name": "Preview Payout",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 5000,\n  \"currency\": \"USD\",\n  \"country\": \"US\",\n  \"payoutType\": \"bank_transfer\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts/preview",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts", "preview"]
            },
            "description": "Preview payout fees and estimated arrival time before creating"
          }
        },
        {
          "name": "Create Payout",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-Idempotency-Key", "value": "{{$guid}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 5000,\n  \"currency\": \"USD\",\n  \"country\": \"US\",\n  \"payoutType\": \"bank_transfer\",\n  \"customerId\": \"cus_xxxxx\",\n  \"beneficiaryDetails\": {\n    \"accountNumber\": \"1234567890\",\n    \"ifscCode\": \"CHASUS33\",\n    \"accountHolderName\": \"John Doe\",\n    \"email\": \"john@example.com\"\n  },\n  \"metadata\": {\n    \"reason\": \"Weekly settlement\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts"]
            },
            "description": "Create a new payout.\n\nPayout types: bank_transfer, upi, imps, neft, rtgs, mobile_money, wallet"
          }
        },
        {
          "name": "List Payouts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "status", "value": "completed", "description": "Filter: pending, processing, completed, failed", "disabled": true },
                { "key": "currency", "value": "USD", "disabled": true },
                { "key": "payoutType", "value": "bank_transfer", "disabled": true },
                { "key": "fromDate", "value": "2024-01-01", "disabled": true },
                { "key": "toDate", "value": "2024-12-31", "disabled": true },
                { "key": "minAmount", "value": "100", "disabled": true },
                { "key": "maxAmount", "value": "10000", "disabled": true },
                { "key": "customerId", "value": "cus_xxxxx", "disabled": true }
              ]
            },
            "description": "List payouts with filtering and pagination"
          }
        },
        {
          "name": "Get Payout",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts/:payoutId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts", ":payoutId"],
              "variable": [
                { "key": "payoutId", "value": "po_xxxxx", "description": "Payout ID" }
              ]
            },
            "description": "Get details of a specific payout"
          }
        },
        {
          "name": "Retry Failed Payout",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts/:payoutId/retry",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts", ":payoutId", "retry"],
              "variable": [
                { "key": "payoutId", "value": "po_xxxxx", "description": "Payout ID to retry" }
              ]
            },
            "description": "Retry a failed payout, optionally forcing a specific TSP"
          }
        },
        {
          "name": "Payout Statistics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts/stats?fromDate=2024-01-01&toDate=2024-12-31&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts", "stats"],
              "query": [
                { "key": "fromDate", "value": "2024-01-01" },
                { "key": "toDate", "value": "2024-12-31" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get payout statistics for a date range"
          }
        },
        {
          "name": "Export Payouts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/payouts/export?fromDate=2024-01-01&toDate=2024-12-31",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "payouts", "export"],
              "query": [
                { "key": "fromDate", "value": "2024-01-01" },
                { "key": "toDate", "value": "2024-12-31" },
                { "key": "status", "value": "completed", "disabled": true },
                { "key": "currency", "value": "USD", "disabled": true },
                { "key": "payoutType", "value": "bank_transfer", "disabled": true }
              ]
            },
            "description": "Export payouts to CSV or Excel"
          }
        }
      ]
    },
    {
      "name": "Refunds",
      "description": "Create and manage refunds for completed transactions.\n\nRoutes to **Payment Engine** (`/payment/api/v1/`).",
      "item": [
        {
          "name": "Create Refund",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-Idempotency-Key", "value": "{{$guid}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"transactionId\": \"txn_xxxxx\",\n  \"reason\": \"customer_request\",\n  \"amount\": 1000,\n  \"customerId\": \"cus_xxxxx\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/refunds",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "refunds"]
            },
            "description": "Create a refund for a completed transaction.\n\nReasons: customer_request, duplicate_payment, fraudulent, order_cancelled, product_not_received, product_defective, other\n\nOmit `amount` for full refund."
          }
        },
        {
          "name": "List Refunds",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/refunds?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "refunds"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "status", "value": "pending", "description": "Filter: pending, processing, succeeded, failed, cancelled", "disabled": true },
                { "key": "transactionId", "value": "txn_xxxxx", "disabled": true },
                { "key": "customerId", "value": "cus_xxxxx", "disabled": true },
                { "key": "currency", "value": "USD", "disabled": true },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true }
              ]
            },
            "description": "List refunds with filtering and pagination"
          }
        },
        {
          "name": "Get Refund",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/refunds/:refundId",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "refunds", ":refundId"],
              "variable": [
                { "key": "refundId", "value": "ref_xxxxx", "description": "Refund ID" }
              ]
            },
            "description": "Get details of a specific refund"
          }
        },
        {
          "name": "Cancel Refund",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/refunds/:refundId",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "refunds", ":refundId"],
              "variable": [
                { "key": "refundId", "value": "ref_xxxxx", "description": "Refund ID" }
              ]
            },
            "description": "Cancel a pending refund"
          }
        },
        {
          "name": "Refund Statistics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/refunds/stats?startDate=2024-01-01&endDate=2024-12-31&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "refunds", "stats"],
              "query": [
                { "key": "startDate", "value": "2024-01-01" },
                { "key": "endDate", "value": "2024-12-31" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get refund statistics for a date range"
          }
        },
        {
          "name": "Refund Analytics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/payment/api/v1/refunds/analytics?startDate=2024-01-01&endDate=2024-12-31&granularity=daily&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["payment", "api", "v1", "refunds", "analytics"],
              "query": [
                { "key": "startDate", "value": "2024-01-01" },
                { "key": "endDate", "value": "2024-12-31" },
                { "key": "granularity", "value": "daily", "description": "daily, weekly, monthly" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get refund analytics with trends"
          }
        }
      ]
    },
    {
      "name": "Settlements",
      "description": "Manage settlements and bank accounts.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Create Settlement",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 100000,\n  \"currency\": \"USD\",\n  \"bankAccountId\": \"ba_xxxxx\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/create",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "create"]
            },
            "description": "Create a settlement request to withdraw funds to your bank account"
          }
        },
        {
          "name": "List Settlements",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/list?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "list"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "status", "value": "completed", "description": "Filter: pending, processing, completed, failed, cancelled", "disabled": true },
                { "key": "currency", "value": "USD", "disabled": true },
                { "key": "fromDate", "value": "2024-01-01", "disabled": true },
                { "key": "toDate", "value": "2024-12-31", "disabled": true }
              ]
            },
            "description": "List settlements with filtering and pagination"
          }
        },
        {
          "name": "Get Settlement",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/:settlementId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", ":settlementId"],
              "variable": [
                { "key": "settlementId", "value": "stl_xxxxx", "description": "Settlement ID" }
              ]
            },
            "description": "Get details of a specific settlement"
          }
        },
        {
          "name": "Cancel Settlement",
          "request": {
            "method": "PUT",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/:settlementId/cancel",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", ":settlementId", "cancel"],
              "variable": [
                { "key": "settlementId", "value": "stl_xxxxx", "description": "Settlement ID" }
              ]
            },
            "description": "Cancel a pending settlement"
          }
        },
        {
          "name": "Settlement Statistics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/stats/summary?currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "stats", "summary"],
              "query": [
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get settlement statistics summary"
          }
        },
        {
          "name": "List Bank Accounts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/bank-accounts/list",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "bank-accounts", "list"]
            },
            "description": "List all bank accounts configured for settlements"
          }
        },
        {
          "name": "Add Bank Account",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"accountNumber\": \"1234567890\",\n  \"accountHolderName\": \"Acme Inc\",\n  \"ifscCode\": \"CHAS0001234\",\n  \"accountType\": \"checking\",\n  \"isPrimary\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/bank-accounts",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "bank-accounts"]
            },
            "description": "Add a new bank account for settlements"
          }
        },
        {
          "name": "Update Bank Account",
          "request": {
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"accountHolderName\": \"Acme Inc Updated\",\n  \"isPrimary\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/bank-accounts/:accountId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "bank-accounts", ":accountId"],
              "variable": [
                { "key": "accountId", "value": "ba_xxxxx", "description": "Bank account ID" }
              ]
            },
            "description": "Update an existing bank account"
          }
        },
        {
          "name": "Delete Bank Account",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/settlements/bank-accounts/:accountId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "settlements", "bank-accounts", ":accountId"],
              "variable": [
                { "key": "accountId", "value": "ba_xxxxx", "description": "Bank account ID" }
              ]
            },
            "description": "Delete a bank account (cannot delete primary account)"
          }
        }
      ]
    },
    {
      "name": "Wallet",
      "description": "View wallet balances, transactions, and analytics.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Get All Balances",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/wallet/balances",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "wallet", "balances"]
            },
            "description": "Get all wallet balances across currencies"
          }
        },
        {
          "name": "Get Currency Balance",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/wallet/currency/:currency",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "wallet", "currency", ":currency"],
              "variable": [
                { "key": "currency", "value": "USD", "description": "ISO 4217 currency code" }
              ]
            },
            "description": "Get balance for a specific currency"
          }
        },
        {
          "name": "Wallet Summary",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/wallet/summary",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "wallet", "summary"]
            },
            "description": "Get comprehensive wallet summary"
          }
        },
        {
          "name": "Wallet Transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/wallet/:currency/transactions?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "wallet", ":currency", "transactions"],
              "variable": [
                { "key": "currency", "value": "USD", "description": "ISO 4217 currency code" }
              ],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "type", "value": "credit", "description": "Filter: credit, debit", "disabled": true },
                { "key": "status", "value": "completed", "disabled": true },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true },
                { "key": "search", "value": "", "disabled": true }
              ]
            },
            "description": "Get wallet transaction history for a specific currency"
          }
        },
        {
          "name": "Wallet Analytics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/wallet/analytics?currency=USD&granularity=daily",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "wallet", "analytics"],
              "query": [
                { "key": "currency", "value": "USD" },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true },
                { "key": "granularity", "value": "daily", "description": "daily, weekly, monthly" }
              ]
            },
            "description": "Get wallet analytics with trends"
          }
        }
      ]
    },
    {
      "name": "Ledger",
      "description": "Double-entry bookkeeping ledger for financial records.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Ledger Overview",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/overview?currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "overview"],
              "query": [
                { "key": "currency", "value": "USD" },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true }
              ]
            },
            "description": "Get ledger balance overview"
          }
        },
        {
          "name": "Ledger Entries",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/entries?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "entries"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "currency", "value": "USD", "disabled": true },
                { "key": "entryType", "value": "credit", "description": "Filter: credit, debit", "disabled": true },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true }
              ]
            },
            "description": "Get ledger entries with filtering"
          }
        },
        {
          "name": "Ledger Balances",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/balances?currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "balances"],
              "query": [
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get ledger account balances"
          }
        },
        {
          "name": "Ledger Accounts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/accounts?currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "accounts"],
              "query": [
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get all ledger accounts"
          }
        },
        {
          "name": "Ledger Reserves",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/reserves",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "reserves"],
              "query": [
                { "key": "reserveType", "value": "rolling", "description": "Reserve type filter", "disabled": true },
                { "key": "status", "value": "active", "disabled": true }
              ]
            },
            "description": "Get reserve information"
          }
        },
        {
          "name": "Daily Summary",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/summary/daily?date=2024-01-15&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "summary", "daily"],
              "query": [
                { "key": "date", "value": "2024-01-15" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get daily ledger summary for a specific date"
          }
        },
        {
          "name": "Daily Summaries (Range)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/summaries?startDate=2024-01-01&endDate=2024-01-31&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "summaries"],
              "query": [
                { "key": "startDate", "value": "2024-01-01" },
                { "key": "endDate", "value": "2024-01-31" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get daily summaries for a date range"
          }
        },
        {
          "name": "Reconciliation",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/ledger/reconciliation?date=2024-01-15&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "ledger", "reconciliation"],
              "query": [
                { "key": "date", "value": "2024-01-15" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get reconciliation data for a specific date"
          }
        }
      ]
    },
    {
      "name": "Analytics",
      "description": "Dashboard analytics and business insights.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Dashboard Overview",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/analytics/dashboard/overview?period=month&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "analytics", "dashboard", "overview"],
              "query": [
                { "key": "period", "value": "month", "description": "day, week, month, year" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get dashboard analytics overview"
          }
        },
        {
          "name": "Revenue Trends",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/analytics/revenue/trends?granularity=daily&currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "analytics", "revenue", "trends"],
              "query": [
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true },
                { "key": "granularity", "value": "daily", "description": "daily, weekly, monthly" },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get revenue trends over time"
          }
        },
        {
          "name": "Payment Methods Breakdown",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/analytics/payment-methods?currency=USD",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "analytics", "payment-methods"],
              "query": [
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true },
                { "key": "currency", "value": "USD" }
              ]
            },
            "description": "Get payment methods breakdown and distribution"
          }
        },
        {
          "name": "Business Insights",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/analytics/insights",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "analytics", "insights"],
              "query": [
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true },
                { "key": "currency", "value": "USD", "disabled": true }
              ]
            },
            "description": "Get AI-powered business insights and recommendations"
          }
        }
      ]
    },
    {
      "name": "Reports",
      "description": "Generate, download, and manage reports.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Generate Report",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"transactions\",\n  \"format\": \"csv\",\n  \"startDate\": \"2024-01-01T00:00:00.000Z\",\n  \"endDate\": \"2024-01-31T23:59:59.999Z\",\n  \"filters\": {\n    \"status\": [\"succeeded\"],\n    \"currency\": \"USD\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/reports/generate",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "reports", "generate"]
            },
            "description": "Generate a new report.\n\nTypes: transactions, payouts, settlements, refunds, customers\nFormats: csv, xlsx, pdf"
          }
        },
        {
          "name": "List Reports",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/reports?page=1&limit=20",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "reports"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "type", "value": "transactions", "disabled": true },
                { "key": "status", "value": "completed", "description": "pending, processing, completed, failed", "disabled": true },
                { "key": "startDate", "value": "2024-01-01", "disabled": true },
                { "key": "endDate", "value": "2024-12-31", "disabled": true }
              ]
            },
            "description": "List generated reports with filtering"
          }
        },
        {
          "name": "Get Report",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/reports/:reportId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "reports", ":reportId"],
              "variable": [
                { "key": "reportId", "value": "rep_xxxxx", "description": "Report ID" }
              ]
            },
            "description": "Get details and status of a specific report"
          }
        },
        {
          "name": "Download Report",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/reports/:reportId/download",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "reports", ":reportId", "download"],
              "variable": [
                { "key": "reportId", "value": "rep_xxxxx", "description": "Report ID" }
              ]
            },
            "description": "Download a completed report file"
          }
        },
        {
          "name": "Delete Report",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/reports/:reportId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "reports", ":reportId"],
              "variable": [
                { "key": "reportId", "value": "rep_xxxxx", "description": "Report ID" }
              ]
            },
            "description": "Delete a generated report"
          }
        }
      ]
    },
    {
      "name": "Merchant Profile",
      "description": "Merchant profile and settings management.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Get Profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/merchants/profile",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "merchants", "profile"]
            },
            "description": "Get the current merchant's profile information"
          }
        },
        {
          "name": "Update Settings",
          "request": {
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"displayName\": \"My Store\",\n  \"description\": \"Online retail store\",\n  \"webhookUrl\": \"https://mystore.com/webhooks/zenpay\",\n  \"successUrl\": \"https://mystore.com/success\",\n  \"cancelUrl\": \"https://mystore.com/cancel\",\n  \"contactInfo\": {\n    \"email\": \"support@mystore.com\",\n    \"phone\": \"+1234567890\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/merchants/settings",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "merchants", "settings"]
            },
            "description": "Update merchant settings"
          }
        },
        {
          "name": "Get Limits",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/merchants/limits",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "merchants", "limits"]
            },
            "description": "Get the merchant's payment processing limits and current usage"
          }
        }
      ]
    },
    {
      "name": "API Keys",
      "description": "Manage API keys for programmatic access.\n\nRoutes to **Merchant Service** (`/merchant/api/v1/`).",
      "item": [
        {
          "name": "Create API Key",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Production API Key\",\n  \"environment\": \"test\",\n  \"scopes\": [\"payments:create\", \"payments:read\", \"refunds:create\"],\n  \"ipRestrictions\": [\"192.168.1.0/24\"],\n  \"rateLimit\": 1000\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/api-keys",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "api-keys"]
            },
            "description": "Generate a new API key with specified permissions"
          }
        },
        {
          "name": "List API Keys",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/api-keys",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "api-keys"]
            },
            "description": "List all API keys for the merchant"
          }
        },
        {
          "name": "Revoke API Key",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/merchant/api/v1/api-keys/:keyId",
              "host": ["{{baseUrl}}"],
              "path": ["merchant", "api", "v1", "api-keys", ":keyId"],
              "variable": [
                { "key": "keyId", "value": "key_xxxxx", "description": "API key ID to revoke" }
              ]
            },
            "description": "Revoke an existing API key"
          }
        }
      ]
    },
    {
      "name": "Health",
      "description": "Service health and readiness endpoints",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/health",
              "host": ["{{baseUrl}}"],
              "path": ["health"]
            },
            "description": "Check if the API is healthy (no auth required)"
          }
        }
      ]
    }
  ]
}
