/services/platforms/v1/checkout/calculate-tax
Auth
Calculate VAT for the current checkout state. Validates ONLY the inputs the tax calculation actually consumes (country, contact_type, vat_number, subtotal) plus the VIES VAT check when a company supplies a number. Other contact fields (name, address, phone, etc.) are intentionally NOT validated here — they don't influence the tax rate, and validating them mid-edit blocks the tax line from rendering while the user is still filling the form. Full field validation runs at the final `/domain-upgrade/checkout` POST.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
contact_type |
string
company, individual, personal |
Yes | Whether the customer is a company or personal buyer | |
subtotal |
number
min: 0 |
Yes | Pre-tax subtotal amount used for VAT calculation | |
vat_number |
string|null
max: 50 |
No | EU VAT number for reverse charge eligibility (validated via VIES below) | |
country |
string
max: 5 |
Yes | Customer's country code for determining applicable tax rate |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string | |
data |
object | |
data.net_amount |
number | Amounts |
data.tax_rate |
string | Tax details |
data.tax_amount |
number | Amounts |
data.gross_amount |
number | Amounts |
data.reverse_charge_applied |
string | Reverse charge |
| Field | Type | Description |
|---|---|---|
message |
string | Errors overview. |
errors |
object | A detailed description of each field that failed validation. |
| Field | Type | Description |
|---|---|---|
message |
string | Error overview. |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
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 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
curl -X POST "https://api.wemasy.nl/api/services/platforms/v1/checkout/calculate-tax" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"contact_type": "string",
"subtotal": 0,
"vat_number": "string",
"country": "string"
}'
fetch('https://api.wemasy.nl/api/services/platforms/v1/checkout/calculate-tax', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"contact_type": "string",
"subtotal": 0,
"vat_number": "string",
"country": "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/platforms/v1/checkout/calculate-tax', {
"contact_type": "string",
"subtotal": 0,
"vat_number": "string",
"country": "string"
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"contact_type": "string",
"subtotal": 0,
"vat_number": "string",
"country": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/platforms/v1/checkout/calculate-tax", headers=headers, json=data)
print(r.json())
{
"error": false,
"message": "string",
"data": {
"net_amount": 0,
"tax_rate": "string",
"tax_amount": 0,
"gross_amount": 0,
"reverse_charge_applied": "string"
}
}