Skip to main content

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:

FieldTypeRequiredDescription
firstNameStringYesFirst name of the customer.
emailStringYesEmail address of the customer. Must be unique.
lastNameStringNoLast name of the customer.
phoneNumberStringNoPhone number of the customer.
companyStringNoID of the company the customer belongs to. Customers with a company are created as business (B2B) customers.
roleNameStringNoName of the customer role, for example Admin, Buyer or Junior Buyer. Default is Admin. See Get All Customer Roles.
statusStringNoactive, pending, invited or inactive. Default is pending.
notesStringNoInternal notes about the customer.
imageStringNoURL of the customer's profile image.
addressArrayNoList of addresses. See Address Object.
metaFieldsArrayNoCustom field values. See MetaFields Object.
productGroupsObjectNoProduct group settings. See Product Groups Object.
paymentAccessObjectNoPayment 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​

FieldTypeDescription
successBooleanWhether the request was successful.
messageStringResult message.

Notes​

  • The response does not include the new customers. Use Get All Customers with the email:in filter 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.