OpenMeter Customers

Void credit grant

Changed on

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

Void a credit grant, forfeiting the remaining unused balance.

Voiding is a forward-looking, irreversible operation. Credits already consumed by usage remain unaffected — only the remaining balance is forfeited. The grant reads as voided status afterwards. Payment state is not adjusted when payment_adjustment is none, so invoice-backed or externally collected payments may still collect the original amount. Only active grants can be voided; voiding a pending, expired, or fully consumed grant returns a conflict. Retrying a successful void is an idempotent success.

post/v3/openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void

Request

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

Path parameters

customerId, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH
creditGrantId, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

VoidCreditGrantRequest required

Request body for voiding a credit grant.

payment_adjustment, 'none'

How voiding adjusts payment state related to the grant.

Currently only none is supported: voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state. If payment later completes, the original invoiced amount may still be collected.

Response

CreditGrant updated response.

BillingCreditGrant required

A credit grant allocates credits to a customer.

Credits are drawn down against charges according to the settlement mode configured on the rate card.

id, string required

ULID (Universally Unique Lexicographically Sortable Identifier).

name, string required

Display name of the resource.

Between 1 and 256 characters.

description, string

Optional description of the resource.

Maximum 1024 characters.

labels, Labels

Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

created_at, string date-time required

An ISO-8601 timestamp representation of entity creation date.

updated_at, string date-time required

An ISO-8601 timestamp representation of entity last update date.

deleted_at, string date-time

An ISO-8601 timestamp representation of entity deletion date.

funding_method, 'none' | 'invoice' | 'external' required

Funding method of the grant.

currency, union required

The fiat or custom currency of the granted credits.

Funded custom-currency grants must define purchase.cost_basis to settle in a fiat currency.

custom_currency, object

Managed currency reference. Present only for custom currencies.

amount, string required

Granted credit amount.

purchase, object

Present when a funding workflow applies (funding_method is not none).

tax_config, object

Tax configuration for the grant.

For invoice and external funding methods, tax configuration should be provided to ensure correct revenue recognition. When not provided, the default credit grant tax code is applied, if that's not set the global default taxcode is used.

invoice, object

Available when funding_method is invoice.

filters, BillingCreditGrantFilters

Filters for the credit grant.

priority, integer

Draw-down priority of the grant. Lower values have higher priority.

effective_at, string date-time

The timestamp when the credit grant becomes effective.

Defaults to the current date and time.

key, string

Idempotency key for the credit grant creation request.

Unique per customer: reusing the same key for the same customer returns an HTTP 409 Conflict instead of creating a duplicate grant, which makes create requests safe to retry. The same key may be reused across different customers.

expires_at, string date-time

The timestamp when the credit grant expires.

Calculated from the grant effective time and expires_after if provided.

voided_at, string date-time

Timestamp when the grant was voided.

status, 'pending' | 'active' | 'expired' | 'voided' required

Current lifecycle status of the grant.

validation_issues, BillingValidationIssue[]

Validation issues found while processing the credit grant.

Present only when there are one or more validation findings. An empty list is omitted.

Example response

{
  "id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "labels": {
    "env": "test"
  },
  "created_at": "2023-01-01T01:01:01.001Z",
  "updated_at": "2023-01-01T01:01:01.001Z",
  "deleted_at": "2023-01-01T01:01:01.001Z",
  "currency": "USD",
  "custom_currency": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH"
  },
  "purchase": {
    "currency": "USD",
    "resolved_cost_basis": {
      "fiat_currency": "USD",
      "cost_basis_id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "resolved_at": "2023-01-01T01:01:01.001Z"
    }
  },
  "tax_config": {
    "code": {
      "id": "01G65Z755AFWAKHE12NY0CQ9FH"
    }
  },
  "invoice": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH",
    "line": {
      "id": "01G65Z755AFWAKHE12NY0CQ9FH"
    }
  },
  "filters": {
    "features": [
      "input_tokens",
      "output_tokens"
    ],
    "plans": [
      {
        "key": "resource_key"
      }
    ]
  },
  "effective_at": "2023-01-01T01:01:01.001Z",
  "key": "019ae40f-4258-7f15-9491-842f42a7d6ac",
  "expires_at": "2023-01-01T01:01:01.001Z",
  "voided_at": "2023-01-01T01:01:01.001Z"
}

Changes

    • info

      added the optional property custom_currency to the response with the status

    • 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

    1 more change in this revision