{
  "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\": \"Example Trading Co.\",\n  \"bank_name\": \"Demo Bank\",\n  \"account_number\": \"000123456789\",\n  \"swift_code\": \"DEMOUS33\",\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\": \"Example Trading Co.\",\n  \"company_name\": \"Example Trading Co.\",\n  \"email\": \"ap@example.test\",\n  \"phone\": \"+1555010100\",\n  \"address\": \"123 Example Street\\nTestville TS 10001\"\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_number\": \"INV-TEST-1001\",\n  \"invoice_type\": \"commercial\",\n  \"awb\": \"AWB-TEST-0001\",\n  \"issue_date\": \"2026-05-14\",\n  \"due_date\": \"2026-05-28\",\n  \"tax_enabled\": false,\n  \"status\": \"pending\",\n  \"items\": [\n    {\n      \"name\": \"Sample consulting package\",\n      \"description\": \"Demonstration line item\",\n      \"quantity\": 1,\n      \"unit_price\": 1500\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"
          }
        }
      ]
    },
    {
      "name": "Statements",
      "item": [
        {
          "name": "Create Statement",
          "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  \"as_of_date\": \"2026-06-25\",\n  \"invoice_from_date\": \"2026-06-01\",\n  \"invoice_to_date\": \"2026-06-30\",\n  \"invoice_ids\": [101, 104, 108],\n  \"notes\": \"Please review the attached statement package.\"\n}"
            },
            "url": "{{base_url}}/customers/12/statements"
          }
        },
        {
          "name": "Get Statement",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/statements/55"
          }
        },
        {
          "name": "Download Statement PDF",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/statements/55/pdf"
          }
        },
        {
          "name": "Email Statement Package",
          "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  \"email\": \"accounts@example.com\",\n  \"message\": \"Attached is your latest statement package.\"\n}"
            },
            "url": "{{base_url}}/statements/55/email"
          }
        }
      ]
    }
  ]
}
