> ## 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.

# Overview

> Create customers and manage their contact, billing and payment details.

A customer is the account you bill. It stores their contact information, billing details and payment settings, and connects their Contracts and invoices.

Create the customer first, then apply a Plan through a [Contract](https://getlago.com/docs/v2/guide/contracts/overview.md). The Contract defines when billing starts.

## Create a customer

Use `external_id` to identify the customer in your system. Pass this value as `external_customer_id` when creating a Contract.

> [tab] Dashboard
>
> 1. Open **Customers**.
> 2. Click **Create a customer**.
> 3. Enter the customer's name.
> 4. Enter their external ID.
> 5. Optionally, select a timezone.
> 6. Optionally, add billing details.
> 7. Optionally, select a payment provider.
> 8. Click **Create customer**.

> [tab] API
>
> Use `POST /customers` to create a customer. If the `external_id` already exists, the request returns `422`. Update that customer with `PUT /customers/{external_id}`.
>
> ```bash Create customer_example theme={"dark"}
>     LAGO_URL="https://api.getlago.com"
>     API_KEY="__YOUR_API_KEY__"
>
>     curl --location --request POST "$LAGO_URL/api/v2/customers" \
>       --header "Authorization: Bearer $API_KEY" \
>       --header 'Content-Type: application/json' \
>       --data-raw '{
>         "customer": {
>           "external_id": "customer_example",
>           "name": "Acme Corp",
>           "customer_type": "company",
>           "email": "billing@example.com",
>           "currency": "USD"
>         }
>       }'
> ```
>
> See [Create a customer](https://getlago.com/docs/v2/api-reference/customers/create.md) for all available fields.

## Configure billing details

Add the information you need to bill and collect payment from the customer.

| Details | What to configure |
| - | - |
| Identity and contact | Name, company or individual type, email and phone number. |
| Legal and address | Legal name, registration and tax identifiers, and billing or shipping address. |
| Billing | Currency, [billing entity](https://getlago.com/docs/v2/guide/billing-entities.md) and invoice settings. |
| Payments | Payment provider and the customer's record with that provider. See [Payment methods](https://getlago.com/docs/v2/guide/payments/payment-methods.md). |
| Metadata | Extra context, such as a CRM ID or purchase order reference. See [Customer metadata](https://getlago.com/docs/v2/guide/customers/customer-metadata.md). |

Set `customer_type` to `company` or `individual` when needed. You can leave it out and set it later.

See the [Customer object](https://getlago.com/docs/v2/api-reference/customers/object.md) for the complete field list.

## Update a customer

Use `PUT /customers/{external_id}` to update an existing customer. Send the fields you want to change. Omitted fields keep their current values.

Treat `external_id` as a permanent identifier. Once the customer has billing objects such as invoices or wallets, changes to it are ignored.

If you send `metadata` or `integration_customers`, include every entry you want to keep. These arrays replace the existing list. Include each retained entry's `id`, using its `lago_id` from the response. Omitted entries are removed; an empty array removes all entries. See [Customer metadata](https://getlago.com/docs/v2/guide/customers/customer-metadata.md) for a worked example.

> [tab] Dashboard
>
> Open **Customers** and select the customer to edit their information.

> [tab] API
>
> This request changes the customer's billing email. If the customer does not exist, the request returns `404`.
>
> ```bash Update the billing email theme={"dark"}
>     LAGO_URL="https://api.getlago.com"
>     API_KEY="__YOUR_API_KEY__"
>
>     curl --location --request PUT "$LAGO_URL/api/v2/customers/customer_example" \
>       --header "Authorization: Bearer $API_KEY" \
>       --header 'Content-Type: application/json' \
>       --data-raw '{
>         "customer": {
>           "email": "finance@example.com"
>         }
>       }'
> ```
>
> See [Update a customer](https://getlago.com/docs/v2/api-reference/customers/update.md) for the complete request schema.

## Find a customer

Use `GET /customers/{external_id}` to retrieve a customer. To include metadata, taxes or integration details, request `metadata`, `taxes` or `integration_customers` with `expands[]`.

Use `GET /customers` to list customers. Filter the results and follow the returned cursors to retrieve additional pages. See [List customers](https://getlago.com/docs/v2/api-reference/customers/list.md) for the available filters and [Pagination](https://getlago.com/docs/v2/api-reference/pagination.md) for navigating results.

```bash Retrieve a customer with its metadata theme={"dark"}
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --globoff --request GET "$LAGO_URL/api/v2/customers/customer_example?expands[]=metadata" \
  --header "Authorization: Bearer $API_KEY"
```

## Delete a customer

Review the customer's pending and active Contracts and draft invoices before deleting the customer.

`DELETE /customers/{external_id}` marks the customer as deleted and queues related termination work. The response includes `deleted_at`; it does not confirm that all related work has finished.

```bash Delete a customer theme={"dark"}
    LAGO_URL="https://api.getlago.com"
    API_KEY="__YOUR_API_KEY__"

    curl --location --request DELETE "$LAGO_URL/api/v2/customers/customer_example" \
      --header "Authorization: Bearer $API_KEY"
```

> [card] [Create a Contract](https://getlago.com/docs/v2/guide/contracts/overview.md)
>
> Apply a Plan and set when the customer's billing starts.

> [card] [Customer metadata](https://getlago.com/docs/v2/guide/customers/customer-metadata.md)
>
> Store extra context on the customer.

> [card] [Billing entities](https://getlago.com/docs/v2/guide/billing-entities.md)
>
> Choose the entity that issues invoices.

> [card] [Retrieve usage](https://getlago.com/docs/v2/guide/events/retrieve-usage.md)
>
> Review received events and current usage.


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