{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-create-mandate-request-schema.json",
  "title": "CreateMandateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-mandates-api-openapi.yml#/components/schemas/CreateMandateRequest",
  "type": "object",
  "properties": {
    "active": {
      "description": "Set this to true if this mandate is already known by the bank. This is for example a good option if you're migrating a lot of mandates that you know are already active. The actual outcome of using this flag depends on the direct debit scheme, since all schemes work in slightly different ways. For example, for `AUTOGIRO`, it means that Atlar won't send the mandate prior to making the collection. For other schemes, it could have an effect on how quickly the collection can be executed.",
      "type": "boolean"
    },
    "scheme": {
      "$ref": "#/$defs/DirectDebitSchemeType"
    },
    "externalAccountId": {
      "type": "string",
      "description": "The ID of the external account to which this mandate is associated with."
    },
    "destinationAccountId": {
      "type": "string",
      "description": "The ID of the destination account where money will be collected for this mandate. This is only required for `AUTOGIRO` mandates."
    },
    "creditorReference": {
      "description": "The customer number that you have received from the bank.\nFor `AUTOGIRO` this is your 6 digit customer number.\n",
      "type": "string",
      "minLength": 1,
      "maxLength": 35
    },
    "mandateReference": {
      "type": "string",
      "description": "A unique reference to the mandate that you have signed with the debtor.\nFor `AUTOGIRO` this is used as payer number associated with the mandate and validated as 1-16 digits. For `AUTOGIRO`, this reference must not contain leading 0's.\n",
      "minLength": 1,
      "maxLength": 35
    },
    "signatureDate": {
      "$ref": "#/$defs/Date",
      "description": "The date that this mandate was signed by the end user."
    },
    "externalId": {
      "$ref": "#/$defs/ExternalID"
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    }
  },
  "required": [
    "scheme",
    "externalAccountId",
    "creditorReference",
    "mandateReference"
  ],
  "$defs": {
    "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"
      ]
    },
    "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
    },
    "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
    }
  }
}