{
  "info": {
    "name": "Crownline Global Payment API",
    "description": "Endpoints for creating payments, checking status, and testing webhooks.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://api.crownlineglobal.co.uk" },
    { "key": "api_key", "value": "YOUR_API_KEY_HERE" }
  ],
  "item": [
    {
      "name": "Create Payment (API)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Authorization", "value": "Bearer {{api_key}}" },
          { "key": "Content-Type", "value": "application/json" }
        ],
        "url": {
          "raw": "{{base_url}}/api/payments/create",
          "host": ["{{base_url}}"],
          "path": ["api", "payments", "create"]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"merchantOrderId\": \"ORDER-1001\",\n  \"amount\": 150000,\n  \"countryCode\": \"IDN\",\n  \"currency\": \"Rp\",\n  \"language\": \"ID\",\n  \"paymentMethodCode\": \"BNIVA\",\n  \"notificationUrl\": \"https://yourshop.com/webhooks/payment\",\n  \"customerName\": \"Jane Doe\",\n  \"customerEmail\": \"jane@example.com\",\n  \"customerPhone\": \"081234567890\",\n  \"productName\": \"Order #1001\"\n}"
        }
      }
    },
    {
      "name": "Create Payment (Hosted Page / H5)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Authorization", "value": "Bearer {{api_key}}" },
          { "key": "Content-Type", "value": "application/json" }
        ],
        "url": {
          "raw": "{{base_url}}/api/payments/create-h5",
          "host": ["{{base_url}}"],
          "path": ["api", "payments", "create-h5"]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"merchantOrderId\": \"ORDER-1002\",\n  \"amount\": 150000,\n  \"countryCode\": \"IDN\",\n  \"currency\": \"Rp\",\n  \"language\": \"ID\",\n  \"paymentMethodCode\": \"BNIVA\",\n  \"notificationUrl\": \"https://yourshop.com/webhooks/payment\",\n  \"customerName\": \"Jane Doe\",\n  \"customerEmail\": \"jane@example.com\",\n  \"customerPhone\": \"081234567890\",\n  \"productName\": \"Order #1002\"\n}"
        }
      }
    },
    {
      "name": "Check Payment Status",
      "request": {
        "method": "GET",
        "header": [
          { "key": "Authorization", "value": "Bearer {{api_key}}" }
        ],
        "url": {
          "raw": "{{base_url}}/api/payments/status?merchantOrderId=ORDER-1001",
          "host": ["{{base_url}}"],
          "path": ["api", "payments", "status"],
          "query": [
            { "key": "merchantOrderId", "value": "ORDER-1001" }
          ]
        }
      }
    }
  ]
}
