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

# Create Coupon Code

Create a new coupon code. Optionally set `network_affiliate_id`, start and end dates, description, and internal notes.


## OpenAPI

````yaml openapi/coupon-codes.yaml post /networks/couponcodes
openapi: 3.0.3
info:
  title: Everflow Network API - Coupon Codes
  description: >
    Endpoints for managing coupon codes in the Everflow network. Coupon codes
    are a powerful attribution tool for tracking partner performance through
    easy-to-share codes — they are specifically designed for tracking and
    attributing conversions to the right partners, not for discounts (discount
    functionality is set up in your own e-commerce platform). For setup, see the
    [Coupon Codes
    guide](https://helpdesk.everflow.io/customer/how-to-create-manage-coupon-codes).
  version: 1.0.0
servers:
  - url: https://api.eflow.team/v1
security: []
tags:
  - name: Coupon Codes
paths:
  /networks/couponcodes:
    post:
      tags:
        - Coupon Codes
      summary: Create Coupon Code
      requestBody:
        required: true
        content:
          application/json:
            example:
              coupon_code: DOCTEST_CODE_1
              network_offer_id: 1
              coupon_status: active
            schema:
              type: object
              required:
                - coupon_code
                - network_offer_id
                - coupon_status
              properties:
                network_offer_id:
                  type: integer
                  description: ID of the offer for which the coupon applies.
                network_affiliate_id:
                  type: integer
                  description: >
                    ID of the affiliate for which the coupon applies. A coupon
                    code without an affiliate specified can exist but cannot be
                    used.
                coupon_code:
                  type: string
                  minLength: 3
                  description: Coupon code value. Must be at least 3 characters.
                coupon_status:
                  type: string
                  enum:
                    - active
                    - paused
                  description: Status of the coupon code.
                internal_notes:
                  type: string
                  description: >-
                    Notes for internal usage — they will not be visible to the
                    partner.
                description:
                  type: string
                  description: >
                    A description (either plain text or HTML) that will be
                    visible to the partner.
                is_description_plain_text:
                  type: boolean
                  description: >
                    Only relevant when a description is provided. Determines if
                    the description is in HTML or plain text format.
                start_date:
                  type: string
                  description: >
                    An optional date starting at which the coupon code can be
                    used. Use the YYYY-MM-DD format.
                end_date:
                  type: string
                  description: >
                    An optional date at which the coupon code becomes obsolete.
                    Use the YYYY-MM-DD format.
      responses:
        '200':
          description: ''
          content:
            application/json:
              example:
                network_coupon_code_id: 1
                network_id: 1
                network_affiliate_id: 7
                network_offer_id: 1
                coupon_code: DOCTEST_CODE_1
                coupon_status: active
                internal_notes: ''
                time_created: 1774725262
                time_saved: 1774725262
                start_date: ''
                end_date: ''
                description: ''
                is_description_plain_text: false
                time_deleted: 0
              schema:
                $ref: '#/components/schemas/CouponCodeWrite'
      security:
        - API Key: []
components:
  schemas:
    CouponCodeWrite:
      type: object
      description: >-
        Coupon code as returned by create and update endpoints (without
        relationship data).
      properties:
        network_coupon_code_id:
          type: integer
          description: Unique identifier for this coupon code.
        network_id:
          type: integer
          description: The ID of the network this coupon code belongs to.
        network_affiliate_id:
          type: integer
          description: >
            ID of the affiliate for which the coupon applies. A coupon code
            without an affiliate specified can exist but cannot be used.
        network_offer_id:
          type: integer
          description: ID of the offer for which the coupon applies.
        coupon_code:
          type: string
          description: Coupon code value.
        coupon_status:
          type: string
          enum:
            - active
            - paused
          description: >
            Status of the coupon code. Can be one of the following values:
            `active` or `paused`.
        internal_notes:
          type: string
          description: Notes for internal usage -- they will not be visible to the partner.
        description:
          type: string
          description: >
            A description (either plain text or HTML) that will be visible to
            the partner.
        is_description_plain_text:
          type: boolean
          description: >
            Only relevant when a description is provided. Determines if the
            description is in HTML or plain text format.
        start_date:
          type: string
          description: >-
            An optional date starting at which the coupon code can be used. Uses
            the YYYY-MM-DD format.
        end_date:
          type: string
          description: >-
            An optional date at which the coupon code becomes obsolete. Uses the
            YYYY-MM-DD format.
        time_created:
          type: integer
          example: 1734455015
          description: Unix timestamp of when the coupon code was created.
        time_saved:
          type: integer
          example: 1734455015
          description: Unix timestamp of when the coupon code was last updated.
        time_deleted:
          type: integer
          example: 0
          description: >-
            Unix timestamp of when the coupon code was deleted. 0 if not
            deleted.
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey

````