Update a product (or product attributes)

PATCH
/products/{id}

Authorization

x-api-key<token>

API Key authentication via header

In: header

Request Body

application/jsonRequired
skustring
namestring
descriptionstring
pricestring
currencystring
statusstring
attributesobject

Product attributes and specifications

Path Parameters

idRequiredstring

Query Parameters

actionstring

Pass update-attributes to update specific attributes only

Value in: "update-attributes"
curl -X PATCH "https://niravai.com/api/v1/products/string?action=update-attributes" \
  -H "x-api-key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "SHIRT 123434",
    "name": "Heavyweight T-Shirt (Updated V2)",
    "description": "Updated premium 240 GSM heavy cotton t-shirt with relaxed oversized fit",
    "price": "54.99",
    "currency": "USD",
    "status": "active",
    "attributes": {
      "Color": "Jet Black",
      "Material": "100% Organic Heavyweight Cotton",
      "Fit": "Relaxed Oversized",
      "Care": "Machine wash cold, tumble dry low"
    }
  }'

Product updated successfully

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "sku": "JEANS-BLK-001",
  "name": "Classic Oversized JEANS T-Shirt",
  "description": "Premium 240 GSM heavy cotton JEANS with modern oversized fit",
  "attributes": {
    "Color": "Black",
    "Material": "100% Organic Cotton",
    "Fit": "Oversized"
  },
  "status": "active",
  "orgId": "25b2c2d5-a7fc-47d0-89e4-8709a1560bfa",
  "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "deletedAt": "2019-08-24T14:15:22Z"
}