Attach Meter to Plan
Attaches a meter to an existing plan as a metered price: included credits per cycle plus the price per unit beyond them.
403 PRODUCT_NOT_ENABLED.- On creation: pass
meters[](same shape as this request body) to Create Plan. Duplicatedmeter_identries are rejected with409. - On a live plan: call this endpoint once per meter, or send
{ "meters": [ ... ] }toPATCH /subscriptions/plans/{plan_id}— that PATCH is attach-only and atomic: if any entry in the list is invalid (already attached, unknown or inactive meter, bad price) nothing is attached. Any other plan field in that body (name,base_amount, …) is silently ignored — plans stay immutable outsidemeters[].
USD and the meter has a default_price, you can omit price_per_credit: the meter’s default applies and the metered price is returned with price_per_credit: null. In any other case (price_per_credit currency must always equal the plan’s base currency) send it explicitly. Only ACTIVE meters can be attached; an archived meter is rejected with 400 METER_NOT_FOUND.pricing_strategy configPER_UNIT uses price_per_credit/country_prices. PACKAGE uses package_size, package_price and optionally package_country_prices. TIERED uses tiers[] (ascending up_to bounds, last tier up_to: null). Sending config fields for a strategy other than the one you selected is rejected with 400 PLAN_METER_PRICING_CONFIG_UNSUPPORTED. Once attached, PACKAGE/TIERED config cannot be changed — see Update Plan Meter.Authorizations
Headers
The account_id found in your Yuno Dashboard (UUID). Required — omitting it returns 400 BAD_REQUEST ("Invalid x-account-code header.").
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 Yuno API.
Path Parameters
The unique identifier of the plan.
Body
The unique identifier of the meter to attach (MAX 64; MIN 36). Must be an existing ACTIVE meter of the account — an unknown or INACTIVE meter is rejected with 400 METER_NOT_FOUND. A meter can be attached to a plan only once, else 409 PLAN_METER_ALREADY_ASSIGNED.
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.
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).
PER_UNIT, PACKAGE, TIERED 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.
Only for pricing_strategy: PACKAGE. The bundle size — billable units are rounded up to the nearest whole multiple. Must be > 0; decimals and scientific notation (1e3) are accepted and coerced. Stored rounded to 4 decimal places. Required when pricing_strategy is PACKAGE; rejected with 400 PLAN_METER_PRICING_CONFIG_UNSUPPORTED for any other strategy.
Only for pricing_strategy: PACKAGE. The price per bundle. Same shape as price_per_credit. Required when pricing_strategy is PACKAGE.
Only for pricing_strategy: PACKAGE. Optional per-bundle price by subscriber country. Same shape as country_prices.
Only for pricing_strategy: TIERED. Ordered, graduated pricing bands. Required when pricing_strategy is TIERED (at least one entry). Every tier but the last needs a strictly-ascending up_to; the last tier's up_to must be null (unbounded). Every tier must share the same currency (and the same country_rates countries, if used).
Response
201
The unique identifier of the metered price (the plan-meter relation).
Units included in the plan per billing cycle.
PER_UNIT, PACKAGE, TIERED null when inherited from the meter's default_price (USD plans).
Set by Yuno on creation.
Set by Yuno on every update.