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

# Create a coupon

> Creates a new discount coupon with percentage or fixed amount.



## OpenAPI

````yaml post /v1/coupons
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/coupons:
    post:
      tags:
        - Coupons
      summary: Create a coupon
      description: Creates a new discount coupon with percentage or fixed amount.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                environment_id:
                  type: string
                  minLength: 1
                code:
                  type: string
                  minLength: 1
                type:
                  type: string
                  enum:
                    - percent
                    - fixed
                amount:
                  type: number
                  minimum: 0
                metadata:
                  type: object
                  additionalProperties:
                    nullable: true
              required:
                - environment_id
                - code
                - type
                - amount
      responses:
        '201':
          description: Coupon created
          content:
            application/json:
              schema:
                nullable: true
        '400':
          description: Validation error

````