Create Multiple Customers
Creates several customer accounts in one request. This is useful when importing customers from another system.
HTTP Request
- URL:
/customers/multiple - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_CUSTOMER
Request Body
The request body is a JSON array. Each item is a customer object with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
firstName | String | Yes | First name of the customer. |
email | String | Yes | Email address of the customer. Must be unique. |
lastName | String | No | Last name of the customer. |
phoneNumber | String | No | Phone number of the customer. |
company | String | No | ID of the company the customer belongs to. Customers with a company are created as business (B2B) customers. |
roleName | String | No | Name of the customer role, for example Admin, Buyer or Junior Buyer. Default is Admin. See Get All Customer Roles. |
status | String | No | active, pending, invited or inactive. Default is pending. |
notes | String | No | Internal notes about the customer. |
image | String | No | URL of the customer's profile image. |
address | Array | No | List of addresses. See Address Object. |
metaFields | Array | No | Custom field values. See MetaFields Object. |
productGroups | Object | No | Product group settings. See Product Groups Object. |
paymentAccess | Object | No | Payment method settings. See Payment Access Object. |
cURL Example
curl --location '<BASE_URL>/customers/multiple' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
{
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria.lopez@northwindsupply.com",
"company": "665434c100e82884676936b9",
"roleName": "Buyer",
"status": "active"
},
{
"firstName": "Daniel",
"lastName": "Okafor",
"email": "daniel.okafor@northwindsupply.com",
"company": "665434c100e82884676936b9",
"roleName": "Junior Buyer",
"status": "active",
"metaFields": [
{ "code": "erp_contact_id", "value": 1255 }
]
}
]'
Response
- 200 OK: The customers were created successfully.
- 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, a field is missing or invalid, or an email is already in use.
Sample JSON Response
{
"success": true,
"message": "Customers created successfully"
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request was successful. |
message | String | Result message. |
Notes
- The response does not include the new customers. Use Get All Customers with the
email:infilter to look them up. - The request is all or nothing. If any customer cannot be created (for example, because the email is already in use or appears twice in the request), no customers are created and the error explains why.