POST
/api/v1/customers
Create a customer in the authenticated shop scope.
Authentication: API key required
Behavior
- At least one of email or phone_number is required.
- The shop is not provided in the request body. It is derived from the API key.
- If the shop does not exist, the route returns 404 Shop not found.
- If a customer already exists with the same email, the route returns HTTP 200 with success: true and existing: true instead of creating a duplicate.
- If a customer already exists with the same phone_number, the route also returns the existing customer with HTTP 200.
- shopify_id, wordpress_id, fb_user_id, ig_user_id, and whatsapp_id are converted to strings before persistence when present.
Body parameters
- email (optional)
Customer email address. Required if phone_number is not provided.
- phone_number (optional)
Customer phone number. Required if email is not provided.
- first_name (optional)
Customer first name.
- last_name (optional)
Customer last name.
- full_name (optional)
Full customer name.
- shopify_id (optional)
Shopify customer ID.
- wordpress_id (optional)
WordPress customer ID.
- fb_user_id (optional)
Facebook user ID.
- ig_user_id (optional)
Instagram user ID.
- whatsapp_id (optional)
WhatsApp user ID.
JSON body
{
"email": "dev@example.com",
"first_name": "Ada",
"last_name": "Lovelace",
"phone_number": "+33123456789",
"shopify_id": 987654321
}Response
Response example
{
"success": true,
"customer": {
"id": 123,
"email": "dev@example.com",
"phone_number": "+33123456789",
"first_name": "Ada",
"last_name": "Lovelace",
"shopify_id": "987654321",
"shopDomain": "example.myshopify.com"
}
}