{
  "$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-response-schema.json",
  "title": "CreatePayoutResponse",
  "x-generated": "2026-10-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openpayments-io-openapi.yml#/components/schemas/CreatePayoutResponse",
  "required": [
    "_links",
    "transactionStatus"
  ],
  "type": "object",
  "properties": {
    "tppMessages": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/tppMessage2XX"
      }
    },
    "transactionStatus": {
      "$ref": "#/$defs/transactionStatus"
    },
    "transactionFees": {
      "$ref": "#/$defs/amount"
    },
    "transactionFeeIndicator": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "scaMethods": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/authenticationObject"
      }
    },
    "chosenScaMethod": {
      "$ref": "#/$defs/authenticationObject"
    },
    "challengeData": {
      "$ref": "#/$defs/challengeData"
    },
    "_links": {
      "$ref": "#/$defs/PayoutLinks"
    },
    "psuMessage": {
      "maxLength": 512,
      "type": [
        "string",
        "null"
      ]
    },
    "payoutId": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    }
  },
  "additionalProperties": false,
  "$defs": {
    "MessageCode2XX": {
      "description": "Message codes for HTTP Error codes 2XX.",
      "type": "string"
    },
    "PayoutLinks": {
      "type": "object",
      "properties": {
        "confirmPayout": {
          "$ref": "#/$defs/hrefType"
        },
        "self": {
          "$ref": "#/$defs/hrefType"
        }
      },
      "additionalProperties": false
    },
    "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})?"
    },
    "authenticationMethodId": {
      "description": "An identification provided by the ASPSP for the later identification of the authentication method selection.\n",
      "type": "string",
      "maxLength": 35
    },
    "authenticationObject": {
      "description": "Authentication Object\n",
      "type": "object",
      "required": [
        "authenticationType",
        "authenticationMethodId"
      ],
      "properties": {
        "authenticationType": {
          "$ref": "#/$defs/authenticationType"
        },
        "authenticationVersion": {
          "description": "Specifies the version of the authentication method. Useful when multiple tools exist under the same method type. \n",
          "type": "string"
        },
        "authenticationMethodId": {
          "$ref": "#/$defs/authenticationMethodId"
        },
        "name": {
          "description": "A user-defined or bank-provided label for the authentication method (e.g. \"SMS OTP on phone +49160 xxxxx 28\"). This should be shown to the user when offering authentication method choices.\n",
          "type": "string"
        },
        "explanation": {
          "description": "Detailed information about the SCA method for the PSU.\n",
          "type": "string"
        }
      }
    },
    "authenticationType": {
      "description": "Type of the authentication method. See Statuses & Types for full descriptions of values.\n",
      "type": "string",
      "enum": [
        "SMS_OTP",
        "CHIP_OTP",
        "PHOTO_OTP",
        "PUSH_OTP"
      ]
    },
    "challengeData": {
      "description": "Contained in addition to the data element `chosenScaMethod` if challenge data is needed for SCA. In rare cases, this attribute is also used in the context of the `startAuthorisationWithPsuAuthentication` link. \n",
      "type": "object",
      "properties": {
        "image": {
          "type": "string",
          "format": "byte",
          "description": "PNG data (max. 512 kilobyte) to be displayed to the PSU,\nBase64 encoding, cp. [RFC4648].\nThis attribute is used only, when PHOTO_OTP or CHIP_OTP\nis the selected SCA method.\n"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Challenge data"
        },
        "imageLink": {
          "type": "string",
          "format": "url",
          "description": "A link where the ASPSP will provides the challenge image for the TPP."
        },
        "otpMaxLength": {
          "type": "integer",
          "description": "The maximal length for the OTP to be typed in by the PSU."
        },
        "otpFormat": {
          "type": "string",
          "description": "The format type of the OTP to be typed in. The admitted values are \"characters\" or \"integer\".",
          "enum": [
            "characters",
            "integer"
          ]
        },
        "additionalInformation": {
          "type": "string",
          "description": "Additional explanation for the PSU to explain\ne.g. fallback mechanism for the chosen SCA method.\nThe TPP is obliged to show this to the PSU.\n"
        }
      }
    },
    "currencyCode": {
      "description": "ISO 4217 Alpha 3 currency code.\n",
      "type": "string",
      "pattern": "[A-Z]{3}"
    },
    "hrefEntry": {
      "description": "Link to a resource",
      "type": "string"
    },
    "hrefType": {
      "description": "Link to a resource",
      "type": "object",
      "properties": {
        "href": {
          "$ref": "#/$defs/hrefEntry"
        }
      }
    },
    "tppMessage2XX": {
      "type": "object",
      "required": [
        "category",
        "code"
      ],
      "properties": {
        "category": {
          "$ref": "#/$defs/tppMessageCategory"
        },
        "code": {
          "$ref": "#/$defs/MessageCode2XX"
        },
        "path": {
          "type": "string"
        },
        "text": {
          "$ref": "#/$defs/tppMessageText"
        }
      }
    },
    "tppMessageCategory": {
      "description": "Category of the TPP message category",
      "type": "string",
      "enum": [
        "INFORMATION",
        "UNMAPPED",
        "ERROR",
        "WARNING"
      ]
    },
    "tppMessageText": {
      "description": "Additional explaining text to the TPP.",
      "type": "string",
      "maxLength": 512
    },
    "transactionStatus": {
      "description": "Uses codes from the ISO 20022 data table. See Statuses & Types documentation for full descriptions of values. \n",
      "type": "string",
      "enum": [
        "ACCC",
        "ACCP",
        "ACSC",
        "ACSP",
        "ACTC",
        "ACWC",
        "ACWP",
        "RCVD",
        "PDNG",
        "RJCT",
        "CANC",
        "ACFC",
        "PATC",
        "PART"
      ]
    }
  }
}