Skip to main content
POST
/
api
/
v2
/
admin
/
products
/
{id}
Update product
curl --request POST \
  --url https://faisalshop.mvp-apps.ae/api/v2/admin/products/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Tenant-ID: <x-tenant-id>' \
  --data '
{
  "name": "<string>",
  "price": 123,
  "description": "<string>",
  "stock": 123,
  "category_id": 123
}
'

Overview

Update an existing product’s information. Only products belonging to your tenant can be updated.

Authorization

  • User must be authenticated with a valid Bearer token
  • User must be a member of the tenant
  • Requires X-Tenant-ID header

Partial Updates

You can update specific fields without providing all product data. Only include the fields you want to change.

Example Usage

curl -X POST \
  https://faisalshop.mvp-apps.ae/api/v2/admin/products/42 \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Tenant-ID: 123' \
  -H 'Content-Type: application/json' \
  -d '{
    "price": 29.99,
    "stock": 75
  }'
await axios.post(
  `/api/v2/admin/products/${productId}`,
  {
    price: 29.99,
    stock: 75
  },
  {
    headers: {
      Authorization: `Bearer ${token}`,
      'X-Tenant-ID': tenantId
    }
  }
);

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Tenant-ID
string
required

Tenant ID for multi-tenancy

Path Parameters

id
integer
required

Body

application/json
name
string
required
price
number<float>
required
description
string
stock
integer
category_id
integer

Response

200

Product updated