Shipping rates
A shipping rate is a fixed shipping cost with an optional delivery estimate, offered to customers in a checkout session or charged every period on a subscription.
The ShippingRate object
- Name
object
- Type
- "shipping_rate",
- Description
- The object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
trueif the object is live, orfalseif it's in a sandbox.
- Name
created_at
- Type
- integer,
- Description
- When the object was created, in milliseconds since the Unix epoch.
- Name
active
- Type
- boolean,
- Description
- Whether the shipping rate can be set on a subscription.
- Name
amount
- Type
- integer, at least 0,
- Description
- The shipping cost, in cents.
- Name
deleted
- Type
- boolean,
- Description
- Whether the shipping rate has been deleted.
- Name
delivery_estimate
- Type
- object or null,
- Description
- How long delivery is estimated to take.
- Properties
- Name
display_name
- Type
- string,
- Description
- The shipping rate's name, shown to customers.
- Name
metadata
- Type
- object,
- Description
- Your own key-value data on the object.
- Name
updated_at
- Type
- integer,
- Description
- When the object was last updated, in milliseconds since the Unix epoch.
The ShippingRate object
Create a shipping rate
Create a new shipping rate.
Required parameters
- Name
display_name
- Type
- string,
- Description
- The shipping rate's name, shown to customers.
- Name
amount
- Type
- integer, at least 0,
- Description
- The shipping cost, in cents.
Optional parameters
- Name
expand
- Type
- empty object,
- Name
delivery_estimate
- Type
- object or null,
- Description
- How long delivery is estimated to take.
- Properties
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the shipping rate object.
Create a shipping rate
Response example
Get a shipping rate
Retrieve a shipping rate by its ID.
Required parameters
- Name
id
- Type
- string,
- Description
- The ID of the shipping rate to retrieve.
Optional parameters
- Name
expand
- Type
- empty object,
- Description
- Related objects to expand in the response.
Returns
Returns the shipping rate object.
Retrieve a shipping rate
Response example
Update a shipping rate
A shipping rate’s amount can’t change. To charge a different amount, create a new rate.
Required parameters
- Name
id
- Type
- string,
Optional parameters
- Name
expand
- Type
- empty object,
- Name
active
- Type
- boolean,
- Description
- Whether the shipping rate can be set on a subscription.
- Name
display_name
- Type
- string,
- Description
- The shipping rate's name, shown to customers.
- Name
delivery_estimate
- Type
- object or null,
- Description
- How long delivery is estimated to take.
- Properties
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the updated shipping rate object.
Update a shipping rate
Response example
List all shipping rates
Retrieve a paginated list of shipping rates, most recently created first.
Optional parameters
- Name
expand
- Type
- empty object,
- Description
- Related objects to expand in the response.
- Name
ending_before
- Type
- string,
- Description
- The ID of the object to list before, for pagination.
- Name
starting_after
- Type
- string,
- Description
- The ID of the object to list after, for pagination.
- Name
limit
- Type
- integer, at least 1, at most 1000, default is 50
- Description
- The maximum number of objects to return, from 1 to 1000. Defaults to 50.
- Name
filters
- Type
- object, object, or object,
- Description
- Properties
Returns
Returns a list of shipping rate objects.