{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-payout-details-schema.json",
  "title": "payoutDetails",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oyster-hr-payments-api-openapi.yml#/components/schemas/payoutDetails",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "INITIATED",
        "NOT_INITIATED",
        "NO_PAYMENT",
        "PAID",
        "RETURNED",
        "SENT"
      ]
    },
    "amount": {
      "$ref": "#/$defs/paymentsAmount"
    },
    "statusChanges": {
      "type": "array",
      "description": "The timeline of the payout status changes.",
      "items": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "enum": [
              "IN_PROGRESS",
              "INITIATED",
              "NOT_INITIATED",
              "NO_PAYMENT",
              "PAID",
              "RETURNED",
              "SENT"
            ]
          }
        },
        "required": [
          "at",
          "to"
        ]
      }
    },
    "subject": {
      "type": "object",
      "description": "The entity that is being paid out.",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "type"
      ]
    }
  },
  "required": [
    "id",
    "status",
    "amount",
    "statusChanges",
    "subject"
  ],
  "$defs": {
    "paymentsAmount": {
      "type": "object",
      "description": "Monetary amount with currency for payments.",
      "properties": {
        "decimal": {
          "type": "string",
          "pattern": "^\\d+([.]\\d+)?$"
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        }
      },
      "required": [
        "decimal",
        "currencyCode"
      ]
    }
  }
}