Knox Docs Sign in

API reference

Test mode. Use your secret key on your server; live processing is currently disabled.

https://api.knoxapi.com

Send form-encoded requests with Authorization: Bearer sk_test_....

Complete OpenAPI specification · Integration guide

Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.

GET /v1/billing/alerts

List billing alerts

Lists billing active and inactive alerts

Request parameters

ParameterLocationTypeDescription
alert_typequerystringFilter results to only include this type of alert.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
meterquerystringFilter results to only include alerts with the given meter.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of billing.alert
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/alerts

Create a billing alert

Creates a billing alert

Request parameters

FieldTypeDescription
alert_type requiredstringThe type of alert to create.
expandarray of stringSpecifies which fields in the response should be expanded.
title requiredstringThe title of the alert.
usage_thresholdobjectThe configuration of the usage threshold.

Responses

HTTP 200: Successful response.
FieldTypeDescription
alert_type requiredstringDefines the type of the alert.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
statusstringStatus of the alert. This can be active, inactive or archived.
title requiredstringTitle of the alert.
usage_thresholdone of multiple schemasEncapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/credit_balance_summary

Retrieve the credit balance summary for a customer

Retrieves the credit balance summary for a customer.

Request parameters

ParameterLocationTypeDescription
customerquerystringThe customer whose credit balance summary you're retrieving.
customer_accountquerystringThe account representing the customer whose credit balance summary you're retrieving.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
filterqueryobjectThe filter criteria for the credit balance summary.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
balances requiredarray of credit_balanceThe billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
customer requiredone of multiple schemasThe customer the balance is for.
customer_accountstringThe account the balance is for.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/credit_balance_transactions

List credit balance transactions

Retrieve a list of credit balance transactions.

Request parameters

ParameterLocationTypeDescription
credit_grantquerystringThe credit grant for which to fetch credit balance transactions.
customerquerystringThe customer whose credit balance transactions you're retrieving.
customer_accountquerystringThe account representing the customer whose credit balance transactions you're retrieving.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of billing.credit_balance_transaction
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/credit_grants

List credit grants

Retrieve a list of credit grants.

Request parameters

ParameterLocationTypeDescription
customerquerystringOnly return credit grants for this customer.
customer_accountquerystringOnly return credit grants for this account representing the customer.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of billing.credit_grant
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/credit_grants

Create a credit grant

Creates a credit grant.

Request parameters

FieldTypeDescription
amount requiredobjectAmount of this credit grant.
applicability_config requiredobjectConfiguration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
categorystringThe category of this credit grant. It defaults to `paid` if not specified.
customerstringID of the customer receiving the billing credits.
customer_accountstringID of the account representing the customer receiving the billing credits.
effective_atintegerThe time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified.
expandarray of stringSpecifies which fields in the response should be expanded.
expires_atintegerThe time when the billing credits expire. If not specified, the billing credits don't expire.
metadataobjectSet of key-value pairs that you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.
namestringA descriptive name shown in the Dashboard.
priorityintegerThe desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredbilling_credit_grants_resource_amount
applicability_config requiredbilling_credit_grants_resource_applicability_config
category requiredstringThe category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer requiredone of multiple schemasID of the customer receiving the billing credits.
customer_accountstringID of the account representing the customer receiving the billing credits
effective_atintegerThe time when the billing credits become effective-when they're eligible for use.
expires_atintegerThe time when the billing credits expire. If not present, the billing credits don't expire.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringA descriptive name shown in dashboard.
object requiredstringString representing the object's type. Objects of the same type share the same value.
priorityintegerThe priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
test_clockone of multiple schemasID of the test clock this credit grant belongs to.
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
voided_atintegerThe time when this credit grant was voided. If not present, the credit grant hasn't been voided.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/feedback_options

Feedback Options List API Method

An API method for listing the feedback options model

Request parameters

ParameterLocationTypeDescription
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
statusquerystringFilter results to only include feedback options with the given status.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of billing.feedback_option
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/feedback_options

Create a feedback option

