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

# Validate a redemption code

> Validates a customer's redemption code **without consuming it**.
Returns the reward (including its `conditions` text) and the customer,
so your system can check the purchase against the reward before
completing. Codes are created when customers redeem a reward in the
Rigaly app.




## OpenAPI

````yaml /openapi/v1.yaml get /api/v1/redemptions/{code}
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/redemptions/{code}:
    get:
      tags:
        - Redemptions
      summary: Validate a redemption code
      description: |
        Validates a customer's redemption code **without consuming it**.
        Returns the reward (including its `conditions` text) and the customer,
        so your system can check the purchase against the reward before
        completing. Codes are created when customers redeem a reward in the
        Rigaly app.
      operationId: validateRedemption
      parameters:
        - $ref: '#/components/parameters/RedemptionCode'
      responses:
        '200':
          description: Code details
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          redemption:
                            $ref: '#/components/schemas/Redemption'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    RedemptionCode:
      name: code
      in: path
      required: true
      schema:
        type: string
        example: AB12CD34
      description: The short redemption code the customer shows (from the Rigaly app).
  schemas:
    SuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          type: object
    Redemption:
      type: object
      properties:
        code:
          type: string
          example: AB12CD34
        status:
          type: string
          enum:
            - pending
            - completed
            - expired
            - cancelled
          example: pending
        expires_at:
          type: string
          format: date-time
        points_used:
          type: integer
          nullable: true
        cashback_cents:
          type: integer
          nullable: true
        reward:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
              example: Free Coffee
            description:
              type: string
              nullable: true
            conditions:
              type: string
              nullable: true
              example: Valid for SKUs COF-M-* only
            points_cost:
              type: integer
              example: 500
            type:
              type: string
              example: standard
        customer:
          type: object
          properties:
            name:
              type: string
              example: Jane Doe
    ErrorEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            message:
              type: string
  responses:
    NotFound:
      description: Resource not found (or belongs to another business)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              message: Reward not found
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'API key from the Rigaly dashboard: `Authorization: Bearer rgly_sk_...`'

````