update promotion
Developing
PUT
admin/promotions/2
PERCENTAGE_DISCOUNT = "percentage_discount"
FIXED_DISCOUNT = "fixed_discount"
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'admin/promotions/2' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTc0NTU3MDkyMywianRpIjoiN2JmNWYzYWEtNjBiYS00MDcyLWIyY2MtYjcyMTdiOTEyNTExIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6IjMiLCJuYmYiOjE3NDU1NzA5MjMsImNzcmYiOiJlNjliZTVmNC03ODRmLTRmN2YtOWUzZC02NWZmYzE3YWM1YWMiLCJ1c2VybmFtZSI6InNlbGYiLCJlbWFpbCI6InNlbGZAZXhhbXBsZS5jb20iLCJpc192ZW5kb3IiOmZhbHNlfQ.OWOHjdvS-Epyv6Dimp_n53eiO1r2h3RoY8tDTa7yS9c' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Summer Sale updated",
"description": "20% off all eco-friendly products updated",
"promo_code": "SUMMER20updated",
"discount_value": 30,
"promotion_type": "fixed_discount",
"start_date": "2023-06-01T00:00:00",
"end_date": "2026-06-30T23:59:59",
"image_url" : "https://example.com/image-updated.jpg",
"min_order_amount": 200,
"max_discount": 40,
"usage_limit": 1,
"product_ids": [4, 5, 6]
}'
Response Response Example
{
"message": "Promotion updated successfully",
"promotion": {
"categories": "[]",
"created_at": "Fri, 02 May 2025 12:22:34 GMT",
"description": "20% off all eco-friendly products updated",
"discount_value": 30.0,
"end_date": "Tue, 30 Jun 2026 23:59:59 GMT",
"id": 2,
"image_url": "https://example.com/image-updated.jpg",
"is_active": true,
"max_discount": 40.0,
"products": "[4, 5, 6]",
"promo_code": "SUMMER20updated",
"promotion_type": "fixed_discount",
"start_date": "Thu, 01 Jun 2023 00:00:00 GMT",
"title": "Summer Sale updated",
"updated_at": "Fri, 02 May 2025 13:18:18 GMT",
"usage_limit": 1
},
"success": true
}
Request
Header Params
Authorization
string
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTc0NTU3MDkyMywianRpIjoiN2JmNWYzYWEtNjBiYS00MDcyLWIyY2MtYjcyMTdiOTEyNTExIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6IjMiLCJuYmYiOjE3NDU1NzA5MjMsImNzcmYiOiJlNjliZTVmNC03ODRmLTRmN2YtOWUzZC02NWZmYzE3YWM1YWMiLCJ1c2VybmFtZSI6InNlbGYiLCJlbWFpbCI6InNlbGZAZXhhbXBsZS5jb20iLCJpc192ZW5kb3IiOmZhbHNlfQ.OWOHjdvS-Epyv6Dimp_n53eiO1r2h3RoY8tDTa7yS9c
Body Params application/json
Responses
Modified at 2025-05-04 17:44:33