E-commerce API
POST /services/webshop/v1/customer/auth/register Public

Register customer account

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.

Request Body Required

FieldTypeRequiredDescriptionExample
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"}

Responses

201
422
429
Customer created and token issued
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.customer object
data.token null
Validation failed or email already registered for this project
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
errors object
errors.email array
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/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())
Response Example
{
    "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."
}

Try It
Request Body Required

Export