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

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



## OpenAPI

````yaml openapi/coupon-v1.json POST /v2/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:
  /v2/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. 


        Purchase Id is recommended as idempotency key, and required if async
        redemption flow is used (using Purchase Load).
      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 coupons redeem
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Coupon.Client.Models.V2.Requests.RedeemCouponRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/Coupon.Client.Models.V2.Requests.RedeemCouponRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/Coupon.Client.Models.V2.Requests.RedeemCouponRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Coupon.Client.Models.V2.Responses.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'
components:
  schemas:
    Coupon.Client.Models.V2.Requests.RedeemCouponRequest:
      type: object
      properties:
        storeId:
          type: string
          description: Store where Coupons were redeemed
          nullable: true
        coupons:
          type: array
          items:
            $ref: >-
              #/components/schemas/Coupon.Client.Models.V2.Requests.RedeemCouponRequest.RedeemedCoupon
          description: List of Coupons that were redeemed
          nullable: true
        basketValue:
          type: number
          description: >-
            Total basket value for the purchase. Used to show some live
            statistics
          format: double
          nullable: true
      additionalProperties: false
    Coupon.Client.Models.V2.Responses.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: {}
    Coupon.Client.Models.V2.Requests.RedeemCouponRequest.RedeemedCoupon:
      required:
        - couponId
      type: object
      properties:
        couponId:
          minLength: 1
          type: string
          description: Id of the redeemed coupon
        value:
          type: number
          description: >-
            Amount of discount or bonus that was granted for this coupon
            redemption
          format: double
          nullable: true
      additionalProperties: false

````