Create a Coupon
The brand URL of the request. This is used to identify the brand.
YOUR_BRAND_URL
This is used to authenticate the request. If the request is not authenticated, the server will return a 401 Unauthorized response.
YOUR_AUTH_KEY
This class is used to provide a data transfer object for the coupon which is used for command requests.
The name of the coupon.
The code of the coupon.
The percentage of the coupon.
The quantity of the coupon.
The start date and end date of the coupon.
The end date of the coupon.
Is the coupon auto apply to price. If true, the coupon will be applied to the price automatically. By default, the value is false.
The description of the coupon.
The tags of the coupon.
The test mode of the coupon. By default, the value is false.
The request was successful.
The user is not authorized to access the requested resource. The request is missing the required Auth-Key header.
The user's access was denied.
The user has exceeded the rate limit.
POST /api/v1/coupons HTTP/1.1
Host: protocol.jframework.io
Brand-URL: text
Auth-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 230
{
"name": "text",
"code": "text",
"percentage": 1,
"quantity": 1,
"startDate": "2025-08-10T05:09:50.024Z",
"endDate": "2025-08-10T05:09:50.024Z",
"autoApplyToPrice": true,
"description": "text",
"tags": "text",
"status": "1 - Active",
"testMode": true
}
{
"success": true,
"statusCode": 201,
"message": "The request was successful.",
"data": {
"id": "sApKpllz4sAplsmzha",
"code": "COUPON1",
"name": "Coupon 1",
"description": "This is a coupon",
"tags": "tag1, tag2",
"percentage": 10,
"quantity": 100,
"startDate": "2025-07-15T14:34:48.2378722+07:00",
"endDate": "2025-08-14T14:34:48.2378733+07:00",
"autoApplyToPrice": true,
"status": "Active",
"testMode": false,
"modifiedDate": "2025-07-15T14:34:48.2378749+07:00"
},
"errors": []
}
Last updated
Was this helpful?