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

# Create a new discount

> Creates a new discount for the store. Ensures unique discount code within the store.



## OpenAPI

````yaml post /discounts
openapi: 3.0.0
info:
  title: Blink API
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security: []
paths:
  /discounts:
    post:
      tags:
        - Discounts
      summary: Create a new discount
      description: >-
        Creates a new discount for the store. Ensures unique discount code
        within the store.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscountCreateRequest'
      responses:
        '201':
          description: Discount created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountDetailResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '409':
          description: Conflict
components:
  schemas:
    DiscountCreateRequest:
      type: object
      properties:
        name:
          type: string
        code:
          type: string
        discount_type:
          type: string
          enum:
            - percentage
            - fixed
        discount_amount:
          type: number
        status:
          type: string
        max_redemptions:
          type: integer
        product_ids:
          type: array
          items:
            type: string
        starts_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
      required:
        - name
        - code
        - discount_type
        - discount_amount
    DiscountDetailResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            code:
              type: string
            discount_type:
              type: string
            discount_amount:
              type: number
            max_redemptions:
              type: integer
            starts_at:
              type: string
              format: date-time
            expires_at:
              type: string
              format: date-time
            status:
              type: string
            product_ids:
              type: array
              items:
                type: string

````