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

# Customer transaction history

> The customer's points ledger at your business, filterable by type and date range.



## OpenAPI

````yaml /openapi/v1.yaml get /api/v1/customers/{userId}/transactions
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}/transactions:
    get:
      tags:
        - Customers
      summary: Customer transaction history
      description: >-
        The customer's points ledger at your business, filterable by type and
        date range.
      operationId: getCustomerTransactions
      parameters:
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Offset'
        - name: type
          in: query
          schema:
            type: string
            enum:
              - earn
              - redeem
        - name: start_date
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Ledger page
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          user:
                            type: object
                          transactions:
                            type: array
                            items:
                              $ref: '#/components/schemas/Transaction'
                          total_count:
                            type: integer
        '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).
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    Offset:
      name: offset
      in: query
      schema:
        type: integer
        minimum: 0
        default: 0
  schemas:
    SuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          type: object
    Transaction:
      type: object
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        business_id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - earn
            - redeem
        points:
          type: integer
          description: Signed ledger amount (negative for redeem)
        description:
          type: string
        points_multiplier:
          type: number
          example: 1
        created_at:
          type: string
          format: date-time
    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_...`'

````