Create Bulk Customer
Use this endpoint to create several customers in one request. It is useful when onboarding many customers or preparing a group of customers for bulk virtual-account creation.
The response includes a batchid. Save it because you will need it when calling Create Bulk Virtual Account.
This request uses your secret key and must be made from a secure backend server. Never expose your secret key in browser or mobile-app code.
API Endpoint
POST https://backendapi.sayswitchgroup.com/api/v1/customer/bulk_createRequest Body
{
"customers": [
{
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"bvn": "22358970815"
},
{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"phone": "08087654321"
}
]
}Replace the sample customer details with values collected from your own application.
| Field | Type | Required | Description |
|---|---|---|---|
customers | array | Yes | The customers to create. |
customers[].email | string | Yes | The customer’s valid email address. |
customers[].first_name | string | Yes | The customer’s first name. |
customers[].last_name | string | Yes | The customer’s last name. |
customers[].phone | string | Yes | The customer’s phone number. |
customers[].bvn | string | No | The customer’s Bank Verification Number, when required. Only collect and send it with the customer’s consent and appropriate security controls. |
Sample Request
curl -X POST https://backendapi.sayswitchgroup.com/api/v1/customer/bulk_create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-d '{
"customers": [
{
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"bvn": "22358970815"
},
{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"phone": "08087654321"
}
]
}'Success Response
{
"status": true,
"message": "Customers processed",
"data": {
"batchid": "0705855c54999",
"totalSubmitted": 2,
"totalCreated": 2,
"totalSkipped": 0,
"domain": "live"
}
}| Field | Type | Description |
|---|---|---|
status | boolean | Indicates whether the request was processed successfully. |
message | string | A summary of the result. |
data.batchid | string | The batch identifier used for bulk virtual-account creation. |
data.totalSubmitted | integer | Number of customers submitted. |
data.totalCreated | integer | Number of customers created. |
data.totalSkipped | integer | Number of customers skipped, for example because they already exist. |
data.domain | string | The environment in which the customers were processed. |
The response field is
batchid, while the next request expectsbatchId. Use the exact spelling shown for each endpoint.
Validation Errors
If a customer record is incomplete or invalid, the API returns a non-success HTTP status with a message describing the problem. Check both the HTTP status and response body, correct the affected customer data, and then submit the request again. Do not assume that every submitted customer was created; compare totalSubmitted, totalCreated, and totalSkipped.
Next Step
Pass the returned data.batchid to Create Bulk Virtual Account as batchId.