API Reference/Customers
Customers API
View customer records, look up purchase history, and manage your blacklist. Customer records are created automatically from orders.
GET
/v1/customersList customers
Returns a paginated list of your customers, sorted by most recent order.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| limit | integer | Items per page, max 100 (default: 25) |
| string | Search by email address | |
| blacklisted | boolean | Filter by blacklist status |
const res = await fetch("https://api.sellvy.io/v1/customers?limit=20", {
headers: { "Authorization": "Bearer sk_live_..." }
});
const { data, meta } = await res.json();Response
json
{
"data": [
{
"id": "cus_abc123",
"email": "customer@example.com",
"total_spent": 149.97,
"order_count": 5,
"country": "US",
"blacklisted": false,
"first_order_at": "2025-01-10T08:00:00Z",
"last_order_at": "2025-03-20T14:22:00Z"
}
],
"meta": {
"page": 1,
"limit": 20,
"total": 89
}
}GET
/v1/customers/:idGet a customer
Retrieve a customer record by ID, including their full order history.
const res = await fetch("https://api.sellvy.io/v1/customers/cus_abc123", {
headers: { "Authorization": "Bearer sk_live_..." }
});
const customer = await res.json();
console.log(customer.email); // "customer@example.com"
console.log(customer.orders); // Array of order summariesPOST
/v1/customers/:id/blacklistBlacklist a customer
Add or remove a customer from your blacklist. Blacklisted customers cannot place new orders on your store.
Request body
| Field | Type | Description |
|---|---|---|
| blacklisted | boolean | Set to true to blacklist, false to remove from blacklist |
| reason | string | Optional reason for blacklisting |
// Blacklist a customer
const res = await fetch(
"https://api.sellvy.io/v1/customers/cus_abc123/blacklist",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
blacklisted: true,
reason: "Chargeback fraud"
})
}
);
const result = await res.json();
console.log(result.blacklisted); // true