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

# Get customer by ID

> Retrieve detailed information for a specific customer by their unique identifier.

Returns comprehensive customer data including:
- Basic information: name, email, phone
- Address details: billing and shipping addresses
- Custom data: organization-specific custom fields
- Metadata: creation and update timestamps

Requirements:
- Customer must belong to the authenticated organization
- Valid UUID format required for customer_id
- Returns 404 if customer doesn't exist or is not accessible



## OpenAPI

````yaml /openAPI/openapi-20240301.json get /customers/{customer_id}
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /customers/{customer_id}:
    get:
      tags:
        - Customers
      summary: Get customer by ID
      description: >-
        Retrieve detailed information for a specific customer by their unique
        identifier.


        Returns comprehensive customer data including:

        - Basic information: name, email, phone

        - Address details: billing and shipping addresses

        - Custom data: organization-specific custom fields

        - Metadata: creation and update timestamps


        Requirements:

        - Customer must belong to the authenticated organization

        - Valid UUID format required for customer_id

        - Returns 404 if customer doesn't exist or is not accessible
      operationId: Get-customer-by-ID
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Customer Id
      responses:
        '200':
          description: Successfully retrieved customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCustomerResponseSchema'
              example:
                id: 123e4567-e89b-12d3-a456-426614174000
                customer_name: Acme Corporation
                email: billing@acme.com
                phone: +1-555-0100
                billing_address:
                  street: 123 Business Ave
                  city: San Francisco
                  state: CA
                  postal_code: '94102'
                  country: US
                custom_data:
                  industry: Technology
                  company_size: 50-200
                created_at: '2023-01-01T00:00:00'
                updated_at: '2023-06-15T10:30:00'
        '400':
          description: Bad request - invalid customer ID format
          content:
            application/json:
              example:
                error_code: BAD_REQUEST
                message: Invalid customer ID format
        '404':
          description: Customer not found
          content:
            application/json:
              example:
                error_code: NOT_FOUND
                message: >-
                  Customer with id 123e4567-e89b-12d3-a456-426614174000 not
                  found
        '422':
          description: Unprocessable Entity - invalid UUID
          content:
            application/json:
              example:
                status_code: 10422
                message: >-
                  1 validation error for Path; customer_id: value is not a valid
                  uuid
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                error_code: INTERNAL_SERVER_ERROR
                message: Failed to retrieve customer
