Alladdin

Work in progress

Site en construction

الموقع قيد الإنشاء

Alladdin
PUT

Update a product

Scope: inventory:products.write https://api.alladdin.com/api/v2/products/{productId}

Replaces all mutable fields of an existing product. This is a full replacement — any field you omit will be reset to its default value.
To avoid accidentally clearing data, first fetch the product with GET, modify the fields you need, and send back the full object. Stock levels are managed separately via the stock endpoint.

Parameters

Path parameters

productId string required

Product ID (24-char hex ObjectId)

Request body

object name string required

Product name

description string | null optional

Product description

sku string | null optional

Stock keeping unit code

barcode string | null optional

Barcode value

price string | null optional

Unit sale price as a decimal string

default: null cost string | null optional

Unit cost price as a decimal string

default: null purchase_price string | null optional

Unit purchase price as a decimal string

default: null weight number | null optional

Weight in account default unit

default: null tags[] string[] | null optional

List of tag names

taxes[] string[] | null optional

Tax keys applied to this product. Accepts the human tax name (e.g. "IVA 21%") or the internal key (e.g. "s_iva_21"); resolved automatically.

for_sale boolean required

Whether the product is available for sale

for_purchase boolean required

Whether the product is available for purchase

archived boolean required

Whether the product is archived

variants[] object[] | null optional

Variants of the product (for variants, lots and serial numbers product types). Sending this field replaces all existing variants.

id string

Variant identifier

sku string | null barcode string | null price string | null cost string | null purchase_price string | null stock number | null description string | null weight number | null factory_code string | null archived boolean | null lot_number string | null

Only for LOTS products

start_date string<date> | null

Only for LOTS and serial number products. ISO 8601 format. Accepts date (YYYY-MM-DD) or datetime (e.g. 2025-01-01T00:00:00+00:00)

end_date string<date> | null

Only for LOTS and serial number products. ISO 8601 format. Accepts date (YYYY-MM-DD) or datetime (e.g. 2025-12-31T00:00:00+00:00)

pack_items[] object[] | null optional

Items included in this pack product. Sending this field replaces all existing pack items.

product_selection string

Product ID or "productId#variantId"

units number show_start_date boolean | null optional

Show lot start date in documents. Only for LOTS products.

show_end_date boolean | null optional

Show lot end date in documents. Only for LOTS products.

warehouse_id string | null optional

Default warehouse identifier for this product

sales_channel_id string | null optional

Sales channel identifier for this product

exp_account_id string | null optional

Expense/purchases accounting account identifier for this product

Request

python
import requests

url = "https://api.alladdin.com/api/v2/products/{productId}"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

payload = {
    "name": "string",
    "description": "string",
    "sku": "string",
    "barcode": "string",
    "price": "49.99",
    "cost": "29.99",
    "purchase_price": "19.99",
    "weight": 0,
    "tags": [
        "string"
    ],
    "taxes": [
        "s_iva_21"
    ],
    "for_sale": false,
    "for_purchase": false,
    "archived": false,
    "variants": [
        {
            "id": "string",
            "sku": "string",
            "barcode": "string",
            "price": "19.99",
            "cost": "string",
            "purchase_price": "string",
            "stock": 0,
            "description": "string",
            "weight": 0,
            "factory_code": "string",
            "archived": false,
            "lot_number": "string",
            "start_date": "2025-01-01",
            "end_date": "2025-12-31"
        }
    ],
    "pack_items": [
        {
            "product_selection": "507f1f77bcf86cd799439011",
            "units": 2
        }
    ],
    "show_start_date": false,
    "show_end_date": false,
    "warehouse_id": "string",
    "sales_channel_id": "string",
    "exp_account_id": "string"
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())

Responses

Response

json
{
  "id": "string"
}

Success responses

200 Product updated application/json object id string

Error responses

400 Bad request application/json 401 Invalid or missing API key application/json 403 Insufficient permissions application/json 404 Product not found application/json 422 Validation error application/json 429 Rate limit exceeded application/json

← PreviousUpload a product image →

Next →Update stock for a product →