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

# Fetch customer details



## OpenAPI

````yaml GET /external/customer/search
openapi: 3.1.0
info:
  title: OpenAPI Valyx API
  description: To demonstrate features in the Valyx
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.valyx.com
security:
  - bearerAuth:
      - demo-api
tags:
  - name: billing
    description: External Billing APIs
  - name: external
    description: External APIs for customers
  - name: invoice
    description: Invoice APIs
  - name: creditNote
    description: Credit Note APIs
paths:
  /external/customer/search:
    get:
      tags:
        - external
      summary: Search customers based on passed search parameters
      operationId: get_customer_search
      parameters:
        - name: amountType
          in: query
          schema:
            type: string
        - name: identifierType
          in: query
          schema:
            type: string
            enum:
              - GSTIN
              - PAN
              - BUYER_ID
              - CUSTOMER_NAME
        - name: identifierValue
          in: query
          schema:
            type: string
        - name: minAmount
          in: query
          schema:
            type: number
        - name: maxAmount
          in: query
          schema:
            type: number
        - name: invoiceStatus
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            enum:
              - OVERDUE
              - DUE
              - NO_DUES
              - VOID
          description: list of invoice statuses to filter by
        - name: paymentStatus
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            enum:
              - PAID
              - UNPAID
              - PARTIALLY_PAID
          description: list of payment statuses to filter by
        - name: customerStatus
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            enum:
              - PROSPECT
              - LIVE
              - CHURNED
              - INACTIVE
          description: list of customer statuses to filter by
        - name: tag
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: list of tag key-value pair to filter by
        - name: excludeTag
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: list of tag key-value pair to filter by (exclude)
        - name: excludeTagKey
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: list of tag key to filter by (exclude)
        - name: ownerId
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: owner ID to search by
        - name: ownerRole
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: owner role to search by
        - name: notOwnerRole
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: not owner role to search by
        - name: contactRole
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: contact role to search by
        - name: notContactRole
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: not contact role to search by
        - name: page
          in: query
          required: true
          schema:
            type: integer
          description: Page number for pagination.
        - name: pageSize
          in: query
          required: true
          schema:
            type: integer
          description: Page size for pagination.
        - name: dateType
          in: query
          schema:
            type: string
            enum:
              - INVOICE_DATE
              - DUE_DATE
              - PROMISE_TO_PAY_DATE
        - name: startDate
          in: query
          schema:
            type: string
          description: Start date for invoices
        - name: endDate
          in: query
          schema:
            type: string
          description: End date for invoices
        - name: createdAtStart
          in: query
          schema:
            type: string
          description: >-
            Customer creation date start - will return customers created on or
            after this date. Pass as YYYY-MM-DD string
        - name: createdAtEnd
          in: query
          schema:
            type: string
          description: >-
            Customer creation date end - will return customers created on or
            before this date. Pass as YYYY-MM-DD string
        - name: updatedAtStart
          in: query
          schema:
            type: string
          description: >
            Return customers whose `updatedAt` is on or after this date. Pass as
            `YYYY-MM-DD`.
        - name: updatedAtEnd
          in: query
          schema:
            type: string
          description: >
            Return customers whose `updatedAt` is on or before this date. Pass
            as `YYYY-MM-DD`.


            **Gotcha:** the end-date comparison is a raw `<=` against the
            `updated_at` DateTime

            column (same semantics as `createdAtEnd`). A customer that was
            updated late on the end

            day may fall outside the window — pass the next day if you need the
            full end day covered.
        - name: currencies
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
          description: Currencies
        - name: X-Valyx-Signature
          in: header
          required: true
          schema:
            type: string
          description: Auth key
        - name: X-Fields
          in: header
          description: An optional fields mask
          schema:
            type: string
            format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CustomerDetailExternalApiResponseResponseModel
components:
  schemas:
    CustomerDetailExternalApiResponseResponseModel:
      properties:
        error:
          type: string
        message:
          type: string
        data:
          $ref: '#/components/schemas/CustomerDetailExternalApiResponseModel'
      type: object
    CustomerDetailExternalApiResponseModel:
      properties:
        totalDocs:
          type: integer
        docs:
          type: array
          items:
            $ref: '#/components/schemas/CustomerDetailExternalApiResponseModelDocs'
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
        pageNumber:
          type: integer
        pageSize:
          type: integer
        totalPages:
          type: integer
        prevPageNumber:
          type: integer
        nextPageNumber:
          type: integer
      type: object
    CustomerDetailExternalApiResponseModelDocs:
      properties:
        id:
          type: string
        buyerId:
          type: string
        companyId:
          type: string
        name:
          type: string
        alias:
          type: string
        registeredAddress:
          $ref: >-
            #/components/schemas/CustomerDetailExternalApiResponseModelDocsregisteredAddress
        addresses:
          type: array
          items:
            $ref: >-
              #/components/schemas/CustomerDetailExternalApiResponseModelDocsaddresses
        contacts:
          type: array
          items:
            $ref: >-
              #/components/schemas/CustomerDetailExternalApiResponseModelDocscontacts
        internalStakeholders:
          type: array
          items:
            $ref: >-
              #/components/schemas/CustomerDetailExternalApiResponseModelDocsinternalStakeholders
        taxIdentifiers:
          type: array
          items:
            $ref: >-
              #/components/schemas/CustomerDetailExternalApiResponseModelDocstaxIdentifiers
        customerContactPerson:
          type: string
        currency:
          type: string
        currencyId:
          type: string
        tags:
          type: object
        metaData:
          type: object
        customerStatus:
          type: string
        upcomingCustomerStatus:
          type: string
        upcomingCustomerStatusChangeDate:
          type: string
        upcomingCustomerStatusChangeReason:
          type: string
        upcomingCustomerStatusChangeByUserid:
          type: string
        isManuallyCreated:
          type: boolean
        erpId:
          type: string
        createdAt:
          type: string
        updatedAt:
          type: string
        totalInvoiceAmount:
          type: number
        totalPaidAmount:
          type: number
        totalOutstandingAmount:
          type: number
        totalAdjustedAmount:
          type: number
        invoiceCount:
          type: number
        creditNoteCount:
          type: number
        overdueAmount:
          type: number
        overdueCount:
          type: number
      type: object
    CustomerDetailExternalApiResponseModelDocsregisteredAddress:
      properties:
        line1:
          type: string
        line2:
          type: string
        state:
          type: string
        city:
          type: string
        country:
          type: string
        zipCode:
          type: string
      type: object
    CustomerDetailExternalApiResponseModelDocsaddresses:
      properties:
        line1:
          type: string
        line2:
          type: string
        state:
          type: string
        city:
          type: string
        country:
          type: string
        zipCode:
          type: string
      type: object
    CustomerDetailExternalApiResponseModelDocscontacts:
      properties:
        id:
          type: string
        name:
          type: string
        primaryPhone:
          type: string
        primaryEmail:
          type: string
        role:
          type: string
      type: object
    CustomerDetailExternalApiResponseModelDocsinternalStakeholders:
      properties:
        id:
          type: string
        name:
          type: string
        primaryPhone:
          type: string
        primaryEmail:
          type: string
        role:
          type: string
        isRegistered:
          type: boolean
      type: object
    CustomerDetailExternalApiResponseModelDocstaxIdentifiers:
      properties:
        value:
          type: string
        type:
          type: string
      type: object

````