---
title: "Search Company by Customer Code"
url: "https://developer.yukisoftware.com/apis/yuki-platform-api-prod-1/versions/1237fe18-1f8f-477a-8f52-b3546dd409bf/operations/searchCompanyByCustomerCode"
---

> Full API specification: https://developer.yukisoftware.com/apis/yuki-platform-api-prod-1/versions/1237fe18-1f8f-477a-8f52-b3546dd409bf.md

# Search Company by Customer Code

`GET` `/portals/{portal-id}/companies/search/byCustomerCode`

Operation ID: `searchCompanyByCustomerCode`

This endpoint allows searching for a company within a specific portal by its internal customer code. Returns the company details if a match is found. Users attempting to perform this operation need to ensure they possess the necessary permissions. You should have yukiapi:portal:portals:read scope to access this endpoint. <!-- authorization:start --> **Authorization** Called with a **Portal User** token - an employee of an accounting portal. The caller must hold at least one of these roles in the portal: `AccountantManagement`, `Accountant`. <!-- authorization:end -->

## Path parameters

- `portal-id` (string, required) - The portal id

## Query parameters

- `customerCode` (string, required) - The internal customer code to search for

## Header parameters

- `Authorization` (string, required) - Bearer token for authentication
- `Content-Type` (string, required) - Content type of the request body

## Responses

- `200` - Company object
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `500` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Yuki Platform API Prod
  version: 1.0.52
servers:
  - url: https://apirest.yukiworks.com/api/v1
paths:
  /portals/{portal-id}/companies/search/byCustomerCode:
    get:
      x-environments:
        - development
        - pilot
        - production
      x-portal-visibility:
        - internal
        - trusted
        - prod
      x-required-roles:
        - any-of:
            - AccountantManagement
            - Accountant
          scope: portal
      summary: Search Company by Customer Code
      description: >-
        This endpoint allows searching for a company within a specific portal by
        its internal customer code. Returns the company details if a match is
        found. Users attempting to perform this operation need to ensure they
        possess the necessary permissions. You should have
        yukiapi:portal:portals:read scope to access this endpoint.


        <!-- authorization:start -->


        **Authorization**


        Called with a **Portal User** token - an employee of an accounting
        portal.


        The caller must hold at least one of these roles in the portal:
        `AccountantManagement`, `Accountant`.


        <!-- authorization:end -->
      operationId: searchCompanyByCustomerCode
      tags:
        - Company
      parameters:
        - $ref: "#/components/parameters/AuthorizationHeader"
        - $ref: "#/components/parameters/ContentTypeHeader"
        - $ref: "#/components/parameters/PortalIdPath"
        - $ref: "#/components/parameters/CustomerCodeQuery"
      security:
        - vismaConnectPortalUser:
            - yukiapi:portal:portals:read
      responses:
        "200":
          $ref: "#/components/responses/GetCompanyResponse"
        "400":
          $ref: "#/components/responses/BadRequestResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedResponse"
        "403":
          $ref: "#/components/responses/ForbiddenResponse"
        "404":
          $ref: "#/components/responses/NotFoundResponse"
        "500":
          $ref: "#/components/responses/InternalServerErrorResponse"
