Shop

Change a product (JSON Merge Patch)

patch/products/{id}

Request

  • Base URL
    https://gorest.co.in/public/v3
  • URL
    https://gorest.co.in/public/v3/products/{id}
  • Auth
    HTTP bearer

Headers

If-Matchstring

The strong ETag the change is based on, from a read without include or from the last write; when the item changed since, the answer is 412. A weak ETag never matches.

Prefer'return=minimal' | 'return=representation'

return=minimal for an answer with no body, return=representation (the default) for the full item (RFC 7240).

Request body

category_idstring uuid
descriptionstring
namestring

Not blank; spaces at the ends are dropped.

price_minorinteger

A new price; orders already placed keep theirs.

skustring

Your code for the product, unique in your account.

stockinteger nullable

Units in stock, or null to stop tracking.

Example request

{
  "sku": "EL-1001"
}

Response

The changed product.

category_idstring uuid
created_atstring date-time
currencystring

An ISO 4217 code (see /currencies). Fixed once the product is made.

descriptionstring
idstring uuid required
namestring
price_minorinteger

The price in minor units of currency: 249900 with INR is ₹2,499.00.

read_onlyboolean

True for sample data (the seed); it cannot be changed.

skustring

Your code for the product, unique in your account.

stockinteger nullable

Units left; null when stock is not tracked (sample products). An order takes from it and a cancel puts it back.

updated_atstring date-time

Example response

{
  "category": {
    "name": "Home and kitchen",
    "slug": "home-kitchen"
  },
  "currency": "INR",
  "name": "Wireless earbuds",
  "price_minor": 249900,
  "sku": "EL-1001"
}

Changes

No recorded changes to this operation across all 1 revision of this API.