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

# Get customer balance



## OpenAPI

````yaml /openapi/v1.yaml get /api/v1/customers/{userId}/balance
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/{userId}/balance:
    get:
      tags:
        - Customers
      summary: Get customer balance
      operationId: getCustomerBalance
      parameters:
        - $ref: '#/components/parameters/UserId'
      responses:
        '200':
          description: Balance
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          user_id:
                            type: string
                            format: uuid
                          balance:
                            type: integer
                            example: 5600
                          points_expire_at:
                            type: string
                            format: date-time
                            nullable: true
                          last_visit_at:
                            type: string
                            format: date-time
                            nullable: true
        '404':
          $ref: '#/components/responses/CustomerNotFound'
components:
  parameters:
    UserId:
      name: userId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: The Rigaly customer ID (from lookup or previous responses).
  schemas:
    SuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          type: object
    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_...`'

````