Customers API
The Customers API lets you create and manage customer profiles. Link customers to payments to track purchase history and enable saved payment methods.
Endpoints
POST
/v1/customersCreate a new customer
GET
/v1/customers/:idRetrieve a customer by ID
PATCH
/v1/customers/:idUpdate a customer
GET
/v1/customersList all customers
DELETE
/v1/customers/:idDelete a customer
The Customer Object
JSON
{
"id": "cus_abc123def456",
"object": "customer",
"email": "jane@example.com",
"name": "Jane Smith",
"phone": "+1 555 123 4567",
"metadata": {
"user_id": "12345"
},
"created_at": "2026-01-19T10:30:00Z",
"updated_at": "2026-01-19T10:30:00Z"
}Attributes
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier for the customer |
object | string | Always "customer" |
email | string | Customer's email address |
name | string | Customer's full name |
phone | string | Customer's phone number |
metadata | object | Custom key-value pairs for your use |
created_at | string | ISO 8601 timestamp of creation |
updated_at | string | ISO 8601 timestamp of last update |
Create a Customer
POST
/v1/customersCreate a new customer profile
Request Body
| Parameter | Type | Description |
|---|---|---|
emailrequired | string | Customer's email address |
name | string | Customer's full name |
phone | string | Customer's phone number |
metadata | object | Custom key-value pairs |
Example Request
cURL
curl https://api.vexutopia.com/v1/customers \
-H "Authorization: Bearer vex_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"email": "jane@example.com",
"name": "Jane Smith",
"metadata": {
"user_id": "12345"
}
}'JavaScript
const response = await fetch('https://api.vexutopia.com/v1/customers', {
method: 'POST',
headers: {
'Authorization': 'Bearer vex_test_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'jane@example.com',
name: 'Jane Smith',
metadata: {
user_id: '12345'
}
})
});
const customer = await response.json();
console.log(customer.id); // cus_abc123def456Retrieve a Customer
GET
/v1/customers/:idRetrieve a customer by their unique identifier
Example Request
cURL
curl https://api.vexutopia.com/v1/customers/cus_abc123def456 \
-H "Authorization: Bearer vex_test_your_api_key"JavaScript
const response = await fetch('https://api.vexutopia.com/v1/customers/cus_abc123def456', {
headers: {
'Authorization': 'Bearer vex_test_your_api_key'
}
});
const customer = await response.json();Update a Customer
PATCH
/v1/customers/:idUpdate an existing customer's details
Example Request
cURL
curl https://api.vexutopia.com/v1/customers/cus_abc123def456 \
-X PATCH \
-H "Authorization: Bearer vex_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"phone": "+1 555 987 6543"
}'JavaScript
const response = await fetch('https://api.vexutopia.com/v1/customers/cus_abc123def456', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer vex_test_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Jane Doe',
phone: '+1 555 987 6543'
})
});
const customer = await response.json();List Customers
GET
/v1/customersList all customers with optional filtering
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results per page (default: 10, max: 100) |
offset | integer | Number of results to skip |
email | string | Filter by email address |
Example Request
cURL
curl "https://api.vexutopia.com/v1/customers?limit=10" \
-H "Authorization: Bearer vex_test_your_api_key"Response
JSON
{
"object": "list",
"data": [
{
"id": "cus_abc123def456",
"object": "customer",
"email": "jane@example.com",
"name": "Jane Smith",
...
}
],
"total": 150,
"limit": 10,
"offset": 0,
"has_more": true
}Delete a Customer
DELETE
/v1/customers/:idPermanently delete a customer
Warning: Deleting a customer is permanent and cannot be undone. Historical payment data will retain the customer reference.
Example Request
cURL
curl https://api.vexutopia.com/v1/customers/cus_abc123def456 \
-X DELETE \
-H "Authorization: Bearer vex_test_your_api_key"Response
JSON
{
"id": "cus_abc123def456",
"object": "customer",
"deleted": true
}Using Customers with Payments
Link a customer to a payment by including the customer_id when creating a payment:
JavaScript
// Create a payment for an existing customer
const response = await fetch('https://api.vexutopia.com/v1/payments', {
method: 'POST',
headers: {
'Authorization': 'Bearer vex_test_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 2000,
currency: 'usd',
customer_id: 'cus_abc123def456',
description: 'Order #1234'
})
});