For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a product

Update a product's name, description or status.

Update a product

patch

Update a product's name, description or status. Set status to published to make it buyable, draft to hide it, or archived to retire it. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
store_idstringRequired

The ID of the store that owns the product.

Example: store_01J8Z5F8W9K8M4A7B3C2D1E0FG
product_idstringRequired

The ID of the product to update.

Example: prod_01J8Z5F8W9K8M4A7B3C2D1E0FG
Body
namestring · max: 255Optional

The product name.

Example: Blue T-Shirt
descriptionstring · max: 5000Optional

The product description.

Example: Soft combed cotton, unisex fit.
statusstring · enumOptional

Set "published" to make the product buyable, "draft" to hide it, or "archived" to retire it.

Example: publishedPossible values:
Responses
200

Success response

application/json
patch/api/ecommerce/v1/stores/{store_id}/products/{product_id}
PATCH /api/ecommerce/v1/stores/{store_id}/products/{product_id} HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 92

{
  "name": "Blue T-Shirt",
  "description": "Soft combed cotton, unisex fit.",
  "status": "published"
}
{
  "data": {
    "id": "prod_01J8Z5F8W9K8M4A7B3C2D1E0FG",
    "title": "Blue T-Shirt",
    "status": "published",
    "thumbnail": "https://cdn.example.com/prod/thumb.jpg",
    "type": "physical",
    "variant_count": 3,
    "price_range": {
      "min": 1999,
      "max": 2499,
      "currency_code": "usd"
    },
    "variants": [
      {
        "id": "variant_01J8Z5F8W9K8M4A7B3C2D1E0FG",
        "title": "Medium",
        "sku": "TSHIRT-BLU-M",
        "options": [
          {
            "name": "Size",
            "value": "M"
          }
        ],
        "prices": [
          {
            "amount": 1999,
            "sale_amount": null,
            "currency_code": "usd"
          }
        ],
        "inventory_quantity": 42,
        "manage_inventory": true
      }
    ],
    "media": [
      {
        "url": "https://cdn.example.com/prod/1.jpg",
        "type": "image",
        "is_thumbnail": true
      }
    ]
  }
}

Last updated

Was this helpful?