Save product (PIM model)

POST /PIM/SaveProductsManually — PIM API · Products

Creates or updates products using PIM's own data model. The body is an array of products; each element is a model, option, or SKU record defined by the Main object.

Product types (Main.Type, see List product types): 1 Model, 2 Option, 3 SKU/variant, 4 Single product, 5 Bundle.

  • Single product: single element, Type: 4, with Model/Option/Sku/Barcode filled.
  • Variant product: one Type: 1 (model), one Type: 2 (option, color), and one Type: 3 (SKU) per size. Mapping is done via Model and Option codes.
  • To update only prices, sending Main + Prices is sufficient.

List identifiers: EntityListId values are company-specific; content (name, description), price, image, product, and attribute list IDs are obtained via Get lists. Currency IDs are obtained via List currencies, attribute Key values via List attributes.

Processing: If the body contains a single product, the request is processed immediately and returns product-level results (TransactionProductStatusList). If multiple products are included, the request is queued, returning TransactionStatus: INQUEUE; results can be tracked via Query transaction summary and Query transaction product results.

The OperationType field can be upsert (default) or delete. An empty Value in an attribute deletes that attribute. If the image Name field starts with http, the file is downloaded and uploaded to the CommerceLab repository.

Parametreler

  • companyId (query, integer, zorunlu): Company ID where the product will be saved. Provided by CommerceLab; if the company is not found, the request returns an error.
  • supplierId (query, integer): Supplier ID if saving on behalf of a supplier. If provided, writing is allowed only to lists in that supplier's catalog.
  • deleteOldAttributes (query, boolean): If true, attributes present in the product but not sent in the request are deleted.
  • requestSource (query, string): Source of the request. Do not change the default pim value in integrations; body validation is performed only for this value.
  • Tenant (header, string): Company code for users accessing multiple companies via Basic Auth. Not required if using Bearer token.

İstek gövdesi

  • Main (object, zorunlu): Record ID and type. At least one of Id, Barcode, Sku, Option, Model must be filled; otherwise, the request returns invalid product main info error.
    • Main.Id (integer): Existing product's PIM ID (if known).
    • Main.Sku (string): SKU code (for types 3, 4, 5).
    • Main.Type (integer, zorunlu): Product type: 1 Model, 2 Option, 3 SKU/variant, 4 Single, 5 Bundle, 7 Assortment, 8 Box.
    • Main.Model (string): Model code.
    • Main.Option (string): Option (color) code.
    • Main.Barcode (string): Default barcode (for types 3, 4, 5).
  • Name (object[]): Product name (per language).
    • Name.Value (string, zorunlu): Content text.
    • Name.Culture (string): Language code (std default, tr, en, etc.).
    • Name.EntityListId (integer, zorunlu): Content list ID (EntityTypeId = 8).
  • Title (object[]): Product title (per language).
    • Title.Value (string, zorunlu): Content text.
    • Title.Culture (string): Language code (std default, tr, en, etc.).
    • Title.EntityListId (integer, zorunlu): Content list ID (EntityTypeId = 8).
  • Assets (object[]): Images and videos.
    • Assets.Name (string, zorunlu): File address. If starting with http, the file is downloaded and uploaded to CommerceLab repository; otherwise, relative path in repository is accepted.
    • Assets.Order (integer): Display order.
    • Assets.AssetType (integer): File type: 1 photo (default), 3 video.
    • Assets.EntityListId (integer, zorunlu): Image list ID (EntityTypeId = 7).
    • Assets.OperationType (string): upsert (default), delete, or deleteThenInsertIfUrlChanged which reloads if address changed.
  • OnSale (object[]): Whether the product is on sale (per content list). Value: null removes manual value.
    • OnSale.Value (boolean): Is on sale.
    • OnSale.Culture (string): Language code; use std.
    • OnSale.EntityListId (integer): Content list ID.
  • Prices (object[]): Prices.
    • Prices.Id (integer): Existing price record ID (for delete/update).
    • Prices.ListPrice (number): List price; must be greater than 0.
    • Prices.SalePrice (number): Sale price; must be greater than 0.
    • Prices.CurrencyId (integer): Currency ID; if not sent, default currency is used.
    • Prices.VatStrategy (integer): 1 VAT included, 2 VAT excluded.
    • Prices.EntityListId (integer, zorunlu): Price list ID (EntityTypeId = 4).
    • Prices.ValidEndDate (string<date-time>): Validity end date.
    • Prices.CampaignPrice (number): Campaign price.
    • Prices.OperationType (string): Operation type; determined based on default price fields.
    • Prices.IsTransferable (boolean): Whether the price will be transferred to sales channels.
    • Prices.ValidStartDate (string<date-time>): Validity start date.
    • Prices.SourceFirstPrice (number): Original (source) price.
    • Prices.CustomerGroupCode (string): Customer group code for which the price is valid.
  • Stocks (object[]): Stock per warehouse.
    • Stocks.Quantity (integer): Stock quantity.
    • Stocks.OperationType (string): Write (upsert) or delete (delete).
    • Stocks.WarehouseCode (string, zorunlu): Warehouse code; cannot be empty.
  • Attributes (object[]): Attribute values.
    • Attributes.Key (integer, zorunlu): Attribute ID (AttributeId).
    • Attributes.Value (string): Value text. If the value is not in the list, it is created; empty value deletes the attribute.
    • Attributes.Culture (string): Language code (std default).
    • Attributes.EntityListId (integer, zorunlu): Attribute list ID.
    • Attributes.OperationType (string): Operation type.
  • Categories (object[]): Category bindings.
    • Categories.Id (integer, zorunlu): Category ID.
    • Categories.EntityListId (integer, zorunlu): Category tree list ID (EntityTypeId = 3).
    • Categories.OperationType (string): Bind (upsert) or unbind (delete).
  • Description (object[]): Product description (per language, may contain HTML).
    • Description.Value (string, zorunlu): Content text.
    • Description.Culture (string): Language code (std default, tr, en, etc.).
    • Description.EntityListId (integer, zorunlu): Content list ID (EntityTypeId = 8).
  • ProductLists (object[]): Product lists where the product will be included.
    • ProductLists.EntityListId (integer): Product list ID (EntityTypeId = 5).
    • ProductLists.OperationType (string): Add (upsert) or remove (delete).
  • SeoDescription (object[]): SEO description (per language).
    • SeoDescription.Value (string, zorunlu): Content text.
    • SeoDescription.Culture (string): Language code (std default, tr, en, etc.).
    • SeoDescription.EntityListId (integer, zorunlu): Content list ID (EntityTypeId = 8).

Yanıtlar

  • 200: Single product returns operation result, multiple products return queue record. TransactionStatus: SUCCESS (processed; product-level results in list), INQUEUE (queued or will retry due to temporary lock), ERROR (operation failed).
  • 400: Request body is not valid JSON or field types are incompatible.
  • 401: Authentication failed (missing header, incorrect Basic info, or invalid token). Body is empty.
  • 500: Body or authorization error. Example messages: invalid product main info (missing Main in an item or all identifier fields empty), You are not authorized for this operation (user lacks product creation permission), company not found.

200 yanıt alanları

  • IsRetryable (boolean): true if the operation will retry due to temporary lock.
  • TransactionId (string): Transaction ID; used in transaction tracking endpoints.
  • TransactionStatus (string): SUCCESS, INQUEUE, or ERROR.
  • TransactionErrorMessage (string): Message if the entire operation failed.
  • TransactionProductStatusList (object[]): Product-level results (only for immediately processed single-product requests).