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

# Create creditor

> Create new creditor allows the api consumer to create new creditors



## OpenAPI

````yaml POST /v1/{tenantId}/creditors
openapi: 3.1.0
info:
  title: Debbie Platform API Docs
  description: >
    The Debbie API is a RESTful interface, allowing you to programmatically

    update, add and access your data in the platform. It provides predictable
    URLs

    for accessing resources, and uses built-in HTTP features to receive commands
    and

    return responses. This makes it easy to communicate with third party
    systems.


    ## Idempotency


    The Debbie API supports idempotency for non-idempotent requests through the
    optional `Idempotency-Key` header. 

    This ensures that retrying the same request multiple times will produce the
    same result, preventing duplicate operations.


    ### Using Idempotency Keys


    - Include an `Idempotency-Key` header with a unique string (we recommend
    UUIDs)  

    - Maximum key length is 64 characters

    - Keys are valid for 48 hours

    - Responses served from the idempotency cache include an
    `Idempotency-Cached` header


    ### Example

    ```http

    Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000

    ```


    ### Error Cases

    - Invalid key format: 400 Bad Request

    - Reusing a key for a different request: 400 Bad Request


    ### Best Practices

    - Use a new key for each unique business transaction

    - Use the same key when retrying a failed request 

    - Store keys with request details for debugging
  contact:
    email: support@debbie.dk
  version: v0.1.0
  x-logo:
    url: https://debbie-platform.github.io/platform-api-docs/deb-logo.svg
servers:
  - url: https://api.debbiecollect.com
security:
  - bearerAuth: []
tags:
  - name: Authorization
    description: Endpoints for interacting with authorization
  - name: Cases
    description: Endpoints for interacting with cases
  - name: Customers
    description: Endpoints for interacting with customers
  - name: Creditors
    description: Endpoints for interacting with creditors
  - name: Updates
    description: Endpoints for interacting with updates
  - name: Users
    description: Endpoints for interacting with updates
  - name: Files
    description: Endpoints for interacting with files
  - name: Case vouchers
    description: Endpoints for interacting with case vouchers
  - name: Billing
    description: Endpoints for interacting with billing
  - name: Links
    description: Endpoints for generating links
  - name: Webhooks
    description: >-
      Debbie provides a range of webhooks. To try them out please visit Debbie
      Caseworker and navigate to Settings --> Developers --> Webhooks.
  - name: Voucher Type Ids
    description: >
      ### Principals:

      | Type | id |

      | --- | --- |

      | Invoice (Faktura)          | eb41e58e-fccf-419d-a771-cd5027fe6e87 |

      | Credit note (Kreditnota)       | ef2cdc50-230f-4046-b1af-0f9c498dddd3 |

      | Final statement (OpgÃ¸relse)        |
      42385ae0-6846-425c-a793-8d47a3b190b5 |

      | On account invoice (Acontofaktura)    |
      2d101b6e-74f9-4a4d-9f8e-c7abe2264da0 |

      | Loan (GÃ¦ldsbrev)        | bf61f462-6d3c-42e8-a99a-852d4a664926 |


      ### Costs:

      | Type | id |

      | --- | --- |

      | Collection cost (Inkassoomkostning)        |
      07960de4-303d-4793-92da-3a8cfd5da1a1 |

      | Collection fee (Inkassogebyr)             |
      4c3ccbbf-0651-45b2-b37b-4fe736acfd7e |

      | Reminder fee (Rykkergebyr)              |
      3e51bf87-3c8f-4dd5-abd5-69417d113c89 |

      | Compensation cost (Kompensationsgebyr)       |
      ed3e3d61-e1bc-4ee2-9166-adf2c41a2bbf |


      ### Interests:

      | Type | id |

      | --- | --- |

      | DK interest (Procesrente)               |Â
      ca4af363-9925-436c-83d6-23b3db6ed5d2 |

      | Fixed interest (Fastrente)                 |
      299dc393-1b71-4950-860f-8fb485036722 |

      | Yearly interest (Ã…rlig rente)               |
      37db68dd-80be-40c7-8d2d-3619c793107f |


      ### Transactions:

      | Type | id |

      | --- | --- |

      | Deposit (Indbetaling)               |
      c51f2f6a-8081-45ef-b52d-5e0569fdf12e |