components:
  schemas:
    GetCustomerResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Customer ID
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: External Customer Id
        customer_name:
          type: string
          title: Customer Name
          description: Customer name
        custom_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Data
          description: Customer Custom Data
        address:
          anyOf:
            - $ref: '#/components/schemas/AddressResponse'
            - type: 'null'
          description: Customer address
        ship_to_address:
          anyOf:
            - $ref: '#/components/schemas/AddressResponse'
            - type: 'null'
          description: Customer Ship To address
        tax_info:
          anyOf:
            - items:
                $ref: '#/components/schemas/TaxId'
              type: array
            - type: 'null'
          title: Tax Info
          description: Customer Tax Ids
          default: []
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: Customer Phone Number
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Customer primary email address
        contacts:
          anyOf:
            - items:
                $ref: '#/components/schemas/ContactResponseSchema'
              type: array
            - type: 'null'
          title: Contacts
          description: List of associated contacts
        custom_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Attributes
          description: Customer Tags
        communications_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Communications Enabled
          description: To enable/disable communications
          default: true
        auto_charge_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Auto Charge Enabled
          description: To enable/disable auto-charge
          default: true
        invoice_details:
          anyOf:
            - $ref: '#/components/schemas/InvoiceDetailsObject'
            - type: 'null'
          description: Invoice Details Object
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Updated At
        default_payment_method:
          anyOf:
            - $ref: '#/components/schemas/CustomerPaymentMethodsResponseSchema'
            - type: 'null'
          description: default_payment_method
        business_entity_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Business Entity Id
          description: Business Entity Id
        business_entity:
          anyOf:
            - $ref: '#/components/schemas/BusinessEntityResponseSchema'
            - type: 'null'
          description: Business Entity
      type: object
      required:
        - id
        - external_id
        - customer_name
        - custom_data
        - address
      title: GetCustomerResponseSchema
      description: Create Customer Response Schema
    AddressResponse:
      properties:
        line1:
          anyOf:
            - type: string
            - type: 'null'
          title: Line1
          description: Street address line 1 (e.g., building number and street name)
        line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Line2
          description: Street address line 2 (e.g., apartment, suite, unit number)
        line3:
          anyOf:
            - type: string
            - type: 'null'
          title: Line3
          description: Street address line 3 (additional address information)
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: City or locality name
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: State, province, or region
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: Postal code or ZIP code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country name (e.g., 'United States')
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: Two-letter ISO country code (e.g., 'US', 'GB')
        validation_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Validation Status
          description: Address validation status
        connector_validation:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Connector Validation
          description: Validation data from external connector
      type: object
      title: AddressResponse
      description: Address Schema
    TaxId:
      properties:
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: Two-letter ISO country code for the tax ID (e.g., 'US', 'GB', 'IN')
        tax_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Code
          description: Type of tax identifier (e.g., 'VAT', 'GST', 'EIN')
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
          description: The actual tax identification number
      type: object
      title: TaxId
      description: Tax Id Schema
    ContactResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Contact Id
        customer:
          type: string
          format: uuid
          title: Customer
          description: ' '
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: Contact first name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: Contact last name
        email:
          type: string
          title: Email
          description: Contact Email
        send_contract:
          type: boolean
          title: Send Contract
          description: Send Contract
          default: false
        send_invoice:
          type: boolean
          title: Send Invoice
          description: Send Contact
          default: true
      type: object
      required:
        - id
        - customer
        - email
      title: ContactResponseSchema
      description: Create & Update Contact Response Schema
    InvoiceDetailsObject:
      properties:
        no_of_invoices:
          anyOf:
            - type: integer
            - type: 'null'
          title: No Of Invoices
        total_amount_due:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Amount Due
      type: object
      title: InvoiceDetailsObject
    CustomerPaymentMethodsResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Customer Id
        customer_id:
          type: string
          format: uuid
          title: Customer Id
          description: Customer Id
        organisation_id:
          type: string
          format: uuid
          title: Organisation Id
          description: Organisation Id
        connector_id:
          type: string
          format: uuid
          title: Connector Id
          description: Connector Id
        connector_name:
          type: string
          title: Connector Name
          description: Connector Name
        external_id:
          type: string
          title: External Id
          description: External Id
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: status
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: country
        is_default:
          type: boolean
          title: Is Default
          description: is default payment method
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: payment method type
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: Payment Method Details
      type: object
      required:
        - id
        - customer_id
        - organisation_id
        - connector_id
        - connector_name
        - external_id
        - is_default
      title: CustomerPaymentMethodsResponseSchema
      description: Create Customer Response Schema
    BusinessEntityResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Business Entity ID
        name:
          type: string
          title: Name
          description: Business Entity Name
        address:
          anyOf:
            - $ref: '#/components/schemas/EntityAddress'
            - type: 'null'
          description: Business Entity address
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Business Entity email
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: Business Entity phone number
        is_default:
          type: boolean
          title: Is Default
          description: Business Entity default
        tax_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tax Config
          description: Business Entity tax config
        logo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Logo Url
          description: Business Entity logo URL
      type: object
      required:
        - id
        - name
        - is_default
      title: BusinessEntityResponseSchema
      description: Business Entity Response Schema
    EntityAddress:
      properties:
        line1:
          anyOf:
            - type: string
            - type: 'null'
          title: Line1
          description: Line 1
        line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Line2
          description: Line 2
        line3:
          anyOf:
            - type: string
            - type: 'null'
          title: Line3
          description: Line 3
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: State
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: Zip Code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country
        validation_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Validation Status
          description: Address Validation Status
      type: object
      title: EntityAddress
      description: Address Schema
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````