Prices

A price is what one product costs, in USD cents, and how often it’s charged. A product can have several prices, for example retail and wholesale terms. One-time prices are charged on invoices and checkout sessions, and recurring prices are billed through subscriptions.

The Price object

Name
object
Type
"price",
Description
The object's type.
Name
id
Type
string,
Description
Unique identifier for the object.
Name
live
Type
boolean,
Description
true if the object is live, or false if 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 price can be used for new purchases.
Name
amount
Type
integer, at least 0,
Description
The amount in cents.
Name
deleted
Type
boolean,
Description
Whether the price has been deleted.
Name
metadata
Type
object,
Description
Your own key-value data on the object.
Name
name
Type
string or null,
Description
An internal name for the price.
Name
product
Type
string or Product,
Description
Expandable. The product this price is for.
Name
recurring
Type
object or null,
Description
The billing period of a recurring price.
Properties
Name
type
Type
enum,
Description
one_time for a single purchase, or recurring for a subscription.
Properties
Name
updated_at
Type
integer,
Description
When the object was last updated, in milliseconds since the Unix epoch.

The Price object

{
  "object": "price",
  "id": "price_dz1NVvl5CSogERkeA9Ng67",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "product": "prod_KDCnId9DMZSOA9MSaut4Q",
  "active": true,
  "name": "Pro monthly",
  "amount": 2900,
  "type": "recurring",
  "recurring": {
    "interval": "month",
    "interval_count": 1
  },
  "metadata": {}
}

Create a price

Create a new price for a product.

Required parameters

Name
product
Type
string,
Description
The ID of the product the price is for.
Name
amount
Type
integer, at least 0,
Description
The amount in cents.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
Name
active
Type
boolean or null,
Description
Whether the price can be used for new purchases.
Name
name
Type
string or null,
Description
An internal name for the price.
Name
type
Type
enum,
Description
one_time for a single purchase, or recurring for a subscription. Defaults to recurring when recurring is set, and one_time otherwise.
Properties
Name
recurring
Type
object or null,
Description
The billing period. Required for recurring prices.
Properties
Name
metadata
Type
object or null,
Description
Your own key-value data on the object.

Returns

Returns the price object.

Create a price

const price = await bias.prices.create({
  product: "prod_KDCnId9DMZSOA9MSaut4Q",
  active: true,
  name: "Pro monthly",
  amount: 2900,
  recurring: {
    interval: "month"
  }
});

Response example

{
  "object": "price",
  "id": "price_dz1NVvl5CSogERkeA9Ng67",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "product": "prod_KDCnId9DMZSOA9MSaut4Q",
  "active": true,
  "name": "Pro monthly",
  "amount": 2900,
  "type": "recurring",
  "recurring": {
    "interval": "month",
    "interval_count": 1
  },
  "metadata": {}
}

Get a price

Retrieve a price by its ID.

Required parameters

Name
id
Type
string,
Description
The ID of the price to retrieve.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties

Returns

Returns the price object.

Retrieve a price

const price = await bias.prices.get("id");

Response example

{
  "object": "price",
  "id": "price_dz1NVvl5CSogERkeA9Ng67",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "product": "prod_KDCnId9DMZSOA9MSaut4Q",
  "active": true,
  "name": "Pro monthly",
  "amount": 2900,
  "type": "recurring",
  "recurring": {
    "interval": "month",
    "interval_count": 1
  },
  "metadata": {}
}

Update a price

A price’s amount, type and recurring interval can’t change, so subscriptions billing it keep the same amount. To charge new customers a different amount, create a new price and set active: false on the old one.

Required parameters

Name
id
Type
string,

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
Name
active
Type
boolean,
Description
Whether the price can be used for new purchases.
Name
name
Type
string or null,
Description
An internal name for the price.
Name
metadata
Type
object or null,
Description
Your own key-value data on the object.

Returns

Returns the updated price object.

Update a price

const price = await bias.prices.update("id", {
  active: false,
  name: "Pro monthly (legacy)"
});

Response example

{
  "object": "price",
  "id": "price_dz1NVvl5CSogERkeA9Ng67",
  "live": false,
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "deleted": false,
  "product": "prod_KDCnId9DMZSOA9MSaut4Q",
  "active": true,
  "name": "Pro monthly",
  "amount": 2900,
  "type": "recurring",
  "recurring": {
    "interval": "month",
    "interval_count": 1
  },
  "metadata": {}
}

List all prices

Retrieve a paginated list of prices, most recently created first.

Optional parameters

Name
expand
Type
object,
Description
Related objects to expand in the response.
Properties
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
Filters for the list, combined with and and or.
Properties

Returns

Returns a list of price objects.

List all prices

const price = await bias.prices.list();

Response example

{
  "object": "list",
  "items": [
    {
      "object": "price",
      "id": "price_dz1NVvl5CSogERkeA9Ng67",
      "live": false,
      "created_at": 1750000000000,
      "updated_at": 1750000000000,
      "deleted": false,
      "product": "prod_KDCnId9DMZSOA9MSaut4Q",
      "active": true,
      "name": "Pro monthly",
      "amount": 2900,
      "type": "recurring",
      "recurring": {
        "interval": "month",
        "interval_count": 1
      },
      "metadata": {}
    }
  ],
  "has_more": true
}