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

# Issue points

> Issues points to a customer identified by `user_id` **or** `identifier`
(email, phone, or a business-scoped external identifier). Tier
multipliers, signup bonuses, and promo bonuses apply automatically —
`points_issued` in the response is the final amount credited.

Supports the optional `Idempotency-Key` header: retries with the same
key within 24 hours replay the original response instead of issuing
points twice.

Rule of thumb: **100 points per USD** of purchase value.




## OpenAPI

````yaml /openapi/v1.yaml post /api/v1/points/issue
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/points/issue:
    post:
      tags:
        - Points
      summary: Issue points
      description: |
        Issues points to a customer identified by `user_id` **or** `identifier`
        (email, phone, or a business-scoped external identifier). Tier
        multipliers, signup bonuses, and promo bonuses apply automatically —
        `points_issued` in the response is the final amount credited.

        Supports the optional `Idempotency-Key` header: retries with the same
        key within 24 hours replay the original response instead of issuing
        points twice.

        Rule of thumb: **100 points per USD** of purchase value.
      operationId: issuePoints
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PointsRequest'
            example:
              identifier: customer@example.com
              points: 500
              description: 'Order #1042'
      responses:
        '200':
          description: Points issued
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customer:
                            $ref: '#/components/schemas/CustomerRef'
                          points_issued:
                            type: integer
                            example: 600
                            description: >-
                              Final points credited (after tier multiplier and
                              bonuses)
                          balance:
                            type: integer
                            example: 5600
                          transaction:
                            $ref: '#/components/schemas/Transaction'
                          tier_multiplier_applied:
                            type: number
                            example: 1.2
                          signup_bonus_applied:
                            type: integer
                            example: 0
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/CustomerNotFound'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        maxLength: 255
      description: >-
        Optional. Retries with the same key within 24h replay the original
        response instead of repeating the operation.
  schemas:
    PointsRequest:
      type: object
      required:
        - points
      description: Exactly one of `user_id` / `identifier` is required.
      properties:
        user_id:
          type: string
          format: uuid
          description: Rigaly customer ID
        identifier:
          type: string
          description: Email, phone, or a business-scoped external identifier
        points:
          type: integer
          minimum: 1
          maximum: 1000000
        description:
          type: string
          maxLength: 500
          description: Shown in the customer's transaction history
    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
    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:
    BadRequest:
      description: Validation or business-rule error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              message: Provide exactly one of "user_id" or "identifier"
    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_...`'

````