Shop

Change a cart (JSON Merge Patch)

patch/carts/{id}

Request

  • Base URL
    https://gorest.co.in/public/v3
  • URL
    https://gorest.co.in/public/v3/carts/{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

status'active' | 'abandoned' required

Leave a cart or come back to it; an ordered cart cannot change.

Response

The changed cart.

created_atstring date-time
currencystring

Every line is in this currency. Fixed once the cart is made.

idstring uuid required
read_onlyboolean

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

status'active' | 'abandoned' | 'ordered'

ordered is set by placing an order and is final.

updated_atstring date-time
user_idstring uuid

Whose cart; a user you can see. One active cart per user.

Example response

{
  "currency": "INR",
  "items": [
    {
      "product": {
        "category": {
          "name": "Home and kitchen",
          "slug": "home-kitchen"
        },
        "currency": "INR",
        "name": "Wireless earbuds",
        "price_minor": 249900,
        "sku": "EL-1001"
      }
    }
  ],
  "user": {
    "email": "aarav.sharma@example.com",
    "name": "Aarav Sharma"
  }
}

Changes

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