# Update Plan Meter

<Note>
**Enabled per organization**

Usage-based billing must be enabled for your organization before these endpoints accept requests. Contact your WHITELABEL account manager to enable it. Requests from an organization where it is not enabled return `403 PRODUCT_NOT_ENABLED`.
</Note>

Send at least one of `credits`, `pricing_strategy`, `price_per_credit`, `country_prices`. The same currency rules as [Attach Meter to Plan](/reference/meters/attach-meter-to-plan) apply. If the meter has been archived (`INACTIVE`) the metered price is frozen and this call returns `400 PLAN_METER_NOT_FOUND` until the meter is reactivated.

<Note>
**`PACKAGE`/`TIERED` config is attach-time only**

`package_size`, `package_price`, `package_country_prices` and `tiers` cannot be sent to this endpoint — any request containing one of them is rejected with `400 PLAN_METER_PRICING_CONFIG_UNSUPPORTED`, regardless of the metered price's current `pricing_strategy`. Switching `pricing_strategy` itself is validated against the metered price's existing config for the target strategy; an unsupported switch is rejected rather than silently applied. To change a `PACKAGE`/`TIERED` config, attach a new meter instead — see the [Usage-Based Billing guide](/docs/payment-features/subscriptions/usage-based-billing#pricing-a-meter-on-a-plan).
</Note>

<Note>
There is no detach endpoint. To stop billing a meter, archive it with [Update Meter](/reference/meters/update-meter) (`status: INACTIVE`), or set `credits` high enough that no overage is billed.
</Note>

Refer to [Meter Error Codes](/reference/meters/meter-error-codes) for the possible error outcomes.

**PATCH** `/subscriptions/plans/{plan_id}/meters/{meter_id}`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Usage-based billing must be enabled for your organization before this endpoint accepts requests (otherwise `403 PRODUCT_NOT_ENABLED`). Updates a metered price already attached to a plan: included `credits`, `pricing_strategy`, `price_per_credit` and `country_prices`. Send at least one field. The change applies to usage rated from the subscription's next billing cycle onward. `package_size`, `package_price`, `package_country_prices` and `tiers` cannot be sent here — any request containing one is rejected with `400 PLAN_METER_PRICING_CONFIG_UNSUPPORTED`; `PACKAGE`/`TIERED` config is attach-time only, and switching `pricing_strategy` is validated against the metered price's config for the target strategy. If the meter is `INACTIVE` the metered price is frozen and this call returns `400 PLAN_METER_NOT_FOUND`. To stop billing a meter on a plan, archive the meter (Update Meter with `status: INACTIVE`) — there is no detach endpoint.

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Header parameters

- `X-Account-Code` (string, required)
  The `account_id` found in your [WHITELABEL Dashboard](https://dashboard.whitelabel.com/developers) (UUID). Required — omitting it returns `400 BAD_REQUEST` ("Invalid x-account-code header.").
- `X-Idempotency-Key` (string, required)
  Unique identifier used in HTTP headers to ensure that a request is processed only once, even if it is retried due to network issues or timeouts. Optional, as on the rest of the WHITELABEL API.

## Path parameters

- `plan_id` (string, required)
  The unique identifier of the plan.
- `meter_id` (string, required)
  The unique identifier of the meter attached to the plan.

## Body

Content type: `application/json`

- `credits` (number<float>)
  Units included in the plan per billing cycle — the allowance a subscriber can consume before any usage is billed. Must be >= 0. `0` means every unit is billed.
- `pricing_strategy` ("PER_UNIT" | "PACKAGE" | "TIERED")
  How usage beyond `credits` is priced: `PER_UNIT` (billable units × `price_per_credit`), `PACKAGE` (bundles of N units, partial bundle counts as a full one) or `TIERED` (graduated tiers, each band at its own rate).
- `price_per_credit` (object)
  - `currency` (string, required)
    MAX 3; MIN 3. Must equal the plan's `base_amount` currency, else `400 INVALID_PARAMETERS`.
  - `value` (number<float>, required)
    Price per unit beyond the included credits (multiple of 0.0001). Optional only when the plan's base currency is `USD` and the meter has a `default_price` — the meter's default then applies and the metered price is returned with `price_per_credit: null`. Required otherwise.
- `country_prices` (object[])
  Optional explicit per-country price per unit. One entry per country — a repeated country is rejected with `400 INVALID_PARAMETERS`. A country not listed falls back to `price_per_credit`.
  - `country` (string, required)
    MAX 2; MIN 2; [ISO 3166-1](/reference/country-reference).
  - `amount` (object, required)
    - `currency` (string, required)
      MAX 3; MIN 3; [ISO 4217](/reference/country-reference).
    - `value` (number<float>, required)
      Multiple of 0.0001.

Example:

```json
{
  "credits": 0,
  "pricing_strategy": "PER_UNIT",
  "price_per_credit": {
    "currency": "string",
    "value": 0
  },
  "country_prices": [
    {
      "country": "string",
      "amount": {
        "currency": "string",
        "value": 0
      }
    }
  ]
}
```

## Responses

### 200

200

- `id` (string)
  The unique identifier of the metered price (the plan-meter relation).
- `plan_id` (string)
- `meter_id` (string)
- `credits` (number)
  Units included in the plan per billing cycle.
- `pricing_strategy` ("PER_UNIT" | "PACKAGE" | "TIERED")
- `price_per_credit` (object)
  `null` when inherited from the meter's `default_price` (USD plans).
  - `currency` (string)
  - `value` (number)
- `country_prices` (object[])
  - `country` (string)
  - `amount` (object)
    - `currency` (string)
    - `value` (number)
- `created_at` (string)
  Set by WHITELABEL on creation.
- `updated_at` (string)
  Set by WHITELABEL on every update.

Example:

```json
{
  "id": "string",
  "plan_id": "string",
  "meter_id": "string",
  "credits": 0,
  "pricing_strategy": "PER_UNIT",
  "price_per_credit": {
    "currency": "string",
    "value": 0
  },
  "country_prices": [
    {
      "country": "string",
      "amount": {
        "currency": "string",
        "value": 0
      }
    }
  ],
  "created_at": "string",
  "updated_at": "string"
}
```

### 400

400

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "string",
  "messages": [
    "string"
  ]
}
```

### 403

403

- `code` (string)
- `messages` (string[])

Example:

```json
{
  "code": "PRODUCT_NOT_ENABLED",
  "messages": [
    "string"
  ]
}
```

### 404

404