Importing Inventories
Create and update InventoryEntries in your Project.
The Inventory data to import is represented by InventoryImport and included in an InventoryImportRequest, which is imported using Import Inventory.
Representations
InventoryImportRequest
The request body to import Inventories. Contains data for InventoryEntries to be created or updated in a commercetools Project.
type | "inventory" The Inventory import resource type. |
resources Array of InventoryImport | The inventory import resources of this request. MaxItems:20 |
{"type": "inventory","resources": [{"key": "inventory-import-key","sku": "product-variant-sku","quantityOnStock": 15,"restockableInDays": 2,"expectedDelivery": "2022-06-30T14:00:00.000Z","supplyChannel": {"typeId": "channel","key": "channel-key"},"custom": {"type": {"typeId": "type","key": "custom-field-key"},"fields": {"theNameofTheInventoryCustomField": {"type": "LocalizedString","value": {"en": "English text","de": "German text"}}}}}]}
InventoryImport
The data representation for an Inventory to be imported that is persisted as a Inventory in the Project.
key String | User-defined unique identifier. If an InventoryEntry with this 2 MaxLength: 256 Pattern: ^[A-Za-z0-9_-]+$ |
sku String | Maps to |
quantityOnStock Int | Maps to |
restockableInDays Int | Maps to |
expectedDelivery | Maps to |
supplyChannel | Maps to |
custom | Maps to |
Import Inventory
Creates a request for creating new Inventories or updating existing ones.
manage_products:{projectKey}
region String | The Region in which the Project is hosted. |
projectKey String | The Project key. |
importContainerKey String | The ImportContainer used to create the new resource |
application/json
application/json
curl https://import.{region}.commercetools.com/{projectKey}/inventories/import-containers/{importContainerKey} -i \--header "Authorization: Bearer ${BEARER_TOKEN}" \--header 'Content-Type: application/json' \--data-binary @- << DATA{"type" : "inventory","resources" : [ {"key" : "inventory-import-key","sku" : "product-variant-sku","quantityOnStock" : 15,"restockableInDays" : 2,"expectedDelivery" : "2022-06-30T14:00:00.000Z","supplyChannel" : {"typeId" : "channel","key" : "channel-key"},"custom" : {"type" : {"typeId" : "type","key" : "custom-field-key"},"fields" : {"theNameofTheInventoryCustomField" : {"type" : "LocalizedString","value" : {"en" : "English text","de" : "German text"}}}}} ]}DATA
{"operationStatus": [{"state": "processing","operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"}]}