Create Discount (admin)
Admin endpoint to create and manage discount codes and promotional rules for brands.
Overview
- Method: POST
- Path:
/brand/discounts/create-discount - Tags: brand
Use Cases
- Allow admins to create new discount codes for campaigns.
- Configure percentage or fixed-amount discounts with usage limits.
- Schedule discounts with valid from/until windows.
- Target discounts to specific products or categories.
Parameters
No parameters required.
Request Body
- Content Type:
application/json - Required: Yes
Fields
| Field | Type | Required | Details |
|---|---|---|---|
| code | string | Yes | minLength: 1, maxLength: 50 |
| type | object | Yes | |
| value | number | Yes | |
| description | string | No | |
| usageLimit | number | No | |
| minimumAmount | number | No | |
| validFrom | string | No | |
| validUntil | string | No | |
| applicableProducts | string | Yes | |
| applicableCategories | string | Yes |
Responses
200
Successful response
Content Type: application/json
{
"id": "string",
"code": "string",
"type": "string",
"value": 123,
"description": "string",
"usageLimit": 123,
"minimumAmount": 123,
"validFrom": "string",
"validUntil": "string",
"status": {},
"usageCount": 123,
"created_at": "string",
"updated_at": "string"
}400
Bad Request
Content Type: application/json
{}401
Unauthorized
404
Not Found
500
Internal Server Error
Example Usage
curl -X POST \
https://api.pillexa.com/brand/discounts/create-discount \
-H "Content-Type: application/json" \
-d '{"example": "data"}'