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

# Create discount



## OpenAPI

````yaml /api-reference/openapi.json post /marketing/create-discount
openapi: 3.1.0
info:
  title: BillingServ API V2
  description: >-
    Resources and tools for developers to integrate with the BillingServ v2 API.
    v1 is deprecated; use the v2 base URL and bearer-token authentication unless
    an endpoint states otherwise.
  version: '2.0'
servers:
  - url: https://demo.onlinebillingform.com/api/v2
    description: BillingServ demo API
security:
  - bearerAuth: []
tags:
  - name: Customer
  - name: Package
  - name: Group
  - name: Country
  - name: County
  - name: VPN
  - name: Invoice
  - name: Order
  - name: Module
  - name: Report
  - name: Marketing
  - name: Setting
  - name: Checkout
  - name: Usage
  - name: Support
paths:
  /marketing/create-discount:
    post:
      tags:
        - Marketing
      summary: Create discount
      operationId: POST_marketing_create_discount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                minimum_value:
                  type: number
                discount_value:
                  type: number
                start:
                  type: string
                  format: date
                end:
                  type: string
                  format: date
                type:
                  type: integer
                  description: 0 = percentage, 1 = fixed/code
                recurring:
                  type: integer
                  enum:
                    - 0
                    - 1
                uses:
                  type: string
                selected_packages:
                  type: string
              additionalProperties: true
              required:
                - minimum_value
                - discount_value
                - start
                - type
                - recurring
                - uses
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                minimum_value:
                  type: number
                discount_value:
                  type: number
                start:
                  type: string
                  format: date
                end:
                  type: string
                  format: date
                type:
                  type: integer
                  description: 0 = percentage, 1 = fixed/code
                recurring:
                  type: integer
                  enum:
                    - 0
                    - 1
                uses:
                  type: string
                selected_packages:
                  type: string
              additionalProperties: true
              required:
                - minimum_value
                - discount_value
                - start
                - type
                - recurring
                - uses
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
              example:
                success: true
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                errors: Invalid API Key
        '403':
          description: Authenticated key does not have permission for this endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                errors: Insufficient permissions for this endpoint.
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
              example:
                success: false
                errors:
                  id:
                    - The id field is required.
      security:
        - bearerAuth: []
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errors:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
            - type: object
              additionalProperties: true
      additionalProperties: true
    ValidationErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errors:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
              additionalProperties: true
            - type: string
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Use `Authorization: Bearer <live_api_key>`.'

````