security:
  - vismaConnectPortalUser:
      - yukiapi:portal:portals:read
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      description: Bearer token for authentication
      schema:
        type: string
    ContentTypeHeader:
      name: Content-Type
      in: header
      required: true
      description: Content type of the request body
      schema:
        type: string
        default: application/json
    PortalIdPath:
      name: portal-id
      in: path
      required: true
      description: The portal id
      example: 3afb7b54-6144-4561-9a29-1148006f2375
      schema:
        type: string
    CustomerCodeQuery:
      name: customerCode
      in: query
      required: true
      description: The internal customer code to search for
      schema:
        type: string
  responses:
    GetCompanyResponse:
      description: Company object
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Company"
    BadRequestResponse:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/BadRequestError"
    UnauthorizedResponse:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
    ForbiddenResponse:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ForbiddenError"
    NotFoundResponse:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/InternalServerError"
  schemas:
    Company:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the company.
          example: 123e4567-e89b-12d3-a456-426614174000
        companyName:
          type: string
          description: The name of the company.
          example: Example Corp
        companyDescription:
          type: string
          description: A brief description of the company.
          example: Example Corp is a leading provider of innovative solutions.
        address:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/CompanyAddress"
        mailingAddress:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/CompanyAddress"
        country:
          type: string
          nullable: true
          description: Country ISO code.
          example: NL
        emailAddress:
          type: string
          description: Email address.
          example: info@example.com
        phone:
          type: string
          description: Phone number.
          example: +31 20 123 4567
        website:
          type: string
          description: Company website (optional).
          example: https://example.com
        legalForm:
          $ref: "#/components/schemas/LegalForm"
        cocNumber:
          type: string
          description: Chamber of Commerce number.
          example: "12345678"
        internalCustomerCode:
          type: string
          description: Internal customer code (optional).
          example: CUST001
        accountingStartingDate:
          type: string
          format: date
          description: Accounting starting date.
          example: 2024-01-01
        financial:
          $ref: "#/components/schemas/CompanyFinancials"
        peppolConfiguration:
          $ref: "#/components/schemas/PeppolConfiguration"
        domainId:
          type: string
          format: uuid
          description: The unique identifier of the domain where the company belongs.
          example: 456e5678-f90c-23e4-b567-537725285111
      required:
        - peppolConfiguration
      description: Company information object.
    BadRequestError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/bad-request
        title: Bad Request
        status: 400
        detail: The request is invalid or malformed.
        instance: /example/bad-request
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/unauthorized
        title: Unauthorized
        status: 401
        detail: Authentication is required.
        instance: /example/unauthorized
    ForbiddenError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/forbidden
        title: Forbidden
        status: 403
        detail: You do not have permission to access this resource.
        instance: /example/forbidden
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/not-found
        title: Not Found
        status: 404
        detail: The requested resource could not be found.
        instance: /example/not-found
    InternalServerError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/internal-server-error
        title: Internal Server Error
        status: 500
        detail: An unexpected error occurred.
        instance: /example/internal-server-error
    CompanyAddress:
      type: object
      properties:
        address:
          type: string
          nullable: true
          description: Street name and number.
          example: Main Street 123
        address2:
          type: string
          nullable: true
          description: Additional address information.
          example: Suite 456
        postalCode:
          type: string
          nullable: true
          description: Postal code.
          example: 1234AB
        city:
          type: string
          nullable: true
          description: City name.
          example: Amsterdam
      description: Address information object.
    LegalForm:
      type: string
      enum:
        - Unknown
        - SolePartnership
        - PrivateLimited
        - PublicLimited
        - GeneralPartnership
        - LimitedPartnership
        - Partnership
        - Association
        - Foundation
        - Cooperative
      description: >
        Legal form of the company. \

        BE: Unknown, SolePartnership, PrivateLimited, PublicLimited,
        GeneralPartnership, LimitedPartnership, Partnership, Association,
        Foundation, Cooperative. \

        NL: values to be added later
      example: PrivateLimited
    CompanyFinancials:
      type: object
      properties:
        vatNumber:
          type: string
          nullable: true
          description: VAT number.
          example: NL123456789B01
        fiscalNumber:
          type: string
          nullable: true
          description: Fiscal number.
          example: "123456789"
        payrollTaxNumber:
          type: string
          nullable: true
          description: Payroll tax number.
          example: "987654321"
        vatLiable:
          type: boolean
          nullable: true
          description: VAT liable indicator.
          example: true
        mixedOrPartialLiable:
          $ref: "#/components/schemas/MixedOrPartialLiable"
        icpFrequency:
          $ref: "#/components/schemas/ICPFrequency"
        vatFrequency:
          $ref: "#/components/schemas/VATFrequency"
        pettyCash:
          $ref: "#/components/schemas/PettyCashOption"
        financialYearFollowsCalendarMonths:
          type: boolean
          description: Whether the financial year follows calendar months.
          example: true
        yukiStartKeepingFinancialRecordsYear:
          type: string
          description: The year when Yuki started keeping financial records.
          example: "2023"
        yukiStartKeepingFinancialRecordsDate:
          type: string
          format: date-time
          description: The date when Yuki started keeping financial records.
          example: 2023-01-01T00:00:00Z
      description: Financial object containing financial-related settings.
    PeppolConfiguration:
      type: object
      required:
        - enableSending
        - enableReceiving
      properties:
        enableSending:
          type: boolean
          description: Whether Peppol sending is enabled for this company. Defaults to
            false when the company is not registered on Peppol.
          default: false
        enableReceiving:
          type: boolean
          description: Whether Peppol receiving is enabled for this company. Defaults to
            false when the company is not registered on Peppol.
          default: false
      description: Peppol configuration object containing Peppol-related settings.
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          example: https://dev.yuki.nl/errors/problem
        title:
          type: string
          example: Problem
        status:
          type: integer
          example: 500
        detail:
          type: string
          example: An unexpected error occurred.
        instance:
          type: string
          example: /example/endpoint
    MixedOrPartialLiable:
      type: string
      nullable: true
      enum:
        - No
        - Mixed
        - Partial
      description: Mixed or partial liable indicator.
      example: No
    ICPFrequency:
      type: string
      nullable: true
      enum:
        - None
        - Yearly
        - Quarterly
        - Monthly
      description: ICP frequency indicator.
      example: Monthly
    VATFrequency:
      type: string
      nullable: true
      enum:
        - None
        - Yearly
        - Quarterly
        - Monthly
      description: VAT frequency indicator.
      example: Monthly
    PettyCashOption:
      type: string
      nullable: true
      enum:
        - Unknown
        - Regularly
        - Petty
        - None
      description: |
        Cash usage option: Unknown, Regularly, Petty, None
      example: Regularly
  securitySchemes:
    vismaConnectPortalUser:
      type: oauth2
      description: >
        Visma Connect token belonging to a **Portal User** - an employee of an
        accounting portal. The token carries a `portal-id` claim, and the portal
        it identifies must match the portal in the route. Unless an endpoint
        says otherwise, the caller's roles are resolved against the portal.
      flows:
        authorizationCode:
          authorizationUrl: https://connect.identity.stagaws.visma.com/connect/authorize
          tokenUrl: https://connect.identity.stagaws.visma.com/connect/token
          scopes:
            yukiapi:domain:companies:read: Allows reading information of a Company
            yukiapi:domain:companies:update: Allows the update of a Company
            yukiapi:portal:portals:read: Allows reading portal information
            yukiapi:domain:domains:read: Allows reading domains information
            yukiapi:domain:domains:write: Allows modifications of domain information, may
              include create/update
            yukiapi:domain:domains:create: Allows the creation of new domains
            yukiapi:domain:domains:update: Allows updating existing domain information
            yukiapi:domain:domains:delete: Allows the deletion of domain data
            yukiapi:domain:users:read: Allows reading of domain user data
            yukiapi:domain:users:write: Allows the update of domain user data, may include create/update
            yukiapi:domain:users:update: Allows updating a Domain User
            yukiapi:domain:users:delete: Allows the deletion of Domain Users
            yukiapi:portal:portals:write: Allows updating existing portal information
            yukiapi:portal:users:read: Allows reading Portal user data
            yukiapi:portal:users:write: Allows the update of Portal user, may include create/update
            yukiapi:portal:users:update: Allows updating an existing Portal User
            yukiapi:portal:users:delete: Allows the deletion of a Portal User
```
