{
  "info": {
    "name": "Payroll Pipeline API",
    "description": "Complete API collection for Payroll Pipeline management system including Payroll Runs, Salary Slips, and Payment Processing",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.0.0",
    "_postman_id": "payroll-pipeline-api-collection"
  },
  "item": [
    {
      "name": "Payroll Runs",
      "item": [
        {
          "name": "List All Payroll Runs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs?per_page=15&page=1&status=approved",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs"],
              "query": [
                {
                  "key": "per_page",
                  "value": "15"
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "status",
                  "value": "approved",
                  "disabled": true
                },
                {
                  "key": "department_id",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "company_id",
                  "value": "1",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "company_id", "value": "1", "type": "text" },
                { "key": "department_id", "value": "2", "type": "text" },
                { "key": "period_from", "value": "2024-01-01", "type": "text" },
                { "key": "period_to", "value": "2024-01-31", "type": "text" },
                { "key": "employee_ids[0]", "value": "1", "type": "text" },
                { "key": "employee_ids[1]", "value": "2", "type": "text" },
                { "key": "components[basic]", "value": "1", "type": "text" },
                { "key": "components[allowances]", "value": "1", "type": "text" },
                { "key": "components[deductions]", "value": "1", "type": "text" },
                { "key": "components[rewards]", "value": "1", "type": "text" },
                { "key": "components[penalties]", "value": "0", "type": "text" },
                { "key": "components[overtime]", "value": "1", "type": "text" },
                { "key": "components[tax]", "value": "1", "type": "text" },
                { "key": "notes", "value": "January 2024 payroll run", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs"]
            }
          },
          "response": [
            {
              "name": "Validation error - invalid department / missing components",
              "originalRequest": {
                "method": "POST",
                "header": [
                  { "key": "Accept", "value": "application/json" }
                ],
                "body": {
                  "mode": "formdata",
                  "formdata": [
                    { "key": "company_id", "value": "1", "type": "text" },
                    { "key": "department_id", "value": "999", "type": "text" }
                  ]
                },
                "url": { "raw": "{{BASE_URL}}/payroll/runs", "host": ["{{BASE_URL}}"], "path": ["payroll", "runs"] }
              },
              "status": "Unprocessable Entity",
              "code": 422,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"ok\": false,\n  \"code\": 422,\n  \"message\": \"The selected department id is invalid.\",\n  \"direct\": null,\n  \"data\": {\n    \"department_id\": [\n      \"The selected department id is invalid.\"\n    ],\n    \"components.rewards\": [\n      \"The components.rewards field is required.\"\n    ],\n    \"components.penalties\": [\n      \"The components.penalties field is required.\"\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "Get Payroll Run Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1"]
            }
          },
          "response": []
        },
        {
          "name": "Validate Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/validate",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "validate"]
            }
          },
          "response": []
        },
        {
          "name": "Submit Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/submit",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "submit"]
            }
          },
          "response": []
        },
        {
          "name": "Approve Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/approve",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "approve"]
            }
          },
          "response": []
        },
        {
          "name": "Reject Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "rejection_reason", "value": "Incomplete salary data for some employees", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/reject",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "reject"]
            }
          },
          "response": []
        },
        {
          "name": "Get Payroll Run Salary Slips",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/salary-slips?page=1&per_page=20",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "salary-slips"],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "per_page",
                  "value": "20"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Payroll Run Validations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/validations?page=1&per_page=20",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "validations"],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "per_page",
                  "value": "20"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Payroll Run Payment Records",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1/payment-records?page=1&per_page=20",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1", "payment-records"],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "per_page",
                  "value": "20"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Delete Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "_method", "value": "DELETE", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/runs/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "runs", "1"]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Salary Slips",
      "item": [
        {
          "name": "List All Salary Slips",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips?per_page=15&page=1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips"],
              "query": [
                {
                  "key": "per_page",
                  "value": "15"
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "payroll_run_id",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "employee_id",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "approved",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Salary Slip Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1"]
            }
          },
          "response": []
        },
        {
          "name": "Update Salary Slip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "_method", "value": "PUT", "type": "text" },
                { "key": "basic_salary", "value": "5000.00", "type": "text" },
                { "key": "allowances", "value": "1000.00", "type": "text" },
                { "key": "deductions", "value": "500.00", "type": "text" },
                { "key": "rewards", "value": "0", "type": "text" },
                { "key": "penalties", "value": "0", "type": "text" },
                { "key": "overtime_hours", "value": "5", "type": "text" },
                { "key": "overtime_amount", "value": "250.00", "type": "text" },
                { "key": "tax_amount", "value": "500.00", "type": "text" },
                { "key": "notes", "value": "Updated salary components", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1"]
            }
          },
          "response": []
        },
        {
          "name": "Approve Salary Slip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1/approve",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1", "approve"]
            }
          },
          "response": []
        },
        {
          "name": "Bulk Approve Salary Slips",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "slip_ids[0]", "value": "1", "type": "text" },
                { "key": "slip_ids[1]", "value": "2", "type": "text" },
                { "key": "slip_ids[2]", "value": "3", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/bulk-approve",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "bulk-approve"]
            }
          },
          "response": []
        },
        {
          "name": "Pay Salary Slip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "paid_date", "value": "2024-01-31", "type": "text" },
                { "key": "payment_method", "value": "bank_transfer", "type": "text" },
                { "key": "payment_reference", "value": "TRF-2024-01-001", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1/pay",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1", "pay"]
            }
          },
          "response": []
        },
        {
          "name": "Bulk Pay Salary Slips",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "slip_ids[0]", "value": "1", "type": "text" },
                { "key": "slip_ids[1]", "value": "2", "type": "text" },
                { "key": "paid_date", "value": "2024-01-31", "type": "text" },
                { "key": "payment_method", "value": "bank_transfer", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/bulk-pay",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "bulk-pay"]
            }
          },
          "response": []
        },
        {
          "name": "Cancel Salary Slip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "cancellation_reason", "value": "Employee left the company", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1/cancel",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1", "cancel"]
            }
          },
          "response": []
        },
        {
          "name": "Regenerate Salary Slip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": []
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1/regenerate",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1", "regenerate"]
            }
          },
          "response": []
        },
        {
          "name": "Export Salary Slip",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1/export",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1", "export"]
            }
          },
          "response": []
        },
        {
          "name": "Delete Salary Slip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "_method", "value": "DELETE", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/salary-slips/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "salary-slips", "1"]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Payments",
      "item": [
        {
          "name": "List All Payment Records",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments?per_page=15&page=1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments"],
              "query": [
                {
                  "key": "per_page",
                  "value": "15"
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "payment_method",
                  "value": "bank_transfer",
                  "disabled": true
                },
                {
                  "key": "from_date",
                  "value": "2024-01-01",
                  "disabled": true
                },
                {
                  "key": "to_date",
                  "value": "2024-01-31",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Payment Record Details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "1"]
            }
          },
          "response": []
        },
        {
          "name": "Process Salary Slips Payment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "slip_ids[0]", "value": "1", "type": "text" },
                { "key": "slip_ids[1]", "value": "2", "type": "text" },
                { "key": "payment_method", "value": "bank_transfer", "type": "text" },
                { "key": "payment_account_id", "value": "1", "type": "text" },
                { "key": "notes", "value": "January 2024 salary payment", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/process-slips",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "process-slips"]
            }
          },
          "response": []
        },
        {
          "name": "Process Entire Payroll Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "payment_method", "value": "bank_transfer", "type": "text" },
                { "key": "payment_account_id", "value": "1", "type": "text" },
                { "key": "notes", "value": "Complete payroll run payment", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/process-payroll/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "process-payroll", "1"]
            }
          },
          "response": []
        },
        {
          "name": "Get Payment History",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/payroll/1/history?page=1&per_page=20",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "payroll", "1", "history"],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "per_page",
                  "value": "20"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Payment Summary",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/payroll/1/summary",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "payroll", "1", "summary"]
            }
          },
          "response": []
        },
        {
          "name": "Get Payment Method Statistics",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/statistics/by-method?from_date=2024-01-01&to_date=2024-01-31",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "statistics", "by-method"],
              "query": [
                {
                  "key": "from_date",
                  "value": "2024-01-01"
                },
                {
                  "key": "to_date",
                  "value": "2024-01-31"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Reverse Payment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "reversal_reason", "value": "Payment made in error, incorrect amount transferred", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/1/reverse",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "1", "reverse"]
            }
          },
          "response": []
        },
        {
          "name": "Export Payment Records",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/export?from_date=2024-01-01&to_date=2024-01-31",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "export"],
              "query": [
                {
                  "key": "from_date",
                  "value": "2024-01-01"
                },
                {
                  "key": "to_date",
                  "value": "2024-01-31"
                },
                {
                  "key": "payment_method",
                  "value": "bank_transfer",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Delete Payment Record",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{access_token}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "_method", "value": "DELETE", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{BASE_URL}}/payroll/payments/1",
              "host": ["{{BASE_URL}}"],
              "path": ["payroll", "payments", "1"]
            }
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8000",
      "type": "string"
    },
    {
      "key": "token",
      "value": "your_auth_token_here",
      "type": "string"
    }
  ]
}
