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

# Customers

> Create and manage customers with lago v2 customers, and read their invoices, credit notes, payments and payment methods.

| Command | Description |
| - | - |
| `v2 customers create` | Create a customer. An existing `external_id` returns 422, it does not update. |
| `v2 customers get <external_id>` | Retrieve a customer. `--expands` takes `metadata`, `taxes`, `integration_customers`. |
| `v2 customers list` | List customers. Filters include `--external-id`, `--currencies`, `--countries`, `--billing-entity-codes`, `--customer-type`, `--search-term`. |
| `v2 customers update <external_id>` | Partial update. Also `patch`. |
| `v2 customers delete <external_id>` | Soft-delete the customer and queue related termination work. Confirmation-gated. |
| `v2 customers invoices <customer_external_id>` | The customer's invoices. |
| `v2 customers credit-notes <customer_external_id>` | The customer's credit notes. |
| `v2 customers payments <customer_external_id>` | The customer's payments. |
| `v2 customers payment-requests <customer_external_id>` | The customer's payment requests. |
| `v2 customers payment-methods <customer_external_id>` | The customer's payment methods. |
| `v2 customers set-default-payment-method <customer_external_id> <lago_id>` | Make a payment method the default. |
| `v2 customers delete-payment-method <customer_external_id> <lago_id>` | Delete a payment method. Confirmation-gated. |
| `v2 customers checkout-url <customer_external_id>` | Create a checkout URL with the customer's payment provider. |

## create and update

In v2, billing and payment settings are top-level flags, not a `billing_configuration` object: `--payment-provider`, `--payment-provider-code`, `--provider-customer-id`, `--sync-with-provider`, `--document-locale`, `--invoice-grace-period`, `--periodic-invoice-issuing-date-anchor`, `--periodic-invoice-issuing-date-adjustment`. Shipping address fields take the `--shipping-address-` prefix.

`--metadata` and `--integration-customers` are full replacements on update. Send each existing entry with its `id` to keep it. Omitted entries are deleted, and an empty array removes them all. A customer holds at most five metadata entries.

Contracts, not customers, carry what a customer buys. See [Contracts](https://getlago.com/docs/v2/guide/lago-cli/commands/contracts.md) and [customer management](https://getlago.com/docs/v2/guide/customers/customer-management.md).

```bash create theme={"dark"}
lago v2 customers create --external-id acme --name "Acme Corp" \
  --email billing@acme.example --currency USD --country US

lago v2 customers create --external-id acme_eu --name "Acme EU" --currency EUR \
  --billing-entity-code acme_eu --payment-provider stripe \
  --payment-provider-code stripe-eu-1 --sync-with-provider true
```

```bash read theme={"dark"}
lago v2 customers get acme --expands metadata,taxes
lago v2 customers list --currencies USD --all --output json | jq -r '.customers[].external_id'
```

```bash update theme={"dark"}
lago v2 customers update acme --email finance@acme.example
lago v2 customers update acme --metadata '[{"key":"po","value":"PO-1234","display_on_invoice":true}]'
```

```bash related lists theme={"dark"}
lago v2 customers invoices acme --payment-status pending
lago v2 customers payments acme
lago v2 customers payment-methods acme
```

```bash payment methods theme={"dark"}
lago v2 customers set-default-payment-method acme 1a901a90-1a90-1a90-1a90-1a901a901a90
lago v2 customers checkout-url acme
```

```bash delete theme={"dark"}
lago v2 customers delete acme --confirm acme
```

```text create theme={"dark"}
LAGO_ID      1a901a90-1a90-1a90-1a90-1a901a901a90
EXTERNAL_ID  acme
NAME         Acme Corp
```


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