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

Create Discount

Request Body

FieldTypeRequiredDescriptionExample
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

Responses

500
201
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
Resource created
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 object
data.id integer
data.project_id integer
data.label string
data.discount_type string
data.start_date string
data.end_date string|null
data.include_shipping integer
data.sale_price_handling string
data.selections string
data.status string
data.priority integer|null
data.created_at string|null (date-time)
data.updated_at string|null (date-time)
data.archived_at string|null (date-time)
Successful response
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
Validation 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
message string
errors object
errors.selections string[]
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/create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string"
}'
fetch('https://api.wemasy.nl/api/services/webshop/v1/discounts/create', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "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/create', {
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string"
});
$data = $response->json();
import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = {
    "discount_type": "string",
    "start_date": "string",
    "end_date": "string",
    "label": "string",
    "include_shipping": "string",
    "sale_price_handling": "string",
    "selections": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/webshop/v1/discounts/create", headers=headers, json=data)
print(r.json())

Try It
Request Body Optional

Export