externalDocs:
  description: Find out more about Debbie here
  url: https://debbie.dk
paths:
  /v1/{tenantId}/creditors:
    post:
      tags:
        - Creditors
      summary: Create new creditor
      description: Create new creditor allows the api consumer to create new creditors
      operationId: create-creditor
      parameters:
        - in: path
          name: tenantId
          schema:
            type: string
            format: uuid
          required: true
          description: Id of the tenant the creditor is being created for
      requestBody:
        description: New creditor object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewCreditor'
            example:
              id: My reference
              name: John Doe's Factories
              centralRegisterId: DK40125949
              isCompany: true
              address:
                address: Applebys Pl. 7, 1.
                coAddress: null
                city: København K
                zipcode: '1411'
                country: Danmark
              notes: Note to self (and my colleagues).
              erpLink: https://example.com?id={{customerReferenceId}}&test
              acquisitionResponsibleId: 9409b6d8-cde5-45f1-b8e1-e756847a7077
              contactId: bb71f936-c60c-4ad7-82f6-eddca673d30f
              caseworkerContactId: 9409b6d8-cde5-45f1-b8e1-e756847a7077
              defaultWorkflowId: 3057ca58-d39d-48ec-9d79-c45182b92ca0
              state: ACTIVE
              vatRegistered: true
              aksEnabled: true
              bankAccountDetails:
                type: DANISH
                registrationNumber: '1234'
                accountNumber: '00012345678'
              selfCollection: false
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditorCreated'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    NewCreditor:
      type: object
      properties:
        id:
          type: string
          description: Id from your internal systems. For example your ERP creditor id.
        name:
          type: string
          description: Name of the creditor.
        centralRegisterId:
          type: string
          description: Central register id. For example "DK40125949"
        isCompany:
          type: boolean
          description: Whether the creditor is a company.
        address:
          $ref: '#/components/schemas/Address'
          description: The creditors' address
        notes:
          type: string
          description: Creditor notes.
        erpLink:
          type: string
          description: >-
            Link to creditors' ERP system (
            https://example.com?id={{customerReferenceId}}&test ).
        acquisitionResponsibleId:
          type: string
          format: uuid
          description: >-
            Id of the user who is responsible for the acquisition of the
            creditor.
        contactId:
          type: string
          format: uuid
          description: Id of the client user who is case responsible.
        caseworkerContactId:
          type: string
          format: uuid
          description: Id of the caseworker user who is case responsible.
        defaultWorkflowId:
          type: string
          format: uuid
          description: Id of the default workflow.
        state:
          type: string
          enum:
            - LEAD
            - SIGNED_ON
            - ACTIVE
            - CANCELLED
            - CEASED
          description: The state of the creditor
        vatRegistered:
          type: boolean
          description: Whether the creditor is vat registered or not.
        aksEnabled:
          type: boolean
          description: Whether Experian AKS is enabled or not.
        bankAccountDetails:
          $ref: '#/components/schemas/BankAccountDetails'
          description: The creditors' bank account
        selfCollection:
          type: boolean
          description: Whether the creditor is collecting for themselves or not.
      required:
        - name
        - isCompany
    CreditorCreated:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Id of the creditor
        reference:
          type: string
          description: Id from your internal systems. For example your ERP creditor id.
      required:
        - id
        - reference
    Address:
      type: object
      properties:
        address:
          type: string
          description: The street name and number of the address
        coAddress:
          type: string
        zipcode:
          type: string
        city:
          type: string
        country:
          type: string
      required:
        - address
        - zipcode
        - city
    BankAccountDetails:
      type: object
      properties:
        type:
          type: string
          enum:
            - DANISH
          description: Type of bank account details
        registrationNumber:
          type: string
        accountNumber:
          type: string
      required:
        - type
        - registrationNumber
        - accountNumber
  responses:
    UnauthorizedError:
      description: Access token missing or invalid
    ConflictError:
      description: Conflict
    UnprocessableContent:
      description: Unable to process the contained instructions.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication can be done by using a bearer token in the Authorization
        header. This is done using the following format `Authorization: Bearer
        {token}`.

````