---     
tags: 
  - Discounts
description: Creates a new discount.
parameters:
  - in: header
    name: Authorization
    type: string
    required: true
  - in: body
    name: body
    type: object
    required: true
    schema:
      example: {
        "max_uses": 5,
        "value": 20,
        "value_type": 1,
        "expires_at": "20240923",
        "user_id": 17,
        "created_by_id": 1,
      }
produces: 
  - 'application/json'
responses:
  201:
    schema:
      type: object
      example: {
        "message": "discount created",
        "id": 5
      }
  401:
    schema:
      type: object
      properties:
        error:
          type: string
          example: 'Unauthorised'
