This endpoint requires admin authentication. Include a valid admin JWT token in the Authorization header.
Path Parameters
The unique identifier of the coupon to update. Must be a valid positive integer.
Request Body
All fields are optional. Only include the fields you want to update.
The unique name/code for the coupon (max 30 characters)
The discount percentage. Must be an integer between 1 and 100
The expiration date in ISO 8601 date string format (e.g., “2026-12-31”)
Response
Returns the updated coupon object.
The unique identifier for the coupon
curl -X PATCH https://api.example.com/coupons/1 \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"percentage": 30
}'
{
"id": 1,
"name": "SUMMER2026",
"percentage": 30,
"expirationDate": "2026-09-30"
}
Validation Rules
When provided, each field follows the same validation rules as creation:
- name: Maximum 30 characters
- percentage: Must be an integer between 1 and 100 (inclusive)
- expirationDate: Must be a valid ISO 8601 date string format
Behavior
- Only the fields included in the request body will be updated
- The coupon must exist (returns 404 if not found)
- All validation rules apply to the fields being updated
- The ID parameter is validated using
IdValidationPipe