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

# Retrieve a customer

> Retrieves a customer by ID.



## OpenAPI

````yaml https://api.salesbricks.com/api/v2/openapi.yaml get /customers/{customer_id}
openapi: 3.0.3
info:
  title: Salesbricks REST API
  version: 2.0.0
  description: API reference for external integrations
servers:
  - url: https://api.salesbricks.com/api/v2
    description: Production
  - url: https://api.staging.salesbricks.com/api/v2
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Subscriptions
    description: >-
      Operations related to subscription management, including creation,
      updates, and retrieving subscription details. Subscriptions can be
      upgraded to add / remove add-ons by using the POST
      /subscriptions/{subscription_id}/upgrade endpoint and can be recasted for
      replacing the current agreement using the POST
      /subscriptions/{subscription_id}/recast endpoint
  - name: Customers
    description: >-
      Operations related to customer management, including creation, updates,
      and managing customer person objects.
  - name: Invoices
    description: Operations related to subscription's invoicing details.
  - name: Plans
    description: >-
      Operations related to listing and getting plan details including bricks in
      the plan.
  - name: Payment Methods
    description: Operations related to subscription's payment method.
paths:
  /customers/{customer_id}:
    get:
      tags:
        - Customers
      summary: Retrieve a customer
      description: Retrieves a customer by ID.
      operationId: retrieveCustomer
      parameters:
        - in: path
          name: customer_id
          schema:
            type: string
            pattern: ^([a-zA-Z\d\-]+)$
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOutput'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                NotFoundResponse:
                  value:
                    error:
                      code: ERR_NOT_FOUND
                      message: >-
                        Not found — the resource you are looking for does not
                        exist.
                  summary: Not Found Response
          description: ''
components:
  schemas:
    CustomerOutput:
      type: object
      description: >-
        Customer output serializer; we can represent the customer model
        differently

        depending on the request so we need a custom serializer for the output.
      properties:
        customer_id:
          type: string
          format: uuid
        name:
          type: string
        legal_name:
          type: string
          readOnly: true
        external_id:
          type: string
          nullable: true
          maxLength: 255
        address:
          allOf:
            - $ref: '#/components/schemas/AddressInput'
          description: The address of the customer
        stripe_customer_id:
          type: string
          nullable: true
          description: The companies stripe customer_id
          maxLength: 255
        tax_id:
          type: string
          nullable: true
          description: Tax identification number (e.g., EIN, VAT number)
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionSummary'
          readOnly: true
          description: List of subscriptions associated with this customer
      required:
        - customer_id
        - legal_name
        - name
        - subscriptions
    ErrorResponse:
      type: object
      description: >-
        Standardizes API error responses with a consistent structure containing
        error code and message.
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    AddressInput:
      type: object
      description: >-
        Address input serializer to not confuse it with Address model
        serializer.
      properties:
        line_1:
          type: string
          description: The first line of the address input
        line_2:
          type: string
          nullable: true
          description: The second line of the address input
        city:
          type: string
          description: The city of the address input
        region:
          type: string
          description: 'The region (ISO 3166: 2 character code) of the address input'
        zip:
          type: string
          description: The zip code of the address input
        country:
          type: string
          description: 'The country (ISO 3166: 2 character code) of the address input'
      required:
        - city
        - country
        - line_1
        - zip
    SubscriptionSummary:
      type: object
      description: |-
        Lightweight subscription serializer for embedding in customer responses.
        Contains only the essential subscription fields.
      properties:
        subscription_id:
          type: string
          format: uuid
          description: Unique identifier for the subscription
        status:
          enum:
            - ACTIVE
            - ORDER_NEEDED
            - OPEN_ORDER
            - SCHEDULED
            - TERMINATED
            - TERMINATING
            - INACTIVE
            - PAUSED
            - SUPERSEDED
          type: string
          x-spec-enum-id: f557ac38d7b2529c
          description: |-
            Current status of the subscription

            * `ACTIVE` - Active
            * `ORDER_NEEDED` - Order needed
            * `OPEN_ORDER` - Open order
            * `SCHEDULED` - Scheduled
            * `TERMINATED` - Terminated
            * `TERMINATING` - Terminating
            * `INACTIVE` - Inactive
            * `PAUSED` - Paused
            * `SUPERSEDED` - Superseded
        name:
          type: string
          nullable: true
          description: Name of the subscription
        starts_at:
          type: string
          format: date
          nullable: true
          description: Start date of the subscription
        ends_at:
          type: string
          format: date
          nullable: true
          description: End date of the subscription
      required:
        - ends_at
        - name
        - starts_at
        - status
        - subscription_id
    Error:
      type: object
      description: >-
        Represents individual error details with a standardized code and
        descriptive message.
      properties:
        code:
          enum:
            - ERR_NOT_FOUND
            - ERR_BAD_REQUEST
            - ERR_SERVER_ERROR
          type: string
          x-spec-enum-id: dc5a5d6feae1b697
          description: >-
            Error code indicating the type of error: NOT_FOUND for missing
            resources, BAD_REQUEST for invalid input, SERVER_ERROR for internal
            server issues


            * `ERR_NOT_FOUND` - ERR_NOT_FOUND

            * `ERR_BAD_REQUEST` - ERR_BAD_REQUEST

            * `ERR_SERVER_ERROR` - ERR_SERVER_ERROR
        message:
          type: string
        error_id:
          type: string
          format: uuid
          description: >-
            Correlation handle for SERVER_ERROR responses — quote this when
            contacting support; it joins to the structured server log line for
            the failure. Not present on 4xx responses.
      required:
        - code
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: API key for authentication

````

## Related topics

- [Overview](/api-reference/getting-started/overview.md)
- [Managing Your Customer](/documentation/managing-your-customer.md)
- [Customer email notifications](/documentation/customer-email-notifications.md)
