Platform Management API
POST /services/platforms/v1/checkout/calculate-tax Auth

Calculate Checkout Tax

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.

Request Body Required

FieldTypeRequiredDescriptionExample
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

Responses

200
422
401
403
429
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
FieldTypeDescription
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
Validation error
FieldTypeDescription
message string Errors overview.
errors object A detailed description of each field that failed validation.
Unauthenticated
FieldTypeDescription
message string Error overview.
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/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())
Response Example
{
    "error": false,
    "message": "string",
    "data": {
        "net_amount": 0,
        "tax_rate": "string",
        "tax_amount": 0,
        "gross_amount": 0,
        "reverse_charge_applied": "string"
    }
}

Try It
Request Body Required

Export