Catalog
Create or update a plan by its code (versioned on a price change)
Needs the catalog:write scope, or a full-access key. About scopes
PUT
/
api/v1/plans/by-code/{code}Authorization
AuthorizationRequiredBearer <token>
An API key: gpy_test_… or gpy_live_… (or an agent key, agk_…).
In: header
Request Body
application/jsonOptionalproduct_idRequiredstring
Format:
"uuid"nameRequiredstring
Minimum length:
1Maximum length: 200pricing_modelRequiredstring
Value in:
"flat" | "per_seat" | "metered" | "tiered" | "volume" | "package"intervalRequiredstring
Value in:
"monthly" | "quarterly" | "annual" | "one_time"billing_timingstring
Value in:
"advance" | "arrears"currencyRequiredstring
Value in:
"USD" | "AUD" | "CAD" | "GBP" | "EUR" | "INR" | "NPR"amount_centsRequiredstring
Base-currency price, in minor units. On a graduated per_seat plan it is set to band 1 of tier_config.
Pattern:
"^\\d+$"tier_configarray<object>
Base-currency ladder, ascending, last band up_to: null.
included_unitsstring
Included usage units.
Pattern:
"^\\d+$"package_sizeinteger
unit_namestring
Maximum length:
50aggregationstring
Value in:
"sum" | "max" | "last_during_period"pricesarray<object>
Other currencies (never the base one, none twice). A graduated per_seat plan needs tiers on every one.
metadataobject
At most 20 keys; values up to 500 characters.
activeboolean
Omitted: a new plan is active, an existing one keeps its flag.
Path Parameters
codeRequiredstring
Pattern:
"^[a-z0-9_]+$"updated (name, product, unit name, metadata or active changed in place) or unchanged.