Creates a new feedback option.

Request parameters

FieldTypeDescription
description requiredstring
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
description requiredstringAn arbitrary string attached to the object. Often useful for displaying to users.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe feedback option's status.
status_transitions requiredfeedback_options_status_transitions
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/meter_event_adjustments

Create a billing meter event adjustment

Creates a billing meter event adjustment.

Request parameters

FieldTypeDescription
cancelobjectSpecifies which event to cancel.
event_name requiredstringThe name of the meter event. Corresponds with the `event_name` field on a meter.
expandarray of stringSpecifies which fields in the response should be expanded.
type requiredstringSpecifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.

Responses

HTTP 200: Successful response.
FieldTypeDescription
cancelone of multiple schemasSpecifies which event to cancel.
event_name requiredstringThe name of the meter event. Corresponds with the `event_name` field on a meter.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe meter event adjustment's status.
type requiredstringSpecifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/meter_events

Create a billing meter event

Creates a billing meter event.

Request parameters

FieldTypeDescription
event_name requiredstringThe name of the meter event. Corresponds with the `event_name` field on a meter.
expandarray of stringSpecifies which fields in the response should be expanded.
identifierstringA unique identifier for the event. If not provided, one is generated. We recommend using UUID-like identifiers. Stripe enforces uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations.
payload requiredobjectThe payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/meters/configure#meter-configuration-attributes).
timestampintegerThe time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
event_name requiredstringThe name of the meter event. Corresponds with the `event_name` field on a meter.
identifier requiredstringA unique identifier for the event.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
payload requiredobjectThe payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/meters/configure#meter-configuration-attributes).
timestamp requiredintegerThe timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/meters

List billing meters

Retrieve a list of billing meters.

Request parameters

ParameterLocationTypeDescription
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
statusquerystringFilter results to only include meters with the given status.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of billing.meter
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/meters

Create a billing meter

Creates a billing meter.

Request parameters

FieldTypeDescription
customer_mappingobjectFields that specify how to map a meter event to a customer.
default_aggregation requiredobjectThe default settings to aggregate a meter's events with.
display_name requiredstringThe meter’s name. Not visible to the customer.
event_name requiredstringThe name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
event_time_windowstringThe time window which meter events have been pre-aggregated for, if any.
expandarray of stringSpecifies which fields in the response should be expanded.
value_settingsobjectFields that specify how to calculate a meter event's value.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer_mapping requiredbilling_meter_resource_customer_mapping_settings
default_aggregation requiredbilling_meter_resource_aggregation_settings
display_name requiredstringThe meter's name.
event_name requiredstringThe name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
event_time_windowstringThe time window which meter events have been pre-aggregated for, if any.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe meter's status.
status_transitions requiredbilling_meter_resource_billing_meter_status_transitions
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
value_settings requiredbilling_meter_resource_billing_meter_value
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/alerts/{id}

Retrieve a billing alert

Retrieves a billing alert given an ID

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
alert_type requiredstringDefines the type of the alert.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
statusstringStatus of the alert. This can be active, inactive or archived.
title requiredstringTitle of the alert.
usage_thresholdone of multiple schemasEncapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/alerts/{id}/activate

Activate a billing alert

Reactivates this alert, allowing it to trigger again.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
alert_type requiredstringDefines the type of the alert.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
statusstringStatus of the alert. This can be active, inactive or archived.
title requiredstringTitle of the alert.
usage_thresholdone of multiple schemasEncapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/alerts/{id}/archive

Archive a billing alert

Archives this alert, removing it from the list view and APIs. This is non-reversible.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
alert_type requiredstringDefines the type of the alert.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
statusstringStatus of the alert. This can be active, inactive or archived.
title requiredstringTitle of the alert.
usage_thresholdone of multiple schemasEncapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/alerts/{id}/deactivate

Deactivate a billing alert

Deactivates this alert, preventing it from triggering.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
alert_type requiredstringDefines the type of the alert.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
statusstringStatus of the alert. This can be active, inactive or archived.
title requiredstringTitle of the alert.
usage_thresholdone of multiple schemasEncapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/credit_balance_transactions/{id}

