{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/breezecash/json-schema/breezecash-create-headless-payout-request-schema.json",
  "title": "CreateHeadlessPayoutRequest",
  "description": "Headless payout details",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/breezecash-headless-payout-api-openapi.yml#/components/schemas/CreateHeadlessPayoutRequest",
  "type": "object",
  "properties": {
    "amount": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD",
        "EUR"
      ]
    },
    "clientReferenceId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "releaseMethod": {
      "type": "string",
      "enum": [
        "MANUAL",
        "AUTOMATIC"
      ]
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "referenceId": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "email"
      ],
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "id"
          ],
          "title": "By Id"
        },
        {
          "required": [
            "referenceId"
          ],
          "title": "By Reference Id"
        },
        {
          "not": {
            "oneOf": [
              {
                "required": [
                  "id"
                ]
              },
              {
                "required": [
                  "referenceId"
                ]
              },
              {
                "required": [
                  "id",
                  "referenceId"
                ]
              }
            ]
          },
          "title": "Neither"
        }
      ]
    },
    "customerIpAddress": {
      "type": "string",
      "oneOf": [
        {
          "format": "ipv4"
        },
        {
          "format": "ipv6"
        }
      ]
    },
    "bankAccount": {
      "type": "object",
      "properties": {
        "accountNumber": {
          "type": "string",
          "minLength": 4,
          "maxLength": 17,
          "pattern": "^\\d+$"
        },
        "routingNumber": {
          "type": "string",
          "pattern": "^\\d+$"
        },
        "accountType": {
          "type": "string",
          "enum": [
            "checking",
            "savings"
          ]
        }
      },
      "required": [
        "accountNumber",
        "routingNumber",
        "accountType"
      ],
      "additionalProperties": false
    },
    "sepaBankAccount": {
      "type": "object",
      "properties": {
        "iban": {
          "type": "string",
          "minLength": 15,
          "maxLength": 34
        },
        "accountHolderName": {
          "type": "string",
          "minLength": 1
        },
        "bic": {
          "type": "string",
          "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$"
        }
      },
      "required": [
        "iban",
        "accountHolderName",
        "bic"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "amount",
    "currency",
    "clientReferenceId",
    "releaseMethod",
    "customer"
  ],
  "additionalProperties": false,
  "oneOf": [
    {
      "required": [
        "bankAccount"
      ]
    },
    {
      "required": [
        "sepaBankAccount"
      ]
    }
  ]
}