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 true if the object exists in a production environment or the value false if 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

{
  "object": "shipping_rate",
  "id": "shr_z6TEWSU3AgYq95B7KHhEg5",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "active": true,
  "display_name": "Standard shipping",
  "amount": 500,
  "delivery_estimate": {
    "maximum": {
      "unit": "business_day",
      "value": 5
    },
    "minimum": {
      "unit": "business_day",
      "value": 3
    }
  },
  "metadata": {}
}

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

const shippingRate = await bias.shippingRates.create({
  display_name: "Standard shipping",
  amount: 500,
  delivery_estimate: {
    maximum: {
      unit: "business_day",
      value: 5
    },
    minimum: {
      unit: "business_day",
      value: 3
    }
  },
  metadata: {}
});

Response example

{
  "object": "shipping_rate",
  "id": "shr_z6TEWSU3AgYq95B7KHhEg5",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "active": true,
  "display_name": "Standard shipping",
  "amount": 500,
  "delivery_estimate": {
    "maximum": {
      "unit": "business_day",
      "value": 5
    },
    "minimum": {
      "unit": "business_day",
      "value": 3
    }
  },
  "metadata": {}
}

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

const shippingRate = await bias.shippingRates.get("id");

Response example

{
  "object": "shipping_rate",
  "id": "shr_z6TEWSU3AgYq95B7KHhEg5",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "active": true,
  "display_name": "Standard shipping",
  "amount": 500,
  "delivery_estimate": {
    "maximum": {
      "unit": "business_day",
      "value": 5
    },
    "minimum": {
      "unit": "business_day",
      "value": 3
    }
  },
  "metadata": {}
}

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

const shippingRate = await bias.shippingRates.update("id", {
  active: false,
  display_name: "Standard shipping"
});

Response example

{
  "object": "shipping_rate",
  "id": "shr_z6TEWSU3AgYq95B7KHhEg5",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "active": true,
  "display_name": "Standard shipping",
  "amount": 500,
  "delivery_estimate": {
    "maximum": {
      "unit": "business_day",
      "value": 5
    },
    "minimum": {
      "unit": "business_day",
      "value": 3
    }
  },
  "metadata": {}
}

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_before is 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_after is 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 and and or.
Properties

Returns

Returns a list of shipping rate objects.

List all shipping rates

const shippingRate = await bias.shippingRates.list();

Response example

{
  "object": "list",
  "items": {
    "object": "shipping_rate",
    "id": "shr_z6TEWSU3AgYq95B7KHhEg5",
    "live": false,
    "created_at": 1750000000000,
    "updated_at": 1750000000000,
    "deleted": false,
    "active": true,
    "display_name": "Standard shipping",
    "amount": 500,
    "delivery_estimate": {
      "maximum": {
        "unit": "business_day",
        "value": 5
      },
      "minimum": {
        "unit": "business_day",
        "value": 3
      }
    },
    "metadata": {}
  },
  "has_more": false
}