Products

Updates a product. Only the fields you send are changed. A field that this endpoint does not accept, such as id or createdAt, is rejected.

Clearing fields:

Send null for slug or defaultPriceId to remove it. Other fields cannot be cleared.

Default price:

defaultPriceId must be an active price of this product. A price that is archived later stays the default until you change it.

Archiving:

Set active to false to archive the product. Products are never deleted.

put/products/{id}

Request

Request body

namestring

The name of the product.

descriptionstring

A description of the product.

imagesstring[]

Up to 8 image URLs of the product. Each URL must use https.

slugstring nullable

A short name of the product, unique in your account. A slug another product already has is rejected with 409. Send null to remove the slug.

shippableboolean

Whether the product is shipped to the buyer.

unitLabelstring

The name of one unit of the product, for example seat or hour.

descriptorstring

A statement descriptor stored on the product and returned in its responses. It is not applied to payments or subscriptions yet: set descriptor on the subscription instead.

defaultPriceIdstring uuid nullable

The ID of an active price of this product. Send null to remove the default price.

activeboolean

Whether the product is active. Products are never deleted: set active to false to archive one. Archiving a product does not archive its prices, and its prices can still start subscriptions.

metadataMetadata

A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.

Example request

{
  "name": "Gold plan",
  "description": "Unlimited access to every course",
  "images": [
    "https://example.com/images/gold-plan.png"
  ],
  "slug": "gold-plan",
  "unitLabel": "seat",
  "descriptor": "MONEI GOLD",
  "defaultPriceId": "3c5a1f8e-2b7d-4e9a-9c41-7d2e6b0f5a13",
  "active": true,
  "metadata": {
    "systemId": "12345"
  }
}

Response

A product object

idstring uuid required

Unique identifier for the product.

namestring required

The name of the product.

descriptionstring

A description of the product.

imagesstring[]

Up to 8 image URLs of the product. Each URL must use https.

slugstring

A short name of the product: lowercase letters and digits, joined by single hyphens.

A slug is unique in your account. A request that sets a slug another product already has is rejected with 409. An archived product keeps its slug until you remove it.

shippableboolean

Whether the product is shipped to the buyer.

unitLabelstring

The name of one unit of the product, for example seat or hour.

descriptorstring

A statement descriptor stored on the product and returned in its responses. It is not applied to payments or subscriptions yet: set descriptor on the subscription instead.

defaultPriceIdstring uuid

The default price of the product. It is always a price of this product. You set it with Update Product, after you create the price.

activeboolean required

Whether the product is active. Products are never deleted: set active to false to archive one. Archiving a product does not archive its prices, and its prices can still start subscriptions.

metadataMetadata

A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.

createdAtinteger required

Time at which the resource was created. Measured in seconds since the Unix epoch.

updatedAtinteger

Time at which the resource updated last time. Measured in seconds since the Unix epoch.

Example response

{
  "id": "8f2c6d1a-4b3e-4f7a-9d2c-1e5b7a9c3f60",
  "name": "Gold plan",
  "description": "Unlimited access to every course",
  "images": [
    "https://example.com/images/gold-plan.png"
  ],
  "slug": "gold-plan",
  "unitLabel": "seat",
  "descriptor": "MONEI GOLD",
  "defaultPriceId": "3c5a1f8e-2b7d-4e9a-9c41-7d2e6b0f5a13",
  "active": true,
  "metadata": {
    "systemId": "12345"
  },
  "createdAt": 1636366897,
  "updatedAt": 1636366897
}

Changes