/services/platforms/v1/checkout/calculate-tax
Auth
Validate the full checkout payload and calculate VAT. Runs the same validation rules as DomainUpgradeController (including VIES VAT validation) so that all field errors surface here — before the user ever sees the tax step. This prevents 422 back-navigation on the final "Proceed to Checkout" click.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
contact_type |
string|null
company, personal |
No | Contact form (required for buy and transfer) Whether the domain registrant is a company or personal | |
subtotal |
number
min: 0 |
Yes | Pre-tax subtotal amount used for VAT calculation | |
vat_number |
string|null
max: 50 |
No | EU VAT number for tax reverse charge eligibility | |
country |
string|null
max: 50 |
No | Country code for registrant contact and tax calculation | |
product |
string
max: 100 |
Yes | Package key identifying the subscription product to purchase | |
plan |
string
max: 100 |
Yes | Plan tier within the selected product (e.g. basic, pro) | |
period |
string
year, month |
Yes | Billing cycle: yearly or monthly subscription | |
domain_choice |
string
buy, own, transfer |
Yes | How the user wants to handle their domain: buy new, use own, or transfer existing | |
domain_name |
string|null
max: 255 |
No | Domain buy / transfer fields Full domain name to register or transfer (e.g. example.com), checked against DB for duplicates | |
sld |
string|null
max: 255 |
No | Second-level domain part (e.g. "example" in example.com) | |
tld |
string|null
max: 50 |
No | Top-level domain part (e.g. "com", "nl", or multi-label like "aaa.pro") | |
domain_price |
number|null
min: 0 |
No | Frontend-submitted domain price (server re-verifies against DB) | |
epp_code |
string|null
max: 100 |
No | Authorization code required to transfer a domain from another registrar | |
first_name |
string|null
max: 255 |
No | Registrant's first name for domain WHOIS contact | |
last_name |
string|null
max: 255 |
No | Registrant's last name for domain WHOIS contact | |
company_name |
string|null
max: 255 |
No | Company name for domain registration (only relevant for company contact_type) | |
email |
string|null (email)
max: 255 |
No | Contact email for domain registration and billing | |
phone |
string|null
max: 50 |
No | Contact phone number, validated against country-specific format | |
address |
string|null
max: 500 |
No | Full street address including house number (min 20 chars to ensure completeness) | |
city |
string|null
max: 255 |
No | City name for domain registrant contact | |
postal_code |
string|null
max: 20 |
No | Postal/ZIP code, validated against country-specific format | |
state |
string|null
max: 255 |
No | State/province, required for countries like US, CA, AU, IN, BR, etc. | |
own_domain |
string|null
max: 255 |
No | Own domain User's existing domain they want to connect (when domain_choice=own) | |
redirect_url |
string|null
max: 500 |
No | Redirect URL to redirect to after successful payment (stored in subscription metadata) |
| 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. |
| 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 |
mixed[] |
| 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 |
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",
"product": "string",
"plan": "string",
"period": "string",
"domain_choice": "string",
"domain_name": "string",
"sld": "string",
"tld": "string",
"domain_price": "string",
"epp_code": "string",
"first_name": "string",
"last_name": "string",
"company_name": "string",
"email": "string",
"phone": "string",
"address": "string",
"city": "string",
"postal_code": "string",
"state": "string",
"own_domain": "string",
"redirect_url": "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",
"product": "string",
"plan": "string",
"period": "string",
"domain_choice": "string",
"domain_name": "string",
"sld": "string",
"tld": "string",
"domain_price": "string",
"epp_code": "string",
"first_name": "string",
"last_name": "string",
"company_name": "string",
"email": "string",
"phone": "string",
"address": "string",
"city": "string",
"postal_code": "string",
"state": "string",
"own_domain": "string",
"redirect_url": "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",
"product": "string",
"plan": "string",
"period": "string",
"domain_choice": "string",
"domain_name": "string",
"sld": "string",
"tld": "string",
"domain_price": "string",
"epp_code": "string",
"first_name": "string",
"last_name": "string",
"company_name": "string",
"email": "string",
"phone": "string",
"address": "string",
"city": "string",
"postal_code": "string",
"state": "string",
"own_domain": "string",
"redirect_url": "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",
"product": "string",
"plan": "string",
"period": "string",
"domain_choice": "string",
"domain_name": "string",
"sld": "string",
"tld": "string",
"domain_price": "string",
"epp_code": "string",
"first_name": "string",
"last_name": "string",
"company_name": "string",
"email": "string",
"phone": "string",
"address": "string",
"city": "string",
"postal_code": "string",
"state": "string",
"own_domain": "string",
"redirect_url": "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"
}
}