> ## 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.

# List customer addresses

> Retrieve all addresses associated with a customer, with optional filtering by address type.

**Filtering:**
- `billing`: Returns only addresses marked as default billing
- `shipping`: Returns only addresses marked as default shipping
- No filter: Returns all addresses for the customer

**Address Types:**
A single address can serve as both billing and shipping default simultaneously. This is determined by the `is_default_billing` and `is_default_shipping` flags.

**Deduplication:**
Addresses are automatically deduplicated based on their content hash. If the same address data is used for both billing and shipping, only one record exists with both flags set.



## OpenAPI

````yaml /openAPI/openapi-20240301.json get /customers/{customer_id}/addresses
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /customers/{customer_id}/addresses:
    get:
      tags:
        - Customer Addresses
      summary: List customer addresses
      description: >-
        Retrieve all addresses associated with a customer, with optional
        filtering by address type.


        **Filtering:**

        - `billing`: Returns only addresses marked as default billing

        - `shipping`: Returns only addresses marked as default shipping

        - No filter: Returns all addresses for the customer


        **Address Types:**

        A single address can serve as both billing and shipping default
        simultaneously. This is determined by the `is_default_billing` and
        `is_default_shipping` flags.


        **Deduplication:**

        Addresses are automatically deduplicated based on their content hash. If
        the same address data is used for both billing and shipping, only one
        record exists with both flags set.
      operationId: List-customer-addresses
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Customer Id
        - name: address_type
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - billing
                  - shipping
                type: string
              - type: 'null'
            description: 'Filter by type: billing or shipping'
            title: Address Type
          description: 'Filter by type: billing or shipping'
      responses:
        '200':
          description: Successfully retrieved customer addresses
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerAddressResponseSchema'
                title: Response List-Customer-Addresses
              example:
                - id: 123e4567-e89b-12d3-a456-426614174000
                  customer_id: 223e4567-e89b-12d3-a456-426614174001
                  line1: 123 Business Ave
                  line2: Suite 100
                  city: San Francisco
                  state: CA
                  zip_code: '94102'
                  country: United States
                  country_code: US
                  is_default_billing: true
                  is_default_shipping: false
                  validation_status: valid
                  created_at: '2023-01-01T00:00:00'
                  updated_at: '2023-06-15T10:30:00'
        '400':
          description: Bad request - invalid parameters
          content:
            application/json:
              example:
                error_code: BAD_REQUEST
                message: Invalid address_type parameter
        '404':
          description: Customer not found
          content:
            application/json:
              example:
                error_code: NOT_FOUND
                message: Customer not found
        '422':
          description: Unprocessable Entity - invalid UUID
          content:
            application/json:
              example:
                status_code: 10422
                message: >-
                  1 validation error for Query; 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 addresses
components:
  schemas:
    CustomerAddressResponseSchema:
      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
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
          description: Postal/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
        id:
          type: string
          format: uuid
          title: Id
          description: Address ID
        customer_id:
          type: string
          format: uuid
          title: Customer Id
          description: Customer ID
        is_default_billing:
          type: boolean
          title: Is Default Billing
          description: Whether this is the default billing address
        is_default_shipping:
          type: boolean
          title: Is Default Shipping
          description: Whether this is the default shipping address
      type: object
      required:
        - id
        - customer_id
        - is_default_billing
        - is_default_shipping
      title: CustomerAddressResponseSchema
      description: Customer Address Response 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>

````