{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-direct-debit-schema.json",
  "title": "DirectDebit",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-direct-debits-api-openapi.yml#/components/schemas/DirectDebit",
  "type": "object",
  "properties": {
    "id": {
      "description": "ID of the direct debit.",
      "$ref": "#/$defs/ResourceID"
    },
    "organizationId": {
      "$ref": "#/$defs/OrganizationID"
    },
    "creatorUserId": {
      "$ref": "#/$defs/ResourceID",
      "description": "ID of the user that created the direct debit.",
      "readOnly": true
    },
    "amount": {
      "$ref": "#/$defs/Amount",
      "readOnly": true
    },
    "scheme": {
      "$ref": "#/$defs/DirectDebitSchemeType",
      "readOnly": true
    },
    "schemeDetails": {
      "$ref": "#/$defs/SchemeDetails",
      "readOnly": true
    },
    "date": {
      "description": "Requested payment execution date.",
      "$ref": "#/$defs/Date",
      "readOnly": true
    },
    "status": {
      "$ref": "#/$defs/PaymentStatus",
      "readOnly": true
    },
    "statusReason": {
      "$ref": "#/$defs/PaymentStatusReason",
      "readOnly": true
    },
    "destination": {
      "description": "Destination account which will receive funds. This account will be credited.",
      "$ref": "#/$defs/AccountSnapshot",
      "readOnly": true
    },
    "destinationHolder": {
      "$ref": "#/$defs/AccountHolder",
      "readOnly": true
    },
    "source": {
      "description": "Source account from which funds will be collected. This account will be debited.",
      "$ref": "#/$defs/ExternalAccountSnapshot",
      "readOnly": true
    },
    "sourceHolder": {
      "$ref": "#/$defs/AccountHolder",
      "readOnly": true
    },
    "mandate": {
      "description": "The mandate which represents the end user's consent to executing this direct debit.",
      "$ref": "#/$defs/MandateSnapshot",
      "readOnly": true
    },
    "approvalSteps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentApprovalStep"
      },
      "readOnly": true
    },
    "attachedTransactions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttachedTransactionRef"
      },
      "readOnly": true
    },
    "reference": {
      "$ref": "#/$defs/PaymentReference",
      "readOnly": true
    },
    "categoryPurpose": {
      "$ref": "#/$defs/CategoryPurpose",
      "readOnly": true
    },
    "chargeBearer": {
      "$ref": "#/$defs/ChargeBearer",
      "readOnly": true
    },
    "connectionInstructionId": {
      "type": "string",
      "description": "The ID of the instruction that was sent to the bank in which this direct debit was included when it was created.",
      "readOnly": true
    },
    "batch": {
      "description": "Details of the associated payments batch if the direct debit was created as part of a batch.",
      "$ref": "#/$defs/BatchDetails"
    },
    "paymentScheduleId": {
      "description": "ID of the payment schedule associated with this direct debit.",
      "$ref": "#/$defs/ResourceID"
    },
    "etag": {
      "$ref": "#/$defs/ETag"
    },
    "externalId": {
      "$ref": "#/$defs/ExternalID",
      "readOnly": true
    },
    "metadata": {
      "$ref": "#/$defs/Metadata",
      "readOnly": true
    },
    "version": {
      "$ref": "#/$defs/ResourceVersion"
    },
    "created": {
      "$ref": "#/$defs/CreatedTimestamp"
    },
    "updated": {
      "$ref": "#/$defs/UpdatedTimestamp"
    }
  },
  "required": [
    "id",
    "organizationId",
    "amount",
    "scheme",
    "date",
    "status",
    "destination",
    "destinationHolder",
    "source",
    "sourceHolder",
    "approvalSteps",
    "reference",
    "version",
    "etag",
    "created",
    "updated",
    "attachedTransactions"
  ],
  "$defs": {
    "AccountHolder": {
      "type": "object",
      "description": "Information about the legal holder of an account.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "COUNTERPARTY",
            "ENTITY",
            "INLINE"
          ],
          "readOnly": true
        },
        "id": {
          "type": "string",
          "description": "Resource ID of either a `Counterparty` or an `Entity`. Absent when `type` is `INLINE`, since an inline holder refers to no resource.",
          "readOnly": true
        },
        "externalId": {
          "$ref": "#/$defs/ExternalID",
          "description": "External ID of either a `Counterparty` or an `Entity`."
        },
        "legalName": {
          "type": "string",
          "description": "The legal name of the account holder. Some banks, and for some payment schemes, the correctness of the legal name will be validated and payments may be rejected if legal names do not match.",
          "readOnly": true
        },
        "address": {
          "description": "Postal address of the account holder.",
          "$ref": "#/$defs/Address",
          "readOnly": true
        },
        "nationalIdentifier": {
          "description": "The national identifier of the account holder.",
          "$ref": "#/$defs/NationalIdentifier",
          "readOnly": true
        },
        "partyType": {
          "description": "The party type of the account holder.",
          "$ref": "#/$defs/PartyType",
          "readOnly": true
        },
        "email": {
          "description": "Email of the account holder.",
          "type": "string",
          "readOnly": true
        }
      },
      "required": [
        "type",
        "legalName"
      ]
    },
    "AccountIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/AccountIdentifierType"
        },
        "market": {
          "$ref": "#/$defs/MarketCode",
          "description": "The market of the `AccountIdentifier` specifies in which market-context the identifier should be treated.\n\nA `NUMBER` from Sweden does not look and does not validate in the same way as a `NUMBER` from GB. The market\ncode is, in most cases, the same as where the account itself is domiciled, but not necessarily. An examples\nof this discrepancy is Jersey which may have domiciled accounts with market `JE`, but the account identifier\nwould be an `IBAN` with country code `GB`."
        },
        "number": {
          "type": "string",
          "description": "The unformatted identifier itself. For type `NUMBER` the structure of the account number is country-specific.",
          "minLength": 1,
          "maxLength": 255
        },
        "invalid": {
          "type": "boolean",
          "description": "Will be `true` if the account identifier is invalid according to Atlar account identifier validation rules.",
          "readOnly": true
        }
      },
      "required": [
        "type",
        "market",
        "number"
      ]
    },
    "AccountIdentifierType": {
      "type": "string",
      "enum": [
        "IBAN",
        "NUMBER",
        "ADYEN",
        "AU_BPAY_BILLER_CODE",
        "DK_FIK",
        "INVESTMENT_NUMBER",
        "NATIONAL_ID_NUMBER",
        "PAYPAL",
        "PROPRIETARY",
        "SE_BANKGIRO",
        "SE_PLUSGIRO",
        "SOLDO",
        "WALLET_ADYEN_BALANCE_PLATFORM",
        "WALLET_AIRWALLEX",
        "WALLET_AIRWALLEX_NUMBER",
        "WALLET_CURRENCYCLOUD",
        "WALLET_FLASH_PAYMENTS",
        "WALLET_FREEMARKET",
        "WALLET_HYPERWALLET",
        "WALLET_INPAY",
        "WALLET_LEAD",
        "WALLET_MERCURY",
        "WALLET_MONEYCORP",
        "WALLET_PAYHAWK",
        "WALLET_REVOLUT",
        "WALLET_SKRILL",
        "WALLET_STRIPE",
        "WALLET_SWISSQUOTE",
        "WALLET_UNIT"
      ],
      "description": "Account Identifier type. Choose among:\n<ul>\n<li><code>IBAN</code> — IBAN</li>\n<li><code>NUMBER</code> — Account number</li>\n<li><code>ADYEN</code> — Adyen identifier</li>\n<li><code>AU_BPAY_BILLER_CODE</code> — Australian BPAY Biller Code</li>\n<li><code>DK_FIK</code> — FIK creditor number</li>\n<li><code>INVESTMENT_NUMBER</code> — Investment number</li>\n<li><code>NATIONAL_ID_NUMBER</code> — National Identification Number</li>\n<li><code>PAYPAL</code> — PayPal wallet identifier</li>\n<li><code>PROPRIETARY</code> — Proprietary identifier</li>\n<li><code>SE_BANKGIRO</code> — <a href=\"https://www.bankgirot.se/en/\">Bankgiro number</a></li>\n<li><code>SE_PLUSGIRO</code> — <a href=\"https://www.nordea.se/foretag/produkter/betala/plusgirot.html\">Plusgiro number</a></li>\n<li><code>SOLDO</code> — Soldo entity identifier</li>\n<li><code>WALLET_ADYEN_BALANCE_PLATFORM</code> — Adyen balance platform wallet identifier</li>\n<li><code>WALLET_AIRWALLEX</code> — Airwallex wallet identifier</li>\n<li><code>WALLET_AIRWALLEX_NUMBER</code> — Airwallex account number</li>\n<li><code>WALLET_CURRENCYCLOUD</code> — Currencycloud wallet identifier</li>\n<li><code>WALLET_FLASH_PAYMENTS</code> — Flash Payments wallet identifier</li>\n<li><code>WALLET_FREEMARKET</code> — Freemarket wallet identifier</li>\n<li><code>WALLET_HYPERWALLET</code> — Hyperwallet wallet identifier</li>\n<li><code>WALLET_INPAY</code> — Inpay account identifier</li>\n<li><code>WALLET_LEAD</code> — Lead wallet identifier</li>\n<li><code>WALLET_MERCURY</code> — Mercury wallet identifier</li>\n<li><code>WALLET_MONEYCORP</code> — Moneycorp wallet identifier</li>\n<li><code>WALLET_PAYHAWK</code> — Payhawk wallet identifier</li>\n<li><code>WALLET_REVOLUT</code> — Revolut wallet identifier</li>\n<li><code>WALLET_SKRILL</code> — Skrill wallet identifier</li>\n<li><code>WALLET_STRIPE</code> — Stripe wallet identifier</li>\n<li><code>WALLET_SWISSQUOTE</code> — Swissquote wallet identifier</li>\n<li><code>WALLET_UNIT</code> — Unit wallet identifier</li>\n</ul>\nFor further information please refer to <a href=\"https://docs.atlar.com/v2.0/docs/payment-details#account-identifiers\">Account Identifiers</a>"
    },
    "AccountSnapshot": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/AccountType"
        },
        "id": {
          "description": "ID of the (internal) Account.",
          "$ref": "#/$defs/ResourceID"
        },
        "organizationId": {
          "$ref": "#/$defs/OrganizationID"
        },
        "market": {
          "$ref": "#/$defs/MarketCode",
          "readOnly": true
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccountIdentifier"
          },
          "minItems": 1,
          "uniqueItems": true,
          "readOnly": true
        },
        "routing": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RoutingIdentifier"
          },
          "uniqueItems": true,
          "maxItems": 5,
          "readOnly": true
        },
        "currency": {
          "$ref": "#/$defs/CurrencyCode",
          "readOnly": true
        }
      },
      "required": [
        "type",
        "id",
        "organizationId",
        "market",
        "currency",
        "identifiers",
        "routing"
      ]
    },
    "AccountType": {
      "type": "string",
      "enum": [
        "ACCOUNT",
        "EXTERNAL_ACCOUNT",
        "INLINE"
      ],
      "description": "Account type specifier. `ACCOUNT` for internal _Account_ resources. `EXTERNAL_ACCOUNT` for _External Account_ resources."
    },
    "Address": {
      "description": "Postal address.",
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/$defs/CountryCode",
          "x-go-type-skip-optional-pointer": true
        },
        "countrySubdivision": {
          "$ref": "#/$defs/CountrySubdivision",
          "x-go-type-skip-optional-pointer": true
        },
        "city": {
          "type": "string",
          "maxLength": 64
        },
        "postalCode": {
          "type": "string",
          "maxLength": 16
        },
        "streetName": {
          "type": "string",
          "maxLength": 64
        },
        "streetNumber": {
          "type": "string",
          "maxLength": 16
        }
      }
    },
    "Amount": {
      "type": "object",
      "properties": {
        "currency": {
          "$ref": "#/$defs/CurrencyCode"
        },
        "stringValue": {
          "description": "A string representation of the amount value. This will be\na decimal number if the currency has decimals. The number\nis not formatted for display purposes (e.g. with locale\nspecific thousand separator) and always contains the dot\n`.` character as decimal separator.",
          "type": "string"
        },
        "value": {
          "description": "The amount value as an integer (int64) represented in\ncurrency minor units (e.g. 15.02 EUR is represented as the\nvalue 1502).",
          "type": "integer",
          "format": "int64"
        }
      },
      "required": [
        "currency",
        "stringValue",
        "value"
      ]
    },
    "ApprovalStatus": {
      "type": "string",
      "description": "The status of the approval step.",
      "enum": [
        "PENDING",
        "APPROVED",
        "REJECTED"
      ]
    },
    "AttachedTransactionRef": {
      "type": "object",
      "description": "An association between a _transactable_ payment resource, e.g. a _Credit Transfer_, _Direct Debit_, or _Expected Transaction_, and an account _Transaction_.",
      "properties": {
        "type": {
          "type": "string",
          "description": "The resource type of the attached transaction",
          "enum": [
            "TRANSACTION"
          ],
          "readOnly": true
        },
        "id": {
          "type": "string",
          "description": "ID of the attached transaction resource.",
          "readOnly": true
        }
      },
      "required": [
        "type",
        "id"
      ]
    },
    "BatchDetails": {
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the batch.",
          "$ref": "#/$defs/ResourceID"
        },
        "treatment": {
          "$ref": "#/$defs/BatchTreatmentType"
        }
      },
      "required": [
        "id",
        "treatment"
      ]
    },
    "BatchTreatmentType": {
      "type": "string",
      "deprecated": true,
      "description": "Deprecated: You can approve or reject on batch and individual level regardless of the treatment type.\n",
      "enum": [
        "INDIVIDUAL_PAYMENTS",
        "BATCH"
      ]
    },
    "CategoryPurpose": {
      "type": "string",
      "description": "ISO 20022 Category Purpose Code (ExternalCategoryPurpose1Code)."
    },
    "ChargeBearer": {
      "type": "string",
      "description": "Charge bearer specifies which party should bear the charges of the transaction.",
      "enum": [
        "SHARED",
        "DEBTOR",
        "CREDITOR",
        "SERVICE_LEVEL"
      ]
    },
    "CitiWorldlinkInstrument": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/InstrumentType"
        },
        "citiWorldlinkId": {
          "type": "string",
          "description": "The WorldLink ID assigned to the account to initiate payments."
        }
      },
      "required": [
        "type",
        "citiWorldlinkId"
      ]
    },
    "CountryCode": {
      "type": "string",
      "description": "Two-letter ISO 3166-1 alpha2 country code.",
      "minLength": 2,
      "maxLength": 2,
      "pattern": "^[A-Z]{2,2}$"
    },
    "CountrySubdivision": {
      "type": "string",
      "description": "Country subdivision code (second part of the ISO 3166-2 code).\nE.g. state code `CA` for the state of California in the USA, `ON` for the province of Ontario in Canada, `NSW` for the state of New South Wales in Australia.\nISO 3166-2 codes can be found on the ISO website, for example, for the USA: https://www.iso.org/obp/ui/#iso:code:3166:US.\nIn the USA the state code is required for domestic payments, in Canada the province code is required for domestic payments.",
      "maxLength": 6,
      "pattern": "^[A-Z]{2,2}-[A-Z0-9]{1,3}$"
    },
    "CreatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was created.",
      "readOnly": true
    },
    "CurrencyCode": {
      "type": "string",
      "description": "Three-letter ISO 4217 currency code.",
      "minLength": 3,
      "maxLength": 3,
      "pattern": "^[A-Z]{3,3}$"
    },
    "Date": {
      "type": "string",
      "format": "date",
      "description": "`full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`."
    },
    "DirectDebitSchemeType": {
      "type": "string",
      "description": "Direct debit payment scheme. Choose among: <ul>\n  <li><code>SDD_CORE</code> (<a\nhref=\"https://www.europeanpaymentscouncil.eu/what-we-do/epc-payment-schemes/sepa-direct-debit/sepa-direct-debit-core-rulebook-and-implementation\">SEPA Direct Debit Core</a>)</li>\n  <li><code>SDD_B2B</code> (<a\nhref=\"https://www.europeanpaymentscouncil.eu/what-we-do/epc-payment-schemes/sepa-direct-debit/sepa-direct-debit-b2b-rulebook-and-implementation\">SEPA Direct Debit B2B</a>)</li>\n  <li><code>GB_DD_BACS</code> (UK <a href=\"https://www.bacs.co.uk\">BACS</a> Direct Debit)</li>\n  <li><code>AUTOGIRO</code> (Swedish <a href=\"https://www.bankgirot.se/autogiro\">Bg AutoGiro</a>)</li>\n  <li><code>CH_DD_LSV</code> (Swiss <a href=\"https://www.six-group.com/en/products-services/banking-services/billing-and-payments/direct-debits.html\">Direct Debit LSV+</a>)</li>\n  <li><code>CH_DD_BDD</code> (Swiss <a href=\"https://www.six-group.com/en/products-services/banking-services/billing-and-payments/direct-debits.html\">Direct Debit BDD</a>)</li>\n  <li><code>US_DD_ACH</code> (US ACH Direct Debit)</li>\n</ul>",
      "enum": [
        "SDD_CORE",
        "SDD_B2B",
        "GB_DD_BACS",
        "AUTOGIRO",
        "CH_DD_LSV",
        "CH_DD_BDD",
        "US_DD_ACH"
      ]
    },
    "ETag": {
      "type": "string",
      "description": "[ETag](https://en.wikipedia.org/wiki/HTTP_ETag) based on the\nresource version. This can be passed along in `If-Match` HTTP\nheader when updating a resource to perform a conditional\nupdate.",
      "pattern": "^version:\\d{1,4}$",
      "readOnly": true
    },
    "ExternalAccountSnapshot": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/AccountType",
          "readOnly": true
        },
        "id": {
          "description": "ID of the External Account.",
          "$ref": "#/$defs/ResourceID"
        },
        "externalId": {
          "$ref": "#/$defs/ExternalID",
          "description": "External ID of the External Account."
        },
        "organizationId": {
          "$ref": "#/$defs/OrganizationID"
        },
        "market": {
          "$ref": "#/$defs/MarketCode",
          "readOnly": true
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccountIdentifier"
          },
          "minItems": 1,
          "uniqueItems": true,
          "readOnly": true
        },
        "routing": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RoutingIdentifier"
          },
          "uniqueItems": true,
          "readOnly": true,
          "x-omitempty": true
        }
      },
      "required": [
        "type",
        "id",
        "organizationId",
        "market",
        "identifiers"
      ]
    },
    "ExternalID": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9._\\-+=]{1,64}$",
      "description": "External ID is optional to use, but if used, the Atlar platform will persist it, index it, as well as require it to be unique across all resources. It is possible to retrieve a resource using the external ID using the prefix `external:`.",
      "x-omitempty": true
    },
    "Instrument": {
      "type": "object",
      "description": "The payment instrument used to initiate the payment. For example Citi has a proprietary payment instrument called WorldLink, which can be used to initiate payments.",
      "oneOf": [
        {
          "$ref": "#/$defs/CitiWorldlinkInstrument"
        },
        {
          "$ref": "#/$defs/USACHInstrument"
        }
      ]
    },
    "InstrumentType": {
      "type": "string",
      "description": "The type of the payment instrument.",
      "enum": [
        "US_ACH",
        "CITI_WORLDLINK"
      ]
    },
    "MandateSnapshot": {
      "type": "object",
      "description": "Mandate information about the mandate to be used for a Direct Debit. This mandate data is a snapshot of the state of the mandate at the time when the Direct Debit was created.",
      "properties": {
        "id": {
          "description": "The unique identifier of this mandate.",
          "$ref": "#/$defs/ResourceID"
        },
        "creditorReference": {
          "description": "The customer number that you have received from the bank.",
          "type": "string"
        },
        "mandateReference": {
          "type": "string",
          "description": "A unique reference to the mandate that you have signed with the debtor.",
          "minLength": 1,
          "maxLength": 35
        },
        "finalCollection": {
          "type": "boolean",
          "readOnly": true,
          "description": "Whether to consider this Direct Debit collection the final one for this mandate.\nThis field is set automatically by the Atlar platform if the mandate has been cancelled prior to the creation of the Direct Debit.\nThis field only affects certain direct debit schemes (e.g. SEPA DDs),\nwhere the bank is notified about the mandate cancellation in relation to the final collection.\n"
        },
        "signatureDate": {
          "description": "The date that this mandate was signed by the end user.",
          "$ref": "#/$defs/Date"
        },
        "version": {
          "$ref": "#/$defs/ResourceVersion"
        }
      },
      "required": [
        "id",
        "creditorReference",
        "mandateReference",
        "finalCollection",
        "version"
      ]
    },
    "MarketCode": {
      "type": "string",
      "description": "Two-letter ISO 3166-1 alpha2 country code.",
      "minLength": 2,
      "maxLength": 2,
      "pattern": "^[A-Z]{2,2}$"
    },
    "Metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Metadata is a `string-string` key-value container that\ncan be used to store information known at the time of resource\ncreation. This can be retrieved later on, for instance when a\npayment or expected transaction is reconciled with the booked\ntransaction on the bank statement.\n\nMetadata can have at most 20 entries. Keys may have a\nmaximum length of 64 chars and values a maximum length of 512\nchars.\n\nBy default, this field is optional. It is possible to make it\nrequired in the Atlar Dashboard by visiting the [Metadata keys\npage](https://app.atlar.com/metadata-keys). Requirement rules\ncan be specified per API resource. Both the Dashboard and the\nAPI will then enforce these rules and give validation errors\nwhen the required fields are not set.",
      "maxProperties": 20,
      "x-omitempty": true
    },
    "NationalIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the national identifier.",
          "enum": [
            "CIVIC",
            "COMPANY"
          ]
        },
        "market": {
          "$ref": "#/$defs/MarketCode"
        },
        "number": {
          "type": "string",
          "description": "The identifier itself."
        }
      },
      "required": [
        "type",
        "market",
        "number"
      ]
    },
    "OrganizationID": {
      "type": "string",
      "description": "Unique resource identifier for an Organization."
    },
    "PartyType": {
      "type": "string",
      "description": "The legal type of a party",
      "enum": [
        "INDIVIDUAL",
        "COMPANY"
      ]
    },
    "PaymentApprovalStep": {
      "type": "object",
      "properties": {
        "id": {
          "description": "The ID of this step. Used when approving/rejecting.",
          "type": "string",
          "readOnly": true
        },
        "approvalChainId": {
          "description": "The ID of the approval chain that triggered this approval step.",
          "type": "string",
          "readOnly": true
        },
        "requiredRoleIds": {
          "type": "array",
          "description": "IDs of the Roles that can approve/reject. Not specified if the step was automatically approved based on an auto-approval chain.",
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "uniqueItems": true,
          "readOnly": true,
          "x-omitempty": true
        },
        "status": {
          "description": "The status of the approval step. `PENDING` if step is not yet interacted with.",
          "$ref": "#/$defs/ApprovalStatus",
          "readOnly": true
        },
        "approver": {
          "description": "User information about the user who approved/rejected. Omitted if step is not yet approved/rejected.",
          "$ref": "#/$defs/UserAuditInfo",
          "readOnly": true
        },
        "updated": {
          "description": "Timestamp when approved/rejected. Omitted if the step is not yet approved/rejected.",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "autoApproved": {
          "type": "boolean"
        },
        "allowCreatorApproval": {
          "description": "Allow approval by the user creating this resource if they have the role required for this step. By default, this is not allowed to conform with a four-eyes principle where approval by another person is required.",
          "type": "boolean",
          "readOnly": true
        },
        "sequentialApproval": {
          "type": "boolean",
          "description": "If true, the approval steps for this approval chain, specified by `approvalChainId`, need to be approved in the the order specified by `sequenceNumber`.",
          "readOnly": true
        },
        "sequenceNumber": {
          "type": "integer",
          "description": "The sequence number of this step in the approval chain.",
          "readOnly": true
        }
      },
      "required": [
        "id",
        "status",
        "approvalChainId",
        "autoApproved"
      ]
    },
    "PaymentReference": {
      "type": "string",
      "description": "This reference will be sent to the destination bank and recipient. (This type of reference is sometimes also referred to as remittance information.)",
      "maxLength": 140
    },
    "PaymentStatus": {
      "description": "Status of a payment. Applicable to both credit transfer payments and direct debit payments.",
      "type": "string",
      "enum": [
        "CREATED",
        "APPROVED",
        "REJECTED",
        "PENDING_SUBMISSION",
        "SENT",
        "PENDING_AT_BANK",
        "ACCEPTED",
        "EXECUTED",
        "FAILED",
        "RETURNED",
        "UNKNOWN"
      ]
    },
    "PaymentStatusReason": {
      "description": "Reason for the status of a payment.",
      "type": "object",
      "properties": {
        "code": {
          "description": "Failure reason code. If present, this is a <a href=\"https://www.iso20022.org/catalogue-messages/additional-content-messages/external-code-sets\">ISO 20022 error code</a>.",
          "type": "string",
          "readOnly": true
        },
        "description": {
          "description": "Human readable description of the reason. Can be presented to an end-user.",
          "type": "string",
          "readOnly": true
        }
      }
    },
    "ResourceID": {
      "type": "string",
      "description": "Unique resource identifier.",
      "minLength": 32,
      "maxLength": 64
    },
    "ResourceVersion": {
      "type": "integer",
      "description": "Resource version. Starts at value `1` when the resource is\ncreated and increases by one for each successive update.",
      "minimum": 1,
      "readOnly": true
    },
    "RoutingConstraints": {
      "description": "Constraints on a `RoutingIdentifier`.",
      "type": "object",
      "properties": {
        "accountNumberType": {
          "$ref": "#/$defs/AccountIdentifierType",
          "x-go-type-skip-optional-pointer": true
        },
        "scheme": {
          "type": "string"
        }
      }
    },
    "RoutingIdentifier": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/RoutingIdentifierType"
        },
        "number": {
          "type": "string",
          "description": "The form of the routing number depends on `type`. E.g. for `BIC` the value should be an 8 or 11 character BIC/SWIFT code. For `GB_DSC` (UK domestic routing) the value should be a six digit sort code.",
          "minLength": 1,
          "maxLength": 255
        },
        "invalid": {
          "type": "boolean",
          "description": "Will be `true` if the routing identifier is invalid according to Atlar validation rules.",
          "readOnly": true
        },
        "constraints": {
          "$ref": "#/$defs/RoutingConstraints"
        }
      },
      "required": [
        "type",
        "number"
      ]
    },
    "RoutingIdentifierType": {
      "type": "string",
      "enum": [
        "BIC",
        "AT_BLZ",
        "AU_BSB",
        "BD_BRN",
        "BR_BRANCH",
        "BR_COMPE",
        "BR_ISP",
        "CA_CPA",
        "CH_BCC",
        "CH_SIC",
        "CL_SBIF",
        "CN_APS",
        "CZ_NBC",
        "DE_BLZ",
        "ES_NCC",
        "GB_DSC",
        "GR_BIC",
        "HK_NCC",
        "IE_NCC",
        "IL_NCC",
        "IN_FSC",
        "IT_NCC",
        "JP_ZGN",
        "KR_BOK",
        "KR_KFTC",
        "MX_ABM",
        "MY_NCC",
        "NZ_NCC",
        "PH_BRSTN",
        "PL_KNR",
        "PT_NCC",
        "RU_CBC",
        "SE_SBA",
        "SG_IBG",
        "TH_CBC",
        "TW_NCC",
        "US_ABA",
        "US_PID",
        "VN_CITAD",
        "ZA_NCC"
      ],
      "description": "A routing identifier of type `BIC` must be provided to support cross-border/SWIFT payments."
    },
    "SchemeDetails": {
      "type": "object",
      "properties": {
        "instrument": {
          "$ref": "#/$defs/Instrument"
        },
        "intraCompany": {
          "type": "boolean",
          "description": "Whether the payment is between companies within the same group."
        },
        "initiatorId": {
          "type": "string"
        },
        "urgency": {
          "$ref": "#/$defs/SchemeDetailsUrgency"
        }
      }
    },
    "SchemeDetailsUrgency": {
      "type": "string",
      "description": "The urgency of the payment.",
      "enum": [
        "HIGH"
      ]
    },
    "USACHInstrument": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/InstrumentType"
        },
        "usAchCompanyId": {
          "type": "string",
          "description": "The US ACH Company ID assigned to the account to initiate US ACH payments."
        },
        "usAchCompanyName": {
          "type": "string",
          "description": "Optional US ACH Company Name override. When set, it is used as the debtor name (Dbtr/Nm)\non outgoing US ACH payments from this account instead of the account holder's legal name.\nOnly used for US ACH payments.\n"
        },
        "usAchImmediateOrigin": {
          "type": "string",
          "description": "Optional US ACH Immediate Origin. When set, it populates the Immediate Origin field of the\nNACHA file header instead of the US ACH Company ID. Some banks assign an Immediate Origin\nthat is distinct from the Company ID. Only used for US ACH payments.\n"
        }
      },
      "required": [
        "type",
        "usAchCompanyId"
      ]
    },
    "UpdatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was last updated.",
      "readOnly": true
    },
    "UserAuditInfo": {
      "type": "object",
      "description": "User information for audit trail.",
      "properties": {
        "id": {
          "$ref": "#/$defs/ResourceID",
          "description": "User ID"
        },
        "username": {
          "type": "string",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "User given name(s) information. May be a concatenation of firstname, lastname etc.",
          "readOnly": true
        },
        "roleId": {
          "type": "string",
          "description": "Role ID",
          "readOnly": true
        }
      },
      "required": [
        "id",
        "username"
      ]
    }
  }
}