/services/webshop/v1/customer/auth/register
Public
Creates a new customer account under the given project and returns a sanctum bearer token — the customer is logged in immediately without waiting on email verification. A verification email is sent, and any past guest orders with the same email are linked to the new account in the background.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
project_id |
integer | Yes | 1 |
|
email |
string (email)
max: 191 |
Yes | jane@example.com |
|
password |
string
max: 191 |
Yes | correct-horse-battery-staple |
|
firstname |
string|null
max: 191 |
No | Jane |
|
lastname |
string|null
max: 191 |
No | Doe |
|
phone |
string|null
max: 191 |
No | +31612345678 |
|
account_type |
string|null
private, business |
No | private |
|
company |
string|null
max: 191 |
No | Acme B.V. |
|
tax_number |
string|null
max: 191 |
No | NL123456789B01 |
|
cart_reminder_consent |
boolean|null | No | true |
|
default_billing |
object | No | {"firstname":"Jane","lastname":"Doe","street":"Keizersgracht","number":"123","postcode":"1015 CJ","city":"Amsterdam","country":"NL","phone":"+31612345678"} |
| 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.customer |
object | |
data.token |
null |
| 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 | |
errors |
object | |
errors.email |
array |
| 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/webshop/v1/customer/auth/register" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"project_id": 1,
"email": "jane@example.com",
"password": "correct-horse-battery-staple",
"firstname": "Jane",
"lastname": "Doe",
"phone": "+31612345678",
"account_type": "private",
"company": "Acme B.V.",
"tax_number": "NL123456789B01",
"cart_reminder_consent": true,
"default_billing": {
"firstname": "Jane",
"lastname": "Doe",
"street": "Keizersgracht",
"number": "123",
"postcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"phone": "+31612345678"
}
}'
fetch('https://api.wemasy.nl/api/services/webshop/v1/customer/auth/register', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"project_id": 1,
"email": "jane@example.com",
"password": "correct-horse-battery-staple",
"firstname": "Jane",
"lastname": "Doe",
"phone": "+31612345678",
"account_type": "private",
"company": "Acme B.V.",
"tax_number": "NL123456789B01",
"cart_reminder_consent": true,
"default_billing": {
"firstname": "Jane",
"lastname": "Doe",
"street": "Keizersgracht",
"number": "123",
"postcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"phone": "+31612345678"
}
})})
.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/customer/auth/register', {
"project_id": 1,
"email": "jane@example.com",
"password": "correct-horse-battery-staple",
"firstname": "Jane",
"lastname": "Doe",
"phone": "+31612345678",
"account_type": "private",
"company": "Acme B.V.",
"tax_number": "NL123456789B01",
"cart_reminder_consent": true,
"default_billing": {
"firstname": "Jane",
"lastname": "Doe",
"street": "Keizersgracht",
"number": "123",
"postcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"phone": "+31612345678"
}
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"project_id": 1,
"email": "jane@example.com",
"password": "correct-horse-battery-staple",
"firstname": "Jane",
"lastname": "Doe",
"phone": "+31612345678",
"account_type": "private",
"company": "Acme B.V.",
"tax_number": "NL123456789B01",
"cart_reminder_consent": true,
"default_billing": {
"firstname": "Jane",
"lastname": "Doe",
"street": "Keizersgracht",
"number": "123",
"postcode": "1015 CJ",
"city": "Amsterdam",
"country": "NL",
"phone": "+31612345678"
}
}
r = requests.post("https://api.wemasy.nl/api/services/webshop/v1/customer/auth/register", headers=headers, json=data)
print(r.json())
{
"customer": {
"id": 42,
"email": "jane@example.com",
"firstname": "Jane",
"lastname": "Doe",
"email_verified_at": null
},
"token": "1|plaintext-sanctum-token-here",
"message": "Account created. Check your email to verify your address."
}