Utwórz produkty wraz z zależnościami
POST
/api/products/v2/products/bulkCreateWithDependencies
const url = 'https://twoja-instancja-pim-api.enterprise.sellrocket.pl/api/products/v2/products/bulkCreateWithDependencies';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"products":[{"id":1,"externalId":"example","name":"example","catalogId":1,"sku":"example","ean":"example","manufacturerId":{"id":1,"name":"example"},"weight":1,"height":1,"width":1,"length":1,"vat":1,"categoryId":{"id":1,"name":"example","parentId":1},"parentId":1,"isBundle":true,"stocks":[{"warehouseId":1,"quantity":1,"locationName":"example","vatAmount":1,"vatSymbol":"example"}],"productPriceGroups":[{"priceGroupId":1,"price":1}],"isAsteriskMarked":true,"properties":[{"name":"example","value":"example"}],"overwriteProductLinks":true,"productLinks":[{"externalProductId":"example","externalVariantId":"example","externalConnectionId":"example","connectionId":1}],"complexFields":[{"name":"example","description":"example","caption":"example","type":"example","additionalFieldMapping":"example","options":["example"],"id":1,"value":"example"}],"bundleItems":[{"bundleItemProductId":1,"quantity":1}],"replaceAllExistingImages":true,"images":[{"slot":1,"imageLink":"example","imageFile":"example"}],"additionalEans":[{"id":"example","ean":"example","quantity":1,"description":"example"}],"translations":{"additionalProperty":{"name":"example","descriptionComplexFields":[{"name":"example","description":"example"}],"productProperties":[{"name":"example","value":"example"}]}}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://twoja-instancja-pim-api.enterprise.sellrocket.pl/api/products/v2/products/bulkCreateWithDependencies \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "products": [ { "id": 1, "externalId": "example", "name": "example", "catalogId": 1, "sku": "example", "ean": "example", "manufacturerId": { "id": 1, "name": "example" }, "weight": 1, "height": 1, "width": 1, "length": 1, "vat": 1, "categoryId": { "id": 1, "name": "example", "parentId": 1 }, "parentId": 1, "isBundle": true, "stocks": [ { "warehouseId": 1, "quantity": 1, "locationName": "example", "vatAmount": 1, "vatSymbol": "example" } ], "productPriceGroups": [ { "priceGroupId": 1, "price": 1 } ], "isAsteriskMarked": true, "properties": [ { "name": "example", "value": "example" } ], "overwriteProductLinks": true, "productLinks": [ { "externalProductId": "example", "externalVariantId": "example", "externalConnectionId": "example", "connectionId": 1 } ], "complexFields": [ { "name": "example", "description": "example", "caption": "example", "type": "example", "additionalFieldMapping": "example", "options": [ "example" ], "id": 1, "value": "example" } ], "bundleItems": [ { "bundleItemProductId": 1, "quantity": 1 } ], "replaceAllExistingImages": true, "images": [ { "slot": 1, "imageLink": "example", "imageFile": "example" } ], "additionalEans": [ { "id": "example", "ean": "example", "quantity": 1, "description": "example" } ], "translations": { "additionalProperty": { "name": "example", "descriptionComplexFields": [ { "name": "example", "description": "example" } ], "productProperties": [ { "name": "example", "value": "example" } ] } } } ] }'Masowo tworzy produkty, zakładając brakujące elementy powiązane (np. kategorie, producentów), i zwraca wynik dla każdego produktu.
Autoryzacja
Dział zatytułowany „Autoryzacja”Treść żądania
Dział zatytułowany „Treść żądania”object
products
Array<object>
object
id
integer format: int64
externalId
string
name
string
catalogId
integer format: int64
sku
string
ean
string
manufacturerId
object
id
integer format: int64
name
string
weight
number format: double
height
number format: double
width
number format: double
length
number format: double
vat
number format: double
categoryId
object
id
integer format: int64
name
string
parentId
integer format: int64
parentId
integer format: int64
isBundle
boolean
stocks
Array<object>
object
warehouseId
integer format: int64
quantity
integer format: int32
locationName
string
vatAmount
number format: double
vatSymbol
string
productPriceGroups
Array<object>
object
priceGroupId
integer format: int64
price
number format: double
isAsteriskMarked
boolean
properties
Array<object>
object
name
string
value
string
overwriteProductLinks
boolean
productLinks
Array<object>
object
externalProductId
string
externalVariantId
string
externalConnectionId
string
connectionId
integer format: int64
complexFields
Array<object>
object
name
string
description
string
caption
string
type
string
additionalFieldMapping
string
options
Array<string>
id
integer format: int64
value
string
bundleItems
Array<object>
object
bundleItemProductId
integer format: int64
quantity
integer format: int32
replaceAllExistingImages
boolean
images
Array<object>
object
slot
integer format: int32
imageLink
string
imageFile
string
additionalEans
Array<object>
object
id
string
ean
string
quantity
integer format: int32
description
string
translations
object
key
additional properties
object
name
string
descriptionComplexFields
Array<object>
object
name
string
description
string
productProperties
Array<object>
object
name
string
value
string
Examplegenerated
{ "products": [ { "id": 1, "externalId": "example", "name": "example", "catalogId": 1, "sku": "example", "ean": "example", "manufacturerId": { "id": 1, "name": "example" }, "weight": 1, "height": 1, "width": 1, "length": 1, "vat": 1, "categoryId": { "id": 1, "name": "example", "parentId": 1 }, "parentId": 1, "isBundle": true, "stocks": [ { "warehouseId": 1, "quantity": 1, "locationName": "example", "vatAmount": 1, "vatSymbol": "example" } ], "productPriceGroups": [ { "priceGroupId": 1, "price": 1 } ], "isAsteriskMarked": true, "properties": [ { "name": "example", "value": "example" } ], "overwriteProductLinks": true, "productLinks": [ { "externalProductId": "example", "externalVariantId": "example", "externalConnectionId": "example", "connectionId": 1 } ], "complexFields": [ { "name": "example", "description": "example", "caption": "example", "type": "example", "additionalFieldMapping": "example", "options": [ "example" ], "id": 1, "value": "example" } ], "bundleItems": [ { "bundleItemProductId": 1, "quantity": 1 } ], "replaceAllExistingImages": true, "images": [ { "slot": 1, "imageLink": "example", "imageFile": "example" } ], "additionalEans": [ { "id": "example", "ean": "example", "quantity": 1, "description": "example" } ], "translations": { "additionalProperty": { "name": "example", "descriptionComplexFields": [ { "name": "example", "description": "example" } ], "productProperties": [ { "name": "example", "value": "example" } ] } } } ]}object
products
Array<object>
object
id
integer format: int64
externalId
string
name
string
catalogId
integer format: int64
sku
string
ean
string
manufacturerId
object
id
integer format: int64
name
string
weight
number format: double
height
number format: double
width
number format: double
length
number format: double
vat
number format: double
categoryId
object
id
integer format: int64
name
string
parentId
integer format: int64
parentId
integer format: int64
isBundle
boolean
stocks
Array<object>
object
warehouseId
integer format: int64
quantity
integer format: int32
locationName
string
vatAmount
number format: double
vatSymbol
string
productPriceGroups
Array<object>
object
priceGroupId
integer format: int64
price
number format: double
isAsteriskMarked
boolean
properties
Array<object>
object
name
string
value
string
overwriteProductLinks
boolean
productLinks
Array<object>
object
externalProductId
string
externalVariantId
string
externalConnectionId
string
connectionId
integer format: int64
complexFields
Array<object>
object
name
string
description
string
caption
string
type
string
additionalFieldMapping
string
options
Array<string>
id
integer format: int64
value
string
bundleItems
Array<object>
object
bundleItemProductId
integer format: int64
quantity
integer format: int32
replaceAllExistingImages
boolean
images
Array<object>
object
slot
integer format: int32
imageLink
string
imageFile
string
additionalEans
Array<object>
object
id
string
ean
string
quantity
integer format: int32
description
string
translations
object
key
additional properties
object
name
string
descriptionComplexFields
Array<object>
object
name
string
description
string
productProperties
Array<object>
object
name
string
value
string
Examplegenerated
{ "products": [ { "id": 1, "externalId": "example", "name": "example", "catalogId": 1, "sku": "example", "ean": "example", "manufacturerId": { "id": 1, "name": "example" }, "weight": 1, "height": 1, "width": 1, "length": 1, "vat": 1, "categoryId": { "id": 1, "name": "example", "parentId": 1 }, "parentId": 1, "isBundle": true, "stocks": [ { "warehouseId": 1, "quantity": 1, "locationName": "example", "vatAmount": 1, "vatSymbol": "example" } ], "productPriceGroups": [ { "priceGroupId": 1, "price": 1 } ], "isAsteriskMarked": true, "properties": [ { "name": "example", "value": "example" } ], "overwriteProductLinks": true, "productLinks": [ { "externalProductId": "example", "externalVariantId": "example", "externalConnectionId": "example", "connectionId": 1 } ], "complexFields": [ { "name": "example", "description": "example", "caption": "example", "type": "example", "additionalFieldMapping": "example", "options": [ "example" ], "id": 1, "value": "example" } ], "bundleItems": [ { "bundleItemProductId": 1, "quantity": 1 } ], "replaceAllExistingImages": true, "images": [ { "slot": 1, "imageLink": "example", "imageFile": "example" } ], "additionalEans": [ { "id": "example", "ean": "example", "quantity": 1, "description": "example" } ], "translations": { "additionalProperty": { "name": "example", "descriptionComplexFields": [ { "name": "example", "description": "example" } ], "productProperties": [ { "name": "example", "value": "example" } ] } } } ]}object
products
Array<object>
object
id
integer format: int64
externalId
string
name
string
catalogId
integer format: int64
sku
string
ean
string
manufacturerId
object
id
integer format: int64
name
string
weight
number format: double
height
number format: double
width
number format: double
length
number format: double
vat
number format: double
categoryId
object
id
integer format: int64
name
string
parentId
integer format: int64
parentId
integer format: int64
isBundle
boolean
stocks
Array<object>
object
warehouseId
integer format: int64
quantity
integer format: int32
locationName
string
vatAmount
number format: double
vatSymbol
string
productPriceGroups
Array<object>
object
priceGroupId
integer format: int64
price
number format: double
isAsteriskMarked
boolean
properties
Array<object>
object
name
string
value
string
overwriteProductLinks
boolean
productLinks
Array<object>
object
externalProductId
string
externalVariantId
string
externalConnectionId
string
connectionId
integer format: int64
complexFields
Array<object>
object
name
string
description
string
caption
string
type
string
additionalFieldMapping
string
options
Array<string>
id
integer format: int64
value
string
bundleItems
Array<object>
object
bundleItemProductId
integer format: int64
quantity
integer format: int32
replaceAllExistingImages
boolean
images
Array<object>
object
slot
integer format: int32
imageLink
string
imageFile
string
additionalEans
Array<object>
object
id
string
ean
string
quantity
integer format: int32
description
string
translations
object
key
additional properties
object
name
string
descriptionComplexFields
Array<object>
object
name
string
description
string
productProperties
Array<object>
object
name
string
value
string
Examplegenerated
{ "products": [ { "id": 1, "externalId": "example", "name": "example", "catalogId": 1, "sku": "example", "ean": "example", "manufacturerId": { "id": 1, "name": "example" }, "weight": 1, "height": 1, "width": 1, "length": 1, "vat": 1, "categoryId": { "id": 1, "name": "example", "parentId": 1 }, "parentId": 1, "isBundle": true, "stocks": [ { "warehouseId": 1, "quantity": 1, "locationName": "example", "vatAmount": 1, "vatSymbol": "example" } ], "productPriceGroups": [ { "priceGroupId": 1, "price": 1 } ], "isAsteriskMarked": true, "properties": [ { "name": "example", "value": "example" } ], "overwriteProductLinks": true, "productLinks": [ { "externalProductId": "example", "externalVariantId": "example", "externalConnectionId": "example", "connectionId": 1 } ], "complexFields": [ { "name": "example", "description": "example", "caption": "example", "type": "example", "additionalFieldMapping": "example", "options": [ "example" ], "id": 1, "value": "example" } ], "bundleItems": [ { "bundleItemProductId": 1, "quantity": 1 } ], "replaceAllExistingImages": true, "images": [ { "slot": 1, "imageLink": "example", "imageFile": "example" } ], "additionalEans": [ { "id": "example", "ean": "example", "quantity": 1, "description": "example" } ], "translations": { "additionalProperty": { "name": "example", "descriptionComplexFields": [ { "name": "example", "description": "example" } ], "productProperties": [ { "name": "example", "value": "example" } ] } } } ]}Odpowiedzi
Dział zatytułowany „Odpowiedzi”Success
Array<object>
object
externalId
string
id
integer format: int64
Array<object>
object
externalId
string
id
integer format: int64
Examplegenerated
[ { "externalId": "example", "id": 1 }]Array<object>
object
externalId
string
id
integer format: int64
Examplegenerated
[ { "externalId": "example", "id": 1 }]Conflict
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
