Customers API
The Customers API allows you to create and manage customers on your integration.
Create Customer
Create a customer on your integration.
Endpoint: POST https://api.budpay.com/api/v2/customer
Virtual Account Requirement: The first_name, last_name, and phone are optional parameters. However, when creating a customer that would be assigned to a Dedicated Virtual Account, these parameters become required.
Parameters
This section details the header information required for creating a customer.
| Field Name | Description |
|---|---|
| URL | https://api.budpay.com/api/v2/customer |
| Method | POST |
| Authorization | Bearer YOUR_SECRET_KEY (Replace with your actual BudPay secret key) |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | String | Yes | Customer's email address |
first_name | String | Yes | Customer's first name |
last_name | String | Yes | Customer's last name |
phone | String | No | Customer's phone number |
metadata | Object | No | Key/value pairs for additional information |
Sample Request
curl https://api.budpay.com/api/v2/customer \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "zero@budpay.com",
"first_name": "Zero",
"last_name": "Sum",
"phone": "+2348123456789"
}' \
-X POSTSample Response
{
"status": true,
"message": "Customer created",
"data": {
"email": "zero@sum.com",
"domain": "test",
"customer_code": "CUS_mc85c8hzzwfyowx",
"id": 6,
"created_at": "2022-02-01T00:01:33.000000Z",
"updated_at": "2022-02-01T00:01:33.000000Z"
}
}Try it out
Response Fields
| Field | Description |
|---|---|
email | Customer's email address |
domain | Environment (test or live) |
customer_code | Unique customer identifier (e.g., CUS_xxxxx) |
id | Customer ID in BudPay system |
created_at | Timestamp when customer was created |