---
title: "Create a direct debit mandate"
method: PUT
path: "/customers/{id}/directdebitmandates"
tags: ["Direct debit mandates"]
---

# Create a direct debit mandate

`PUT /customers/{id}/directdebitmandates`

The request body is optional and may contain only a `redirectUrl`. Bank details cannot be submitted through the API: the customer authorises the mandate themselves via the `url` returned in the response. In staging, you can open that link yourself and complete it with test bank details.

## Path parameters

- `id` string, required — The id of the customer for whom to create the mandate

## Request body

- CreateDirectDebitMandateRequest — The request containing the redirect URL
  - `redirectUrl` string — The redirect URL to redirect the user after they sign the mandate

## Response `200`

The direct debit mandate was created

- DirectDebitMandateResponse — Direct Debit mandate details
  - `id` string — The ID of the mandate
  - `creationTime` string, date-time — The creation time of the mandate
  - `lastUpdateTime` string, date-time — The last time when the mandate was updated
  - `distributionTime` string, date-time — The time when the mandate was sent to the customer
  - `authorisationTime` string, date-time — The time when the mandate was signed by the customer
  - `submissionTime` string, date-time — The time when the mandate was submitted to the payment provider
  - `status` 'CREATED' | 'PENDING' | 'ACTIVE' | 'PENDING_CANCELLATION' | 'CANCELLED' | 'MIGRATING' — The mandate status
  - `failureReason` string — The reason for failing to set up the mandate
  - `statusReasonCode` 'PENDING_DD_CAPABILITY' | 'PENDING_ACTIVATION' | 'MIGRATED' | 'BANK_ACCOUNT_CHANGED' | 'INCORRECT_BANK_DETAILS' | 'INSTRUCTION_CANCELLED_BY_PAYER' | 'PAYER_DECEASED' | 'ACCOUNT_TRANSFERRED' | 'ADVANCE_NOTICE_DISPUTED' | 'AMOUNT_DISPUTED' | 'MANDATE_NOT_FOUND' | 'DISPUTE_TOO_EARLY' | 'DISPUTE_TOO_LATE' | 'INVALID_SORT_CODE' | 'INVALID_ACC_NUMBER' | 'ACCOUNT_CLOSED' | 'CANCELLED_ON_DEMAND' | 'REINSTATED' | 'MIGRATION_TIMEOUT' | 'DISCARDED_BY_BILLER' | 'ACCEPTED_ON_CREATION' | 'OTHER' — The reason as predefined code why the mandate is in a certain status
  - `statusReason` string — Reason explaining the current status of the direct debit mandate, especially useful for failure cases.
  - `customer` CustomerResponse — The customer details.
    - `id` string — The Adfin id of the customer.
    - `externalId` string — The id of the customer from the platform that is integrating with Adfin.
    - `name` string — The full name of the customer.
    - `creationTime` string, date-time — The time the customer was created.
    - `lastUpdatedTime` string, date-time — The last time when the customer was updated.
    - `people` Person[] — The list of people assigned to the customer.
      - `id` string — The internal id of the person.
      - `firstName` string — The first name of the person.
      - `lastName` string — The last name of the person.
      - `email` string — The email of the person.
      - `phoneNo` string — The phone number of the person.
      - `isPrimaryContact` boolean — True if this person is a primary contact.
      - `isIncludedInCommunications` boolean — True if this person is included in the customers communications.
      - `validForEmailCommunication` boolean
      - `validForPhoneCommunication` boolean
    - `addresses` Address[] — The list of the addresses for the customer.
      - `id` string — The internal id of the address.
      - `city` string — The name of the city.
      - `postalCode` string — The postal code.
      - `country` string — The name of the biller country.
      - `addressLine1` string — The name of the street, and the house or building number.
    - `directDebitMandate` DirectDebitMandateSummary — Direct Debit details.
      - `id` string — The id of the direct debit mandate.
      - `status` 'CREATED' | 'PENDING' | 'ACTIVE' | 'PENDING_CANCELLATION' | 'CANCELLED' | 'MIGRATING' — Current status of the direct debit.
      - `statusReasonCode` 'PENDING_DD_CAPABILITY' | 'PENDING_ACTIVATION' | 'MIGRATED' | 'BANK_ACCOUNT_CHANGED' | 'INCORRECT_BANK_DETAILS' | 'INSTRUCTION_CANCELLED_BY_PAYER' | 'PAYER_DECEASED' | 'ACCOUNT_TRANSFERRED' | 'ADVANCE_NOTICE_DISPUTED' | 'AMOUNT_DISPUTED' | 'MANDATE_NOT_FOUND' | 'DISPUTE_TOO_EARLY' | 'DISPUTE_TOO_LATE' | 'INVALID_SORT_CODE' | 'INVALID_ACC_NUMBER' | 'ACCOUNT_CLOSED' | 'CANCELLED_ON_DEMAND' | 'REINSTATED' | 'MIGRATION_TIMEOUT' | 'DISCARDED_BY_BILLER' | 'ACCEPTED_ON_CREATION' | 'OTHER' — The reason as predefined code why the mandate is in a certain status
      - `statusReason` string — Reason explaining the current status of the direct debit mandate, especially useful for failure cases.
      - `creationTime` string, date-time — The time when the mandate was created
      - `lastUpdatedTime` string, date-time — The last time when the mandate was updated
      - `authorisationTime` string, date-time — The time when the mandate was signed by the customer
      - `submissionTime` string, date-time — The time when the mandate was submitted to the payment provider
      - `url` string — The URL where the customer can sign the direct debit mandate.
      - `bankAccountNumber` string — The bank account number associated with the mandate.
      - `mandateContactId` string — The ID of the person linked as the mandate contact
      - `distributionTime` string, date-time — The time when the mandate was first sent to the customer
      - `lastNotificationSentTime` string, date-time — The time when the mandate was last sent to the customer
    - `billerBankAccount` CustomerBankAccount — The bank account of the customer used for bank transfers
      - `accountHolderAddress` Address — The address of a biller location
        - `id` string — The internal id of the address.
        - `city` string — The name of the city.
        - `postalCode` string — The postal code.
        - `country` string — The name of the biller country.
        - `addressLine1` string — The name of the street, and the house or building number.
      - `accountHolderName` string, required — Full name of the bank account holder as registered with the bank.
      - `bankAccount` BankAccount, required
        - `accountNumber` string
        - `sortCode` string
      - `bankAddress` Address — The address of a biller location
        - `id` string — The internal id of the address.
        - `city` string — The name of the city.
        - `postalCode` string — The postal code.
        - `country` string — The name of the biller country.
        - `addressLine1` string — The name of the street, and the house or building number.
      - `currencyCode` 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GGP' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'IMP' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SPL' | 'SRD' | 'STD' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TVD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VEF' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XDR' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWD', required — Currency of the bank account (ISO 4217).
    - `timezone` string — The timezone of the customer.
    - `discount` CustomerDiscount — The customer discount details.
      - `percentage` number — The discount as a percentage to be applied for the invoices.
      - `period` integer — The period in hours until the discount expires.
    - `externalData` CustomerExternalData[] — References about this customer from external platforms Adfin integrates with, such as ID, etc.
      - `connectorType` 'XERO' | 'QUICKBOOKS', required — The name of the platform for which this data is stored for.
      - `id` string, required — The ID of the Customer in the external platform.
      - `name` string — The name of the Customer in the external platform.
    - `tags` string[] — The tag ids associated with the customer.
    - `status` 'ACTIVE' | 'ARCHIVED' — The status of the customer (ACTIVE, ARCHIVED)
    - `statusReasonCode` 'MERGED' | 'ARCHIVED_MANUALLY' — The reason as a predefined code for why the customer is in a certain status
    - `settings` CustomerSettingsResponse — Customer settings
      - `paymentSettings` CustomerPaymentSettingsResponse — Customer payment settings
        - `allowPartialPayments` boolean — Indicates whether partial payments are allowed
        - `minPartialPaymentAmount` number — The minimum amount for partial payments
        - `surchargeIsEnabled` boolean — Indicates whether a surcharge is applied to commercial card payments
        - `lateFeesIsEnabled` boolean — Indicates whether late fees calculation is enabled
    - `trackingItems` TrackingItemCatalogueResponse[] — The tracking item catalogues associated with the customer.
      - `id` string, uuid — The id of the tracking item catalogue entry
      - `name` string — The name of the tracking item catalogue entry
      - `externalData` CatalogueExternalDataRequest[] — The external data of the tracking item catalogue entry
        - `connectorType` 'XERO' | 'QUICKBOOKS' | 'PLATFORM' — The name of the platform for which this data is stored for.
        - `externalId` string — The unique id of the item in the external platform.
      - `items` TrackingItemCatalogueResponse[] — The child tracking items (options) of this category
    - `office` InvoiceOfficeResponse — The office associated with the customer.
      - `id` string, uuid — The unique identifier of the office.
      - `name` string — The name of the office.
      - `trackingItemId` string, uuid — The tracking item identifier.
      - `details` InvoiceOfficeDetailsResponse — The office contact and address details.
        - `email` string — The office email address.
        - `addressLine1` string — The first line of the address.
        - `addressLine2` string — The second line of the address.
        - `city` string — The city.
        - `country` string — The country.
        - `postcode` string — The postcode.
  - `url` string — The URL where the customer can sign the direct debit mandate.
  - `redirectUrl` string — The (optional) redirect URL to redirect the user after they sign the mandate
  - `sender` SenderResponse — The sender details.
    - `name` string — The registration name of the sender.
  - `bankAccountNumber` string — The mandate bank account number
  - `sortCode` string — The mandate sort code
  - `bankAccountHolderName` string — The mandate bank account holder name
  - `mandateContactId` string — The ID of the person linked as the mandate contact

## Other responses

- `400` — Invalid input was provided in the request

---

[API](https://skmtc.net/adfin/apis/adfin-api.md) · [All operations](https://skmtc.net/adfin/apis/adfin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/adfin/adfin-api/versions/c188ba232e1d/schema)
