Update a product
PUT/subscriptions/products/:product_uuid
Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the product is not updated.
Request
Path Parameters
The unique identifier of a product.
- application/json
Body
data ProductUpdaterequired
The unique identifier.
Possible values: [subscription_product
]
attributes ProductUpdateAttributesrequired
Possible values: <= 2048 characters
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
Possible values: >= 3 characters
and <= 1024 characters
The name of the product.
Possible values: <= 1024 characters
The product or service description to display to customers.
Possible values: <= 1024 characters
A stock keeping unit for the product, if appropriate.
Possible values: <= 1024 characters
A URL from which an image or file for the product can be fetched. You can either upload your images and files to Commerce using the Commerce Files API or you can use your own content delivery network. If you are using the Commerce Files API, use Create a File to upload your file and return an HREF link in the response. An extensive range of media and file extensions are supported.
price objectnullable
property name* objectnullable
The value as a whole number of the currency's smallest subdivision.
Whether the amount includes any taxes.
price_units objectnullable
The timeframe during which the product price is applicable. For example, for a streaming service, the price is $12.99 and the unit
is months
and the amount
is 1
. In other words, the streaming service is available for $12.99 a month. You may want to specify a unit price if you have many products that all have different prices. Rather than having to create separate plans for each product, you can specify the timeframe during which the product price is applicable and then create one plan that determines the billing frequency for those products.
Possible values: [day
, month
]
A unit of time, either days or months.
Possible values: >= 1
The number of days or months the period covers.
Responses
- 200
- 400
- 403
- 404
- 409
- 500
Success. The product details are updated.
- application/json
- Schema
- Example (from schema)
Schema
data Product
The unique identifier.
Possible values: [subscription_product
]
attributes ProductAttributesrequired
Possible values: <= 2048 characters
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
Possible values: >= 3 characters
and <= 1024 characters
The name of the product.
Possible values: <= 1024 characters
The product or service description to display to customers.
Possible values: <= 1024 characters
A stock keeping unit for the product, if appropriate.
Possible values: <= 1024 characters
A URL from which an image or file for the product can be fetched. You can either upload your images and files to Commerce using the Commerce Files API or you can use your own content delivery network. If you are using the Commerce Files API, use Create a File to upload your file and return an HREF link in the response. An extensive range of media and file extensions are supported.
price Price
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
price_units object
The timeframe during which the product price is applicable. For example, for a streaming service, the price is $12.99 and the unit
is months
and the amount
is 1
. In other words, the streaming service is available for $12.99 a month. You may want to specify a unit price if you have many products that all have different prices. Rather than having to create separate plans for each product, you can specify the timeframe during which the product price is applicable and then create one plan that determines the billing frequency for those products.
Possible values: [day
, month
]
A unit of time.
Possible values: >= 1
The number of days or months the period covers.
The date and time a resource was updated.
The date and time a resource was created.
meta ProductMetarequired
display_price DisplayPrice
without_tax PriceFormatting
The unformatted amount for the objects.
The three-letter ISO currency code in uppercase, associated with a price.
The formatted amount for the objects.
with_tax PriceFormatting
The unformatted amount for the objects.
The three-letter ISO currency code in uppercase, associated with a price.
The formatted amount for the objects.
The owner of a resource, either store
or organization
.
timestamps Timestampsrequired
The date and time a resource was updated.
The date and time a resource was created.
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_product",
"attributes": {
"external_ref": "abc123",
"name": "Magazine",
"description": "A lovely magazine that is published every month.",
"sku": "MAGAZINE1",
"main_image": "https://magazine.com/cover.jpg",
"price": {
"USD": {
"amount": 100,
"includes_tax": false
},
"GBP": {
"amount": 90,
"includes_tax": true
}
},
"price_units": {
"unit": "day",
"amount": 7
},
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
},
"meta": {
"display_price": {
"without_tax": {
"amount": 100,
"currency": "USD",
"formatted": "$1.00"
},
"with_tax": {
"amount": 110,
"currency": "USD",
"formatted": "$1.10"
}
},
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- missing-name
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Validation Error",
"status": "400",
"detail": "data.attributes.name: \"name\" is required"
}
]
}
Forbidden. The operation is forbidden on this entity.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Permission denied",
"status": "404",
"detail": "Permission denied: plan tenancy mismatch"
}
]
}
Not found. The requested entity does not exist.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Not Found",
"status": "404",
"detail": "No plan found"
}
]
}
Write conflict. Unable to perform the operation at this time.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Write Conflict",
"status": "409"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Internal Server Error",
"status": "500"
}
]
}