API Documentation for Coupon System

Overview

This API allows for the creation and management of coupons in a system defined by a specific Python schema. The /create endpoint is used to create a new coupon.

Openapi

openapi click here

CheckCoupon

test coupon here

Endpoint: Create Coupon

Schema Definitions

Coupon Object

Supporting Objects

Example Request

POST <url>/create
Content-Type: application/json

{
  "couponCodes": ["CODE123", "CODE456"],
  "couponId": 12345,
  "type_": "DISC",
  "disc": {
    "products": [101, 102],
    "exclude": [201],
    "cash": 10,
    "percentage": 5
  },
  "conditions": {
    "noCombine": ["BOGO"],
    "cartTotal": 100,
    "endDate": 20231231,
    "firstTimerOnly": false,
    "isActive": true
  },
  "description": "10% off on products 101 and 102, excluding product 201",
  "isPromotion": true
}

Response

The response will include details of the created coupon, including its ID and applicable conditions.

Error Handling

Security and Authentication

Please ensure appropriate authentication mechanisms are in place to secure this endpoint, as it can modify the coupon system’s state.


This documentation provides a basic guideline for interacting with the coupon creation endpoint. Further details can be added based on specific requirements and additional functionalities of the system.