{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/openpayments-io/main/json-schema/openpayments-io-create-payout-request-schema.json",
  "title": "CreatePayoutRequest",
  "x-generated": "2026-10-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openpayments-io-openapi.yml#/components/schemas/CreatePayoutRequest",
  "required": [
    "creditorGiro",
    "creditorName",
    "debtorAccount",
    "instructedAmount"
  ],
  "type": "object",
  "properties": {
    "instructionId": {
      "maxLength": 35,
      "type": [
        "string",
        "null"
      ]
    },
    "debtorAccount": {
      "$ref": "#/$defs/accountReference"
    },
    "creditorAgent": {
      "maxLength": 35,
      "type": [
        "string",
        "null"
      ]
    },
    "creditorGiro": {
      "$ref": "#/$defs/giroReference"
    },
    "creditorName": {
      "maxLength": 70,
      "minLength": 1,
      "type": "string"
    },
    "instructedAmount": {
      "$ref": "#/$defs/amount"
    },
    "requestedExecutionDate": {
      "type": [
        "string",
        "null"
      ]
    },
    "debtorAccountMessage": {
      "type": [
        "string",
        "null"
      ]
    },
    "creditorAccountMessage": {
      "type": [
        "string",
        "null"
      ]
    },
    "invoiceRef": {
      "type": [
        "string",
        "null"
      ]
    },
    "ocrRef": {
      "type": [
        "string",
        "null"
      ]
    },
    "endToEndIdentification": {
      "maxLength": 35,
      "type": [
        "string",
        "null"
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "accountNumber": {
      "description": "Bank account number. Used to identify the particular customer account within the financial institution. \n",
      "type": "string",
      "pattern": "[a-zA-Z0-9]{1,30}"
    },
    "accountReference": {
      "description": "Reference to an account by either\n  * IBAN, of a payment account, or\n  * BBAN, for payment accounts if there is no IBAN, or \n  * the Primary Account Number (PAN) of a card, can be tokenised by the ASPSP due to PCI DSS requirements, or\n  * the Primary Account Number (PAN) of a card in a masked form, or\n  * an alias to access a payment account via a registered mobile phone number (MSISDN).\n",
      "type": "object",
      "properties": {
        "iban": {
          "$ref": "#/$defs/iban"
        },
        "bban": {
          "$ref": "#/$defs/bban"
        },
        "clearingNumber": {
          "$ref": "#/$defs/clearingNumber"
        },
        "accountNumber": {
          "$ref": "#/$defs/accountNumber"
        },
        "pan": {
          "$ref": "#/$defs/pan"
        },
        "maskedPan": {
          "$ref": "#/$defs/maskedPan"
        },
        "msisdn": {
          "$ref": "#/$defs/msisdn"
        },
        "currency": {
          "$ref": "#/$defs/currencyCode"
        }
      }
    },
    "amount": {
      "type": "object",
      "required": [
        "currency",
        "amount"
      ],
      "properties": {
        "currency": {
          "$ref": "#/$defs/currencyCode"
        },
        "amount": {
          "$ref": "#/$defs/amountValue"
        }
      }
    },
    "amountValue": {
      "description": "The amount given with fractional digits, where fractions must be compliant to the currency definition.\nUp to 14 significant figures. Negative amounts are signed by minus.\nThe decimal separator is a dot.\n\n**Example:**\nValid representations for EUR with up to two decimals are:\n\n  * 1056\n  * 5768.2\n  * -1.50\n  * 5877.78\n",
      "type": "string",
      "pattern": "-?[0-9]{1,14}(\\.[0-9]{1,3})?"
    },
    "bban": {
      "description": "Basic Bank Account Number (BBAN) Identifier. Used nationally by financial institutions, i.e., in individual countries, \n  generally as part of a National Account Numbering Scheme(s), \n  which uniquely identifies the account of a customer.\n",
      "type": "string",
      "pattern": "[a-zA-Z0-9]{1,30}"
    },
    "clearingNumber": {
      "description": "Bank account clearing number. Used to identify the financial institution within a domestic payment system. \n",
      "type": "string",
      "pattern": "[0-9]{1,5}"
    },
    "currencyCode": {
      "description": "ISO 4217 Alpha 3 currency code.\n",
      "type": "string",
      "pattern": "[A-Z]{3}"
    },
    "giroNumber": {
      "type": "string",
      "description": "Swedish Bankgiro or Plusgiro number",
      "pattern": "[0-9-]{5,35}"
    },
    "giroReference": {
      "description": "Reference to a Swedish Bankgiro or Plusgiro account\n",
      "type": "object",
      "required": [
        "giroNumber",
        "giroType"
      ],
      "properties": {
        "giroNumber": {
          "$ref": "#/$defs/giroNumber"
        },
        "giroType": {
          "$ref": "#/$defs/giroType"
        }
      }
    },
    "giroType": {
      "type": "string",
      "description": "Swedish giro type",
      "enum": [
        "BANKGIRO",
        "PLUSGIRO"
      ]
    },
    "iban": {
      "type": "string",
      "description": "International Bank Account Number (IBAN) of an account.",
      "pattern": "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"
    },
    "maskedPan": {
      "description": "Masked Primary Account Number.\n",
      "type": "string",
      "maxLength": 35
    },
    "msisdn": {
      "type": "string",
      "maxLength": 35,
      "description": "Mobile phone number."
    },
    "pan": {
      "description": "Primary Account Number according to ISO/IEC 7812.\n",
      "type": "string",
      "maxLength": 35
    }
  }
}