cURL
curl --request POST \ --url https://api.example.com/api/v1/products/update-prices \ --header 'Content-Type: application/json' \ --data ' { "product_id": "<string>", "new_price": 123, "reason": "<string>" } '
{ "message": "<string>", "error": "<string>" }
Bulk update product prices with automatic price history tracking
admin
gestor
curl -X POST https://api.example.com/api/v1/products/update-prices \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "product_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "new_price": 5.49, "reason": "Seasonal price increase" }, { "product_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "new_price": 0.30, "reason": "Supplier cost adjustment" }, { "product_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "new_price": 12.99, "reason": "Market price correction" } ]'
{ "message": "Updated 3 product prices successfully" }
curl -X POST https://api.example.com/api/v1/products/update-prices \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '[ { "product_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "new_price": 5.99, "reason": "Premium quality upgrade" } ]'
{ "error": "Expected a list of updates" }
[ {"product_id": "id1", "new_price": 3.99, "reason": "Summer sale"}, {"product_id": "id2", "new_price": 7.49, "reason": "Summer sale"}, {"product_id": "id3", "new_price": 12.99, "reason": "Summer sale"} ]
[ {"product_id": "id1", "new_price": 15.00, "reason": "Supplier cost increase"}, {"product_id": "id2", "new_price": 22.50, "reason": "Supplier cost increase"} ]
[ {"product_id": "id1", "new_price": 9.99, "reason": "Competitor price matching"}, {"product_id": "id2", "new_price": 14.99, "reason": "Market analysis adjustment"} ]