API reference
Test mode. Use your secret key on your server; live processing is currently disabled.
https://api.knoxapi.comSend 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
| Parameter | Location | Type | Description |
|---|---|---|---|
active | query | boolean | Only return shipping rates that are active or inactive. |
created | query | one of multiple schemas | A 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. |
currency | query | string | Only return shipping rates for the given currency. |
ending_before | query | string | A 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. |
expand | query | array of string | Specifies which fields in the response should be expanded. |
limit | query | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
starting_after | query | string | A 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.
| Field | Type | Description |
|---|---|---|
data required | array of shipping_rate | |
has_more required | boolean | True if this list has another page of items after this one that can be fetched. |
object required | string | String representing the object's type. Objects of the same type share the same value. Always has the value `list`. |
url required | string | The URL where this list can be accessed. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
POST /v1/shipping_rates
Create a shipping rate
Creates a new shipping rate object.
Request parameters
| Field | Type | Description |
|---|---|---|
delivery_estimate | object | The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. |
display_name required | string | The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. |
expand | array of string | Specifies which fields in the response should be expanded. |
fixed_amount | object | Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. |
metadata | object | Set 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_behavior | string | Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
tax_code | string | A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. |
type | string | The type of calculation to use on the shipping rate. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
active required | boolean | Whether the shipping rate can be used for new purchases. Defaults to `true`. |
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
delivery_estimate | one of multiple schemas | The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. |
display_name | string | The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. |
fixed_amount | shipping_rate_fixed_amount | |
id required | string | Unique identifier for the object. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata required | object | Set 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 required | string | String representing the object's type. Objects of the same type share the same value. |
tax_behavior | string | Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
tax_code | one of multiple schemas | A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. |
type required | string | The type of calculation to use on the shipping rate. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
GET /v1/shipping_rates/{shipping_rate_token}
Retrieve a shipping rate
Returns the shipping rate object with the given ID.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
expand | query | array of string | Specifies which fields in the response should be expanded. |
shipping_rate_token | path | string |
object. See the OpenAPI specification for the complete schema.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
active required | boolean | Whether the shipping rate can be used for new purchases. Defaults to `true`. |
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
delivery_estimate | one of multiple schemas | The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. |
display_name | string | The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. |
fixed_amount | shipping_rate_fixed_amount | |
id required | string | Unique identifier for the object. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata required | object | Set 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 required | string | String representing the object's type. Objects of the same type share the same value. |
tax_behavior | string | Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
tax_code | one of multiple schemas | A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. |
type required | string | The type of calculation to use on the shipping rate. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
POST /v1/shipping_rates/{shipping_rate_token}
Update a shipping rate
Updates an existing shipping rate object.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
shipping_rate_token | path | string |
| Field | Type | Description |
|---|---|---|
active | boolean | Whether the shipping rate can be used for new purchases. Defaults to `true`. |
expand | array of string | Specifies which fields in the response should be expanded. |
fixed_amount | object | Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. |
metadata | one of multiple schemas | Set 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_behavior | string | Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
active required | boolean | Whether the shipping rate can be used for new purchases. Defaults to `true`. |
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
delivery_estimate | one of multiple schemas | The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. |
display_name | string | The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. |
fixed_amount | shipping_rate_fixed_amount | |
id required | string | Unique identifier for the object. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata required | object | Set 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 required | string | String representing the object's type. Objects of the same type share the same value. |
tax_behavior | string | Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. |
tax_code | one of multiple schemas | A [tax code](https://docs.stripe.com/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. |
type required | string | The type of calculation to use on the shipping rate. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |