Create Customer
curl -X POST https://api.atlas.co/functions/v1/customers \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "Jane Doe",
"metadata": { "user_id": "123" }
}'
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Customer email address |
name | string | No | Customer full name |
phone | string | No | Customer phone number |
metadata | object | No | Key-value pairs for your use |
address.line1 | string | No | Street address |
address.city | string | No | City |
address.state | string | No | State or province |
address.postal_code | string | No | ZIP or postal code |
address.country | string | No | Two-letter country code |
{
"id": "cus_xxx",
"object": "customer",
"email": "[email protected]",
"name": "Jane Doe",
"metadata": { "user_id": "123" },
"created": 1704844800
}
List Customers
curl "https://api.atlas.co/functions/v1/customers?limit=10" \
-H "Authorization: Bearer sk_test_xxx"
Retrieve Customer
curl https://api.atlas.co/functions/v1/customers/cus_xxx \
-H "Authorization: Bearer sk_test_xxx"
Update Customer
curl -X PATCH https://api.atlas.co/functions/v1/customers/cus_xxx \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{ "name": "Jane Smith" }'
Delete Customer
curl -X DELETE https://api.atlas.co/functions/v1/customers/cus_xxx \
-H "Authorization: Bearer sk_test_xxx"
Node.js SDK
import { Atlas } from '@atlas/node';
const atlas = new Atlas('sk_test_xxx');
// Create
const customer = await atlas.customers.create({
email: '[email protected]',
name: 'Jane Doe',
});
// List
const customers = await atlas.customers.list({ limit: 10 });
// Retrieve
const cust = await atlas.customers.retrieve('cus_xxx');
// Update
await atlas.customers.update('cus_xxx', { name: 'Jane Smith' });
// Delete
await atlas.customers.delete('cus_xxx');