Skip to main content
Create and manage customer records for billing.

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" }
  }'
Parameters:
ParameterTypeRequiredDescription
emailstringYesCustomer email address
namestringNoCustomer full name
phonestringNoCustomer phone number
metadataobjectNoKey-value pairs for your use
address.line1stringNoStreet address
address.citystringNoCity
address.statestringNoState or province
address.postal_codestringNoZIP or postal code
address.countrystringNoTwo-letter country code
Response:
{
  "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');