{
  "info": {
    "name": "RushPay Core API v2",
    "description": "RushPay Core v2 REST API. Set the collection variables baseUrl, apiKey, accessToken, and widgetSession before sending requests. Merchant server routes use X-API-Key; widget routes use X-RushPay-Widget-Session; dashboard routes use Bearer access tokens.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "https://core.rushpay.cash", "type": "string" },
    { "key": "apiKey", "value": "YOUR_API_KEY_HERE", "type": "string" },
    { "key": "accessToken", "value": "YOUR_ACCESS_TOKEN", "type": "string" },
    { "key": "widgetSession", "value": "YOUR_WIDGET_SESSION_TOKEN", "type": "string" },
    { "key": "paymentReference", "value": "API1710000000000000123456", "type": "string" }
  ],
  "item": [
    {
      "name": "Merchant Applications",
      "item": [
        {
          "name": "Create application",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{accessToken}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/applications", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "applications"] },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"My Store\",\n  \"description\": \"Production checkout\",\n  \"webhook_url\": \"https://store.example/webhooks/rushpay\"\n}"
            }
          }
        },
        {
          "name": "List applications",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{accessToken}}" } ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/applications", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "applications"] }
          }
        },
        {
          "name": "Revoke application",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{accessToken}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/applications/revoke", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "applications", "revoke"] },
            "body": { "mode": "raw", "raw": "{\n  \"public_id\": \"app_xxxxxxxx\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Merchant Payments",
      "item": [
        {
          "name": "Create payment",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key", "value": "{{apiKey}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/payments/create", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "payments", "create"] },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": \"149.99\",\n  \"description\": \"Order #1042\",\n  \"callback_url\": \"https://store.example/webhooks/rushpay\",\n  \"metadata\": {\n    \"order_id\": \"1042\",\n    \"customer_email\": \"ama@example.com\"\n  }\n}"
            }
          }
        },
        {
          "name": "Create widget session",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key", "value": "{{apiKey}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/payments/widget-session", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "payments", "widget-session"] },
            "body": { "mode": "raw", "raw": "{\n  \"payment_reference\": \"{{paymentReference}}\"\n}" }
          }
        },
        {
          "name": "Update merchant metadata",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-API-Key", "value": "{{apiKey}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/payments/update-merchant", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "payments", "update-merchant"] },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"payment_reference\": \"{{paymentReference}}\",\n  \"description\": \"Order #1042 - paid checkout\",\n  \"metadata\": { \"order_id\": \"1042\", \"platform\": \"woocommerce\" }\n}"
            }
          }
        },
        {
          "name": "Get payment status",
          "request": {
            "method": "GET",
            "header": [ { "key": "X-API-Key", "value": "{{apiKey}}" } ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/merchant/payments/status?payment_reference={{paymentReference}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "merchant", "payments", "status"],
              "query": [ { "key": "payment_reference", "value": "{{paymentReference}}" } ]
            }
          }
        },
        {
          "name": "Get widget context",
          "request": {
            "method": "GET",
            "header": [ { "key": "X-RushPay-Widget-Session", "value": "{{widgetSession}}" } ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/payments/widget-context", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "payments", "widget-context"] }
          }
        },
        {
          "name": "Validate gift card",
          "request": {
            "method": "POST",
            "header": [
              { "key": "X-RushPay-Widget-Session", "value": "{{widgetSession}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/payments/validate-giftcard", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "payments", "validate-giftcard"] },
            "body": { "mode": "raw", "raw": "{\n  \"giftcard_code\": \"RRC-XXXX-XXXX\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Wallet & Platform",
      "item": [
        {
          "name": "Get merchant balance",
          "request": {
            "method": "GET",
            "header": [ { "key": "X-API-Key", "value": "{{apiKey}}" } ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/balance", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "balance"] }
          }
        },
        {
          "name": "List merchant transactions",
          "request": {
            "method": "GET",
            "header": [ { "key": "X-API-Key", "value": "{{apiKey}}" } ],
            "url": { "raw": "{{baseUrl}}/api/v1/merchant/transactions", "host": ["{{baseUrl}}"], "path": ["api", "v1", "merchant", "transactions"] }
          }
        },
        {
          "name": "Initiate deposit",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{accessToken}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/deposits/initiate", "host": ["{{baseUrl}}"], "path": ["api", "v1", "deposits", "initiate"] },
            "body": { "mode": "raw", "raw": "{\n  \"amount\": \"50.00\",\n  \"channel\": \"mobile_money\"\n}" }
          }
        },
        {
          "name": "Create transfer",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{accessToken}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/transfers", "host": ["{{baseUrl}}"], "path": ["api", "v1", "transfers"] },
            "body": { "mode": "raw", "raw": "{\n  \"recipient\": \"0241234567\",\n  \"amount\": \"20.00\",\n  \"pin\": \"0000\"\n}" }
          }
        },
        {
          "name": "Initiate withdrawal",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{accessToken}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "url": { "raw": "{{baseUrl}}/api/v1/withdrawals/initiate", "host": ["{{baseUrl}}"], "path": ["api", "v1", "withdrawals", "initiate"] },
            "body": { "mode": "raw", "raw": "{\n  \"amount\": \"100.00\",\n  \"destination\": \"mobile_money\",\n  \"pin\": \"0000\"\n}" }
          }
        },
        {
          "name": "List user transactions",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{accessToken}}" } ],
            "url": { "raw": "{{baseUrl}}/api/v1/transactions", "host": ["{{baseUrl}}"], "path": ["api", "v1", "transactions"] }
          }
        }
      ]
    }
  ]
}
