v1.0

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/customers

Create a new customer

GET/v1/customers/:id

Retrieve a customer by ID

PATCH/v1/customers/:id

Update a customer

GET/v1/customers

List all customers

DELETE/v1/customers/:id

Delete 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
ParameterTypeDescription
idstringUnique identifier for the customer
objectstringAlways "customer"
emailstringCustomer's email address
namestringCustomer's full name
phonestringCustomer's phone number
metadataobjectCustom key-value pairs for your use
created_atstringISO 8601 timestamp of creation
updated_atstringISO 8601 timestamp of last update

Create a Customer

POST/v1/customers

Create a new customer profile

Request Body

ParameterTypeDescription
emailrequiredstringCustomer's email address
namestringCustomer's full name
phonestringCustomer's phone number
metadataobjectCustom 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_abc123def456

Retrieve a Customer

GET/v1/customers/:id

Retrieve 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/:id

Update 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/customers

List all customers with optional filtering

Query Parameters

ParameterTypeDescription
limitintegerNumber of results per page (default: 10, max: 100)
offsetintegerNumber of results to skip
emailstringFilter 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/:id

Permanently 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'
  })
});

Next Steps

Learn more about related features: