Bulk transfer products

POST /sapigw/suppliers/{supplierId}/v2/products — PIM API · Products

Transfers products in ERP/supplier format to PIM in bulk (creates or updates). The request is queued and immediately returns a BatchRequestId; the result is tracked with Query bulk operation result.

Product hierarchy: Model → Option (color) → SKU (size/variant, sellable unit).

Field PIM equivalent
ProductMainId Option code
StockCode SKU (unique)
Barcode Default barcode (unique)
Model Code inside Attributes Model code (if missing, ProductMainId)
Title Product name
CategoryId Written as CategoryId attribute

Rules:

  • Rows with empty StockCode or Barcode are not processed.
  • All rows with duplicate StockCode or Barcode in the same request are rejected.
  • ListPrice, SalePrice, and Quantity sent with the product are also written as price/stock.
  • Field mapping may be company-specific; the above table is the default mapping.
  • If "trusted source" requirement is enabled for the company, requests without trustedSource=true are not processed (IsSuccess: false is returned; rejection record can still be queried with BatchRequestId).

Companies using the marketplace model may expect a different body format for the same address; follow the integration notes provided to you.

Parametreler

  • supplierId (path, string, zorunlu): Supplier ID provided by CommerceLab. If not defined in this environment, the request receives 401.
  • trustedSource (query, boolean): If the company has "trusted source" requirement enabled, true must be sent; otherwise, the request is rejected without processing. If disabled, this is ignored.
  • Tenant (header, string): Company code for users accessing multiple companies with Basic Auth. Not required when using Bearer token.

İstek gövdesi

  • items (object[], zorunlu): SKUs to be transferred; each element represents a single sellable product (barcode).
    • items.title (string): Product name (written as name, short description, and SEO description).
    • items.images (object[]): Product images; order is preserved.
      • items.images.url (string): Public full URL of the image.
      • items.images.updatedOn (string<date-time>): Last update time of the image.
    • items.onSale (boolean): Sale status field; in default mapping, sale status is determined by salePrice > 0.
    • items.barcode (string, zorunlu): Default barcode of the product; must be unique.
    • items.brandId (integer<int64>): Brand ID.
    • items.vatRate (number): VAT rate (e.g., 20).
    • items.quantity (number): Stock quantity; written to the default warehouse.
    • items.brandName (string): Brand name.
    • items.listPrice (number): List price.
    • items.salePrice (number): Sale price; if greater than 0, the product is considered on sale.
    • items.stockCode (string, zorunlu): SKU code; must be unique.
    • items.attributes (object[]): Product attributes. Sent by attribute name (attributeName) or ID (attributeId). The attribute named Model Code defines the product's model code.
      • items.attributes.attributeId (integer<int64>): Attribute ID; used as key if attributeName is missing.
      • items.attributes.attributeName (string): Attribute name (e.g., Color, Size). If / is in the name, it is replaced with -.
      • items.attributes.attributeValue (string): Attribute value (text).
      • items.attributes.attributeValueId (integer<int64>): Value ID; used if attributeValue and customAttributeValue are missing.
      • items.attributes.customAttributeValue (string): Free text value; used if attributeValue is missing.
    • items.categoryId (integer): Category ID; written as CategoryId attribute on the product.
    • items.description (string): Product description (may be HTML).
    • items.currencyType (string): Currency code (e.g., TRY).
    • items.productMainId (string, zorunlu): Option (color) code; must be the same for sizes in the same color.
    • items.cargoCompanyId (integer<int64>): Shipping company ID.
    • items.sourceFirstPrice (number): Original (source) price; if not sent, listPrice is used.
    • items.dimensionalWeight (integer<int64>): Volume (desi).

Yanıtlar

  • 200: Request received. If IsSuccess: true, it has been queued. If IsSuccess: false and empty BatchRequestId, the request limit was exceeded; if BatchRequestId is present, it indicates rejection due to untrusted source.
  • 400: Request body is not valid JSON or field types are incompatible.
  • 401: Authentication failed or supplierId is not defined in this environment. Body is empty.
  • 500: Unexpected server-side error.

200 yanıt alanları

  • Message (string): Reason if the request was not queued (e.g., request limit exceeded); null if successful.
  • IsSuccess (boolean): true if the request was queued.
  • BatchRequestId (string): Operation ID; keep to query the result. null if limit exceeded.