> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Redeem coupons

> If any of the provided coupons is not found, the error will be returned, but existing coupons will still be redeemed.
The error will contain coupons that were not found. 

We recommend to always pass idempotency key, but keep it as optional for compatibility.
Purchase Id is recommended as idempotency key, and required if async redemption flow is used (using Purchase Load).
Idempotency key is required to use Redemption Cancellation feature.
Without the idempotency key, multi-redeem coupons will not work properly in many cases.



## OpenAPI

````yaml openapi/coupon-v1.json POST /api/v1/customers/{customerId}/coupons/redeem
openapi: 3.0.4
info:
  title: Coupon.Api
  version: v1
servers:
  - url: https://{host}/coupon
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security: []
paths:
  /api/v1/customers/{customerId}/coupons/redeem:
    post:
      tags:
        - Customers
      summary: Redeem coupons
      description: >-
        If any of the provided coupons is not found, the error will be returned,
        but existing coupons will still be redeemed.

        The error will contain coupons that were not found. 


        We recommend to always pass idempotency key, but keep it as optional for
        compatibility.

        Purchase Id is recommended as idempotency key, and required if async
        redemption flow is used (using Purchase Load).

        Idempotency key is required to use Redemption Cancellation feature.

        Without the idempotency key, multi-redeem coupons will not work properly
        in many cases.
      parameters:
        - name: customerId
          in: path
          description: Customer Id
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            Identifier for request used to determine if it is a retry, or a new
            request
          schema:
            type: string
      requestBody:
        description: List of coupon ids to redeem
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
          text/json:
            schema:
              type: array
              items:
                type: string
          application/*+json:
            schema:
              type: array
              items:
                type: string
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Coupon.Client.Models.Response.CouponIdsResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      deprecated: true
components:
  schemas:
    Coupon.Client.Models.Response.CouponIdsResponse:
      type: object
      properties:
        couponIds:
          type: array
          items:
            type: string
          description: Ids of Coupons that were successfully processed
          nullable: true
      additionalProperties: false
    LoopFoundation.Commons.Contracts.WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}

````