Price Units

Create price unit

Changed on

Use when defining a new unit of measure for pricing (e.g. GB, API call, seat). Ideal for metered or usage-based prices.

post/prices/units

Request

  • Base URL
    https://us.api.flexprice.io/v1
  • URL
    https://us.api.flexprice.io/v1/prices/units
  • Auth
    API key in header x-api-key

Request body

base_currencystring required

base_currency is the currency that the price unit is based on

codestring required
conversion_ratestring required

ConversionRate defines the exchange rate from this price unit to the base currency. This rate is used to convert amounts in the custom price unit to the base currency for storage and billing.

Conversion formula: price_unit_amount * conversion_rate = base_currency_amount

Example: If conversion_rate = "0.01" and base_currency = "usd": 100 price_unit tokens * 0.01 = 1.00 USD

Note: Rounding precision is determined by the base currency (e.g., USD uses 2 decimal places, JPY uses 0).

metadataTypesMetadata
namestring required
symbolstring required

Response

Created

base_currencystring
codestring
conversion_ratestring
created_atstring date-time
created_bystring
environment_idstring
idstring
metadataTypesMetadata
namestring
status'published' | 'deleted' | 'archived'
symbolstring
tenant_idstring
updated_atstring date-time
updated_bystring

Changes

    • warning

      added the new not_implemented enum value to the response property for the response status

    • warning

      added the new not_implemented enum value to the response property for the response status

    • breaking

      the request property type changed from no type to object

    • breaking

      the response's property type changed from no type to object for status

    • breaking

      the response's property type changed from no type to string for status

    • warning

      added the new archived enum value to the response property for the response status

    • warning

      added the new deleted enum value to the response property for the response status

    • warning

      added the new published enum value to the response property for the response status