E-commerce API
POST /services/webshop/v1/discounts/update Auth

Update Discount

Request Body Required

FieldTypeRequiredDescriptionExample
discount_id string Yes 42
discount_type string No
start_date string No
end_date string No
label string No
include_shipping string No
sale_price_handling string No
selections string No
coupon_codes string No

Responses

500
200
422
401
403
429
Internal server error
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
details string
Discount updated successfully
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
data mixed
Validation error
FieldTypeDescription
message string Errors overview.
errors object A detailed description of each field that failed validation.
Unauthenticated — missing or invalid Bearer token
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
Forbidden — insufficient permissions for this resource
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
FieldTypeDescription
error boolean
message string
Too Many Requests — rate limit exceeded
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 60
X-RateLimit-Remaining integer Number of requests remaining in the current window 57
Retry-After integer Seconds until the rate limit resets 60
FieldTypeDescription
error boolean
message string
Base URL
https://api.wemasy.nl/api
Authentication

Request Sample
cURL
JS
PHP
Python
curl -X POST "https://api.wemasy.nl/api/services/webshop/v1/discounts/update" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "discount_id": "42",
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string",
    "coupon_codes": "string"
}'
fetch('https://api.wemasy.nl/api/services/webshop/v1/discounts/update', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "discount_id": "42",
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string",
    "coupon_codes": "string"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
    ->accept('application/json')
    ->post('https://api.wemasy.nl/api/services/webshop/v1/discounts/update', {
    "discount_id": "42",
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string",
    "coupon_codes": "string"
});
$data = $response->json();
import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = {
    "discount_id": "42",
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string",
    "coupon_codes": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/webshop/v1/discounts/update", headers=headers, json=data)
print(r.json())
Response Example
{
    "error": false,
    "message": "Discount updated successfully",
    "data": {
        "id": 42,
        "project_id": 10,
        "discount_type": "coupon",
        "status": "active",
        "priority": 2,
        "label": "Winter Sale 15%",
        "discount_value": null,
        "discount_value_type": null,
        "start_date": "2026-11-01T00:00:00.000000Z",
        "end_date": "2026-12-31T23:59:59.000000Z",
        "include_shipping": true,
        "sale_price_handling": "apply_to_sale_price",
        "selections": "[{\"label\":\"All products\",\"discount_value\":15,\"discount_value_type\":\"percentage\",\"filters\":[]}]",
        "created_at": "2026-04-01T12:00:00.000000Z",
        "updated_at": "2026-04-01T14:30:00.000000Z"
    }
}

Try It
Request Body Required

Export