Skip to main content
POST
/
api
/
v2
/
admin
/
products
Create product
curl --request POST \
  --url https://faisalshop.mvp-apps.ae/api/v2/admin/products \
  --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

Create a new product in your tenant’s catalog. Products are automatically scoped to the tenant specified in the X-Tenant-ID header.

Authorization

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

Tenant Scoping

Products are automatically associated with the tenant from the X-Tenant-ID header. You don’t need to manually set the tenant_id in the request body.

Example Usage

curl -X POST \
  https://faisalshop.mvp-apps.ae/api/v2/admin/products \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Tenant-ID: 123' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Premium Coffee Beans",
    "description": "Organic arabica coffee beans",
    "price": 24.99,
    "stock": 100,
    "category_id": 5
  }'
await axios.post(
  '/api/v2/admin/products',
  {
    name: 'Premium Coffee Beans',
    description: 'Organic arabica coffee beans',
    price: 24.99,
    stock: 100,
    category_id: 5
  },
  {
    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

Body

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

Response

201

Product created