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

# Look up a customer

> Resolves an identifier to a customer and returns their balance at your
business. Resolution order: email (contains `@`) → business-scoped
external identifier → phone number.




## OpenAPI

````yaml /openapi/v1.yaml get /api/v1/customers/lookup
openapi: 3.1.0
info:
  title: Rigaly Business API
  version: '1.0'
  description: |
    Public API for businesses to manage their Rigaly loyalty programs: issue
    and redeem points, manage rewards, validate redemptions, and generate mass
    codes for physical products.

    All endpoints require an API key created in the Rigaly business dashboard
    (Tools → API Management), passed as `Authorization: Bearer rgly_sk_...`.
  contact:
    email: support@rigaly.com
servers:
  - url: https://api.rigaly.com
    description: Production
security:
  - apiKey: []
paths:
  /api/v1/customers/lookup:
    get:
      tags:
        - Customers
      summary: Look up a customer
      description: |
        Resolves an identifier to a customer and returns their balance at your
        business. Resolution order: email (contains `@`) → business-scoped
        external identifier → phone number.
      operationId: lookupCustomer
      parameters:
        - name: identifier
          in: query
          required: true
          schema:
            type: string
          example: customer@example.com
      responses:
        '200':
          description: Customer found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customer:
                            $ref: '#/components/schemas/CustomerRef'
                          balance:
                            type: integer
                            example: 5600
                          points_expire_at:
                            type: string
                            format: date-time
                            nullable: true
        '404':
          $ref: '#/components/responses/CustomerNotFound'
components:
  schemas:
    SuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          type: object
    CustomerRef:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Jane Doe
    ErrorEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            message:
              type: string
  responses:
    CustomerNotFound:
      description: No customer matches the reference
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              message: Customer not found. Check the user_id or identifier.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'API key from the Rigaly dashboard: `Authorization: Bearer rgly_sk_...`'

````