{
  "info": {
    "name": "InvoiceGen API",
    "_postman_id": "d5d7fc89-5e57-4f85-b6d0-e230de827f68",
    "description": "Starter collection for InvoiceGen ERP integrations.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8000/api/v1"
    },
    {
      "key": "token",
      "value": "replace-with-api-key"
    },
    {
      "key": "request_id",
      "value": "erp-sync-20260514-0001"
    }
  ],
  "item": [
    {
      "name": "Payment Information",
      "item": [
        {
          "name": "List Payment Profiles",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/payment-information"
          }
        },
        {
          "name": "Create Payment Profile",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"currency\": \"USD\",\n  \"account_name\": \"InvoiceGen LLC\",\n  \"bank_name\": \"I&M Bank\",\n  \"account_number\": \"00105089851250\",\n  \"swift_code\": \"IMBLKENA\",\n  \"instructions\": \"Use invoice number as payment reference.\",\n  \"is_default\": true\n}"
            },
            "url": "{{base_url}}/payment-information"
          }
        }
      ]
    },
    {
      "name": "Customers",
      "item": [
        {
          "name": "Create Customer",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"AGRO LINK LTD\",\n  \"company_name\": \"AGRO LINK LTD\",\n  \"email\": \"billing@agrolink.test\",\n  \"phone\": \"+254700000000\",\n  \"address\": \"46 WATTS GROVE\\nLONDON E3 3RE\"\n}"
            },
            "url": "{{base_url}}/customers"
          }
        }
      ]
    },
    {
      "name": "Invoices",
      "item": [
        {
          "name": "Create Invoice",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" },
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "{{request_id}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"customer_id\": 12,\n  \"payment_information_id\": 3,\n  \"invoice_type\": \"commercial\",\n  \"awb\": \"176-12345675\",\n  \"issue_date\": \"2026-05-14\",\n  \"due_date\": \"2026-05-28\",\n  \"tax_enabled\": false,\n  \"status\": \"pending\",\n  \"items\": [\n    {\n      \"description\": \"Green chili\",\n      \"quantity\": 120,\n      \"unit_price\": 19.5\n    }\n  ]\n}"
            },
            "url": "{{base_url}}/invoices"
          }
        },
        {
          "name": "List Invoices",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/invoices"
          }
        }
      ]
    }
  ]
}
