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

# Search Customers

> Look up an existing customer by email, phone number or internal_id

Search for an existing customer belonging to your business by email, phone number and/or `internal_id`. Use this to look up a Soap `customer_id` before creating a checkout, or to check whether a customer already exists. Results are always scoped to the merchant whose API key is used.

Every Soap API request is authenticated with a bearer token in the `Authorization` header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

Your API key is in the Soap Dashboard under the Developers section. It looks like `key_...`.

Requests with a missing or invalid API key return `422` — never `401` — with a JSON `error` field, usually `{"error": "API key not found."}`. Branch on the status code rather than the message: `GET /api/v1/device_pings/latest_geo_check` does not yet return the same wording.

Never expose your API key in client-side code — it is server-side only.

> [!NOTE]
>
> At least one of `email`, `phone_number` or `internal_id` must be supplied. When more than one is provided, the customer must match **all** of them (AND semantics), so if a customer has changed both email and phone, search by `internal_id` alone. Email matching is case-insensitive; phone numbers are normalized to 10 digits (a leading `+1` and any non-digit characters are stripped); `internal_id` is an exact match against the value you supplied when creating the customer.

```bash Curl theme={null}
curl -G "https://api-sandbox.paywithsoap.com/api/v1/customers/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "email=customer@example.com"
```

```bash Curl (internal_id) theme={null}
curl -G "https://api-sandbox.paywithsoap.com/api/v1/customers/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "internal_id=3f1b8c4e-7c2e-4c2c-8d2f-179cf0efb36b"
```

```ruby Ruby theme={null}
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse('https://api-sandbox.paywithsoap.com/api/v1/customers/search')
uri.query = URI.encode_www_form(email: 'customer@example.com')

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'

response = http.request(request)
puts response.body
```

```javascript JavaScript theme={null}
const axios = require('axios');

const searchCustomer = async () => {
  try {
    const response = await axios.get('https://api-sandbox.paywithsoap.com/api/v1/customers/search', {
      params: {
        email: 'customer@example.com'
      },
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    });

    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
};

searchCustomer();
```

```python Python theme={null}
import requests

url = "https://api-sandbox.paywithsoap.com/api/v1/customers/search"

headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

params = {
    "email": "customer@example.com"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

```json Match found theme={null}
{
  "results": [
    {
      "id": "cus_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK",
      "internal_id": "3f1b8c4e-7c2e-4c2c-8d2f-179cf0efb36b",
      "email": "customer@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "phone_number": "8008001234",
      "created_at": "2026-05-31T18:26:43.069Z"
    }
  ]
}
```

```json No match theme={null}
{
  "results": []
}
```


## OpenAPI

````yaml GET /api/v1/customers/search
openapi: 3.1.0
info:
  title: Soap API
  description: >-
    API documentation for Soap - AI-native payments infrastructure for complex,
    compliance-heavy payment flows
  license:
    name: MIT
  version: 1.4.0
servers:
  - url: https://api-sandbox.paywithsoap.com
security:
  - bearerAuth: []
paths:
  /api/v1/customers/search:
    get:
      tags:
        - Customers
      summary: Search customers by email, phone number and/or internal_id
      parameters:
        - name: email
          in: query
          required: false
          description: >-
            Customer email. Case-insensitive. At least one of `email`,
            `phone_number` or `internal_id` must be supplied; supplied
            parameters are combined with AND.
          schema:
            type: string
            example: john@acme.com
        - name: phone_number
          in: query
          required: false
          description: >-
            US phone number. Non-digit characters and a leading +1 are stripped;
            the normalized form must be 10 digits. At least one of `email`,
            `phone_number` or `internal_id` must be supplied; supplied
            parameters are combined with AND.
          schema:
            type: string
            example: '8008001234'
        - name: internal_id
          in: query
          required: false
          description: >-
            Your own reference for the customer, as supplied at creation. Exact
            match. At least one of `email`, `phone_number` or `internal_id` must
            be supplied; supplied parameters are combined with AND.
          schema:
            type: string
            example: 3f1b8c4e-7c2e-4c2c-8d2f-179cf0efb36b
      responses:
        '200':
          description: Search results. Always returns a `results` array, possibly empty.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique Soap identifier for the customer.
                          example: cus_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK
                        internal_id:
                          type:
                            - string
                            - integer
                            - 'null'
                          example: 3f1b8c4e-7c2e-4c2c-8d2f-179cf0efb36b
                          description: >-
                            Your identifier for the customer, as supplied; null
                            when none was given.
                        email:
                          type: string
                          example: john@acme.com
                          nullable: true
                        first_name:
                          type: string
                          example: John
                          nullable: true
                          description: >-
                            Null only on accounts configured to create customers
                            without names.
                        last_name:
                          type: string
                          example: Doe
                          nullable: true
                          description: >-
                            Null only on accounts configured to create customers
                            without names.
                        phone_number:
                          type: string
                          example: '8008001234'
                          nullable: true
                        created_at:
                          type: string
                          format: date-time
                          example: '2026-05-31T18:26:43.069Z'
        '422':
          description: >-
            Invalid search parameters — none of `email`, `phone_number` or
            `internal_id` provided, an unparseable phone number, or a
            missing/invalid API key. Authentication failures return 422 with
            `{"error": "API key not found."}`, not 401.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  hint:
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication using your API key (key_...). Used for every
        endpoint except POST /api/v1/device_pings.

````

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