LoyaltyLion Redemptions API

Claiming and refunding rewards on behalf of a customer.

OpenAPI Specification

loyaltylion-redemptions-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: LoyaltyLion Activities Redemptions API
  description: The LoyaltyLion v2 REST API powers an e-commerce loyalty and rewards program. It is split into an Admin API - for moving data in and out of LoyaltyLion, such as retrieving customers and transactions, tracking orders, and adjusting points - and a Headless API for building custom shopper-facing loyalty experiences in web, mobile, and POS applications. Requests authenticate with a Program API key passed as a Bearer token in the Authorization header (with scoped access such as read_customers), or the deprecated token/secret pair over HTTP Basic auth (supported until 2027-01-10). Customers are addressed by the merchant_id you use in your own platform. All endpoints share a rate limit of 20 requests per second unless otherwise stated. This document grounds the core Customers, Activities, Points, Rewards, and Redemptions resources; some verbs are modeled from the documented resource index and should be verified against the live reference.
  version: '2.0'
  contact:
    name: LoyaltyLion
    url: https://developers.loyaltylion.com
servers:
- url: https://api.loyaltylion.com/v2
  description: LoyaltyLion v2 API
security:
- bearerAuth: []
- basicAuth: []
tags:
- name: Redemptions
  description: Claiming and refunding rewards on behalf of a customer.
paths:
  /customers/{merchant_id}/claimed_rewards:
    parameters:
    - $ref: '#/components/parameters/MerchantId'
    post:
      operationId: redeemReward
      tags:
      - Redemptions
      summary: Redeem a reward
      description: Redeems a reward on behalf of a customer, spending their points to create a claimed reward.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedeemRewardInput'
      responses:
        '200':
          description: The claimed reward.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimedReward'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
  /customers/{merchant_id}/claimed_rewards/{claimed_reward_id}/refund:
    parameters:
    - $ref: '#/components/parameters/MerchantId'
    - name: claimed_reward_id
      in: path
      required: true
      schema:
        type: string
      description: The ID of the claimed reward to refund.
    post:
      operationId: refundReward
      tags:
      - Redemptions
      summary: Refund a claimed reward
      description: Refunds a previously claimed reward, returning the spent points to the customer.
      responses:
        '200':
          description: The refunded claimed reward.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaimedReward'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    ValidationError:
      description: The request body failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication failed or the API key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    RedeemRewardInput:
      type: object
      required:
      - reward_id
      properties:
        reward_id:
          type: integer
        multiplier:
          type: number
        variant_id:
          type: string
        shopify_action_id:
          type: string
        attribution:
          type: string
          enum:
          - redemption_notification
        session:
          type: object
          properties:
            kind:
              type: string
            token:
              type: string
    ClaimedReward:
      type: object
      properties:
        id:
          type: integer
        reward_id:
          type: integer
        customer_id:
          type: string
        points_spent:
          type: integer
        state:
          type: string
        created_at:
          type: string
          format: date-time
  parameters:
    MerchantId:
      name: merchant_id
      in: path
      required: true
      schema:
        type: string
      description: The ID of the customer in your platform or e-commerce store.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Program API key passed as a Bearer token in the Authorization header.
    basicAuth:
      type: http
      scheme: basic
      description: Deprecated token (username) and secret (password) over HTTP Basic auth, supported until 2027-01-10.