Retrieve a credit balance transaction

Retrieves a credit balance transaction.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstringUnique identifier for the object.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
creditone of multiple schemasCredit details for this credit balance transaction. Only present if type is `credit`.
credit_grant requiredone of multiple schemasThe credit grant associated with this credit balance transaction.
debitone of multiple schemasDebit details for this credit balance transaction. Only present if type is `debit`.
effective_at requiredintegerThe effective time of this credit balance transaction.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
test_clockone of multiple schemasID of the test clock this credit balance transaction belongs to.
typestringThe type of credit balance transaction (credit or debit).
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/credit_grants/{id}

Retrieve a credit grant

Retrieves a credit grant.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstringUnique identifier for the object.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredbilling_credit_grants_resource_amount
applicability_config requiredbilling_credit_grants_resource_applicability_config
category requiredstringThe category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer requiredone of multiple schemasID of the customer receiving the billing credits.
customer_accountstringID of the account representing the customer receiving the billing credits
effective_atintegerThe time when the billing credits become effective-when they're eligible for use.
expires_atintegerThe time when the billing credits expire. If not present, the billing credits don't expire.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringA descriptive name shown in dashboard.
object requiredstringString representing the object's type. Objects of the same type share the same value.
priorityintegerThe priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
test_clockone of multiple schemasID of the test clock this credit grant belongs to.
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
voided_atintegerThe time when this credit grant was voided. If not present, the credit grant hasn't been voided.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/credit_grants/{id}

Update a credit grant

Updates a credit grant.

Request parameters

ParameterLocationTypeDescription
idpathstringUnique identifier for the object.
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
expires_atone of multiple schemasThe time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire.
metadataobjectSet of key-value pairs you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredbilling_credit_grants_resource_amount
applicability_config requiredbilling_credit_grants_resource_applicability_config
category requiredstringThe category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer requiredone of multiple schemasID of the customer receiving the billing credits.
customer_accountstringID of the account representing the customer receiving the billing credits
effective_atintegerThe time when the billing credits become effective-when they're eligible for use.
expires_atintegerThe time when the billing credits expire. If not present, the billing credits don't expire.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringA descriptive name shown in dashboard.
object requiredstringString representing the object's type. Objects of the same type share the same value.
priorityintegerThe priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
test_clockone of multiple schemasID of the test clock this credit grant belongs to.
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
voided_atintegerThe time when this credit grant was voided. If not present, the credit grant hasn't been voided.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/credit_grants/{id}/expire

Expire a credit grant

Expires a credit grant.

Request parameters

ParameterLocationTypeDescription
idpathstringUnique identifier for the object.
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredbilling_credit_grants_resource_amount
applicability_config requiredbilling_credit_grants_resource_applicability_config
category requiredstringThe category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer requiredone of multiple schemasID of the customer receiving the billing credits.
customer_accountstringID of the account representing the customer receiving the billing credits
effective_atintegerThe time when the billing credits become effective-when they're eligible for use.
expires_atintegerThe time when the billing credits expire. If not present, the billing credits don't expire.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringA descriptive name shown in dashboard.
object requiredstringString representing the object's type. Objects of the same type share the same value.
priorityintegerThe priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
test_clockone of multiple schemasID of the test clock this credit grant belongs to.
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
voided_atintegerThe time when this credit grant was voided. If not present, the credit grant hasn't been voided.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/credit_grants/{id}/void

Void a credit grant

Voids a credit grant.

Request parameters

