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

# Get Customers

> Searches for customers by email within your configuration. Returns a summarized view aggregated across all matching customers, plus the full list of matching provider customer IDs.



## OpenAPI

````yaml /openapi.json get /billing-customers
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /billing-customers:
    get:
      tags:
        - Billing Customers
      summary: Get Customers
      description: >-
        Searches for customers by email within your configuration. Returns a
        summarized view aggregated across all matching customers, plus the full
        list of matching provider customer IDs.
      parameters:
        - in: query
          name: email
          required: true
          schema:
            type: string
          description: >-
            Email to search; normalized to lowercase (and trimmed) server-side
            before the provider query.
          example: customer@example.com
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      config_id:
                        type: string
                        description: Configuration ID.
                      provider_account_id:
                        type:
                          - string
                          - 'null'
                        description: Provider account ID.
                      provider_customer_ids:
                        type: array
                        items:
                          type: string
                        description: >-
                          Array of provider customer IDs matching the email,
                          most recently created first. The summary fields come
                          from the first one.
                      payment_provider:
                        type: string
                        description: Provider enum (e.g. `"stripe"`).
                      email:
                        type: string
                        description: Primary (first) customer email.
                      name:
                        type: string
                        description: Primary customer name.
                      phone:
                        type:
                          - string
                          - 'null'
                        description: Primary customer phone.
                      description:
                        type:
                          - string
                          - 'null'
                        description: Primary customer description.
                      delinquent:
                        type:
                          - boolean
                          - 'null'
                        description: >-
                          Whether the primary customer has an unpaid/overdue
                          invoice.
                      address:
                        type:
                          - object
                          - 'null'
                        properties:
                          line1:
                            type:
                              - string
                              - 'null'
                            description: Street address line 1.
                          line2:
                            type:
                              - string
                              - 'null'
                            description: Street address line 2.
                          city:
                            type:
                              - string
                              - 'null'
                            description: City.
                          state:
                            type:
                              - string
                              - 'null'
                            description: State / province.
                          postal_code:
                            type:
                              - string
                              - 'null'
                            description: Postal code.
                          country:
                            type:
                              - string
                              - 'null'
                            description: Country.
                        description: >-
                          Primary customer address (`line1`, `line2`, `city`,
                          `state`, `postal_code`, `country`).
                      shipping:
                        type:
                          - object
                          - 'null'
                        properties:
                          name:
                            type:
                              - string
                              - 'null'
                            description: Recipient name.
                          phone:
                            type:
                              - string
                              - 'null'
                            description: Recipient phone.
                          address:
                            type:
                              - object
                              - 'null'
                            properties:
                              line1:
                                type:
                                  - string
                                  - 'null'
                                description: Street address line 1.
                              line2:
                                type:
                                  - string
                                  - 'null'
                                description: Street address line 2.
                              city:
                                type:
                                  - string
                                  - 'null'
                                description: City.
                              state:
                                type:
                                  - string
                                  - 'null'
                                description: State / province.
                              postal_code:
                                type:
                                  - string
                                  - 'null'
                                description: Postal code.
                              country:
                                type:
                                  - string
                                  - 'null'
                                description: Country.
                            description: >-
                              Shipping address (same shape as the `address`
                              fields above).
                        description: >-
                          Primary customer shipping (`name`, `phone`,
                          `address`).
                      created:
                        type:
                          - number
                          - 'null'
                        description: Primary customer creation Unix timestamp.
                      metadata:
                        type: object
                        additionalProperties:
                          type: string
                        description: >-
                          Free-form string key/value pairs attached to the
                          billing customer. `{}` when none are set.
                required:
                  - data
              example:
                data:
                  config_id: test_config_id
                  provider_account_id: test_account_id
                  provider_customer_ids:
                    - test_customer_id
                    - test_customer_id_2
                  payment_provider: stripe
                  email: customer@example.com
                  name: Example Customer
                  phone: '+000000000000'
                  description: Imported from EMR
                  delinquent: false
                  address: null
                  shipping: null
                  created: 1300
                  metadata: {}
        '400':
          description: 'ValidationError: Missing `email`.'
        '401':
          description: Missing or invalid bearer token.
        '403':
          description: >-
            No configuration exists for your account, or provider access has
            been disabled for it.
        '500':
          description: An upstream provider error.
      security:
        - serviceToken: []
        - userToken: []
components:
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.