Skip to main content
PATCH
Update a credit unit

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Credit unit ID

Body

application/json

Partial update: an absent field is left unchanged. code and precision have no field here, they are immutable. symbol set to null clears it.

archived
boolean | null

Blocks the unit from new prices, packs and grants; existing ones keep working.

name
string | null

Singular display name, 1 to 64 characters.

plural_name
string | null

Plural display name, 1 to 64 characters.

product_id
string | null

The product sales of the unit are booked under; null clears it, which stops the unit from being sold.

symbol
string | null

Validated by the store (trimmed, at most 8 characters) rather than here: validator has no built-in support for a double Option.

Response

Updated

A tenant-defined denomination usage can be priced or credit granted in, instead of money. code and precision are immutable once created.

archived
boolean
required

Archived units take no new prices, packs or grants; existing ones keep working.

code
string
required

Upper-case code naming the unit in wallets, grants and webhooks, e.g. CREDITS.

id
string
required

The unit's id (cun_…).

name
string
required

Singular display name, e.g. "Credit".

plural_name
string
required

Plural display name, e.g. "Credits".

precision
integer<int32>
required

Minor-unit exponent: amounts of this unit are integers of 10^-precision credit.

Required range: x >= 0
prices
object[]
required

The active selling prices, one per currency.

product_id
string | null

The product sales of this unit are booked under: their tax category and accounting code. The unit can be sold (top-ups) only once it is set.

symbol
string | null

Short display symbol, e.g. "cr".