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

# Update Coupon Configurations

> Update coupon system configuration settings for the loyalty program.

## Update Coupon Configurations

This API call updates your coupon configurations, allowing you to modify details about how coupons are structured, authenticated, and mapped within Gameball.

<Info>
  **Security:** Provide both apikey and secretkey headers.
</Info>


## OpenAPI

````yaml PUT /api/v4.0/integrations/configurations/coupon
openapi: 3.1.0
info:
  title: Gameball API
  description: >-
    Gameball REST API v4.0 - Complete API reference for integrating loyalty,
    gamification, and customer engagement features
  version: 4.0.0
servers:
  - url: https://api.gameball.co
security:
  - bearerAuth: []
paths:
  /api/v4.0/integrations/configurations/coupon:
    put:
      description: >-
        This API call updates your coupon configurations, allowing you to modify
        details about how coupons are structured, authenticated, and mapped
        within Gameball.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - method
              properties:
                url:
                  type: string
                  description: >-
                    The URL of your API endpoint where coupons are created.
                    Gameball will send requests to this endpoint whenever a
                    coupon needs to be generated.
                  example: https://api.mywebsite.com/coupons
                method:
                  type: string
                  description: >-
                    The HTTP method used to send requests to the coupon creation
                    endpoint. Allowed values are POST, PUT or GET.
                  example: POST
                queryParams:
                  type: array
                  description: >-
                    List of query parameters used in the request. Those that
                    will be appended to the URL endpoint. These are used to pass
                    specific parameters required by your coupon system as part
                    of the URL itself, often for identification, filtering, or
                    configuration purposes. Each query parameter is defined by a
                    key-value pair, allowing you to tailor requests based on
                    requirements in your API.
                  items:
                    type: object
                    required:
                      - key
                      - value
                    properties:
                      key:
                        type: string
                        description: The key used in the query parameter.
                        example: appId
                      value:
                        type: string
                        description: The value of the query parameter.
                        example: '12345'
                headers:
                  type: array
                  description: List of headers used in the request.
                  items:
                    type: object
                    required:
                      - key
                      - value
                    properties:
                      key:
                        type: string
                        description: The header key.
                        example: X-Client-Version
                      value:
                        type: string
                        description: The header value.
                        example: '1.0'
                payload:
                  type: string
                  description: >-
                    This specifies the structure of the JSON body Gameball will
                    send to your endpoint when creating a coupon. Since
                    different systems may use varying parameter names and
                    structures, you can customize this payload to align with
                    your system's requirements. You should define the JSON
                    payload with placeholders that Gameball will replace with
                    actual data when sending the request. Example: {
                    "customerId": "{{playerUniqueId}}", "amount": "{{value}}",
                    "code": "{{code}}" }
                  example: '{ "couponCode": "DISCOUNT10" }'
                couponMapping:
                  type: object
                  description: >-
                    A dictionary mapping coupon attributes to specific keys in
                    your system.
                  properties:
                    fixed:
                      type: string
                      description: >-
                        The internal naming for the fixed discount codes in your
                        system.
                      example: fixed_discount
                    percentage:
                      type: string
                      description: >-
                        The internal naming for the percentage discount codes in
                        your system.
                      example: percentage_discount
                    freeProduct:
                      type: string
                      description: >-
                        The internal naming for the free product discount codes
                        in your system.
                      example: free_product
                    freeShipping:
                      type: string
                      description: >-
                        The internal naming for the free shipping discount codes
                        in your system.
                      example: free_delivery
                enableFreeProduct:
                  type: boolean
                  description: Indicates whether free product coupons are enabled.
                  example: true
                enableFixedRate:
                  type: boolean
                  description: Indicates whether fixed-rate discount coupons are enabled.
                  example: true
                enableFreeShipping:
                  type: boolean
                  description: Indicates whether free shipping coupons are enabled.
                  example: true
                enablePercentage:
                  type: boolean
                  description: >-
                    Indicates whether percentage-based discount coupons are
                    enabled.
                  example: true
                platforms:
                  type: array
                  description: >-
                    List of platforms for which the coupon configurations are
                    applied in your system.
                  items:
                    type: object
                    required:
                      - displayName
                      - value
                    properties:
                      displayName:
                        type: string
                        description: The display name of the platform.
                      value:
                        type: string
                        description: The internal value used for the platform.
      responses:
        '200':
          description: Coupon configurations updated successfully
      security:
        - apiKey: []
          secretKey: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: apikey
    secretKey:
      type: apiKey
      in: header
      name: secretkey

````