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

# Search Customer

> Looks up a customer by phone number. Use this to check whether a customer already exists before calling `POST /identity/entities`.




## OpenAPI

````yaml /api_reference/identity.yaml post /identity/entities/search
openapi: 3.0.3
info:
  version: '1.0'
  title: Identity API
  description: Reference for Sardine Universal Identity API (identity.sardine.ai)
  contact:
    email: support@sardine.io
    name: Sardine
    url: docs.sardine.io
servers:
  - url: https://api.sandbox.sardine.ai/v1
    description: Sandbox
  - url: https://api.sardine.ai/v1
    description: Production
security:
  - ClientSecret: []
paths:
  /identity/entities/search:
    post:
      tags:
        - Customer Management
      summary: Search Customer
      description: >
        Looks up a customer by phone number. Use this to check whether a
        customer already exists before calling `POST /identity/entities`.
      operationId: post-identity-entities-search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phoneNumber
              properties:
                phoneNumber:
                  type: string
                  description: E.164 formatted phone number
                  example: '+14155551234'
            example:
              phoneNumber: '+14155551234'
      responses:
        '200':
          description: Customer record (may be empty if not found)
          content:
            application/json:
              schema:
                type: object
                properties:
                  customerId:
                    type: string
                    nullable: true
                    example: 3f8c1a22-1234-4abc-9def-000000000001
                  createdAt:
                    type: string
                    format: date-time
                    nullable: true
        '400':
          description: Phone number is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid client credentials
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Customer not found for customer ID
        status:
          type: integer
          example: 400
  securitySchemes:
    ClientSecret:
      type: http
      scheme: basic
      description: >
        HTTP Basic Auth. Use your `clientId` as the username and `clientSecret`
        as the password.

````