Customers
Create Bulk Customers

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 NameDescription
URLhttps://api.budpay.com/api/v2/customer/bulk_create
MethodPOST
AuthorizationBearer YOUR_SECRET_KEY (Replace with your actual BudPay secret key)
Content-Typeapplication/json
Request Parameters
ParameterTypeRequiredDescription
customersArrayYesArray of customer objects
customers[].emailStringYesCustomer's email address
customers[].first_nameStringYesCustomer's first name
customers[].last_nameStringYesCustomer's last name
customers[].phoneStringNoCustomer'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 POST
Sample Response
{
  "status": true,
  "message": "Customers processed",
  "data": {
    "batchid": "65c1368420424",
    "totalSubmitted": 3,
    "totalCreated": 3,
    "totalSkipped": 0,
    "domain": "test"
  }
}

Try it out

Response Fields
FieldDescription
batchidUnique batch identifier for retrieving created customers
totalSubmittedNumber of customers submitted in the request
totalCreatedNumber of customers successfully created
totalSkippedNumber of customers skipped (already exist)
domainEnvironment (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 NameDescription
URLhttps://api.budpay.com/api/v2/customers_by_batch_id/:batchid
MethodGET
AuthorizationBearer YOUR_SECRET_KEY (Replace with your actual BudPay secret key)
Path Parameters
ParameterTypeRequiredDescription
batchidStringYesBatch 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 GET
Sample 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
FieldDescription
idCustomer ID in BudPay system
first_nameCustomer's first name
last_nameCustomer's last name
emailCustomer's email address
phoneCustomer's phone number
customer_codeUnique customer identifier (e.g., CUS_xxxxx)
batch_idBatch ID the customer was created in
statusCustomer status (active, inactive)