The Update a Product service changes the details for a given product.
{base_url}/products/{id}
PUT
None
Path parameters:
Name | Type | Mandatory? | Constraints | Notes |
---|---|---|---|---|
id | int | yes | Internal unique ID assigned by the system. |
Name | Type | Mandatory? | Constraints | Notes |
---|---|---|---|---|
product_id | string | yes | - | Unique ID provided by the manufacturer. |
name | string | yes | - | - |
price | float | yes | - | - |
eligible_issuer | string | yes | - | The issuer whose gift cards can be used to pay for this product. |
A successful request returns the data you submitted plus the product’s unique id
:
Name | Type | Mandatory? | Constraints | Notes |
---|---|---|---|---|
id | int | yes | - | Unique internal ID generated by the system. |
product_id | string | yes | - | Unique ID provided by the manufacturer. |
name | string | yes | - | - |
price | float | yes | - | - |
eligible_issuer | string | yes | - | The issuer whose gift cards can be used to pay for this product. |
Code | Description | Notes |
---|---|---|
200 | OK | - |
The following example updates the name
and price
for product id
5:
Request:
curl -XPUT -H "Content-type: application/json" -d ' {
"product_id": "gap-coat-001",
"name": "Gap Winter Parka",
"price": 60.00,
"eligible_issuer": "Gap"
}' 'http://localhost:3000/products/5'
Response:
{
"product_id": "gap-coat-001",
"name": "Gap Winter Parka",
"price": 60,
"eligible_issuer": "Gap",
"id": 5
}