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

List all shipping rates

Returns a list of your shipping rates.

Request parameters

ParameterLocationTypeDescription
activequerybooleanOnly return shipping rates that are active or inactive.
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 shipping rates 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.
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 shipping_rate
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/shipping_rates

Create a shipping rate

Creates a new shipping rate object.

Request parameters

FieldTypeDescription
delivery_estimateobjectThe estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
display_name requiredstringThe name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
expandarray of stringSpecifies which fields in the response should be expanded.
fixed_amountobjectDescribes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
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`.
tax_behaviorstringSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
tax_codestringA [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
typestringThe type of calculation to use on the shipping rate.

Responses

HTTP 200: Successful response.
FieldTypeDescription
active requiredbooleanWhether the shipping rate can be used for new purchases. Defaults to `true`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
delivery_estimateone of multiple schemasThe estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
display_namestringThe name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
fixed_amountshipping_rate_fixed_amount
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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
tax_behaviorstringSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
tax_codeone of multiple schemasA [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
type requiredstringThe type of calculation to use on the shipping rate.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/shipping_rates/{shipping_rate_token}

Retrieve a shipping rate

Returns the shipping rate object with the given ID.

Request parameters

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

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
active requiredbooleanWhether the shipping rate can be used for new purchases. Defaults to `true`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
delivery_estimateone of multiple schemasThe estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
display_namestringThe name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
fixed_amountshipping_rate_fixed_amount
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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
tax_behaviorstringSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
tax_codeone of multiple schemasA [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
type requiredstringThe type of calculation to use on the shipping rate.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/shipping_rates/{shipping_rate_token}

Update a shipping rate

Updates an existing shipping rate object.

Request parameters

ParameterLocationTypeDescription
shipping_rate_tokenpathstring
FieldTypeDescription
activebooleanWhether the shipping rate can be used for new purchases. Defaults to `true`.
expandarray of stringSpecifies which fields in the response should be expanded.
fixed_amountobjectDescribes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
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`.
tax_behaviorstringSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
active requiredbooleanWhether the shipping rate can be used for new purchases. Defaults to `true`.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
delivery_estimateone of multiple schemasThe estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
display_namestringThe name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
fixed_amountshipping_rate_fixed_amount
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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
tax_behaviorstringSpecifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
tax_codeone of multiple schemasA [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
type requiredstringThe type of calculation to use on the shipping rate.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors