OpenMeter Billing Settings

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

List charges.

Returns the charges of every customer that are represented as either flat fee or usage-based charges.

get/v3/openmeter/charges

Request

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

Query parameters

page, object
size, integer

The number of items to include per page.

number, integer

The page number.

Determines which page of the collection to retrieve.

sort, string

The asc suffix is optional as the default sort order is ascending. The desc suffix is used to specify a descending order. Multiple sort attributes may be provided via a comma separated list. JSONPath notation may be used to specify a sub-attribute (eg: 'foo.bar desc').

Example:created_at desc

Sort charges returned in the response.

Supported sort attributes are:

  • id
  • created_at
  • service_period.from
  • billing_period.from
filter, ListChargesParamsFilter

Filter options for listing charges across customers.

status, object

Filter charges by status.

Supported statuses are:

  • created
  • active
  • final
  • deleted

If omitted, all statuses are returned except for deleted.

feature_id, union

Filter charges by the ID of their associated feature.

feature_key, object

Filter charges by the key of their associated feature.

service_period_from, union

Filter charges by the start of their service period.

service_period_to, union

Filter charges by the end of their service period.

customer_id, union

Filter charges by the ID of their customer.

Filter charges.

To filter charges by customer add the following query param: filter[customer_id][eq]=<id> or filter[customer_id][oeq]=<id>,<id>.

To filter charges by status add the following query param: filter[status][oeq]=created,active

To filter charges by feature, use filter[feature_id][oeq]=<id>,<id> or filter[feature_key][oeq]=<key>,<key>.

See the service_period_from filter field for expressing a service-period window query.

{
  "feature_id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "service_period_from": {
    "eq": "2022-03-30T07:20:50Z"
  },
  "service_period_to": {
    "eq": "2022-03-30T07:20:50Z"
  },
  "customer_id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
expand, BillingChargesExpand[]

Expand full objects for referenced entities.

Supported values are:

  • real_time_usage: Expand the charge's real-time usage; it sets the usage and the totals.realtime fields.
  • customer: Expand the charge's customer to the complete entity.
  • feature: Expand the charge's feature to the complete entity.
  • subscription: Expand the charge's subscription to the complete entity.
  • realization.invoice: Expand each realization's invoice to the complete entity.
  • realization.totals: Expand each realization run's totals.
  • realization.detailed_lines: Expand each realization run's detailed_lines.

Response

Page paginated response.

ChargePagePaginatedResponse required

Page paginated response.

data, BillingCharge[] required
meta, PaginatedMeta required

returns the pagination information

Example response

{
  "data": [
    {
      "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",
      "customer": {
        "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",
        "key": "019ae40f-4258-7f15-9491-842f42a7d6ac",
        "currency": "USD",
        "billing_address": {
          "country": "US"
        }
      },
      "subscription": {
        "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",
        "active_from": "2023-01-01T01:01:01.001Z",
        "active_to": "2023-01-01T01:01:01.001Z",
        "customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "plan_id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "plan": {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH",
          "key": "resource_key"
        },
        "invoice_currency": "USD",
        "cost_basis_pins": [
          {
            "custom_currency_id": "01G65Z755AFWAKHE12NY0CQ9FH",
            "invoice_currency": "USD",
            "cost_basis_id": "01G65Z755AFWAKHE12NY0CQ9FH"
          }
        ],
        "billing_cadence": "P1Y",
        "billing_anchor": "2023-01-01T01:01:01.001Z",
        "current_period": {
          "from": "2023-01-01T01:01:01.001Z",
          "to": "2023-01-01T01:01:01.001Z"
        },
        "phases": [
          {
            "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",
            "key": "resource_key",
            "active_from": "2023-01-01T01:01:01.001Z",
            "active_to": "2023-01-01T01:01:01.001Z",
            "items": [
              {
                "id": "01G65Z755AFWAKHE12NY0CQ9FH",
                "active_from": "2023-01-01T01:01:01.001Z",
                "active_to": "2023-01-01T01:01:01.001Z"
              }
            ]
          }
        ]
      },
      "currency": "USD",
      "resolved_cost_basis": {
        "fiat_currency": "USD",
        "cost_basis_id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "resolved_at": "2023-01-01T01:01:01.001Z"
      },
      "invoice_at": "2023-01-01T01:01:01.001Z",
      "service_period": {
        "from": "2023-01-01T01:01:01.001Z",
        "to": "2023-01-01T01:01:01.001Z"
      },
      "full_service_period": {
        "from": "2023-01-01T01:01:01.001Z",
        "to": "2023-01-01T01:01:01.001Z"
      },
      "billing_period": {
        "from": "2023-01-01T01:01:01.001Z",
        "to": "2023-01-01T01:01:01.001Z"
      },
      "advance_after": "2023-01-01T01:01:01.001Z",
      "tax_config": {
        "stripe": {
          "code": "txcd_10000000"
        },
        "tax_code_id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "tax_code": {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH"
        }
      },
      "realizations": [
        {
          "invoice": {
            "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",
            "number": "INV-2024-01-01-01",
            "currency": "USD",
            "supplier": {
              "addresses": {
                "billing_address": {
                  "country": "US"
                }
              }
            },
            "service_period": {
              "from": "2023-01-01T01:01:01.001Z",
              "to": "2023-01-01T01:01:01.001Z"
            },
            "issued_at": "2023-01-01T01:01:01.001Z",
            "draft_until": "2023-01-01T01:01:01.001Z",
            "quantity_snapshotted_at": "2023-01-01T01:01:01.001Z",
            "collection_at": "2023-01-01T01:01:01.001Z",
            "due_at": "2023-01-01T01:01:01.001Z",
            "sent_to_customer_at": "2023-01-01T01:01:01.001Z",
            "workflow": {
              "apps": {
                "tax": {
                  "id": "01G65Z755AFWAKHE12NY0CQ9FH"
                },
                "invoicing": {
                  "id": "01G65Z755AFWAKHE12NY0CQ9FH"
                },
                "payment": {
                  "id": "01G65Z755AFWAKHE12NY0CQ9FH"
                }
              },
              "source_billing_profile": {
                "id": "01G65Z755AFWAKHE12NY0CQ9FH"
              },
              "workflow": {
                "invoicing": {
                  "draft_period": "P1D",
                  "due_after": "P30D"
                }
              }
            }
          },
          "service_period": {
            "from": "2023-01-01T01:01:01.001Z",
            "to": "2023-01-01T01:01:01.001Z"
          },
          "detailed_lines": [
            {
              "id": "01G65Z755AFWAKHE12NY0CQ9FH",
              "created_at": "2023-01-01T01:01:01.001Z",
              "updated_at": "2023-01-01T01:01:01.001Z",
              "deleted_at": "2023-01-01T01:01:01.001Z",
              "service_period": {
                "from": "2023-01-01T01:01:01.001Z",
                "to": "2023-01-01T01:01:01.001Z"
              }
            }
          ]
        }
      ],
      "feature": {
        "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",
        "key": "resource_key",
        "meter": {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH"
        }
      },
      "amount_after_proration": {
        "currency": "USD"
      },
      "system_intent": {
        "labels": {
          "env": "test"
        },
        "invoice_at": "2023-01-01T01:01:01.001Z",
        "service_period": {
          "from": "2023-01-01T01:01:01.001Z",
          "to": "2023-01-01T01:01:01.001Z"
        },
        "full_service_period": {
          "from": "2023-01-01T01:01:01.001Z",
          "to": "2023-01-01T01:01:01.001Z"
        },
        "billing_period": {
          "from": "2023-01-01T01:01:01.001Z",
          "to": "2023-01-01T01:01:01.001Z"
        },
        "amount_before_proration": {
          "currency": "USD"
        },
        "deleted_at": "2023-01-01T01:01:01.001Z"
      }
    }
  ],
  "meta": {
    "page": {
      "number": 1,
      "size": 10,
      "total": 100
    }
  }
}

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