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/prices

List all prices

Returns a list of your active prices, excluding inline prices. For the list of inactive prices, set active to false.

Request parameters

ParameterLocationTypeDescription
activequerybooleanOnly return prices that are active or inactive (e.g., pass `false` to list all inactive prices).
createdqueryone of multiple schemasA filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
currencyquerystringOnly return prices for the given currency.
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.
lookup_keysqueryarray of stringOnly return the price with these lookup_keys, if any exist. You can specify up to 10 lookup_keys.
productquerystringOnly return prices for the given product.
recurringqueryobjectOnly return prices with these recurring fields.
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.
typequerystringOnly return prices of type `recurring` or `one_time`.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of priceDetails about each object.
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/prices

Create a price

Creates a new Price for an existing Product. The Price can be recurring or one-time.

Request parameters

FieldTypeDescription
activebooleanWhether the price can be used for new purchases. Defaults to `true`.
billing_schemestringDescribes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
currency_optionsobjectPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
custom_unit_amountobjectWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
expandarray of stringSpecifies which fields in the response should be expanded.
lookup_keystringA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
metadataobjectSet 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
nicknamestringA brief description of the price, hidden from customers.
productstringThe ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
product_dataobjectThese fields can be used to create a new product that this price will belong to.
recurringobjectThe recurring components of a price such as `interval` and `usage_type`.
tax_behaviorstringOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
tiersarray of objectEach element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
tiers_modestringDefines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.
transfer_lookup_keybooleanIf set to true, will atomically remove the lookup key from the existing price, and assign it to this price.
transform_quantityobjectApply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`.
unit_amountintegerA positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`.
unit_amount_decimalstringSame as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.

Responses

HTTP 200: Successful response.
FieldTypeDescription
active requiredbooleanWhether the price can be used for new purchases.
billing_scheme requiredstringDescribes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
currency_optionsobjectPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
custom_unit_amountone of multiple schemasWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
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`.
lookup_keystringA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
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.
nicknamestringA brief description of the price, hidden from customers.
object requiredstringString representing the object's type. Objects of the same type share the same value.
product requiredone of multiple schemasThe ID of the product this price is associated with.
recurringone of multiple schemasThe recurring components of a price such as `interval` and `usage_type`.
tax_behaviorstringOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
tiersarray of price_tierEach element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
tiers_modestringDefines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.
transform_quantityone of multiple schemasApply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`.
type requiredstringOne of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
unit_amountintegerThe unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
unit_amount_decimalstringThe unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/prices/search

Search prices

Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

Request parameters

ParameterLocationTypeDescription
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.
pagequerystringA cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
queryquerystringThe search query string. See [search query language](https://docs.stripe.com/search#search-query-language) and the list of supported [query fields for prices](https://docs.stripe.com/search#query-fields-for-prices).

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of price
has_more requiredboolean
next_pagestring
object requiredstringString representing the object's type. Objects of the same type share the same value.
total_countintegerThe total number of objects that match the query, only accurate up to 10,000.
url requiredstring
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/prices/{price}

Retrieve a price

Retrieves the price with the given ID.

Request parameters

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

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
active requiredbooleanWhether the price can be used for new purchases.
billing_scheme requiredstringDescribes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
currency_optionsobjectPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
custom_unit_amountone of multiple schemasWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
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`.
lookup_keystringA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
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.
nicknamestringA brief description of the price, hidden from customers.
object requiredstringString representing the object's type. Objects of the same type share the same value.
product requiredone of multiple schemasThe ID of the product this price is associated with.
recurringone of multiple schemasThe recurring components of a price such as `interval` and `usage_type`.
tax_behaviorstringOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
tiersarray of price_tierEach element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
tiers_modestringDefines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.
transform_quantityone of multiple schemasApply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`.
type requiredstringOne of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
unit_amountintegerThe unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
unit_amount_decimalstringThe unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/prices/{price}

Update a price

Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.

Request parameters

ParameterLocationTypeDescription
pricepathstring
FieldTypeDescription
activebooleanWhether the price can be used for new purchases. Defaults to `true`.
currency_optionsone of multiple schemasPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
expandarray of stringSpecifies which fields in the response should be expanded.
lookup_keystringA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
metadataone of multiple schemasSet 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
nicknamestringA brief description of the price, hidden from customers.
tax_behaviorstringOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
transfer_lookup_keybooleanIf set to true, will atomically remove the lookup key from the existing price, and assign it to this price.

Responses

HTTP 200: Successful response.
FieldTypeDescription
active requiredbooleanWhether the price can be used for new purchases.
billing_scheme requiredstringDescribes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
currency_optionsobjectPrices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
custom_unit_amountone of multiple schemasWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
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`.
lookup_keystringA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
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.
nicknamestringA brief description of the price, hidden from customers.
object requiredstringString representing the object's type. Objects of the same type share the same value.
product requiredone of multiple schemasThe ID of the product this price is associated with.
recurringone of multiple schemasThe recurring components of a price such as `interval` and `usage_type`.
tax_behaviorstringOnly required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
tiersarray of price_tierEach element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
tiers_modestringDefines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.
transform_quantityone of multiple schemasApply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`.
type requiredstringOne of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
unit_amountintegerThe unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
unit_amount_decimalstringThe unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors