Commet
  • Pricing
Log InTry out
Introduction

Quickstart

Learn

Manage CustomersCustomer Portal

Resources

SDK ReferenceAPI VersioningError HandlingTestingCLI

Plugins

Better Auth
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

Manage Customers

Create and manage customers using the Commet SDK and dashboard.

A customer represents the business or person you bill. Each customer can have one active subscription at a time.

Dashboard

Navigate to Customers to view, search, and manage customers. From a customer's detail page you can assign plans, view subscription details, and manage billing.

Create a customer

const { data } = await commet.customers.create({
  email: 'billing@acme.com',
  id: 'user_123', // optional — your user ID for easy lookup
})
// data.id → 'cus_abc123' (Commet ID)
response = commet.customers.create(
    email='billing@acme.com',
    id='user_123',  # optional — your user ID for easy lookup
)
# response.data['id'] → 'cus_abc123' (Commet ID)
result, err := client.Customers.Create(ctx, &commet.CreateCustomerParams{
    Email: "billing@acme.com",
    ID:    "user_123", // optional — your user ID for easy lookup
})
// result.Data.ID → "cus_abc123" (Commet ID)
CreateCustomerParams params = CreateCustomerParams.builder()
    .email("billing@acme.com")
    .id("user_123") // optional — your user ID for easy lookup
    .build();
ApiResponse<Customer> result = commet.customers().create(params);
// result.getData().getId() → "cus_abc123" (Commet ID)
$result = $commet->customers->create(
    email: 'billing@acme.com',
    id: 'user_123', // optional — your user ID for easy lookup
);
// $result->data['id'] → 'cus_abc123' (Commet ID)
curl -X POST https://commet.co/api/customers \
  -H "x-api-key: $COMMET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "billing@acme.com",
    "id": "user_123"
  }'

create is idempotent — if a customer with the same id already exists, it returns the existing record.

Parameters

ParameterTypeRequiredDescription
emailstringYesBilling email
idstringNoYour user ID for easy lookup
fullNamestringNoCustomer name
addressobjectNoBilling address (line1, city, postalCode, country)
metadataobjectNoCustom key-value pairs

Create customers in batch

Create up to 100 customers in a single request. Each customer follows the same idempotency rules as individual creation.

const { data } = await commet.customers.createBatch({
  customers: [
    { email: 'alice@acme.com', id: 'user_1' },
    { email: 'bob@acme.com', id: 'user_2' },
    { email: 'carol@acme.com', id: 'user_3' },
  ],
})
// data.successful, data.failed
response = commet.customers.create_batch([
    {'email': 'alice@acme.com', 'id': 'user_1'},
    {'email': 'bob@acme.com', 'id': 'user_2'},
    {'email': 'carol@acme.com', 'id': 'user_3'},
])
result, err := client.Customers.CreateBatch(ctx, []commet.CreateCustomerParams{
    {Email: "alice@acme.com", ID: "user_1"},
    {Email: "bob@acme.com", ID: "user_2"},
    {Email: "carol@acme.com", ID: "user_3"},
}, "")
ApiResponse<BatchResult> result = commet.customers().createBatch(List.of(
    Map.of("email", "alice@acme.com", "external_id", "user_1"),
    Map.of("email", "bob@acme.com", "external_id", "user_2"),
    Map.of("email", "carol@acme.com", "external_id", "user_3")
));
$result = $commet->customers->createBatch([
    ['email' => 'alice@acme.com', 'id' => 'user_1'],
    ['email' => 'bob@acme.com', 'id' => 'user_2'],
    ['email' => 'carol@acme.com', 'id' => 'user_3'],
]);
curl -X POST https://commet.co/api/customers/batch \
  -H "x-api-key: $COMMET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customers": [
      { "email": "alice@acme.com", "id": "user_1" },
      { "email": "bob@acme.com", "id": "user_2" },
      { "email": "carol@acme.com", "id": "user_3" }
    ]
  }'

The response includes successful and failed arrays so you can handle partial failures.

Get a customer

