Shipping rates
Shipping rates describe a fixed shipping cost and, optionally, a delivery estimate that can be offered to a customer during checkout.
The ShippingRate object
- Name
object
- Type
- "shipping_rate",
- Description
- Literal representing the object’s type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
trueif the object exists in a production environment or the valuefalseif the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured in milliseconds since the Unix epoch.
- Name
active
- Type
- boolean,
- Description
- Whether the shipping rate can be used for new purchases.
- Name
amount
- Type
- integer, at least 0,
- Description
- The amount to charge, in cents.
- Name
deleted
- Type
- boolean,
- Description
- Whether the shipping rate has been deleted.
- Name
delivery_estimate
- Type
- object or null,
- Description
- The estimated range for how long shipping will take.
- Properties
- Name
display_name
- Type
- string,
- Description
- The display name of the shipping rate, shown to customers.
- Name
metadata
- Type
- object,
- Description
- A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
- Name
updated_at
- Type
- integer,
- Description
- Time at which the object was last updated. Measured in milliseconds since the Unix epoch.
The ShippingRate object
Create a shipping rate
Creates a new shipping rate.
Required parameters
- Name
display_name
- Type
- string,
- Description
- The display name of the shipping rate, shown to customers.
- Name
amount
- Type
- integer, at least 0,
- Description
- The amount to charge, in cents.
Optional parameters
- Name
expand
- Type
- empty object,
- Name
delivery_estimate
- Type
- object or null,
- Description
- The estimated range for how long shipping will take.
- Properties
- Name
metadata
- Type
- object or null,
- Description
- A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
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,
Returns
Returns the shipping rate object.
Retrieve a shipping rate
Response example
Update a shipping rate
Updates the specified shipping rate by setting the values of the parameters passed.
Required parameters
- Name
id
- Type
- string,
Optional parameters
- Name
expand
- Type
- empty object,
- Name
active
- Type
- boolean,
- Description
- Whether the shipping rate can be used for new purchases.
- Name
display_name
- Type
- string,
- Description
- The display name of the shipping rate, shown to customers.
- Name
delivery_estimate
- Type
- object or null,
- Description
- The estimated range for how long shipping will take.
- Properties
- Name
metadata
- Type
- object or null,
- Description
- A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
Returns
Returns the updated shipping rate object.
Update a shipping rate
Response example
List all shipping rates
Returns a list of your shipping rates. Shipping rates are returned in reverse chronological order, with the most recently created shipping rates appearing first.
Optional parameters
- Name
expand
- Type
- empty object,
- Name
ending_before
- Type
- string,
- Description
- A cursor for use in pagination.
ending_beforeis an object ID that results will end before. Used to move backward through the list.
- Name
starting_after
- Type
- string,
- Description
- A cursor for use in pagination.
starting_afteris an object ID that results will start after. Used to move forward through the list.
- Name
limit
- Type
- number, at least 1, at most 1000, default is 50
- Description
- Maximum number of objects to return.
- Name
filters
- Type
- object, object, or object,
- Description
- Filters to apply to the list. Combine multiple conditions with
andandor. - Properties
Returns
Returns a list of shipping rate objects.