Skip to main content

Create Multiple Customers

This POST endpoint allows you to create multiple customer records in the system with a single request. The request body should include an array of customer objects, each containing necessary personal and contact information.

Endpoint

  • URL: /customers/multiple
  • Method: POST

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess token for authentication. (required)

Request Body

The body of the request should be a JSON array containing objects with customer details:

FieldTypeDescription
firstNamestringThe first name of the customer. (required)
lastNamestringThe last name of the customer. (required)
emailstringThe email of the customer. (required)
phoneNumberstringThe contact number of the customer.
statusstringThe status of the customer (e.g., "active"). (required)
companystringAssociated company ID.
metaFieldsarrayArray of meta-information fields for the customer.
notesstringOptional field for additional notes on the customer.

MetaFields Object (metaFields[])

FieldTypeDescription
codestringCode for the metafield.
valuemixedValue of the metafield.

Sample Request Body

[
{
"firstName": "Prashanth",
"lastName": "Viru",
"email": "prs13434344232@mailinator.com",
"phoneNumber": "65161861",
"status": "active",
"company": "637e18fc741020de0693227a",
"metaFields": [
{
"code": "p21_contact_id",
"value": 123
}
],
"notes": "NOTE AREA"
}
]

Response

  • Status Code: 201 Created

Success Response Body

A successful response will confirm the creation of the customers:

FieldTypeDescription
successbooleanIndicates if the request was successful.
messagestringMessage indicating the result of the operation.

Sample Success Response

{
"success": true,
"message": "Customers created successfully"
}

Error Responses

Status CodeDescription
400 Bad RequestThe request body contains invalid data or is missing required fields.
401 UnauthorizedThe access token is invalid or missing.
500 Internal Server ErrorAn error occurred on the server.

Notes

  • Ensure all required fields are included in each customer object within the request array.
  • Confirm that your access token is valid and has permission to create customer data.
  • This endpoint handles the creation of multiple customer records and returns their unique identifiers upon success.