OpenMeter Currencies

Create custom currency

Changed on

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

post/openmeter/currencies/custom

Request

  • Base URL: http://localhost:8888/api/v3
  • URL: http://localhost:8888/api/v3/openmeter/currencies/custom
  • Auth: none declared

Request body

namestring 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".

symbolstring

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.

precisioninteger 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_markstring 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_separatorstring 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.

codestring required

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

Response

CurrencyCustom created response.

type'custom' required

The type of the currency.

namestring 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".

symbolstring

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.

precisioninteger 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_markstring 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_separatorstring 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.

idstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

codestring required

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

created_atstring date-time required

RFC3339 formatted date-time string in UTC.

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 the new required request property

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • breaking

      the request property's minLength was increased from 3 to 4

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • warning

      removed the request property

    • warning

      removed the optional property from the response with the status