> ## 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.

# Register direct payment

> Register money the debtor paid straight to the creditor rather than to the collector, against the case voucher it settles.

The case voucher is referenced by the creditor's own `referenceId` — normally the invoice number — or by its `caseVoucherId`, exactly one of the two. Either is looked up within the creditor given in `creditorId`, so a reference id must match exactly one case voucher there and an id must belong to that creditor. The whole payment is applied to that one voucher through a fixed distribution, so a payment covering several invoices has to be sent as one request per invoice.

The deposit is always registered with source `CREDITOR`. Use `POST /v1/{tenantId}/case-vouchers/{caseId}` when you need the general case-voucher endpoint instead.

Send an `Idempotency-Key` header, one per request, so a retry within 48 hours is answered with the original result instead of registering the payment again. See [Idempotency](/api-reference/idempotency).

**Required scope:** `write:case-vouchers`



## OpenAPI

````yaml POST /v1/{tenantId}/direct-payments
openapi: 3.1.0
info:
  title: Debbie 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: api-support@debbie.dk
  version: v0.1.0
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: Ultimate creditors
    description: >-
      Endpoints for interacting with ultimate creditors. An ultimate creditor is
      the original creditor behind the creditor on a case — for example when a
      debt collection agency forwards cases on behalf of its own client. On
      cases with an ultimate creditor, the creditor template mentions (name,
      address and company identifier) use the details of the ultimate creditor.
  - 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: Voucher types
    description: The voucher types of the tenant, used to categorize case vouchers
  - name: Interactions
    description: >-
      Interactions are messages and notes on a case, for example an incoming
      message from a debtor.
  - name: Billing
    description: Endpoints for interacting with billing
  - name: Transaction accounts
    description: >-
      Endpoints for interacting with transaction accounts — the bank and payment
      service provider accounts that payments are registered on
  - 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: End reasons
    description: Endpoints for interacting with end reasons
  - name: Case groups
    description: Endpoints for interacting with case groups
  - name: Documents
    description: Endpoints for attaching documentation to a case or to a creditor
  - name: Direct payments
    description: Endpoints for registering payments made directly to the creditor
externalDocs:
  description: Find out more about Debbie here
  url: https://debbiecollect.com
paths:
  /v1/{tenantId}/direct-payments:
    post:
      tags:
        - Direct payments
      summary: Register direct payment
      description: >-
        Register money the debtor paid straight to the creditor rather than to
        the collector, against the case voucher it settles.


        The case voucher is referenced by the creditor's own `referenceId` —
        normally the invoice number — or by its `caseVoucherId`, exactly one of
        the two. Either is looked up within the creditor given in `creditorId`,
        so a reference id must match exactly one case voucher there and an id
        must belong to that creditor. The whole payment is applied to that one
        voucher through a fixed distribution, so a payment covering several
        invoices has to be sent as one request per invoice.


        The deposit is always registered with source `CREDITOR`. Use `POST
        /v1/{tenantId}/case-vouchers/{caseId}` when you need the general
        case-voucher endpoint instead.


        Send an `Idempotency-Key` header, one per request, so a retry within 48
        hours is answered with the original result instead of registering the
        payment again. See [Idempotency](/api-reference/idempotency).


        **Required scope:** `write:case-vouchers`
      operationId: create-direct-payment
      parameters:
        - in: path
          name: tenantId
          schema:
            type: string
            format: uuid
          required: true
          description: Id of the tenant
        - in: query
          name: creditorId
          schema:
            type: string
            format: uuid
          required: true
          description: Id of the creditor the case voucher belongs to
      requestBody:
        description: The payment
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewDirectPayment'
            example:
              caseVoucherReferenceId: D12412347
              amount: 120000
              date: '2026-06-04'
              currency: DKK
        required: true
      responses:
        '201':
          description: The payment was registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DirectPayment'
        '400':
          description: >-
            The payment cannot be placed on the referenced case voucher.
            `message` says why:


            - `Reference id … matches more than one case voucher, so the payment
            cannot be placed` — send `caseVoucherId` instead.

            - `Payment is in … but case voucher … is in …` — the `currency` sent
            does not match the voucher's.

            - `Case voucher … is expired and can no longer be paid`.

            - `Case voucher … is not a debt` — the voucher is a payment or a
            credit note, not an invoice or a fee.

            - `Amount … exceeds the … still outstanding on case voucher …` — the
            amount is more than what is left on the voucher, counting payments
            already registered against it.
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: >-
            No case voucher matched: `No case voucher found with id …` or `No
            case voucher found with reference id …`. The voucher does not exist
            within the creditor's creditor, has been deleted, or is not on a
            case yet.
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    NewDirectPayment:
      type: object
      properties:
        caseVoucherId:
          type: string
          format: uuid
          description: >-
            Debbie's id of the case voucher the money paid off, as returned when
            the voucher was created. It must belong to the creditor. Give either
            this or `caseVoucherReferenceId`, not both.
        caseVoucherReferenceId:
          type: string
          description: >-
            The creditor's reference for the case voucher the money paid off —
            normally the invoice number. It is looked up within the creditor
            given in `creditorId`, and must match exactly one case voucher. Give
            either this or `caseVoucherId`, not both.
        amount:
          type: integer
          description: >-
            The amount paid, positive, in the minor unit. 1,200.00 is sent as
            120000. It cannot exceed what is still outstanding on the referenced
            case voucher.
        date:
          type: string
          description: The date the money was received. Defaults to now.
        currency:
          $ref: '#/components/schemas/Currency'
          description: >-
            Optional. When given, it must match the currency of the referenced
            case voucher — it is a check, not a conversion.
        text:
          type: string
          description: Free text shown on the payment.
      required:
        - amount
      description: >-
        Exactly one of `caseVoucherId` and `caseVoucherReferenceId` must be
        given; the other may be left out or null. A body with both or neither is
        rejected with `Give exactly one of caseVoucherId and
        caseVoucherReferenceId`.
    DirectPayment:
      type: object
      properties:
        caseId:
          type: string
          format: uuid
          description: Id of the case the payment was registered on
        caseVoucherId:
          type: string
          format: uuid
          description: Id of the created deposit
        amount:
          type: integer
        currency:
          $ref: '#/components/schemas/Currency'
        date:
          type: string
        paidCaseVoucher:
          type: object
          description: The case voucher the payment was applied to
          properties:
            caseVoucherId:
              type: string
              format: uuid
            referenceId:
              type:
                - string
                - 'null'
            amount:
              type: integer
              description: The full amount of the voucher, negative because it is a debt
    Currency:
      type: string
      enum:
        - DKK
        - SEK
        - NOK
        - USD
        - EUR
        - GBP
        - CHF
      description: Currency
  responses:
    UnauthorizedError:
      description: Access token missing or invalid
    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}`.

````