> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilta.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a mandate

> Authorize Tilta to collect payments directly from a merchant's bank account by creating a SEPA Direct Debit mandate.

A Direct Debit mandate authorizes Tilta to initiate SEPA Direct Debit collections from a merchant's registered bank account – for example, to collect fees or settle a financing adjustment.

<Note>
  SEPA Direct Debit mandates are subject to the SEPA Rulebook. The merchant receives a pre-notification before any debit is
  initiated against their account.
</Note>


## OpenAPI

````yaml POST /v1/merchants/{external_id}/mandates
openapi: 3.0.0
info:
  version: 0.0.1
  title: Tilta API
  description: Tilta API documentation
servers:
  - url: https://api.tilta.io
    description: Tilta Production API
  - url: https://api.tilta-sandbox.io
    description: Tilta Sandbox API
security: []
paths:
  /v1/merchants/{external_id}/mandates:
    post:
      tags:
        - Mandates
      summary: Create a mandate
      description: Creates a Direct Debit mandate for a merchant.
      parameters:
        - schema:
            type: string
            maxLength: 100
            pattern: ^[a-zA-Z0-9-_]+$
            description: Unique identifier of a merchant.
          required: true
          name: external_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                iban:
                  type: string
                  description: IBAN for mandate.
                  example: DE03500105177178979259
              required:
                - iban
              additionalProperties: false
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  mandate_id:
                    type: string
                    description: Unique mandate id
                    example: TLT PLT 00000001
                  created_at:
                    type: number
                    description: Mandate creation date (unix time in seconds).
                    example: 1582896122
                  updated_at:
                    type: number
                    description: Mandate updating date (unix time in seconds).
                    example: 1582896122
                required:
                  - mandate_id
                  - created_at
                  - updated_at
                description: Mandate has been successfully created.
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/badRequestSchema'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedRequestSchema'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/merchantNotFoundSchema'
        '409':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error details.
                    example: Mandate with provided IBAN already exists for this Buyer
                  code:
                    type: string
                    description: Error code.
                    example: CONFLICT
                required:
                  - error
                  - code
                description: Mandate with provided IBAN already exists.
      security:
        - bearerAuth: []
components:
  schemas:
    badRequestSchema:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: BAD_REQUEST
        error:
          type: string
          description: Error message for debugging purposes
          example: Request validation failed. 1 issue found.
        issues:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Issue code
                example: INVALID_TYPE
              path:
                type: string
                description: Issue path starting with body, params, querystring, or headers
                example: body.registered_at
              message:
                type: string
                description: Issue message for debugging purposes
                example: Invalid type
            required:
              - code
              - path
              - message
          description: List of issues
          example:
            - code: INVALID_TYPE
              path: body.registered_at
              message: Invalid type
      required:
        - code
        - error
        - issues
      description: Bad Request, see error message for details.
      example:
        code: BAD_REQUEST
        error: Request validation failed. 1 issue found.
        issues:
          - code: INVALID_TYPE
            path: body.registered_at
            message: Invalid type
    unauthorizedRequestSchema:
      type: object
      properties:
        error:
          type: string
          description: Error details.
          example: Unauthorized
        code:
          type: string
          description: Error code.
          example: UNAUTHORIZED
      required:
        - error
        - code
      description: Unauthorized Request.
      example:
        error: Unauthorized
        code: UNAUTHORIZED
    merchantNotFoundSchema:
      type: object
      properties:
        error:
          type: string
          description: Error details.
          example: No Entity found
        code:
          type: string
          description: Error code.
          example: NOT_FOUND
      required:
        - error
        - code
      description: Merchant not found
      example:
        error: No Entity found
        code: NOT_FOUND
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your Tilta API key, sent as `Bearer <key>`.

````