OpenMeter Currencies

Create custom currency

Changed on

Pre-release Endpoint This endpoint is currently in beta and is subject to change.

Create a custom currency. This operation allows defining your own custom currency for billing purposes.

post/v3/openmeter/currencies/custom

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Request body

CreateCurrencyCustomRequest required

CurrencyCustom create request.

name, string required

The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".

symbol, string

The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.

precision, integer required

The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.

decimal_mark, string required

The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.

thousand_separator, string required

The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.

code, string required

Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.

Response

CurrencyCustom created response.

BillingCurrencyCustom required

Describes custom currency.

type, 'custom' required

The type of the currency.

name, string required

The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".

symbol, string

The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.

precision, integer required

The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.

decimal_mark, string required

The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.

thousand_separator, string required

The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.

id, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

code, string required

Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.

created_at, string date-time required

An ISO-8601 timestamp representation of the custom currency creation date.

cost_basis, BillingCostBasis[]

The list of active and scheduled cost bases for the custom currency. Expired and deleted cost bases are excluded.

Example response

{
  "id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "created_at": "2023-01-01T01:01:01.001Z",
  "cost_basis": [
    {
      "id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "fiat_code": "USD",
      "effective_from": "2023-01-01T01:01:01.001Z",
      "effective_to": "2023-01-01T01:01:01.001Z",
      "created_at": "2023-01-01T01:01:01.001Z"
    }
  ]
}

Changes

    • breaking

      added to the invalid_parameters/items response property oneOf list for the response status

    • warning

      added the new key_invalid enum value to the invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule response property for the response status

    • warning

      added the new unique enum value to the invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule response property for the response status