{
  "info": {
    "name": "Volr Checkout API",
    "description": "Complete API collection for Volr Checkout — stablecoin payment checkout creation, management, refunds, and webhooks.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{server_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.volr.io",
      "type": "string"
    },
    {
      "key": "server_key",
      "value": "volr_server_YOUR_KEY_HERE",
      "type": "string"
    },
    {
      "key": "checkout_id",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Checkouts",
      "item": [
        {
          "name": "Create Checkout",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 201) {",
                  "  const body = pm.response.json();",
                  "  pm.collectionVariables.set('checkout_id', body.id);",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chainId\": 8453,\n  \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n  \"merchantAddress\": \"0xYOUR_WALLET_ADDRESS\",\n  \"amount\": \"10000000\",\n  \"itemName\": \"Premium Plan\",\n  \"itemDescription\": \"Monthly subscription\",\n  \"referenceId\": \"order_123\",\n  \"expiryMinutes\": 30,\n  \"successUrl\": \"https://yoursite.com/success\",\n  \"cancelUrl\": \"https://yoursite.com/cancel\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/v1/checkouts",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts"]
            },
            "description": "Create a new checkout session. The customer will be directed to pay the specified amount in the chosen token."
          }
        },
        {
          "name": "Create Checkout (Fiat Amount)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chainId\": 8453,\n  \"tokenAddress\": \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\n  \"merchantAddress\": \"0xYOUR_WALLET_ADDRESS\",\n  \"fiatAmount\": \"25.00\",\n  \"fiatCurrency\": \"USD\",\n  \"itemName\": \"Concert Ticket\",\n  \"referenceId\": \"ticket_456\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/v1/checkouts",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts"]
            },
            "description": "Create a checkout with a fiat amount. The API automatically converts to the equivalent token amount."
          }
        },
        {
          "name": "List Checkouts",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/checkouts?take=20&skip=0",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts"],
              "query": [
                { "key": "take", "value": "20" },
                { "key": "skip", "value": "0" },
                { "key": "status", "value": "PAID", "disabled": true },
                { "key": "referenceId", "value": "order_123", "disabled": true }
              ]
            },
            "description": "List checkouts for your project. Filter by status or reference ID."
          }
        },
        {
          "name": "Get Checkout",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/checkouts/{{checkout_id}}",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts", "{{checkout_id}}"]
            },
            "description": "Get detailed information about a specific checkout."
          }
        },
        {
          "name": "Cancel Checkout",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/v1/checkouts/{{checkout_id}}/cancel",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts", "{{checkout_id}}", "cancel"]
            },
            "description": "Cancel a pending checkout. Only checkouts with PENDING status can be cancelled."
          }
        }
      ]
    },
    {
      "name": "Refunds",
      "item": [
        {
          "name": "Create Refund",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": \"10000000\",\n  \"reason\": \"Customer requested refund\",\n  \"refundType\": \"CANCELLATION\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/v1/checkouts/{{checkout_id}}/refunds",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts", "{{checkout_id}}", "refunds"]
            },
            "description": "Request a refund for a paid checkout."
          }
        },
        {
          "name": "List Refunds",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v1/checkouts/{{checkout_id}}/refunds",
              "host": ["{{base_url}}"],
              "path": ["v1", "checkouts", "{{checkout_id}}", "refunds"]
            },
            "description": "List all refunds for a specific checkout."
          }
        }
      ]
    }
  ]
}
