Skip to main content
POST
/
v1
/
products
/
{id}
Update a Product
curl --request POST \
  --url https://api.leanrails.com/v1/products/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "name": "<string>",
  "active": true,
  "description": "<string>",
  "images": [
    "<string>"
  ],
  "url": "<string>",
  "default_price": "<string>",
  "shippable": true,
  "statement_descriptor": "<string>",
  "unit_label": "<string>",
  "tax_code": "<string>",
  "package_dimensions": {
    "height": 1,
    "length": 1,
    "width": 1,
    "weight": 1
  },
  "marketing_features": [
    {
      "name": "<string>"
    }
  ],
  "metadata": {}
}
'
{
  "id": "prod_xxx",
  "object": "product",
  "active": true,
  "name": "<string>",
  "images": [
    "<string>"
  ],
  "marketing_features": [
    {
      "name": "<string>"
    }
  ],
  "metadata": {},
  "livemode": false,
  "created": 1234567890,
  "updated": 1234567890,
  "description": "<string>",
  "url": "<string>",
  "default_price": "price_xxx",
  "shippable": true,
  "statement_descriptor": "<string>",
  "unit_label": "<string>",
  "tax_code": "<string>",
  "package_dimensions": {
    "height": 1,
    "length": 1,
    "width": 1,
    "weight": 1
  }
}

Authorizations

Authorization
string
header
required

Use your secret API key as the username with an empty password.

Headers

Idempotency-Key
string
required

Unique key to ensure idempotent requests.

Maximum string length: 255
X-API-Version
string

Override the API version for this request.

Path Parameters

id
string
required

The Product ID.

Body

application/json
name
string

The product's name.

Required string length: 1 - 5000
active
boolean

Whether the product is currently available for purchase.

description
string | null

The product's description. Pass null to unset.

Maximum string length: 5000
images
string<uri>[]

Up to 8 URLs of images for this product.

Maximum array length: 8
url
string<uri> | null

A URL of the product page. Pass null to unset.

default_price
string

The ID of the default price for the product.

Pattern: ^price_
shippable
boolean | null
statement_descriptor
string | null
Maximum string length: 22
unit_label
string | null
Maximum string length: 12
tax_code
string | null
package_dimensions
object
marketing_features
object[]
Maximum array length: 15
metadata
object

Set of key-value pairs for storing additional information.

Response

The updated Product.

id
string
required
Example:

"prod_xxx"

object
enum<string>
required
Available options:
product
active
boolean
required

Whether the product is currently available for purchase.

name
string
required

The product's name.

images
string<uri>[]
required

Up to 8 URLs of images for this product.

marketing_features
object[]
required

Up to 15 marketing features for this product.

metadata
object
required

Set of key-value pairs for storing additional information.

livemode
boolean
required
Example:

false

created
integer
required

Unix timestamp.

Example:

1234567890

updated
integer
required

Unix timestamp.

Example:

1234567890

description
string | null

The product's description.

url
string<uri> | null

A URL of the product page.

default_price
string | null

The ID of the default price, or the expanded Price object.

Example:

"price_xxx"

shippable
boolean | null

Whether this product is shipped (i.e. a physical good).

statement_descriptor
string | null

Descriptor for card statements (max 22 characters).

unit_label
string | null

A label that represents units of this product (max 12 characters).

tax_code
string | null

A tax code ID.

package_dimensions
object

The dimensions of this product for shipping purposes.