{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.paycaptain.com/schemas/payment.schema.json",
  "title": "PayCaptain Payment",
  "description": "Single-record rules for POST /payment. Cross-field and cross-record rules are at https://developer.paycaptain.com/rules.",
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string",
      "minLength": 1,
      "description": "Your identifier for the payment record. Unique in your system. Resubmitting the same paymentId updates the record.",
      "examples": [
        "PM-000912"
      ]
    },
    "company": {
      "type": "string",
      "description": "Company code issued by the PayCaptain team. Must match your PayCaptain company code exactly.",
      "examples": [
        "ABC"
      ]
    },
    "hrEmployeeId": {
      "type": "string",
      "description": "The person being paid. Must match an employee already sent to PayCaptain.",
      "examples": [
        "9876543210"
      ]
    },
    "payrollCode": {
      "type": "string",
      "description": "The employment the payment belongs to. Must match that person's active employment.",
      "examples": [
        "123"
      ]
    },
    "payCode": {
      "type": "string",
      "minLength": 1,
      "description": "Pay Code for this pay element. Must match a Pay Code Name configured in PayCaptain.",
      "examples": [
        "Bonus"
      ]
    },
    "date": {
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Date of the payment.",
      "examples": [
        "2026-11-28"
      ]
    },
    "units": {
      "type": "number",
      "description": "Quantity, for example hours.",
      "examples": [
        1
      ]
    },
    "rate": {
      "type": "number",
      "description": "Rate per unit.",
      "examples": [
        250
      ]
    },
    "description": {
      "type": "string",
      "description": "Text shown on the payslip.",
      "examples": [
        "Quarterly bonus"
      ]
    },
    "information": {
      "type": "string",
      "description": "Extra detail shown behind the help icon on the payslip.",
      "examples": [
        "Q3 performance bonus"
      ]
    },
    "archived": {
      "type": "boolean",
      "default": false,
      "description": "Archive the payment so it is not paid. Send true with the same paymentId to remove the payment from payroll. Records are archived, never deleted.",
      "examples": [
        false
      ]
    },
    "location": {
      "type": "string",
      "description": "Location worked.",
      "examples": [
        "Baker Street"
      ]
    },
    "department": {
      "type": "string",
      "description": "Department worked.",
      "examples": [
        "Marketing"
      ]
    },
    "team": {
      "type": "string",
      "description": "Team worked.",
      "examples": [
        "Content"
      ]
    },
    "job": {
      "type": "string",
      "description": "Job worked.",
      "examples": [
        "Content Marketing"
      ]
    }
  },
  "required": [
    "paymentId",
    "company",
    "hrEmployeeId",
    "payrollCode",
    "payCode",
    "date",
    "units",
    "rate"
  ]
}
