> ## Documentation Index
> Fetch the complete documentation index at: https://commet.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Customers

> Create and manage customers using the current Commet SDKs and dashboard.

Install the Commet Skill so your coding agent can integrate customers using the current API contract.

```bash theme={null}
npx skills add commet-labs/skills --skill commet
```

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

## Dashboard

Navigate to **Customers** to search customers, inspect billing state, assign a plan, and manage the subscription.

## Create a customer

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const customer = await commet.customers.create({ email: "user@example.com" });
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

customer = commet.customers.create(email="user@example.com")
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

customer, err := client.Customers.Create(ctx, &commet.CreateCustomerParams{
	Email: "user@example.com",
})
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.params.CreateCustomerParams;

var commet = Commet.builder().apiKey("ck_xxx").build();

var customer = commet.customers().create(
    CreateCustomerParams.builder("user@example.com").build()
);
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$customer = $commet->customers->create(email: 'user@example.com');
```

`create` is idempotent when you supply your own `id`: a retry with the same ID returns the existing customer.

Use:

* `id` for the stable identifier from your application.
* `email` for billing communication.
* `address` and `taxDocument` for billing and tax context.
* `metadata` for application-specific values that do not control billing behavior.

## Create customers in batch

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const customerBatch = await commet.customers.createBatch({ customers: [{ email: "user@example.com" }] });
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

customer_batch = commet.customers.create_batch(customers=[{"email": "user@example.com"}])
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

customerBatch, err := client.Customers.CreateBatch(ctx, &commet.BatchCreateCustomersParams{
	Customers: []commet.BatchCreateCustomersParamsCustomersItem{{
		Email: "user@example.com",
	}},
})
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.models.BatchCreateCustomersParamsCustomersItem;
import co.commet.params.BatchCreateCustomersParams;
import java.util.List;

var commet = Commet.builder().apiKey("ck_xxx").build();

var customerBatch = commet.customers().createBatch(
    BatchCreateCustomersParams.builder(List.of(new BatchCreateCustomersParamsCustomersItem("user@example.com", null, null, null, null, null, null, null))).build()
);
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$customerBatch = $commet->customers->createBatch(
    customers: [['email' => 'user@example.com']],
);
```

A batch accepts up to 100 customers and returns successful and failed items independently.

## Retrieve a customer

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const customer = await commet.customers.get({ id: "cus_xxx" });
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

customer = commet.customers.get("cus_xxx")
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

customer, err := client.Customers.Get(ctx, "cus_xxx")
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;

var commet = Commet.builder().apiKey("ck_xxx").build();

var customer = commet.customers().get("cus_xxx");
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$customer = $commet->customers->get(id: 'cus_xxx');
```

## Update a customer

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const customer = await commet.customers.update({ id: "cus_xxx" });
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

customer = commet.customers.update("cus_xxx")
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

customer, err := client.Customers.Update(ctx, "cus_xxx", nil)
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.params.UpdateCustomerParams;

var commet = Commet.builder().apiKey("ck_xxx").build();

var customer = commet.customers().update(
    "cus_xxx",
    UpdateCustomerParams.builder().build()
);
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$customer = $commet->customers->update(id: 'cus_xxx');
```

Updates use `PATCH` semantics: send only the fields that should change.

## List customers

```typescript TypeScript theme={null}
import { Commet } from "@commet/node";

const commet = new Commet({ apiKey: "ck_xxx" });

const response = await commet.customers.list();
```

```python Python theme={null}
from commet import Commet

commet = Commet("ck_xxx")

customers_list_result = commet.customers.list()
```

```go Go theme={null}
client, err := commet.New("ck_xxx")
if err != nil {
	log.Fatal(err)
}
ctx := context.Background()

customersListResult, err := client.Customers.List(ctx, nil)
if err != nil {
	log.Fatal(err)
}
```

```java Java theme={null}
import co.commet.Commet;
import co.commet.params.ListCustomersParams;

var commet = Commet.builder().apiKey("ck_xxx").build();

var customersListResult = commet.customers().list(ListCustomersParams.builder().build());
```

```php PHP theme={null}
use Commet\Commet;

$commet = new Commet('ck_xxx');

$customersListResult = $commet->customers->list();
```

Lists return `{ object, data, hasMore, nextCursor }`. Pass `nextCursor` back as `cursor` to request the next page. Singular customer operations return the customer directly.

See the [Customers API reference](https://commet.co/docs/api-reference/customers/list-customers.md) for the exact generated request and response fields.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.