---
title: "Upsert customer"
method: PUT
path: "/openmeter/customers/{customerId}"
tags: ["OpenMeter Customers"]
---

# Upsert customer

`PUT /openmeter/customers/{customerId}`

## Path parameters

- `customerId` string, required — ULID (Universally Unique Lexicographically Sortable Identifier).

## Request body

- UpsertCustomerRequest — Customer upsert request.
  - `name` string, required — Display name of the resource. Between 1 and 256 characters.
  - `description` string — Optional description of the resource. Maximum 1024 characters.
  - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
  - `usage_attribution` BillingCustomerUsageAttribution — Mapping to attribute metered usage to the customer. One customer can have zero or more subjects, but one subject can only belong to one customer.
    - `subject_keys` UsageAttributionSubjectKey[], required — The subjects that are attributed to the customer. Can be empty when no usage event subjects are associated with the customer.
  - `primary_email` string — The primary email address of the customer.
  - `currency` string — Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.
  - `billing_address` Address — Address
    - `country` string — [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. Custom two-letter country codes are also supported for convenience.
    - `postal_code` string — Postal code.
    - `state` string — State or province.
    - `city` string — City.
    - `line1` string — First line of the address.
    - `line2` string — Second line of the address.
    - `phone_number` string — Phone number.

## Response `200`

Customer upsert response.

- BillingCustomer — Customers can be individuals or organizations that can subscribe to plans and have access to features.
  - `id` string, required — ULID (Universally Unique Lexicographically Sortable Identifier).
  - `name` string, required — Display name of the resource. Between 1 and 256 characters.
  - `description` string — Optional description of the resource. Maximum 1024 characters.
  - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
  - `created_at` string, date-time, required — [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
  - `updated_at` string, date-time, required — [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
  - `deleted_at` string, date-time — [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
  - `key` string, required — ExternalResourceKey is a unique string that is used to identify a resource in an external system.
  - `usage_attribution` BillingCustomerUsageAttribution — Mapping to attribute metered usage to the customer. One customer can have zero or more subjects, but one subject can only belong to one customer.
    - `subject_keys` UsageAttributionSubjectKey[], required — The subjects that are attributed to the customer. Can be empty when no usage event subjects are associated with the customer.
  - `primary_email` string — The primary email address of the customer.
  - `currency` string — Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.
  - `billing_address` Address — Address
    - `country` string — [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. Custom two-letter country codes are also supported for convenience.
    - `postal_code` string — Postal code.
    - `state` string — State or province.
    - `city` string — City.
    - `line1` string — First line of the address.
    - `line2` string — Second line of the address.
    - `phone_number` string — Phone number.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `410` — Gone

---

[API](https://skmtc.net/openmeterio/apis/openmeter-and-konnect-metering-billing-api.md) · [All operations](https://skmtc.net/openmeterio/apis/openmeter-and-konnect-metering-billing-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openmeterio/openmeter-and-konnect-metering-billing-api/versions/9bca44e2d61d/schema)
