API Referencev1DiscountsBy ID
Update a discount
X-API-Key<token>
Per-store API key created in the dashboard at Settings > Developer > API Keys.
In: header
Path Parameters
id*string
Length
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PATCH "https://api.whatalo.com/v1/discounts/472819365047" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"id": "disc_abc123",
"code": "SUMMER20",
"type": "percentage",
"value": 20,
"min_order_amount": 0,
"max_uses": 0,
"current_uses": 0,
"starts_at": "string",
"expires_at": "string",
"is_active": true,
"applies_to_all": true,
"applicable_product_ids": [
"string"
],
"applicable_category_ids": [
"string"
],
"is_expired": true,
"is_usable": true,
"has_usage_limit": true,
"created_at": "string",
"updated_at": "string"
}
}{
"error": {
"code": "FEATURE_ACCESS_DENIED",
"message": "\"Control de Inventario\" requiere un plan premium. Actualiza tu plan para acceder a esta función.",
"details": {
"feature": "inventory"
}
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [
{
"field": "string",
"message": "string"
}
]
}
}