Bulk Customers API
The Bulk Customers API allows you to create and manage bulk customers on your integration.
Create Bulk Customers
Create multiple customers on your integration in a single request.
Endpoint: POST https://api.budpay.com/api/v2/customer/bulk_create
Virtual Account Requirement: The first_name, last_name, and phone are optional parameters. However, when creating customers that would be assigned to Dedicated Virtual Accounts, these parameters become required.
Parameters
This section details the header information required for creating bulk customers.
| Field Name | Description |
|---|---|
| URL | https://api.budpay.com/api/v2/customer/bulk_create |
| Method | POST |
| Authorization | Bearer YOUR_SECRET_KEY (Replace with your actual BudPay secret key) |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
customers | Array | Yes | Array of customer objects |
customers[].email | String | Yes | Customer's email address |
customers[].first_name | String | Yes | Customer's first name |
customers[].last_name | String | Yes | Customer's last name |
customers[].phone | String | No | Customer's phone number |
Sample Request
curl https://api.budpay.com/api/v2/customer/bulk_create \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"customers": [
{
"email": "customer1@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "07036218209"
},
{
"email": "customer2@example.com",
"first_name": "Jane",
"last_name": "Smith",
"phone": "07036218210"
},
{
"email": "customer3@example.com",
"first_name": "Bob",
"last_name": "Wilson",
"phone": "07036218211"
}
]
}' \
-X POSTSample Response
{
"status": true,
"message": "Customers processed",
"data": {
"batchid": "65c1368420424",
"totalSubmitted": 3,
"totalCreated": 3,
"totalSkipped": 0,
"domain": "test"
}
}Try it out
Response Fields
| Field | Description |
|---|---|
batchid | Unique batch identifier for retrieving created customers |
totalSubmitted | Number of customers submitted in the request |
totalCreated | Number of customers successfully created |
totalSkipped | Number of customers skipped (already exist) |
domain | Environment (test or live) |
Save the Batch ID: Use the batchid to retrieve created customers or create bulk virtual accounts.
Get Customers By Batch ID
Retrieve all customers created in a batch using the batch ID.
Endpoint: GET https://api.budpay.com/api/v2/customers_by_batch_id/:batchid
Parameters
This section details the header information required for fetching customers by batch ID.
| Field Name | Description |
|---|---|
| URL | https://api.budpay.com/api/v2/customers_by_batch_id/:batchid |
| Method | GET |
| Authorization | Bearer YOUR_SECRET_KEY (Replace with your actual BudPay secret key) |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batchid | String | Yes | Batch ID from bulk customer creation |
Sample Request
curl https://api.budpay.com/api/v2/customers_by_batch_id/65c1368420424 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-X GETSample Response
{
"status": true,
"message": "Customers retrieved",
"data": [
{
"id": 8242070,
"first_name": "Test 1",
"last_name": "Test 1",
"email": "aa@test.com",
"phone": "07036218209",
"domain": "test",
"customer_code": "CUS_3wbenswjirvtnad",
"batch_id": "65c1368420424",
"metadata": "{}",
"status": "active"
},
{
"id": 8242071,
"first_name": "Test 2",
"last_name": "Test 2",
"email": "bb@test.com",
"phone": "07036218209",
"domain": "test",
"customer_code": "CUS_r5drcnpkdo7l3sd",
"batch_id": "65c1368420424",
"metadata": "{}",
"status": "active"
},
{
"id": 8242072,
"first_name": "Test 3",
"last_name": "Test 3",
"email": "cc@test.com",
"phone": "07036218209",
"domain": "test",
"customer_code": "CUS_uaxartryqeqj8pm",
"batch_id": "65c1368420424",
"metadata": "{}",
"status": "active"
}
]
}Try it out
Response Fields
| Field | Description |
|---|---|
id | Customer ID in BudPay system |
first_name | Customer's first name |
last_name | Customer's last name |
email | Customer's email address |
phone | Customer's phone number |
customer_code | Unique customer identifier (e.g., CUS_xxxxx) |
batch_id | Batch ID the customer was created in |
status | Customer status (active, inactive) |