const { data } = await commet.customers.get({ id: 'cus_abc123' })
response = commet.customers.get(customer_id='cus_abc123')
result, err := client.Customers.Get(ctx, "cus_abc123")
ApiResponse<Customer> result = commet.customers().get("cus_abc123");
$result = $commet->customers->get('cus_abc123');
curl https://commet.co/api/customers/cus_abc123 \
  -H "x-api-key: $COMMET_API_KEY"

Update a customer

await commet.customers.update({
  customerId: 'cus_abc123',
  email: 'new@acme.com',
  address: { line1: '123 Main St', city: 'Austin', postalCode: '78701', country: 'US' },
})
commet.customers.update(
    customer_id='cus_abc123',
    email='new@acme.com',
    address={'line1': '123 Main St', 'city': 'Austin', 'postal_code': '78701', 'country': 'US'},
)
client.Customers.Update(ctx, "cus_abc123", &commet.UpdateCustomerParams{
    Email: "new@acme.com",
    Address: &commet.Address{
        Line1:      "123 Main St",
        City:       "Austin",
        PostalCode: "78701",
        Country:    "US",
    },
})
UpdateCustomerParams params = UpdateCustomerParams.builder()
    .email("new@acme.com")
    .address(Address.builder()
        .line1("123 Main St")
        .city("Austin")
        .postalCode("78701")
        .country("US")
        .build())
    .build();
commet.customers().update("cus_abc123", params);
$commet->customers->update(
    customerId: 'cus_abc123',
    email: 'new@acme.com',
    address: [
        'line1' => '123 Main St',
        'city' => 'Austin',
        'postalCode' => '78701',
        'country' => 'US',
    ],
);
curl -X PUT https://commet.co/api/customers/cus_abc123 \
  -H "x-api-key: $COMMET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "new@acme.com",
    "address": {
      "line1": "123 Main St",
      "city": "Austin",
      "postalCode": "78701",
      "country": "US"
    }
  }'

Parameters

ParameterTypeRequiredDescription
customerIdstringYesCommet ID (cus_xxx) or your user ID
emailstringNoNew billing email
fullNamestringNoCustomer name
timezonestringNoIANA timezone
metadataobjectNoCustom key-value pairs
addressobjectNoBilling address (line1, line2, city, state, postalCode, country)

List customers

Cursor-based pagination. Returns up to 100 customers per page.

const { data, hasMore, nextCursor } = await commet.customers.list({ limit: 25 })
response = commet.customers.list(limit=25)
# response.data, response.has_more, response.next_cursor
result, err := client.Customers.List(ctx, &commet.ListCustomersParams{
    Limit: 25,
})
// result.Data, result.HasMore, result.NextCursor
ApiResponse<List<Customer>> result = commet.customers().list(null, null, 25, null);
// result.getData(), result.isHasMore(), result.getNextCursor()
$result = $commet->customers->list(limit: 25);
// $result->data, $result->hasMore, $result->nextCursor
curl "https://commet.co/api/customers?limit=25" \
  -H "x-api-key: $COMMET_API_KEY"

To fetch the next page, pass the nextCursor value.

const nextPage = await commet.customers.list({
  limit: 25,
  cursor: nextCursor,
})
next_page = commet.customers.list(
    limit=25,
    cursor=next_cursor,
)
nextPage, err := client.Customers.List(ctx, &commet.ListCustomersParams{
    Limit:  25,
    Cursor: nextCursor,
})
ApiResponse<List<Customer>> nextPage = commet.customers().list(null, null, 25, nextCursor);
$nextPage = $commet->customers->list(
    limit: 25,
    cursor: $nextCursor,
);
curl "https://commet.co/api/customers?limit=25&cursor=$NEXT_CURSOR" \
  -H "x-api-key: $COMMET_API_KEY"

Related

  • Customer Portal
  • Manage Subscriptions

How is this guide?

Integrate with Symfony

Add billing and payments to your Symfony application.

Customer Portal

Self-service portal for customers to manage their subscriptions.

On this page

Dashboard
Create a customer
Parameters
Create customers in batch
Get a customer
Update a customer
Parameters
List customers
Related