OpenMeter Currencies

Create cost basis

Changed on

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

Create a cost basis for a currency.

post/v3/openmeter/currencies/custom/{currencyId}/cost-bases

Request

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

Path parameters

currencyId, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

CreateCostBasisRequest required

CostBasis create request.

fiat_code, string required

The fiat currency code for the cost basis.

rate, string required

The cost rate for the currency.

effective_from, string date-time

An ISO-8601 timestamp representation of the date from which the cost basis is effective. If not provided, it will be effective immediately and will be set to now by the system.

effective_to, string date-time

An ISO-8601 timestamp representation of the date until which the cost basis is effective. If provided, it must be later than effective_from. If not provided, it remains effective until superseded.

Example request

{
  "fiat_code": "USD",
  "effective_from": "2023-01-01T01:01:01.001Z",
  "effective_to": "2023-01-01T01:01:01.001Z"
}

Response

CostBasis created response.

BillingCostBasis required

Describes currency basis supported by billing system.

id, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

fiat_code, string required

The fiat currency code for the cost basis.

rate, string required

The cost rate for the currency.

effective_from, string date-time

An ISO-8601 timestamp representation of the date from which the cost basis is effective. If not provided, it will be effective immediately and will be set to now by the system.

effective_to, string date-time

An ISO-8601 timestamp representation of the date until which the cost basis is effective. If provided, it must be later than effective_from. If not provided, it remains effective until superseded.

created_at, string date-time required

An ISO-8601 timestamp representation of entity creation date.

Example response

{
  "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