Add a Product Price
POST
/api/v2/products/{productId}/prices.json
Add a Product Price to your product catalogue.
Scope
Requires the products
OAuth scope.
Path parameters
productId
required
The ID of the Product is supplied as a path parameter. |
Request body
Your request body must contain an object including:
data
required
Containing a Product Price object. |
Example: minimum requirements
To add a Product Price you must POST JSON to this resource within a data
object. The
minimum requirement for a price, which is not on special offer is a price
decimal
value. All other properties (such as type
, currency
and
isTaxIncluded
) will have defaults based upon the Product or Account settings.
{
"data": {
"price": 9.99
}
}
Example: scheduling an offer
Let's say you want to schedule a special offer or price change in a month's time:
{
"data": {
"price": 9.99,
"standardPrice": 10.99,
"startOn": "2024-05-28",
"isTaxIncluded": true
}
}
Success responses
If the Product Price was created successfully you should receive a response with a 201
status
code:
success
A boolean where a value of true means the Price was created successfully.
|
status
The HTTP status code e.g. 201 means the Price was created successfully. |
data
Contains the Product Price object you created including its new id . |
Error responses
If the Price could not be created you will encounter a response with a 422
status code:
success
A boolean where a value of false means the Price could not be created.
|
status
A response code of 422 means the Price could not be created and you should check
the errors property for further information. |
context
The context property indicates where the error occurred. For a 422 error this
will typically contain a value of data , indicating that there was an error
with the data object supplied. |
errors
Contains an array of error objects, each will have the following properties:
|