Importing Order Patches
The Order Patch endpoint can be used to import updates to ReturnInfo, Parcel, and Delivery of an existing Order. The Order update data is represented by OrderPatchImport and loaded in an OrderPatchImportRequest, which is posted to import OrderPatches.
To monitor an import status, use Get ImportSummary, Get ImportOperation, and Query ImportOperations.
Representations
OrderPatchImportRequest
The request body to import OrderPatches. The data to be imported are represented by OrderPatchImport.
type String | "order-patch" The order patch import resource type. |
patches Array of OrderPatchImport | The order patches of this request MaxItems:20 |
{"type" : "order-patch","patches" : [ {"orderNumber" : "12345","fields" : {"addReturnInfo" : {"items" : [ {"quantity" : 1,"lineItemId" : "1","comment" : "any comment","shipmentState" : "Advised"} ],"returnTrackingId" : "returnTrackingId-example","returnDate" : "2021-04-30T09:21:15.003Z"},"addDeliveries" : [ {"items" : [ {"id" : "4ce24c27-cce5-447c-890e-0d6b70b690be","quantity" : 5} ],"parcels" : [ {"measurements" : {"heightInMillimeter" : 20,"lengthInMillimeter" : 40,"widthInMillimeter" : 5,"weightInGram" : 10}} ]} ],"removeDelivery" : {"id" : "95a6e7a7-b74e-4397-b0b4-37473d2e3573"},"removeParcelFromDelivery" : {"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76"},"addParcelToDelivery" : {"deliveryId" : "95a6e7a7-b74e-4397-b0b4-37473d2e3573","measurements" : {"heightInMillimeter" : 20,"lengthInMillimeter" : 40,"widthInMillimeter" : 5,"weightInGram" : 10}},"setParcelMeasurements" : {"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76","measurements" : {"heightInMillimeter" : 20,"lengthInMillimeter" : 40,"widthInMillimeter" : 5,"weightInGram" : 10}},"setParcelTrackingData" : {"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76","trackingData" : {"carrier" : "carrier data"}},"setParcelItems" : [ {"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76","items" : [ {"id" : "4ce24c27-cce5-447c-890e-0d6b70b690be","quantity" : 5} ]} ]}} ]}
OrderPatchImport
orderNumber String | Maps to |
fields | Each field referenced must be defined in an already existing order in the commercetools project or the import operation state is set to |
OrderField
Order fields that needs to be added or updated.
addReturnInfo | Maps to |
addParcelToDelivery | Maps to |
addDeliveries Array of DeliveryDraft | Maps to |
removeDelivery | Maps to |
removeParcelFromDelivery | Maps to |
setDeliveryAddress | Maps to |
setParcelMeasurements | Maps to |
setParcelTrackingData | Maps to |
setParcelItems Array of ParcelItems | Maps to |
ReturnInfo
items Array of ReturnItemDraft | |
returnTrackingId String | Maps to |
returnDate | Maps to |
ReturnItemDraft
quantity Float | |
lineItemId String | |
customLineItemId String | |
comment String | |
shipmentState | Maps to |
ReturnShipmentState
Maps to ReturnItem.shipmentState
Advised
Returned
BackInStock
Unusable
DeliveryParcel
deliveryId String | |
measurements | |
trackingData | |
items Array of DeliveryItem |
DeliveryItem
id String | |
quantity Float |
DeliveryDraft
items Array of DeliveryItem | |
address | |
parcels Array of DeliveryParcelDraft |
DeliveryParcelDraft
measurements | |
trackingData | |
items Array of DeliveryItem |
DeliveryAddressDraft
deliveryId String | |
address |
ParcelMeasurement
heightInMillimeter Float | |
lengthInMillimeter Float | |
widthInMillimeter Float | |
weightInGram Float |
ParcelMeasurementDraft
parcelId String | |
measurements |
ParcelTrackingData
parcelId String | |
trackingData |
TrackingData
trackingId String | |
carrier String | |
provider String | |
providerTransaction String | |
isReturn Boolean |
ParcelItems
parcelId String | |
items Array of DeliveryItem |
RemoveDeliveryDraft
id String |
RemoveParcelFromDeliveryDraft
parcelId String |
Import OrderPatches
Creates a new import request for order patches
manage_orders:{projectKey}
region String | The Region in which the Project is hosted. |
projectKey String | The commercetools Project key. |
importContainerKey String | The ImportContainer used to create the resource |