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

# Get customer by reference id

> Get a customer by your own reference id, including the users and cases related to the customer.



## OpenAPI

````yaml GET /v1/{tenantId}/customers/by-reference-id/{referenceId}
openapi: 3.0.1
info:
  title: Debbie Creditor API Docs
  description: >-
    The Debbie Creditor API is a RESTful interface allowing you, as a creditor,
    to programmatically send data to your debt collection partner 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 integrate with your own systems, for
    example your ERP or invoicing system.
  version: v1.0.0
  x-logo:
    url: https://debbie-platform.github.io/creditor-api-docs/deb-logo.svg
servers:
  - url: https://api.debbiecollect.com
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: Endpoints for interacting with customers
  - name: Files
    description: Endpoints for interacting with files
  - 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 |


      Your debt collection partner may also have defined custom voucher types.
      If you need a type that is not listed here, please reach out to them.
externalDocs:
  description: Find out more about Debbie here
  url: https://debbiecollect.com
paths:
  /v1/{tenantId}/customers/by-reference-id/{referenceId}:
    get:
      tags:
        - Customers
      summary: Get customer by reference id
      description: >-
        Get a customer by your own reference id, including the users and cases
        related to the customer.
      operationId: get-customer-by-reference-id
      parameters:
        - in: path
          name: tenantId
          schema:
            type: string
            format: uuid
          required: true
          description: >-
            Id of your debt collection partner's tenant. You can find it on the
            API page in the creditor portal.
        - in: path
          name: referenceId
          schema:
            type: string
          required: true
          description: >-
            Your reference id for the customer. Typically the customer number
            from your own system.
        - in: query
          name: creditorId
          schema:
            type: string
            format: uuid
          required: true
          description: >-
            Your creditor id. You can find it on the API page in the creditor
            portal.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCustomer'
              example:
                customerId: 268b30d2-e895-42b9-8a38-2451a87e19b2
                creditorId: a7fcf07c-74f2-40d9-8ea6-e67b07b14ca4
                isCompany: false
                referenceId: '123'
                createdAt: '2024-04-19T07:30:21.070Z'
                users:
                  - contact: true
                    lang: da
                    relation: debtor
                    details:
                      name: Hans Hansen
                      email: example@debbie.dk
                      phone:
                        locale: '45'
                        number: '12345678'
                      address:
                        address: Applebys Plads 7, 1.
                        coAddress: null
                        city: København K
                        zipcode: '1411'
                        country: Danmark
                cases:
                  - caseId: 268b30d2-e895-42b9-8a38-2451a87e19b2
                    id: 123456
                    status: VERIFIED
                    endReason: null
                    statusTime: '2024-04-19T07:30:21.070Z'
                    createdAt: '2024-04-19T07:30:21.070Z'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    GetCustomer:
      type: object
      properties:
        creditorId:
          type: string
          format: uuid
          description: Id of creditor
        createdAt:
          type: string
          description: Customer created at
        customerId:
          type: string
          format: uuid
          description: Id of the customer
        tenantId:
          type: string
          format: uuid
          description: Id of the tenant
        referenceId:
          type: string
          description: >-
            Reference id of the customer. Typically id of the customer, client,
            patient or similar.
        isCompany:
          type: boolean
          description: Whether the customer is a company.
        users:
          type: array
          description: List of users related to this customer
          items:
            $ref: '#/components/schemas/UserOnCustomer'
        cases:
          type: array
          description: List of cases related to this customer
          items:
            $ref: '#/components/schemas/CaseOnCustomer'
    UserOnCustomer:
      type: object
      properties:
        userId:
          type: string
          format: uuid
          description: Id of the user
        id:
          type: number
          description: Sequential id of the user
        relation:
          type: string
          enum:
            - debtor
            - alternative-contact
          description: Type of relation to the customer
        contact:
          type: boolean
          description: Whether the user is the contact person
        customerId:
          type: string
          format: uuid
          description: Id of the customer
        lang:
          $ref: '#/components/schemas/Language'
          description: The language of the user
        details:
          type: object
          properties:
            name:
              type: string
              description: Name of the user
            cpr:
              type: string
              description: The cpr number of a user, only used when user is a person.
            cvr:
              type: string
              description: The cvr number of a user, only used when user is a company.
            email:
              type: string
              description: The email of the user
            phone:
              type: object
              description: The users' phone number with locale
              properties:
                number:
                  type: string
                  description: The users' phone number. For example 12345678.
                locale:
                  type: string
                  description: The users' phone locale. For example 45.
            address:
              $ref: '#/components/schemas/Address'
              description: The debtors address
            geocode:
              type: object
              properties:
                latitude:
                  type: number
                longitude:
                  type: number
    CaseOnCustomer:
      type: object
      properties:
        caseId:
          type: string
          format: uuid
          description: Id of the case
        id:
          type: number
          description: Sequential id of the case
        status:
          type: string
          enum:
            - PENDING
            - VERIFIED
            - ENDED
          description: Status of the case
        endReason:
          $ref: '#/components/schemas/CaseEndReason'
        statusTime:
          type: string
          description: Case status changed at
        createdAt:
          type: string
          description: Case created at
    Language:
      type: string
      enum:
        - bm
        - ba
        - eu
        - be
        - bn
        - bh
        - bi
        - bs
        - br
        - bg
        - my
        - ca
        - ch
        - ce
        - ny
        - zh
        - cv
        - kw
        - co
        - cr
        - hr
        - cs
        - da
        - dv
        - nl
        - dz
        - en
        - eo
        - et
        - ee
        - fo
        - fj
        - fi
        - fr
        - ff
        - gl
        - ka
        - de
        - el
        - gn
        - gu
        - ht
        - ha
        - he
        - hz
        - hi
        - ho
        - hu
        - ia
        - id
        - ie
        - ga
        - ig
        - ik
        - io
        - is
        - it
        - iu
        - ja
        - jv
        - kl
        - kn
        - kr
        - ks
        - kk
        - km
        - ki
        - rw
        - ky
        - kv
        - kg
        - ko
        - ku
        - kj
        - la
        - lb
        - lg
        - li
        - ln
        - lo
        - lt
        - lu
        - lv
        - gv
        - mk
        - mg
        - ms
        - ml
        - mt
        - mi
        - mr
        - mh
        - mn
        - na
        - nv
        - nd
        - ne
        - ng
        - nb
        - nn
        - 'no'
        - ii
        - nr
        - oc
        - oj
        - cu
        - om
        - or
        - os
        - pa
        - pi
        - fa
        - pl
        - ps
        - pt
        - qu
        - rm
        - rn
        - ro
        - ru
        - sa
        - sc
        - sd
        - se
        - sm
        - sg
        - sr
        - gd
        - sn
        - si
        - sk
        - sl
        - so
        - st
        - es
        - su
        - sw
        - ss
        - sv
        - ta
        - te
        - tg
        - th
        - ti
        - bo
        - tk
        - tl
        - tn
        - to
        - tr
        - ts
        - tt
        - tw
        - ty
        - ug
        - uk
        - ur
        - uz
        - ve
        - vi
        - vo
        - wa
        - cy
        - wo
        - fy
        - xh
        - yi
        - yo
        - za
        - zu
      description: Language.
    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
    CaseEndReason:
      type: string
      enum:
        - PAID
        - OVERPAYMENT
        - PARTIALLY_PAID
        - DEAD
        - BANKRUPTCY
        - OBJECTION
        - ERROR_CREDITOR
        - ERROR_US
        - WITHDRAWN
        - EXPIRATION
        - IRRECOVERABLE
        - TRANSFERRED
        - NO_COURT
        - UNIDENTIFIED
        - OFFER_FROM_US
        - OFFER_FROM_DEBTOR
        - FORCED_DISSOLVED
        - NEGATIVE_PAYOFF
        - DEPARTED
        - CREDITOR_UNRESPONSIVE
        - MERGED
        - FIRE_AND_FORGET
        - SMALL_CASE_NOT_WANTED
        - ADDRESS_UNKNOWN
        - DEBT_RELIEF
        - CONFLICT_OF_INTEREST
        - MINOR
        - DELETED
        - NO_DEBT
      description: Reason why the case is ended
  responses:
    UnauthorizedError:
      description: Access token missing or invalid
    NotFoundError:
      description: The requested resource was not found
    UnprocessableContent:
      description: Unable to process the contained instructions.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication with an API key can be done by using a bearer token in
        the Authorization header. This is done using the following format
        `Authorization: Bearer {token}`. API keys are issued and revoked
        directly from the creditor portal under Developers > API.

````