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

# Create digital product coupon 

> Create a new coupon for a fermion digital product.

Authentication with the "FERMION-API-KEY" header is required to use this endpoint.

Rate limit: Maximum 10 requests in a window of 1m.



## OpenAPI

````yaml https://backend.codedamn.com/webhook/fermion-backend-openapi.yaml post /public/create-digital-product-coupon
openapi: 3.0.0
info:
  version: 1.0.0
  title: Fermion Backend API
  description: Documentation for interacting with the Fermion API
  contact:
    name: Fermion Support
    email: support@codedamn.com
servers:
  - url: https://backend.codedamn.com/api
    description: Fermion primary backend server
security: []
externalDocs:
  description: Fermion Docs
  url: https://docs.fermion.app
paths:
  /public/create-digital-product-coupon:
    post:
      tags:
        - Product
      summary: 'Create digital product coupon '
      description: >-
        Create a new coupon for a fermion digital product.


        Authentication with the "FERMION-API-KEY" header is required to use this
        endpoint.


        Rate limit: Maximum 10 requests in a window of 1m.
      requestBody:
        description: API Request Body
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          fermionDigitalProductId:
                            type: string
                            description: The unique ID of the fermion digital product
                          fermionDigitalProductCouponSlug:
                            type: string
                            minLength: 1
                            description: >-
                              The coupon code/slug (will be converted to
                              uppercase)
                          description:
                            type: string
                            description: Description of the coupon
                          expireAtIsoString:
                            anyOf:
                              - type: string
                                format: date-time
                              - nullable: true
                              - nullable: true
                            description: >-
                              ISO string for coupon expiration date, or null for
                              no expiration
                          shouldApplyAutomatically:
                            type: boolean
                            enum:
                              - false
                            description: >-
                              Whether the coupon should apply automatically
                              (always false for now)
                          numberOfRedemptionsAllowed:
                            anyOf:
                              - type: number
                                minimum: 1
                              - nullable: true
                              - nullable: true
                            description: >-
                              Maximum number of redemptions allowed, or null for
                              unlimited
                          couponTypeData:
                            anyOf:
                              - type: object
                                properties:
                                  percentOff:
                                    type: number
                                    minimum: 0
                                    maximum: 100
                                  type:
                                    type: string
                                    enum:
                                      - percent-off
                                required:
                                  - percentOff
                                  - type
                              - type: object
                                properties:
                                  fixedAmountInLowestCurrencyUnit:
                                    type: number
                                    minimum: 0
                                  currencyType:
                                    type: string
                                    enum:
                                      - Aud
                                      - Aed
                                      - Bdt
                                      - Brl
                                      - Cad
                                      - Cop
                                      - Dop
                                      - Etb
                                      - Eur
                                      - Gbp
                                      - Idr
                                      - Inr
                                      - Kes
                                      - Lkr
                                      - Mad
                                      - Myr
                                      - Mxn
                                      - Ngn
                                      - Npr
                                      - Nzd
                                      - Pkr
                                      - Pln
                                      - Rub
                                      - Thb
                                      - Try
                                      - Usd
                                      - Sgd
                                      - Cny
                                      - Sar
                                      - Twd
                                      - Jpy
                                      - Krw
                                      - Vnd
                                  type:
                                    type: string
                                    enum:
                                      - fixed-amount-off
                                required:
                                  - fixedAmountInLowestCurrencyUnit
                                  - currencyType
                                  - type
                            description: >-
                              Coupon discount configuration - either percentage
                              off or fixed amount off
                        required:
                          - fermionDigitalProductId
                          - fermionDigitalProductCouponSlug
                          - description
                          - expireAtIsoString
                          - shouldApplyAutomatically
                          - numberOfRedemptionsAllowed
                          - couponTypeData
                    required:
                      - data
              required:
                - data
      responses:
        '200':
          description: API Response Body
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    output:
                      anyOf:
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - ok
                            data:
                              type: object
                              properties:
                                fermionDigitalProductCouponId:
                                  type: string
                              required:
                                - fermionDigitalProductCouponId
                          required:
                            - status
                            - data
                        - type: object
                          properties:
                            status:
                              type: string
                              enum:
                                - error
                            errorMessage:
                              type: string
                          required:
                            - status
                            - errorMessage
                  required:
                    - output
      security:
        - FERMION-API-KEY: []
components:
  securitySchemes:
    FERMION-API-KEY:
      name: FERMION-API-KEY
      type: apiKey
      in: header

````