Attributes
- idstring
Unique identifier for the object.
- activeboolean
Whether the shipping rate can be used for new purchases. Defaults to
true
. - display_
namenullable string The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
- fixed_
amountnullable object Describes a fixed amount to charge for shipping. Must be present if type is
fixed_
.amount - metadataobject
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- tax_
behaviornullable enum Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
.Possible enum valuesexclusive
inclusive
unspecified
- tax_
codenullable stringExpandable A tax code ID. The Shipping tax code is
txcd_
.92010001 - typeenum
The type of calculation to use on the shipping rate.
Possible enum valuesfixed_
amount The shipping rate is a fixed amount.
More attributes
- objectstring
- createdtimestamp
- delivery_
estimatenullable object - livemodeboolean
{ "id": "shr_1MrRx2LkdIwHu7ixikgEA6Wd", "object": "shipping_rate", "active": true, "created": 1680207604, "delivery_estimate": null, "display_name": "Ground shipping", "fixed_amount": { "amount": 500, "currency": "usd" }, "livemode": false, "metadata": {}, "tax_behavior": "unspecified", "tax_code": null, "type": "fixed_amount"}
Creates a new shipping rate object.
Parameters
- display_
namestringRequired The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
- fixed_
amountobject Describes a fixed amount to charge for shipping. Must be present if type is
fixed_
.amount - metadataobject
Set of key-value pairs 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_
behaviorenumRecommended if calculating taxes Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
.Possible enum valuesexclusive
inclusive
unspecified
- tax_
codestringRecommended if calculating taxes A tax code ID. The Shipping tax code is
txcd_
.92010001 - typeenumRequired
The type of calculation to use on the shipping rate.
Possible enum valuesfixed_
amount The shipping rate is a fixed amount.
More parameters
- delivery_
estimateobject
Returns
Returns a shipping rate object if the call succeeded.
{ "id": "shr_1MrRx2LkdIwHu7ixikgEA6Wd", "object": "shipping_rate", "active": true, "created": 1680207604, "delivery_estimate": null, "display_name": "Ground shipping", "fixed_amount": { "amount": 500, "currency": "usd" }, "livemode": false, "metadata": {}, "tax_behavior": "unspecified", "tax_code": null, "type": "fixed_amount"}
Updates an existing shipping rate object.
Parameters
- activeboolean
Whether the shipping rate can be used for new purchases. Defaults to
true
. - fixed_
amountobject Describes a fixed amount to charge for shipping. Must be present if type is
fixed_
.amount - metadataobject
Set of key-value pairs 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_
behaviorenumRecommended if calculating taxes Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
.Possible enum valuesexclusive
inclusive
unspecified
Returns
Returns the modified shipping rate object if the call succeeded.
{ "id": "shr_1MrRx2LkdIwHu7ixikgEA6Wd", "object": "shipping_rate", "active": true, "created": 1680207604, "delivery_estimate": null, "display_name": "Ground shipping", "fixed_amount": { "amount": 500, "currency": "usd" }, "livemode": false, "metadata": { "order_id": "6735" }, "tax_behavior": "unspecified", "tax_code": null, "type": "fixed_amount"}
Returns the shipping rate object with the given ID.
Parameters
No parameters.
Returns
Returns a shipping rate object if a valid identifier was provided.
{ "id": "shr_1MrRx2LkdIwHu7ixikgEA6Wd", "object": "shipping_rate", "active": true, "created": 1680207604, "delivery_estimate": null, "display_name": "Ground shipping", "fixed_amount": { "amount": 500, "currency": "usd" }, "livemode": false, "metadata": {}, "tax_behavior": "unspecified", "tax_code": null, "type": "fixed_amount"}
Returns a list of your shipping rates.
Parameters
- activeboolean
Only return shipping rates that are active or inactive.
- createdobject
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. - currencyenum
Only return shipping rates for the given currency.
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A dictionary with a data
property that contains an array of up to limit
shipping rates, starting after shipping rate starting_
. Each entry in the array is a separate shipping rate object. If no more shipping rates are available, the resulting array will be empty. This require should never raise an error.
{ "object": "list", "url": "/v1/shipping_rates", "has_more": false, "data": [ { "id": "shr_1MrRx2LkdIwHu7ixikgEA6Wd", "object": "shipping_rate", "active": true, "created": 1680207604, "delivery_estimate": null, "display_name": "Ground shipping", "fixed_amount": { "amount": 500, "currency": "usd" }, "livemode": false, "metadata": {}, "tax_behavior": "unspecified", "tax_code": null, "type": "fixed_amount" } ]}