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
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be application/json. |
accessToken | string | Access token for authentication. (required) |
Request Body
The body of the request should be a JSON array containing objects with customer details:
| Field | Type | Description |
|---|---|---|
firstName | string | The first name of the customer. (required) |
lastName | string | The last name of the customer. (required) |
email | string | The email of the customer. (required) |
phoneNumber | string | The contact number of the customer. |
status | string | The status of the customer (e.g., "active"). (required) |
company | string | Associated company ID. |
metaFields | array | Array of meta-information fields for the customer. |
notes | string | Optional field for additional notes on the customer. |
MetaFields Object (metaFields[])
| Field | Type | Description |
|---|---|---|
code | string | Code for the metafield. |
value | mixed | Value 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:
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful. |
message | string | Message indicating the result of the operation. |
Sample Success Response
{
"success": true,
"message": "Customers created successfully"
}
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | The request body contains invalid data or is missing required fields. |
| 401 Unauthorized | The access token is invalid or missing. |
| 500 Internal Server Error | An 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.