ParameterLocationTypeDescription
idpathstringUnique identifier for the object.
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredbilling_credit_grants_resource_amount
applicability_config requiredbilling_credit_grants_resource_applicability_config
category requiredstringThe category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer requiredone of multiple schemasID of the customer receiving the billing credits.
customer_accountstringID of the account representing the customer receiving the billing credits
effective_atintegerThe time when the billing credits become effective-when they're eligible for use.
expires_atintegerThe time when the billing credits expire. If not present, the billing credits don't expire.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
namestringA descriptive name shown in dashboard.
object requiredstringString representing the object's type. Objects of the same type share the same value.
priorityintegerThe priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
test_clockone of multiple schemasID of the test clock this credit grant belongs to.
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
voided_atintegerThe time when this credit grant was voided. If not present, the credit grant hasn't been voided.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/feedback_options/{id}

Retrieve a feedback option

Retrieves a feedback options object given an ID.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
description requiredstringAn arbitrary string attached to the object. Often useful for displaying to users.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe feedback option's status.
status_transitions requiredfeedback_options_status_transitions
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/feedback_options/{id}

Update a feedback option

Updates the description of an existing feedback option.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
descriptionstring
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
description requiredstringAn arbitrary string attached to the object. Often useful for displaying to users.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe feedback option's status.
status_transitions requiredfeedback_options_status_transitions
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/feedback_options/{id}/deactivate

Deactivate a feedback option

Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
description requiredstringAn arbitrary string attached to the object. Often useful for displaying to users.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe feedback option's status.
status_transitions requiredfeedback_options_status_transitions
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/meters/{id}

Retrieve a billing meter

Retrieves a billing meter given an ID.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer_mapping requiredbilling_meter_resource_customer_mapping_settings
default_aggregation requiredbilling_meter_resource_aggregation_settings
display_name requiredstringThe meter's name.
event_name requiredstringThe name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
event_time_windowstringThe time window which meter events have been pre-aggregated for, if any.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe meter's status.
status_transitions requiredbilling_meter_resource_billing_meter_status_transitions
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
value_settings requiredbilling_meter_resource_billing_meter_value
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/meters/{id}

Update a billing meter

Updates a billing meter.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
display_namestringThe meter’s name. Not visible to the customer.
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer_mapping requiredbilling_meter_resource_customer_mapping_settings
default_aggregation requiredbilling_meter_resource_aggregation_settings
display_name requiredstringThe meter's name.
event_name requiredstringThe name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
event_time_windowstringThe time window which meter events have been pre-aggregated for, if any.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe meter's status.
status_transitions requiredbilling_meter_resource_billing_meter_status_transitions
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
value_settings requiredbilling_meter_resource_billing_meter_value
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/meters/{id}/deactivate

Deactivate a billing meter

When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer_mapping requiredbilling_meter_resource_customer_mapping_settings
default_aggregation requiredbilling_meter_resource_aggregation_settings
display_name requiredstringThe meter's name.
event_name requiredstringThe name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
event_time_windowstringThe time window which meter events have been pre-aggregated for, if any.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe meter's status.
status_transitions requiredbilling_meter_resource_billing_meter_status_transitions
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
value_settings requiredbilling_meter_resource_billing_meter_value
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/billing/meters/{id}/event_summaries

List billing meter event summaries

Retrieve a list of billing meter event summaries.

Request parameters

ParameterLocationTypeDescription
customerquerystringThe customer for which to fetch event summaries.
end_timequeryintegerThe timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
idpathstringUnique identifier for the object.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
start_timequeryintegerThe timestamp from when to start aggregating meter events (inclusive). Must be aligned with minute boundaries.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
value_grouping_windowquerystringSpecifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC).

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of billing.meter_event_summary
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/billing/meters/{id}/reactivate

Reactivate a billing meter

When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.

Request parameters

ParameterLocationTypeDescription
idpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
customer_mapping requiredbilling_meter_resource_customer_mapping_settings
default_aggregation requiredbilling_meter_resource_aggregation_settings
display_name requiredstringThe meter's name.
event_name requiredstringThe name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
event_time_windowstringThe time window which meter events have been pre-aggregated for, if any.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe meter's status.
status_transitions requiredbilling_meter_resource_billing_meter_status_transitions
updated requiredintegerTime at which the object was last updated. Measured in seconds since the Unix epoch.
value_settings requiredbilling_meter_resource_billing_meter_value
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors