openapi: 3.0.3
info:
  title: Everflow Network API - Coupon Codes (Additional Endpoints)
  description: Additional coupon code management endpoints for the Everflow network.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Coupon Codes
    description: Additional coupon code management endpoints.
paths:
  /networks/couponcodes/bulk:
    post:
      summary: Bulk Create Coupon Codes
      tags:
        - Coupon Codes
      requestBody:
        required: true
        content:
          application/json:
            example:
              - coupon_code: "SAVE20"
                network_offer_id: 1
                network_affiliate_id: 1
                coupon_status: "active"
              - coupon_code: "SAVE30"
                network_offer_id: 2
                network_affiliate_id: 1
                coupon_status: "active"
            schema:
              type: array
              description: Array of coupon codes to create.
              items:
                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
                    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. 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:
              schema:
                type: object
                properties:
                  result:
                    type: boolean
                    description: Whether the bulk creation was successful.
      security:
        - API Key: []

components:
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
