{
  "info": {
    "name": "PerfexCRM API v3.0.9 - Full Test Suite",
    "_postman_id": "a6c0f5a8-1e9f-4b8a-9810-0a2b8ee1b0cd",
    "description": "Comprehensive API tests for PerfexCRM API Webhooks module v2.9.3 under /api/v1/*.\n\nCovers 20 resource sections: Customers, Tickets, Invoices, Contracts, Leads, Projects, Expenses, Estimates, Tasks, Staff, Proposals, Subscriptions, Credit Notes, Payments, Items, Contacts, Timesheets, Notes, Utilities/Lookups, and Webhooks.\n\nIncludes 200/201/404/401 flows, full CRUD operations, sub-resources, chained variable tests, and lookup endpoints.\n\nAuthentication: X-API-KEY header. Set the api_key collection variable before running.",
    "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": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Login (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{admin_email}}\",\n  \"password\": \"{{admin_password}}\"\n}"
            },
            "url": "{{base_url}}/api/v1/auth/login"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.token) pm.collectionVariables.set('bearer_token', d.data.token); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Logout (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearer_token}}",
                  "type": "string"
                }
              ]
            },
            "url": "{{base_url}}/api/v1/auth/logout"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Refresh Token (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearer_token}}",
                  "type": "string"
                }
              ]
            },
            "url": "{{base_url}}/api/v1/auth/refresh"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.token) pm.collectionVariables.set('bearer_token', d.data.token); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Verify Token (200)",
          "request": {
            "method": "GET",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearer_token}}",
                  "type": "string"
                }
              ]
            },
            "url": "{{base_url}}/api/v1/auth/verify"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Customers",
      "item": [
        {
          "name": "List Customers (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Customer (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"company\": \"Postman Test Customer\",\n  \"email\": \"postman-test@example.com\",\n  \"phonenumber\": \"+1234567890\",\n  \"custom_fields\": {\n    \"account_tier_slug\": \"Gold\"\n  }\n}"
            },
            "url": "{{base_url}}/api/v1/customers"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.userid) pm.collectionVariables.set('customer_id_created', d.data.userid); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer with includes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}?include=contacts,projects,invoices,estimates,tickets,contracts"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Customer (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phonenumber\": \"+0987654321\"\n}"
            },
            "url": "{{base_url}}/api/v1/customers/{{customer_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer Contacts (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}/contacts"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer Projects (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}/projects"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer Invoices (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}/invoices"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer Estimates (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}/estimates"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer Tickets (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}/tickets"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Customer Contracts (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/customers/{{customer_id}}/contracts"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Customer (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/customers/{{customer_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Tickets",
      "item": [
        {
          "name": "List Tickets (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket (404 expected)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_404}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 404', () => pm.response.code === 404);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Tickets (401 expected - no auth)",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 401', () => pm.response.code === 401);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Ticket (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"subject\": \"{{ticket_subject}}\",\n  \"department\": {{department_id}},\n  \"message\": \"{{ticket_message}}\"\n}"
            },
            "url": "{{base_url}}/api/v1/tickets"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const data = pm.response.json(); if (data && data.data && data.data.ticketid) pm.collectionVariables.set('ticket_id_created', data.data.ticketid); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket with includes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}?include=replies,attachments,history,customer,contact"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Ticket (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"subject\": \"Updated ticket subject\",\n  \"priority\": 3\n}"
            },
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Assign Ticket (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"staff_id\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/assign"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Change Ticket Status (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": 2\n}"
            },
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/status"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket Attachments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/attachments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Upload Ticket Attachment (201)",
          "request": {
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": ""
                },
                {
                  "key": "reply_id",
                  "value": "",
                  "type": "text",
                  "disabled": true
                }
              ]
            },
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/attachments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket History (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/history"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Ticket Replies (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/replies"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Reply to Ticket (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"message\": \"Reply via Postman\"\n}"
            },
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/replies"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201 || pm.response.code === 200);",
                  "try { const data = pm.response.json(); if (data && data.data && data.data.id) pm.collectionVariables.set('reply_id_created', data.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Single Reply (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/replies/{{reply_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Reply (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"message\": \"Updated reply via Postman\"\n}"
            },
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/replies/{{reply_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Reply (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}/replies/{{reply_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Ticket (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/tickets/{{ticket_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Invoices",
      "item": [
        {
          "name": "List Invoices (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/invoices?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.length > 0 && d.data[0].id) pm.collectionVariables.set('invoice_id', d.data[0].id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Invoices with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/invoices?status=1&customer_id={{customer_id}}&per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Invoice (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"clientid\": 1,\n  \"date\": \"2026-02-09\",\n  \"duedate\": \"2026-03-09\",\n  \"items\": [\n    {\n      \"description\": \"Test\",\n      \"qty\": 1,\n      \"rate\": 100\n    }\n  ]\n}"
            },
            "url": "{{base_url}}/api/v1/invoices"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('invoice_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Invoice (200/404)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/invoices/{{invoice_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Invoice (200/404)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"adminnote\": \"Updated via Postman API\"\n}"
            },
            "url": "{{base_url}}/api/v1/invoices/{{invoice_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Send Invoice (200/404/500)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/invoices/{{invoice_id}}/send"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200/404/500', () => [200,404,500].includes(pm.response.code));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Invoice Payments (200/404)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/invoices/{{invoice_id}}/payments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Invoice PDF (200/404)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/invoices/{{invoice_id}}/pdf"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Invoice (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/invoices/{{invoice_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Contracts",
      "item": [
        {
          "name": "List Contracts (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.length > 0 && d.data[0].id) pm.collectionVariables.set('contract_id', d.data[0].id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Contracts with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts?status=active&customer_id={{customer_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Contract (200/404)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts/{{contract_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Contract (200/404)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated via Postman API\"\n}"
            },
            "url": "{{base_url}}/api/v1/contracts/{{contract_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Expiring Contracts (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts/expiring?days=30"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Expired Contracts (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts/expired"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Renew Contract (200/404)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"datestart\": \"2026-03-01\",\n  \"dateend\": \"2027-03-01\"\n}"
            },
            "url": "{{base_url}}/api/v1/contracts/{{contract_id}}/renew"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200/201/404', () => [200,201,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Contract Attachments (200/404)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts/{{contract_id}}/attachments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Sign Contract (200/400/404)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"signature\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg==\",\n  \"firstname\": \"Test\",\n  \"lastname\": \"Signer\",\n  \"email\": \"signer@test.com\"\n}"
            },
            "url": "{{base_url}}/api/v1/contracts/{{contract_id}}/sign"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200/400/404', () => [200,400,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Contract Comments (200/404)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contracts/{{contract_id}}/comments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Contract (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/contracts/{{contract_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Leads",
      "item": [
        {
          "name": "List Leads (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/leads?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Lead (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman Test Lead\",\n  \"email\": \"postman-lead@test.com\",\n  \"phonenumber\": \"+1234567890\",\n  \"source\": 1,\n  \"status\": 1,\n  \"custom_fields\": {\n    \"lead_priority_slug\": \"High\"\n  }\n}"
            },
            "url": "{{base_url}}/api/v1/leads"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('lead_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Lead (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Lead (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phonenumber\": \"+0987654321\"\n}"
            },
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Lead Activities (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}/activities"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Lead Notes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}/notes"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Lead Note (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Note added via Postman API\"\n}"
            },
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}/notes"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Convert Lead (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"transfer_notes\": true\n}"
            },
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}/convert"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Lead (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/leads/{{lead_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Projects",
      "item": [
        {
          "name": "List Projects (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Project (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman Test Project\",\n  \"clientid\": {{customer_id}},\n  \"start_date\": \"2026-02-10\",\n  \"status\": 1,\n  \"custom_fields\": {\n    \"21\": \"BUD-001\",\n    \"phase_slug\": \"Build\"\n  }\n}"
            },
            "url": "{{base_url}}/api/v1/projects"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('project_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project with custom fields (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}?include=custom_fields"
          }
        },
        {
          "name": "Update Project (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated via Postman\",\n  \"custom_fields\": {\n    \"phase_slug\": \"Launch\"\n  }\n}"
            },
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project Tasks (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}/tasks"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project Milestones (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}/milestones"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project Files (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}/files"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project Discussions (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}/discussions"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Project Activity (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}/activity"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Project (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/projects/{{project_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Expenses",
      "item": [
        {
          "name": "List Expenses (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/expenses?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Expenses with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/expenses?category=1&billable=1"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Expense (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"category\": 1,\n  \"amount\": 150,\n  \"date\": \"2026-02-09\",\n  \"note\": \"Postman test\"\n}"
            },
            "url": "{{base_url}}/api/v1/expenses"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('expense_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Expense (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/expenses/{{expense_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Expense (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 200\n}"
            },
            "url": "{{base_url}}/api/v1/expenses/{{expense_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Categories (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/expenses/categories"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Expense (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/expenses/{{expense_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Estimates",
      "item": [
        {
          "name": "List Estimates (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/estimates?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Estimate (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"clientid\": 1,\n  \"date\": \"2026-02-09\",\n  \"items\": [\n    {\n      \"description\": \"Test\",\n      \"qty\": 1,\n      \"rate\": 100\n    }\n  ]\n}"
            },
            "url": "{{base_url}}/api/v1/estimates"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('estimate_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Estimate (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/estimates/{{estimate_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Estimate (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": 2\n}"
            },
            "url": "{{base_url}}/api/v1/estimates/{{estimate_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get PDF (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/estimates/{{estimate_id_created}}/pdf"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Send Estimate (200/500)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/estimates/{{estimate_id_created}}/send"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 500', () => [200,500].includes(pm.response.code));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Convert Estimate to Invoice (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"draft\": false\n}"
            },
            "url": "{{base_url}}/api/v1/estimates/{{estimate_id_created}}/convert"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 400', () => [200,400].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Estimate (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/estimates/{{estimate_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Tasks",
      "item": [
        {
          "name": "List Tasks (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Task (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Postman Test Task\",\n  \"startdate\": \"2026-02-09\",\n  \"priority\": 2\n}"
            },
            "url": "{{base_url}}/api/v1/tasks"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('task_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Task (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Task with includes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}?include=comments,checklist,assignees,followers"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Task (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated\"\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Assign Task (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"staff_id\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/assign"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Change Status (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": 4\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/status"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Change Priority (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"priority\": 3\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/priority"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Mark Complete (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/mark-complete"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Comment (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": \"Test comment\"\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/comments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Timesheets (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/timesheets"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Timesheet (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"start_time\": 1739429400,\n  \"end_time\": 1739433000,\n  \"staff_id\": 1,\n  \"note\": \"Test timesheet entry\"\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/timesheets"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Checklist (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/checklist"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Checklist Item (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Checklist item\"\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/checklist"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Followers (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/followers"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Follower (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"staff_id\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/followers"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Remove Follower (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/followers/1"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Comments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/comments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Checklist Item (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/checklist/1"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Checklist Item (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated checklist item\",\n  \"finished\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/checklist/1"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Checklist Item (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/checklist/1"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 404', () => [200,404].includes(pm.response.code));",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Attachments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/attachments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Upload Task Attachment (201)",
          "request": {
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": ""
                }
              ]
            },
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}/attachments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Task (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/tasks/{{task_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Staff",
      "item": [
        {
          "name": "List Staff (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Staff (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"firstname\": \"Test\",\n  \"lastname\": \"Staff\",\n  \"email\": \"postman@test.com\",\n  \"password\": \"TestPass123!\"\n}"
            },
            "url": "{{base_url}}/api/v1/staff"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('staff_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Staff (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Staff (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phonenumber\": \"+1234567890\"\n}"
            },
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Permissions (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/permissions"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Permissions (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"permissions\": [1, 2, 5, 8]\n}"
            },
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/permissions"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Staff Departments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/departments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Staff Departments (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"departments\": [1, 3]\n}"
            },
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/departments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Staff Tasks (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/tasks"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Staff Timesheets (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/timesheets"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Deactivate (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/deactivate"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Activate (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/activate"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Change Password (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"new_password\": \"NewPass456!\",\n  \"confirm_password\": \"NewPass456!\"\n}"
            },
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}/change-password"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Roles (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/roles"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Departments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/staff/department-list"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Staff (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/staff/{{staff_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Proposals",
      "item": [
        {
          "name": "List Proposals (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/proposals?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Proposal (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"subject\": \"Postman Proposal\",\n  \"date\": \"2026-02-09\",\n  \"status\": 6,\n  \"items\": [\n    {\n      \"description\": \"Test\",\n      \"qty\": 1,\n      \"rate\": 100\n    }\n  ]\n}"
            },
            "url": "{{base_url}}/api/v1/proposals"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('proposal_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Proposal (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Proposal (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Send Proposal (200/500)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"attach_pdf\": true,\n  \"cc\": \"\"\n}"
            },
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}/send"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200 or 500', () => [200,500].includes(pm.response.code));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Accept (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}/accept"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Decline (200)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}/decline"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get PDF (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}/pdf"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Comments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}/comments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Comment (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": \"Test\"\n}"
            },
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}/comments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Proposal (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/proposals/{{proposal_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Subscriptions",
      "item": [
        {
          "name": "List Subscriptions (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/subscriptions?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Subscription (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Test Sub\",\n  \"clientid\": 1,\n  \"currency\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/subscriptions"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('subscription_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Subscription (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/subscriptions/{{subscription_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get with includes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/subscriptions/{{subscription_id_created}}?include=invoices,customer"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Subscription (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quantity\": 2\n}"
            },
            "url": "{{base_url}}/api/v1/subscriptions/{{subscription_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Subscription (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/subscriptions/{{subscription_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Credit Notes",
      "item": [
        {
          "name": "List Credit Notes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/credit-notes?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Credit Note (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"clientid\": 1,\n  \"date\": \"2026-02-09\",\n  \"items\": [\n    {\n      \"description\": \"Credit\",\n      \"qty\": 1,\n      \"rate\": 50\n    }\n  ]\n}"
            },
            "url": "{{base_url}}/api/v1/credit-notes"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('credit_note_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Credit Note (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get with includes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}?include=refunds,credits"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Credit Note (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Refunds (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}/refunds"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Add Refund (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 50.00,\n  \"refunded_on\": \"2026-02-13\",\n  \"payment_mode\": \"bank_transfer\",\n  \"note\": \"Test refund\"\n}"
            },
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}/refunds"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Credits (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}/credits"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Apply Credit to Invoice (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoice_id\": 1,\n  \"amount\": 25.00\n}"
            },
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}/credits"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get PDF (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}/pdf"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Credit Note (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/credit-notes/{{credit_note_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Payments",
      "item": [
        {
          "name": "List Payments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/payments?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Payments with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/payments?invoice_id={{invoice_id}}&date_from=2026-01-01&date_to=2026-12-31&sort_by=date&sort_order=desc"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Payment (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoiceid\": 1,\n  \"amount\": 250.00,\n  \"date\": \"2026-02-10\",\n  \"paymentmode\": \"Bank\",\n  \"note\": \"Payment via API\",\n  \"transactionid\": \"TXN-PM-001\"\n}"
            },
            "url": "{{base_url}}/api/v1/payments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('payment_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Payment (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/payments/{{payment_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Payment (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 300.00,\n  \"note\": \"Updated payment note\",\n  \"transactionid\": \"TXN-PM-002\"\n}"
            },
            "url": "{{base_url}}/api/v1/payments/{{payment_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Payment (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/payments/{{payment_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Items",
      "item": [
        {
          "name": "List Items (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/items?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Items with group filter (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/items?group_id=1&sort_by=rate&sort_order=desc"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Item (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Postman Test Item\",\n  \"rate\": 99.50,\n  \"tax\": 24,\n  \"tax2\": 0,\n  \"unit\": \"pcs\",\n  \"group_id\": 1,\n  \"long_description\": \"A test item created via Postman API\"\n}"
            },
            "url": "{{base_url}}/api/v1/items"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('item_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Item (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/items/{{item_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Item (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated Postman Item\",\n  \"rate\": 149.99\n}"
            },
            "url": "{{base_url}}/api/v1/items/{{item_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Item Groups (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/items/groups"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Item (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/items/{{item_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Contacts",
      "item": [
        {
          "name": "List Contacts (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contacts?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Contacts with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contacts?customer_id={{customer_id}}&active=1&is_primary=0&sort_by=firstname&sort_order=asc"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Contact (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userid\": 1,\n  \"firstname\": \"John\",\n  \"lastname\": \"Postman\",\n  \"email\": \"john.postman@example.com\",\n  \"phonenumber\": \"+306912345678\",\n  \"title\": \"API Tester\",\n  \"password\": \"TestPass123!\",\n  \"is_primary\": 0,\n  \"active\": 1,\n  \"direction\": \"ltr\"\n}"
            },
            "url": "{{base_url}}/api/v1/contacts"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('contact_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Contact (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contacts/{{contact_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Contact (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"firstname\": \"Jane\",\n  \"lastname\": \"Updated\",\n  \"phonenumber\": \"+306987654321\",\n  \"title\": \"Senior API Tester\"\n}"
            },
            "url": "{{base_url}}/api/v1/contacts/{{contact_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Contact (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/contacts/{{contact_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Timesheets",
      "item": [
        {
          "name": "List Timesheets (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/timesheets?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Timesheets with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/timesheets?task_id={{task_id_created}}&staff_id=1&sort_by=start_time&sort_order=desc"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Timesheet (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"task_id\": 1,\n  \"staff_id\": 1,\n  \"start_time\": \"2026-02-10 09:00:00\",\n  \"end_time\": \"2026-02-10 17:00:00\",\n  \"hourly_rate\": 50.00,\n  \"note\": \"Full day work via API\"\n}"
            },
            "url": "{{base_url}}/api/v1/timesheets"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('timesheet_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Timesheet (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/timesheets/{{timesheet_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Timesheet (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"end_time\": \"2026-02-10 18:30:00\",\n  \"hourly_rate\": 55.00,\n  \"note\": \"Extended work hours\"\n}"
            },
            "url": "{{base_url}}/api/v1/timesheets/{{timesheet_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Timesheet (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/timesheets/{{timesheet_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Notes",
      "item": [
        {
          "name": "List Notes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/notes?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Notes with filters (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/notes?rel_type=customer&rel_id={{customer_id}}&sort_by=dateadded&sort_order=desc"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Note (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"rel_type\": \"customer\",\n  \"rel_id\": 1,\n  \"description\": \"Note created via Postman API test\"\n}"
            },
            "url": "{{base_url}}/api/v1/notes"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.id) pm.collectionVariables.set('note_id_created', d.data.id); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Note (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/notes/{{note_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Note (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated note content via Postman API\"\n}"
            },
            "url": "{{base_url}}/api/v1/notes/{{note_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Note (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/notes/{{note_id_created}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Knowledge Base",
      "item": [
        {
          "name": "List Articles (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/knowledge-base?per_page={{per_page}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Group (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"Postman Test KB Group\",\n    \"description\": \"A test knowledge base group created via Postman\",\n    \"color\": \"#FF8800\",\n    \"group_order\": 1,\n    \"active\": true\n}"
            },
            "url": "{{base_url}}/api/v1/knowledge-base/groups"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.groupid) pm.collectionVariables.set('kb_group_id', d.data.groupid); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Create Article (201)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"subject\": \"Postman Test Article\",\n    \"description\": \"<p>A test knowledge base article created via Postman.</p>\",\n    \"articlegroup\": \"{{kb_group_id}}\",\n    \"active\": true,\n    \"staff_article\": false,\n    \"article_order\": 1\n}"
            },
            "url": "{{base_url}}/api/v1/knowledge-base"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 201', () => pm.response.code === 201);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));",
                  "try { const d = pm.response.json(); if (d && d.data && d.data.articleid) pm.collectionVariables.set('kb_article_id', d.data.articleid); } catch(e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Article (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/knowledge-base/{{kb_article_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Article (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"subject\": \"Updated Postman Article\",\n    \"active\": false\n}"
            },
            "url": "{{base_url}}/api/v1/knowledge-base/{{kb_article_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "List Groups (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/knowledge-base/groups"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Group (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/knowledge-base/groups/{{kb_group_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Update Group (200)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"Updated Postman KB Group\",\n    \"color\": \"#00AAFF\"\n}"
            },
            "url": "{{base_url}}/api/v1/knowledge-base/groups/{{kb_group_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Group with Articles (409)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/knowledge-base/groups/{{kb_group_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 409', () => pm.response.code === 409);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Article (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/knowledge-base/{{kb_article_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Group (200)",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/api/v1/knowledge-base/groups/{{kb_group_id}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Utilities & Lookups",
      "item": [
        {
          "name": "Get Currencies (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/currencies"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Taxes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/taxes"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Departments (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/departments"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Payment Modes (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/payment-modes"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Countries (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/countries"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Search Countries (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/countries?search=Greece"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket Statuses (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/ticket-statuses"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Ticket Priorities (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/ticket-priorities"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Lead Statuses (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/lead-statuses"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Lead Sources (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/lead-sources"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Contract Types (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/contract-types"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Get Item Groups (200)",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/api/v1/item-groups"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status 200', () => pm.response.code === 200);",
                  "pm.test('JSON', () => (pm.response.headers.get('Content-Type')||'').includes('application/json'));"
                ],
                "type": "text/javascript"
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "Webhook testing is admin-panel only (Admin > API Webhooks > Webhooks > Test). There is no public API endpoint for webhook testing.",
      "item": []
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "http://perfex.test"
    },
    {
      "key": "api_key",
      "value": ""
    },
    {
      "key": "per_page",
      "value": "5"
    },
    {
      "key": "customer_id",
      "value": "1"
    },
    {
      "key": "customer_id_created",
      "value": ""
    },
    {
      "key": "ticket_id_404",
      "value": "999999"
    },
    {
      "key": "department_id",
      "value": "1"
    },
    {
      "key": "ticket_subject",
      "value": "Postman test ticket"
    },
    {
      "key": "ticket_message",
      "value": "Created via Postman"
    },
    {
      "key": "ticket_id_created",
      "value": ""
    },
    {
      "key": "reply_id_created",
      "value": ""
    },
    {
      "key": "invoice_id",
      "value": "1"
    },
    {
      "key": "contract_id",
      "value": "1"
    },
    {
      "key": "lead_id_created",
      "value": ""
    },
    {
      "key": "project_id_created",
      "value": ""
    },
    {
      "key": "expense_id_created",
      "value": ""
    },
    {
      "key": "estimate_id_created",
      "value": ""
    },
    {
      "key": "task_id_created",
      "value": ""
    },
    {
      "key": "staff_id_created",
      "value": ""
    },
    {
      "key": "proposal_id_created",
      "value": ""
    },
    {
      "key": "subscription_id_created",
      "value": ""
    },
    {
      "key": "credit_note_id_created",
      "value": ""
    },
    {
      "key": "payment_id_created",
      "value": ""
    },
    {
      "key": "item_id_created",
      "value": ""
    },
    {
      "key": "contact_id_created",
      "value": ""
    },
    {
      "key": "timesheet_id_created",
      "value": ""
    },
    {
      "key": "note_id_created",
      "value": ""
    },
    {
      "key": "admin_email",
      "value": "admin@admin.com"
    },
    {
      "key": "admin_password",
      "value": ""
    },
    {
      "key": "bearer_token",
      "value": ""
    },
    {
      "key": "invoice_id_created",
      "value": ""
    },
    {
      "key": "contract_id_created",
      "value": ""
    },
    {
      "key": "kb_group_id",
      "value": ""
    },
    {
      "key": "kb_article_id",
      "value": ""
    }
  ]
}