This is the early access documentation preview for Custom Views. This documentation might not be in sync with our official documentation.
Order Edits
OrderEdit are containers for financial changes after an Order has been placed.
If no financial aspect of an Order should be changed, use Update Order, which does not perform a recalculation. If no Deliveries or Payments occurred, you can alternatively replicate the Order as a new Cart. This tutorial shows how to perform edits on a placed Order based on an example.
A maximum of 100 000
OrderEdits can exist per Project. Learn more about this limit.
Representations
Representations are JSON objects submitted or received as payload to API requests or responses.
OrderEdit
id String | Unique identifier of the Order Edit. |
version Int | Current version of the Order Edit. |
key String | User-defined unique identifier of the Order Edit. MinLength:2 MaxLength: 256 Pattern: ^[A-Za-z0-9_-]+$ |
resource | Reference to the Order updated with this edit. |
stagedActions Array of StagedOrderUpdateAction | Update actions applied to the Order referenced by |
result | For applied edits, it's a summary of the changes on the Order. For unapplied edits, it's a preview of the changes. |
comment String | User-defined information regarding the Order Edit. |
custom | Custom Fields of the Order Edit. |
createdAt | Date and time (UTC) the Order Edit was initially created. |
createdBy BETA | Present on resources created after 1 February 2019 except for events not tracked. |
lastModifiedAt | Date and time (UTC) the Order Edit was last updated. |
lastModifiedBy BETA | Present on resources created after 1 February 2019 except for events not tracked. |
OrderEditDraft
key String | User-defined unique identifier for the Order Edit. MinLength:2 MaxLength: 256 Pattern: ^[A-Za-z0-9_-]+$ |
resource | Reference to the Order updated with this edit. |
stagedActions Array of StagedOrderUpdateAction | Update actions to apply to the Order referenced in |
comment String | User-defined description regarding the Order Edit. |
dryRun Boolean | Set to Order API Extensions, if any, are also called in dry runs. Default:false |
custom | Custom Fields for the Order Edit. |
OrderEditPagedQueryResponse
PagedQueryResult with results
containing an array of OrderEdit.
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
count Int | Actual number of results returned. |
total Int | Total number of results matching the query.
This number is an estimation that is not strongly consistent.
This field is returned by default.
For improved performance, calculating this field can be deactivated by using the query parameter |
results Array of OrderEdit | OrderEdits matching the query. |
OrderEditResult
Indicates in which of the following states an Order Edit is. Depending on this state, querying the content of an OrderEdit's result
field is possible or not.
OrderEdit NotProcessed
Indicates that the edit has not been applied or processed in any way.
type String | "NotProcessed" This field is queryable. |
OrderEdit PreviewSuccess
The data is not persisted but is dynamically pulled by dry-running the update actions from stagedActions
on the current version of the related Order, not from the Order version at the time the OrderEdit was created. Therefore, it cannot be queried.
type String | "PreviewSuccess" |
preview | A preview of the edited Order as it will be after all |
messagePayloads Array of MessagePayload | Messages that will be generated if the edit is applied. |
If Reference Expansion is used on the resource
field, a race condition can occur if the Order is updated after the preview is calculated but before resource
is expanded. In that case, the preview is based on an older version of the Order.
This rare case can be detected when the messagePayloads
contains an OrderEditApplied Message with a different Order version than the expanded Order in excerptBeforeEdit
.
OrderEdit PreviewFailure
Result of a failed application of stagedActions
to the Order. The data is calculated on the fly and is not queryable.
type String | "PreviewFailure" |
errors Array of ErrorObject | Errors returned. |
OrderEdit Applied
Result of a succesful application of stagedActions
to the Order.
type String | "Applied" This field is queryable. |
appliedAt | Date and time (UTC) the Order was edited. |
excerptBeforeEdit | Prices of the Order before the edit. |
excerptAfterEdit | Prices of the Order after the edit. |
OrderExcerpt
Excerpt of the Order extracting the total and the taxed price.
version Int | Current version of the Order. |
totalPrice | Total price of the Order. |
taxedPrice | Taxed price of the Order. |
OrderMessagePayload
An Order Message payload without the common Message fields apart from the Message type
.
Get OrderEdit
Get OrderEdit by ID
view_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Get OrderEdit by Key
view_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Query OrderEdits
view_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
where | The parameter can be passed multiple times. |
/^var[.][a-zA-Z0-9]+$/ Any string parameter matching this regular expression | Predicate parameter values. The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
withTotal Boolean | Controls the calculation of the total number of query results. Set to |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/edits -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"limit": 20,"offset": 0,"count": 1,"total": 1,"results": [{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"type": "NotProcessed"},"comment": "sample-comment"}]}
Check if OrderEdit exists
Check if OrderEdit exists by ID
Checks if an OrderEdit exists for a given id
. Returns a 200 OK
status if the OrderEdit exists or a 404 Not Found
otherwise.
view_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Check if OrderEdit exists by Key
Checks if an OrderEdit exists for a given key
. Returns a 200 OK
status if the OrderEdit exists or a 404 Not Found
otherwise.
view_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Check if OrderEdit exists by Query Predicate
Checks if an OrderEdit exists for a given Query Predicate. Returns a 200 OK
status if any OrderEdits match the Query Predicate or a 404 Not Found
otherwise.
view_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/orders/edits -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Create OrderEdit
As the Order Edit API does not support tracking or reserving of inventory, you can create an OrderEdit only if the InventoryMode of the Order and its LineItems is None
.
You can either create multiple Order Edits for an Order and apply them sequentially to an Order, or create multiple Order Edits parallelly (as alternatives to each other) and apply one of them to the Order.
manage_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/orders/edits -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"key" : "order-edit-key","resource" : {"typeId" : "order","id" : "ed454f4e-c43a-485f-a86f-046c691b1363"},"stagedActions" : [ {"action" : "setCustomerEmail","email" : "user@localhost"} ],"comment" : "sample-comment"}DATA
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Update OrderEdit
Update OrderEdit by ID
manage_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
expand | The parameter can be passed multiple times. |
application/json
version Int | Expected version of the Order Edit on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of OrderEditUpdateAction | Update actions to be performed on the Order Edit. |
dryRun Boolean | If set to |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 7,"actions" : [ {"action" : "setKey","key" : "another-key"}, {"action" : "addStagedAction","stagedAction" : {"action" : "setCountry","country" : "ES"}} ]}DATA
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Update OrderEdit by Key
manage_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
expand | The parameter can be passed multiple times. |
application/json
version Int | Expected version of the Order Edit on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of OrderEditUpdateAction | Update actions to be performed on the Order Edit. |
dryRun Boolean | If set to |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 7,"actions" : [ {"action" : "setKey","key" : "another-key"}, {"action" : "addStagedAction","stagedAction" : {"action" : "setCountry","country" : "ES"}} ]}DATA
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Update actions
Set Key
action String | "setKey" |
key String | Value to set. If empty, any existing value will be removed. |
{"action": "setKey","key": "keyString"}
Set StagedActions
If the edit is applied, stagedActions
cannot be updated.
action String | "setStagedActions" |
stagedActions Array of StagedOrderUpdateAction | Value to replace the |
{"action": "setStagedActions","stagedActions": [{"action": "setCountry","country": "DE"}]}
Add StagedAction
If the edit was applied, this cannot be updated.
action String | "addStagedAction" |
stagedAction | Order update action to append to the |
{"action": "addStagedAction","stagedAction": {"action": "setCountry","country": "DE"}}
Set Comment
action String | "setComment" |
comment String | Value to set. If empty, any existing value will be removed. |
{"action": "setComment","comment": "commentString"}
Set Custom Type
action String | "setCustomType" |
type | Defines the Type that extends the Order Edit with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Order Edit. |
fields | Sets the Custom Fields fields for the Order Edit. |
{"action": "setCustomType","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set CustomField
action String | "setCustomField" |
name String | Name of the Custom Field. |
value | If |
{"action": "setCustomField","name": "ExampleStringTypeField","value": "TextString"}
StagedOrderUpdateActions
The following update actions can be staged to an OrderEdit.
on Order
Set Order Number
action String | "setOrderNumber" |
orderNumber String | Value to set. Must be unique across a Project. Once set, the value cannot be changed. |
{"action": "setOrderNumber","orderNumber": "orderNumberString"}
Set Purchase Order Number
Produces the PurchaseOrderNumberSet Message.
action String | "setPurchaseOrderNumber" |
purchaseOrderNumber String | Value to set. |
{"action": "setPurchaseOrderNumber","purchaseOrderNumber": "purchaseOrderNumberString"}
Set Customer ID
Setting the Order's customerId
does not recalculate prices or discounts on the Order.
If the Customer belongs to a Customer Group, customerGroup
on the Order is updated automatically.
Produces the OrderCustomerSet Message.
action String | "setCustomerId" |
customerId String |
|
{"action": "setCustomerId","customerId": "{{customer-id}}"}
Set Customer Email
This action updates the customerEmail
on the Order, but it does not change the Customer email on the Cart the Order has been created from.
Produces the Order Customer Email Set Message.
action String | "setCustomerEmail" |
email String | Value to set. If empty, any existing value will be removed. |
{"action": "setCustomerEmail","email": "mail@email.com"}
Set Customer Group
This update action can only be used if a Customer is not assigned to a Cart. If a Customer is already assigned, the Cart has the same Customer Group as the assigned Customer.
Setting the Customer Group also updates the LineItem prices
according to the Customer Group.
action String | "setCustomerGroup" |
customerGroup | Value to set. If empty, any existing value is removed. |
{"action": "setCustomerGroup","customerGroup": {"typeId": "customer-group","id": "{{customer-group-id}}"}}
Add LineItem
If the Cart contains a LineItem for a Product Variant with the same LineItemMode, Custom Fields, supply and distribution channel, then only the quantity of the existing Line Item is increased.
If LineItem shippingDetails
is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up.
A new Line Item is added when the externalPrice
or externalTotalPrice
is set in this update action.
The LineItem price is set as described in LineItem Price selection.
If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.
If the Line Items do not have a Price according to the Product priceMode
value for a selected currency and/or country, Customer Group, or Channel, a MatchingPriceNotFound error is returned.
action String | "addLineItem" |
key String | User-defined unique identifier of the LineItem. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
productId String |
Either the |
variantId Int |
Either the |
sku String | SKU of the ProductVariant. Either the |
quantity Int | Quantity of the Product Variant to add to the Cart. Default:1 |
addedAt | Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time. Optional for backwards compatibility reasons. |
distributionChannel | Used to select a Product Price.
The Channel must have the |
supplyChannel | Used to identify Inventory entries that must be reserved.
The Channel must have the |
externalPrice | Sets the LineItem |
externalTotalPrice | Sets the LineItem |
externalTaxRate | External Tax Rate for the Line Item, if the Cart has the |
inventoryMode | Inventory mode specific to the Line Item only, and valid for the entire |
shippingDetails | Container for Line Item-specific addresses. |
custom | Custom Fields for the Line Item. |
{"action": "addLineItem","sku": "productSKU","quantity": 42,"supplyChannel": {"typeId": "channel","id": "{{channel-id}}"},"distributionChannel": {"typeId": "channel","id": "{{channel-id}}"},"externalTaxRate": {"name": "StandardExternalTaxRate","amount": 0.19,"country": "DE","state": "Berlin"},"shippingDetails": {"targets": [{"addressKey": "AddressKeyStringFromAddress","quantity": 2}]}}
Remove LineItem
The LineItem price is updated as described in LineItem Price selection.
action String | "removeLineItem" |
lineItemId String |
|
lineItemKey String |
|
quantity Int | New value to set.
If absent or 0 |
externalPrice | Sets the LineItem |
externalTotalPrice | Sets the LineItem |
shippingDetailsToRemove | Container for Line Item-specific addresses to remove. |
{"action": "removeLineItem","lineItemId": "{{lineItemId}}","quantity": 1}
Add CustomLineItem
If the Cart already contains a CustomLineItem with the same slug
, name
, money
, taxCategory
, state
,
and Custom Fields, then only the quantity of the existing Custom Line Item is increased.
If CustomLineItem shippingDetails
are set, they are merged with the targets
that already exist on the
ItemShippingDetails of the Custom Line Item.
In case of overlapping address keys the ItemShippingTarget quantity
is summed up.
If the Cart already contains a Custom Line Item with the same slug that is otherwise not identical, an InvalidOperation error is returned.
If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.
action String | "addCustomLineItem" |
key String | User-defined unique identifier of the Custom Line Item. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
money | Money value of the Custom Line Item. The value can be negative. |
name | Name of the Custom Line Item. |
quantity Int | Number of Custom Line Items to add to the Cart. Default:1 |
slug String | User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern |
taxCategory | |
externalTaxRate | An external Tax Rate can be set if the Cart has the |
shippingDetails | Container for Custom Line Item-specific addresses. |
priceMode |
Standard |
custom | Custom Fields for the Custom Line Item. |
{"action": "addCustomLineItem","name": {"en": "Name"},"quantity": 2,"money": {"currencyCode": "EUR","centAmount": 4000},"slug": "slugString","taxCategory": {"typeId": "tax-category","id": "{{tax-category-id}}"}}
Remove CustomLineItem
This update action does not support specifying a quantity, unlike the Remove LineItem update action.
If shippingDetails
must be partially removed, use the Change CustomLineItem Quantity update action.
action String | "removeCustomLineItem" |
customLineItemId String |
|
customLineItemKey String |
|
{"action": "removeCustomLineItem","customLineItemId": "{{customLineItemId}}"}
Add Shopping List
Adds all LineItems of a ShoppingList to the Cart.
action String | "addShoppingList" |
shoppingList | Shopping List that contains the Line Items to be added. |
distributionChannel |
|
supplyChannel |
|
{"action": "addShoppingList","shoppingList": {"typeId": "shopping-list","id": "{{shopping-list-id}}"}}
Set Order Total Tax
Updates the total tax amount of the Order if it has the ExternalAmount
TaxMode.
action String | "setOrderTotalTax" |
externalTotalGross | Total gross amount of the Order (totalNet + taxes). |
externalTaxPortions Array of TaxPortionDraft | Value to set. |
{"action": "setOrderTotalTax","externalTotalGross": {"currencyCode": "EUR","centAmount": 4000},"externalTaxPortions": [{"name": "Name","rate": 0.19,"amount": {"currencyCode": "EUR","centAmount": 4000}}]}
Change TaxMode
- When
External
TaxMode is changed toPlatform
orDisabled
, all previously set external Tax Rates are removed. - When set to
Platform
, Line Items, Custom Line Items, and Shipping Method require a Tax Category with a Tax Rate for the Cart'sshippingAddress
.
action String | "changeTaxMode" |
taxMode | The new TaxMode. |
{"action": "changeTaxMode","taxMode": "Platform"}
Change Tax RoundingMode
Changing the tax rounding mode leads to recalculation of taxes.
action String | "changeTaxRoundingMode" |
taxRoundingMode | New value to set. |
{"action": "changeTaxRoundingMode","taxRoundingMode": "HalfUp"}
Change TaxCalculationMode
Changing the tax calculation mode leads to recalculation of taxes.
action String | "changeTaxCalculationMode" |
taxCalculationMode | New value to set. |
{"action": "changeTaxCalculationMode","taxCalculationMode": "LineItemLevel"}
Add DiscountCode
Adds a DiscountCode to the Cart to activate the related Cart Discounts. Adding a Discount Code is only possible if no DirectDiscount has been applied to the Order.
The maximum number of Discount Codes in a Cart is restricted by a limit.
Specific Error Code: MatchingPriceNotFound
action String | "addDiscountCode" |
code String |
|
{"action": "addDiscountCode","code": "discountCodeString"}
Remove DiscountCode
action String | "removeDiscountCode" |
discountCode | Discount Code to remove from the Cart. |
{"action": "removeDiscountCode","discountCode": {"typeId": "discount-code","id": "{{discount-code-id}}"}}
Set DirectDiscounts
Adds a DirectDiscount, but only if no DiscountCode has been added to the Order. Either a Discount Code or a Direct Discount can exist on a Order at the same time.
action String | "setDirectDiscounts" |
discounts Array of DirectDiscountDraft |
|
{"action": "setDirectDiscounts","discounts": [{"value": {"type": "relative","permyriad": 1000},"target": {"type": "lineItems","predicate": "1=1"}}]}
Add Payment
action String | "addPayment" |
payment | Payment to add to the PaymentInfo. Must not be assigned to another Order or active Cart already. |
{"action": "addPayment","payment": {"typeId": "payment","id": "{{payment-id}}"}}
Remove Payment
action String | "removePayment" |
payment | Payment to remove from the PaymentInfo. |
{"action": "removePayment","payment": {"typeId": "payment","id": "{{payment-id}}"}}
Change PaymentState
Produces the Order Payment State Changed Message.
action String | "changePaymentState" |
paymentState | New payment status of the Order. |
{"action": "changePaymentState","paymentState": "Paid"}
Set Billing Address
This action updates the billingAddress
on the Order, but it does not change the billing address on the referenced Cart from which the Order is created.
Produces the Order Billing Address Set Message.
action String | "setBillingAddress" |
address | Value to set. If empty, any existing value is removed. |
{"action": "setBillingAddress","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"}}
Set Shipping Address
This action updates the shippingAddress
on the Order, but it does not change the shipping address on the referenced Cart from which the Order is created.
Also, it does not recalculate the Cart as taxes may not fit to the shipping address anymore.
Produces the Order Shipping Address Set Message.
action String | "setShippingAddress" |
address | Value to set. If empty, any existing value is removed. |
{"action": "setShippingAddress","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"}}
Add ItemShippingAddress
Adds an address to an Order when shipping to multiple addresses is desired.
action String | "addItemShippingAddress" |
address | Address to append to |
{"action": "addItemShippingAddress","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"}}
Remove ItemShippingAddress
An address can only be removed if it is not referenced in any ItemShippingTarget of the Cart.
action String | "removeItemShippingAddress" |
addressKey String |
|
{"action": "removeItemShippingAddress","addressKey": "addressKey"}
Update ItemShippingAddress
Updates an address in itemShippingAddresses
by keeping the Address key
.
action String | "updateItemShippingAddress" |
address | The new Address with the same |
{"action": "updateItemShippingAddress","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"}}
Set ShippingAddress and ShippingMethod
Sets the shipping address and Shipping Method together to prevent an inconsistent state.
action String | "setShippingAddressAndShippingMethod" |
address | Value to set for |
shippingMethod | Value to set. |
externalTaxRate | An external Tax Rate can be set if the Cart has the |
{"action": "setShippingAddressAndShippingMethod","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"},"shippingMethod": {"typeId": "shipping-method","id": "shippingMethodId"}}
Set ShippingAddress and Custom ShippingMethod
Sets the shipping address and a custom Shipping Method together to prevent an inconsistent state.
action String | "setShippingAddressAndCustomShippingMethod" |
address | Value to set for |
shippingMethodName String | Value to set. |
shippingRate | Value to set. |
taxCategory | Used to select a Tax Rate when the Order has the |
externalTaxRate | An external Tax Rate can be set if the Cart has the |
{"action": "setShippingAddressAndCustomShippingMethod","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"},"shippingMethodName": "shippingMethodName","shippingRate": {"price": {"currencyCode": "EUR","centAmount": 4000}},"taxCategory": {"typeId": "tax-category","id": "{{tax-category-id}}"}}
Set ShippingMethod
To set the Cart's Shipping Method, the Cart must have the Single
ShippingMode and a shippingAddress
.
action String | "setShippingMethod" |
shippingMethod | Value to set. If empty, any existing value will be removed. If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned. |
externalTaxRate | An external Tax Rate can be set if the Cart has the |
{"action": "setShippingMethod","shippingMethod": {"typeId": "shipping-method","id": "shippingMethodId"}}
Set Custom ShippingMethod
To set the Cart's custom Shipping Method (independent of the ShippingMethods managed through the Shipping Methods API) the Cart must have the Single
ShippingMode and a shippingAddress
.
To unset a custom Shipping Method on a Cart, use the Set ShippingMethod update action without the shippingMethod
field instead.
action String | "setCustomShippingMethod" |
shippingMethodName String | Name of the custom Shipping Method. |
shippingRate | Determines the shipping price. |
taxCategory | Tax Category used to determine the Tax Rate when the Cart has the |
externalTaxRate | External Tax Rate for the |
{"action": "setCustomShippingMethod","shippingMethodName": "shippingMethodName","shippingRate": {"price": {"currencyCode": "EUR","centAmount": 4000}},"taxCategory": {"typeId": "tax-category","id": "{{tax-category-id}}"},"externalTaxRate": {"name": "taxRateName","amount": 0.19,"country": "DE"}}
Set ShippingRateInput
Input used to select a ShippingRatePriceTier. If no matching tier can be found, or the input is not set, the default price for the shipping rate is used.
action String | "setShippingRateInput" |
shippingRateInput | The data type of this field depends on the
|
{"action": "setShippingRateInput","shippingRateInput": {"type": "Classification","key": "key"}}
Add Delivery
A Delivery can only be added to an Order if
its shippingInfo
(for shippingMode
= Single
), or its shipping
(for shippingMode
= Multiple
) exists.
Produces the Delivery Added Message.
action String | "addDelivery" |
deliveryKey String |
|
shippingKey String |
|
items Array of DeliveryItem | Items to be included in the Delivery. |
address | Address the |
parcels Array of ParcelDraft | Parcels of the Delivery. If provided, this update action also produces the Parcel Added To Delivery Message. |
custom | Custom Fields for the Delivery. |
{"action": "addDelivery","items": [{"id": "{{lineItemId}}","quantity": 2}],"parcels": [{"measurements": {"heightInMillimeter": 11,"lengthInMillimeter": 11},"trackingData": {"trackingId": "{{trackingId}}","carrier": "TNT","provider": "providerName","providerTransaction": "{{transactionId}}","isReturn": false},"items": {"id": "{{lineItemId}}","quantity": 2}}],"address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"}}
Remove Delivery
Produces the DeliveryRemoved Message.
Change ShipmentState
Produces the Order Shipment State Changed Message.
action String | "changeShipmentState" |
shipmentState | New shipment status of the Order. |
{"action": "changeShipmentState","shipmentState": "Shipped"}
Add ReturnInfo
Produces the Return Info Added Message.
action String | "addReturnInfo" |
returnTrackingId String | Value to set. |
items Array of ReturnItemDraft | Items to be returned. Must not be empty. MinItems:1 |
returnDate | Value to set. If not set, it defaults to the current date and time. |
{"action": "addReturnInfo","items": {"quantity": 1,"lineItemId": "{{lineItemId}}","shipmentState": "BackInStock"},"returnDate": "2018-10-12T14:00:00.000Z"}
Set ReturnInfo
Produces the Return Info Set Message.
action String | "setReturnInfo" |
items Array of ReturnInfoDraft | Value to set. If empty, any existing value will be removed. |
{"action": "setReturnInfo","items": [{"items": [{"quantity": 1,"lineItemId": "{{lineItemId}}","comment": "any comment","shipmentState": "Returned"}],"returnTrackingId": "returnTrackingId-example","returnDate": "2021-04-30T09:21:15.003Z"}]}
Set ReturnShipmentState
To set a ReturnShipmentState
, the Order returnInfo
must have at least one ReturnItem.
Produces the Order Return Shipment State Changed Message.
action String | "setReturnShipmentState" |
returnItemId String |
|
returnItemKey String |
|
shipmentState | New shipment state of the ReturnItem. |
{"action": "setReturnShipmentState","returnItemId": "{{returnItemId}}","shipmentState": "Returned"}
Set ReturnPaymentState
To set a ReturnPaymentState, the Order returnInfo
must have at least one ReturnItem.
action String | "setReturnPaymentState" |
returnItemId String |
|
returnItemKey String |
|
paymentState | New Payment status of the ReturnItem. |
{"action": "setReturnPaymentState","returnItemId": "{{returnItemId}}","paymentState": "Refunded"}
Change OrderState
Produces the Order State Changed Message.
action String | "changeOrderState" |
orderState | New status of the Order. |
{"action": "changeOrderState","orderState": "Open"}
Transition State
If the existing State has set transitions
, there must be a direct transition to the new State. If transitions
is not set, no validation is performed.
This update action produces the Order State Transition Message.
action String | "transitionState" |
state | Value to set. If there is no State yet, the new State must be an initial State. |
force Boolean | Set to false |
{"action": "transitionState","state": {"typeId": "state","id": "{{state-id}}"}}
Update SyncInfo
action String | "updateSyncInfo" |
externalId String | Set this to identify an external order instance, file, or other resource. |
channel | The synchronization destination to set. Must not be empty.
The referenced Channel must have the Channel Role |
syncedAt | If not set, it defaults to the current date and time. |
{"action": "updateSyncInfo","channel": {"typeId": "channel","id": "{{channel-id}}"},"externalId": "externalId"}
Set Locale
Set Country
Setting the country can lead to changes in the LineItem prices.
action String | "setCountry" |
country | Value to set. If empty, any existing value is removed. If the Cart is bound to a ^[A-Z]{2}$ |
{"action": "setCountry","country": "DE"}
Set Store
Sets the Store the Order is assigned to. It should be used to migrate Orders to a new Store. No validations are performed (such as that the Customer is allowed to create Orders in the Store).
Produces the Order Store Set Message.
Returns a 400
error if store
references the same Store the Order is currently assigned to, including if you try to remove the value when no Store is currently assigned.
action String | "setStore" |
store | Value to set. If empty, any existing value will be removed. If |
{"action": "setStore","store": {"key": "{{store-key}}","typeId": "store"}}
Set Custom Type
action String | "setCustomType" |
type | Defines the Type that extends the Order Edit with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Order Edit. |
fields | Sets the Custom Fields fields for the Order Edit. |
{"action": "setCustomType","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set CustomField
action String | "setCustomField" |
name String | Name of the Custom Field. |
value | If |
{"action": "setCustomField","name": "ExampleStringTypeField","value": "TextString"}
on Line Item
Change LineItem Quantity
When multiple shipping addresses are set for a Line Item, use the Remove LineItem and Add LineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the Line Item quantity should be distributed over the sub-quantities, the shippingDetails
field is kept in its current state to avoid data loss.
To change the Line Item quantity and shipping details together, use this update action in combination with the Set LineItem ShippingDetails update action in a single Order update command.
The LineItem price is updated as described in LineItem Price selection.
action String | "changeLineItemQuantity" |
lineItemId String |
|
lineItemKey String |
|
quantity Int | New value to set.
If |
externalPrice | Sets the LineItem The LineItem price is updated as described in LineItem Price selection. |
externalTotalPrice | Sets the LineItem |
{"action": "changeLineItemQuantity","lineItemId": "{{lineItemId}}","quantity": 2}
Set LineItem TaxRate
Can be used if the Cart has the External
TaxMode.
action String | "setLineItemTaxRate" |
lineItemId String |
|
lineItemKey String |
|
externalTaxRate | Value to set. If empty, any existing value will be removed. |
shippingKey String |
|
{"action": "setLineItemTaxRate","lineItemId": "{{lineItemId}}","externalTaxRate": {"name": "Name","amount": 0.19,"country": "DE"}}
Set LineItem TaxAmount
Can be used if the Cart has the ExternalAmount
TaxMode.
action String | "setLineItemTaxAmount" |
lineItemId String |
|
lineItemKey String |
|
externalTaxAmount | Value to set. If empty, any existing value will be removed. |
shippingKey String |
|
{"action": "setLineItemTaxAmount","lineItemId": "{{lineItemId}}","externalTaxAmount": {"totalGross": {"currencyCode": "EUR","centAmount": 4000},"taxRate": {"name": "Name","amount": 0.19,"country": "DE"}}}
Set LineItem Price
Sets the LineItem price
and changes the priceMode
to ExternalPrice
LineItemPriceMode.
action String | "setLineItemPrice" |
lineItemId String |
|
lineItemKey String |
|
externalPrice | Value to set.
If |
{"action": "setLineItemPrice","lineItemId": "{{lineItemId}}","externalPrice": {"currencyCode": "EUR","centAmount": 4000}}
Set LineItem TotalPrice
Sets the LineItem totalPrice
and price
, and changes the priceMode
to ExternalTotal
LineItemPriceMode.
action String | "setLineItemTotalPrice" |
lineItemId String |
|
lineItemKey String |
|
externalTotalPrice | Value to set.
If |
{"action": "setLineItemTotalPrice","lineItemId": "{{lineItemId}}","externalTotalPrice": {"price": {"currencyCode": "EUR","centAmount": 4000},"totalPrice": {"currencyCode": "EUR","centAmount": 4000}}}
Set LineItem DistributionChannel
Setting a distribution channel for a LineItem can lead to an updated price
as described in LineItem Price selection.
Produces the OrderLineItemDistributionChannelSet Message.
action String | "setLineItemDistributionChannel" |
lineItemId String |
|
lineItemKey String |
|
distributionChannel |
|
{"action": "setLineItemDistributionChannel","lineItemId": "{{lineItemId}}","distributionChannel": {"typeId": "channel","id": "{{channel-id}}"}}
Set LineItem ShippingDetails
action String | "setLineItemShippingDetails" |
lineItemId String |
|
lineItemKey String |
|
shippingDetails | Value to set. If empty, the existing value is removed. |
{"action": "setLineItemShippingDetails","lineItemId": "{{lineItemId}}","shippingDetails": {"targets": [{"addressKey": "addressKeyString","quantity": 2}]}}
Set LineItem Custom Type
action String | "setLineItemCustomType" |
lineItemId String |
|
lineItemKey String |
|
type | Defines the Type that extends the Line Item with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Line Item. |
fields | Sets the Custom Fields fields for the Line Item. |
{"action": "setLineItemCustomType","lineItemId": "{{lineItemId}}","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set LineItem CustomField
action String | "setLineItemCustomField" |
lineItemId String |
|
lineItemKey String |
|
name String | Name of the Custom Field. |
value | If |
{"action": "setLineItemCustomField","lineItemId": "{{lineItemId}}","name": "ExampleStringTypeField","value": "TextString"}
Transition LineItem State
Produces the Line Item State Transition Message.
action String | "transitionLineItemState" |
lineItemId String |
|
lineItemKey String |
|
quantity Int | Number of Line Items that should transition State. |
fromState | State the Line Item should transition from. |
toState | State the Line Item should transition to. |
actualTransitionDate | Date and time (UTC) to perform the State transition. |
{"action": "transitionLineItemState","lineItemId": "{lineItemId}}","quantity": 2,"fromState": {"typeId": "state","id": "stateId"},"toState": {"typeId": "state","id": "stateId"}}
Import LineItem State
The import of States does not follow any predefined rules and should be only used if no transitions are defined.
The quantity
in the ItemStates must match the sum of all Line Item states' quantities.
action String | "importLineItemState" |
lineItemId String |
|
lineItemKey String |
|
state Array of ItemState | New status of the Line Items. |
{"action": "importLineItemState","lineItemId": "{{lineItemId}}","state": {"typeId": "state","id": "{{state-id}}"}}
on Custom Line Item
Change CustomLineItem Quantity
When multiple shipping addresses are set for a Custom Line Item, use the Add CustomLineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the Custom Line Item quantity should be distributed over the sub-quantities, the shippingDetails
field is kept in its current state to avoid data loss.
To change the Custom Line Item quantity and shipping details together, use this update action in combination with the Set CustomLineItem ShippingDetails update action in a single Order update command.
action String | "changeCustomLineItemQuantity" |
customLineItemId String |
|
customLineItemKey String |
|
quantity Int | New value to set.
If |
{"action": "changeCustomLineItemQuantity","customLineItemId": "{{customLineItemId}}","quantity": 2}
Set CustomLineItem TaxRate
Can be used if the Cart has the External
TaxMode.
action String | "setCustomLineItemTaxRate" |
customLineItemId String |
|
customLineItemKey String |
|
externalTaxRate | Value to set. If empty, an existing value is removed. |
shippingKey String |
|
{"action": "setCustomLineItemTaxRate","customLineItemId": "{{customLineItemId}}","externalTaxRate": {"name": "Name","amount": 0.19,"country": "DE"}}
Set CustomLineItem TaxAmount
Can be used if the Cart has the ExternalAmount
TaxMode.
action String | "setCustomLineItemTaxAmount" |
customLineItemId String |
|
customLineItemKey String |
|
externalTaxAmount | Value to set. If empty, any existing value is removed. |
shippingKey String |
|
{"action": "setCustomLineItemTaxAmount","customLineItemId": "{{customerLineItemId}}","externalTaxAmount": {"totalGross": {"currencyCode": "EUR","centAmount": 4000},"taxRate": {"name": "Name","country": "DE","amount": 0.19}}}
Change CustomLineItem Money
action String | "changeCustomLineItemMoney" |
customLineItemId String |
|
customLineItemKey String |
|
money | Value to set. Must not be empty. Can be a negative amount. |
{"action": "changeCustomLineItemMoney","customLineItemId": "{{customLineItemId}}","money": {"currencyCode": "EUR","centAmount": 4000}}
Set CustomLineItem ShippingDetails
action String | "setCustomLineItemShippingDetails" |
customLineItemId String |
|
customLineItemKey String |
|
shippingDetails | Value to set. If empty, any existing value is removed. |
{"action": "setCustomLineItemShippingDetails","customLineItemId": "{{customLineItemId}}","shippingDetails": {"targets": [{"addressKey": "addressKey","quantity": 1}]}}
Set CustomLineItem Custom Type
action String | "setCustomLineItemCustomType" |
customLineItemId String |
|
customLineItemKey String |
|
type | Defines the Type that extends the Custom Line Item with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Custom Line Item. |
fields | Sets the Custom Fields fields for the Custom Line Item. |
{"action": "setCustomLineItemCustomType","customLineItemId": "{{customLineItemId}}","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set CustomLineItem CustomField
action String | "setCustomLineItemCustomField" |
customLineItemId String |
|
customLineItemKey String |
|
name String | Name of the Custom Field. |
value | If |
{"action": "setCustomLineItemCustomField","customLineItemId": "{{customLineItemId}}","name": "ExampleStringTypeField","value": "TextString"}
Transition CustomLineItem State
Produces the Custom Line Item State Transition Message.
action String | "transitionCustomLineItemState" |
customLineItemId String |
|
customLineItemKey String |
|
quantity Int | Number of Custom Line Items that should transition State. |
fromState | State the Custom Line Item should transition from. |
toState | State the Custom Line Item should transition to. |
actualTransitionDate | Date and time (UTC) to perform the State transition. |
{"action": "transitionCustomLineItemState","customLineItemId": "{{customLineItemId}}","quantity": 2,"fromState": {"typeId": "state","id": "stateId"},"toState": {"typeId": "state","id": "stateId"}}
Import CustomLineItem State
The import of States does not follow any predefined rules and should be only used if no transitions are defined.
The quantity
of the ItemStates must match the sum of all Custom Line Item states' quantities.
action String | "importCustomLineItemState" |
customLineItemId String |
|
customLineItemKey String |
|
state Array of ItemState | New status of the Custom Line Items. |
{"action": "importCustomLineItemState","customLineItemId": "{{customLineItemId}}","state": [{"quantity": 1,"state": {"typeId": "state","id": "{{state-id}}"}}]}
on Billing Address
Set Billing Address Custom Type
action String | "setBillingAddressCustomType" |
type | Defines the Type that extends the |
fields | Sets the Custom Fields fields for the |
{"action": "setBillingAddressCustomType","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set Billing Address CustomField
action String | "setBillingAddressCustomField" |
name String | Name of the Custom Field. |
value | If |
{"action": "setBillingAddressCustomField","name": "ExampleStringTypeField","value": "TextString"}
on Shipping Address
Set Shipping Address Custom Type
action String | "setShippingAddressCustomType" |
type | Defines the Type that extends the |
fields | Sets the Custom Fields fields for the |
{"action": "setShippingAddressCustomType","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set Shipping Address CustomField
action String | "setShippingAddressCustomField" |
name String | Name of the Custom Field. |
value | If |
{"action": "setShippingAddressCustomField","name": "ExampleStringTypeField","value": "TextString"}
on ItemShipping Address
Set ItemShipping Address Custom Type
action String | "setItemShippingAddressCustomType" |
addressKey String |
|
type | Defines the Type that extends the |
fields | Sets the Custom Fields fields for the |
{"action": "setItemShippingAddressCustomType","addressKey": "{{address-key}}","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set ItemShipping Address CustomField
action String | "setItemShippingAddressCustomField" |
addressKey String |
|
name String | Name of the Custom Field. |
value | If |
{"action": "setItemShippingAddressCustomField","addressKey": "{{address-key}}","name": "ExampleStringTypeField","value": "TextString"}
on Shipping Method
Set ShippingMethod TaxAmount
A Shipping Method tax amount can be set if the Cart has the ExternalAmount
TaxMode.
action String | "setShippingMethodTaxAmount" |
shippingKey String |
|
externalTaxAmount | Value to set. If empty, any existing value will be removed. |
{"action": "setShippingMethodTaxAmount","shippingKey": "shipping-method-key","externalTaxAmount": {"totalGross": {"currencyCode": "EUR","centAmount": 4000},"taxRate": {"name": "Name","amount": 0.19,"country": "DE"}}}
Set ShippingMethod TaxRate
A Shipping Method Tax Rate can be set if the Cart has the External
TaxMode.
action String | "setShippingMethodTaxRate" |
shippingKey String |
|
externalTaxRate | Value to set. If empty, any existing value is removed. |
{"action": "setShippingMethodTaxRate","shippingKey": "shipping-method-key","externalTaxRate": {"name": "Name","amount": 0.19,"country": "DE"}}
on Delivery
Set Delivery Address
Produces the DeliveryAddressSet Message.
action String | "setDeliveryAddress" |
deliveryId String |
Either |
deliveryKey String |
Either |
address | Value to set. If empty, any existing value will be removed. |
{"action": "setDeliveryAddress","deliveryId": "{{deliveryId}}","address": {"key": "exampleKey","title": "My Address","salutation": "Mr.","firstName": "Example","lastName": "Person","streetName": "Example Street","streetNumber": "4711","additionalStreetInfo": "Backhouse","postalCode": "80933","city": "Exemplary City","region": "Exemplary Region","state": "Exemplary State","country": "DE","company": "My Company Name","department": "Sales","building": "Hightower 1","apartment": "247","pOBox": "2471","phone": "+49 89 12345678","mobile": "+49 171 2345678","email": "email@example.com","fax": "+49 89 12345679","additionalAddressInfo": "no additional Info","externalId": "Information not needed"}}
Add Parcel to Delivery
To add a Parcel, at least one Delivery must exist.
Produces the Parcel Added To Delivery Message.
action String | "addParcelToDelivery" |
deliveryId String |
Either |
deliveryKey String |
Either |
parcelKey String |
|
measurements | Value to set. |
trackingData | Value to set. |
items Array of DeliveryItem | Value to set. |
custom | Custom Fields for the Parcel. |
{"action": "addParcelToDelivery","deliveryId": "{{deliveryId}}","measurements": {"heightInMillimeter": 11,"lengthInMillimeter": 11},"trackingData": {"trackingId": "{{trackingId}}"},"items": {"id": "{{lineItemId}}","quantity": 2}}
Remove Parcel from Delivery
Produces the ParcelRemovedFromDelivery Message.
Set Delivery Items
Produces the Delivery Items Updated Message.
action String | "setDeliveryItems" |
deliveryId String |
Either |
deliveryKey String |
Either |
items Array of DeliveryItem | Value to set. If empty, any existing value is removed. |
{"action": "setDeliveryItems","deliveryId": "{{deliveryId}}","items": [{"id": "{{itemId}}","quantity": 2}]}
Set Delivery Custom Type
action String | "setDeliveryCustomType" |
deliveryId String |
Either |
deliveryKey String |
Either |
type | Defines the Type that extends the Delivery with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Delivery. |
fields | Sets the Custom Fields fields for the Delivery. |
{"action": "setDeliveryCustomType","deliveryId": "exampleDeliveryID","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set Delivery CustomField
action String | "setDeliveryCustomField" |
deliveryId String |
Either |
deliveryKey String |
Either |
name String | Name of the Custom Field. |
value | If |
{"action": "setDeliveryCustomField","deliveryId": "exampleDeliveryID","name": "ExampleStringTypeField","value": "TextString"}
on Delivery Address
Set Delivery Address Custom Type
action String | "setDeliveryAddressCustomType" |
deliveryId String |
Either |
deliveryKey String |
Either |
type | Defines the Type that extends the Delivery |
fields | Sets the Custom Fields fields for the Delivery |
{"action": "setDeliveryAddressCustomType","deliveryId": "{{delivery-id}}","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set Delivery Address CustomField
action String | "setDeliveryAddressCustomField" |
deliveryId String |
Either |
deliveryKey String |
Either |
name String | Name of the Custom Field. |
value | If |
{"action": "setDeliveryAddressCustomField","deliveryId": "{{delivery-id}}","name": "ExampleStringTypeField","value": "TextString"}
on Parcel
Set Parcel Measurements
Produces the ParcelMeasurementsUpdated Message.
action String | "setParcelMeasurements" |
parcelId String |
Either |
parcelKey String |
Either |
measurements | Value to set. If empty, any existing value will be removed. |
{"action": "setParcelMeasurements","parcelId": "{{parcelId}}","measurements": {"heightInMillimeter": 11,"widthInMillimeter": 11}}
Set Parcel Tracking Data
Produces the ParcelTrackingDataUpdated Message.
action String | "setParcelTrackingData" |
parcelId String |
Either |
parcelKey String |
Either |
trackingData | Value to set. If empty, any existing value will be removed. |
{"action": "setParcelTrackingData","parcelId": "{{parcelId))","trackingData": {"trackingId": "{{trackingId}}","carrier": "TNT","provider": "providerName","providerTransaction": "{{transactionId}}","isReturn": false}}
Set Parcel Items
Produces the ParcelItemsUpdated Message.
action String | "setParcelItems" |
parcelId String |
Either |
parcelKey String |
Either |
items Array of DeliveryItem | Value to set. If empty, any existing value will be removed. |
{"action": "setParcelItems","parcelId": "{{parcelId}}","items": [{"id": "{{lineItemId}}","quantity": 2}]}
Set Parcel Custom Type
action String | "setParcelCustomType" |
parcelId String |
Either |
parcelKey String |
Either |
type | Defines the Type that extends the Parcel with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Parcel. |
fields | Sets the Custom Fields fields for the Parcel. |
{"action": "setParcelCustomType","parcelId": "exampleParcelID","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set Parcel CustomField
action String | "setParcelCustomField" |
parcelId String |
Either |
parcelKey String |
Either |
name String | Name of the Custom Field. |
value | If |
{"action": "setParcelCustomField","parcelId": "exampleParcelID","name": "ExampleStringTypeField","value": "TextString"}
on ReturnItem
Set ReturnItem Custom Type
action String | "setReturnItemCustomType" |
returnItemId String |
|
returnItemKey String |
|
type | Defines the Type that extends the Return Item with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Return Item. |
fields | Sets the Custom Fields fields for the Return Item. |
{"action": "setReturnItemCustomType","returnItemId": "examplereturnItemID","type": {"id": "{{type-id}}","typeId": "type"},"fields": {"exampleStringTypeField": "TextString"}}
Set ReturnItem CustomField
action String | "setReturnItemCustomField" |
returnItemId String |
|
returnItemKey String |
|
name String | Name of the Custom Field. |
value | If |
{"action": "setReturnItemCustomField","returnItemId": "exampleReturnItemID","name": "ExampleStringTypeField","value": "TextString"}
Apply OrderEdit
stagedActions
cannot be updated if an Order Edit is applied.
Applying an OrderEdit produces the OrderEditApplied Message.
manage_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
application/json
If the editVersion
and/or resourceVersion
do not match the actual version, a ConcurrentModification error will be returned.
editVersion Int | Current |
resourceVersion Int | Current |
application/json
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Delete OrderEdit
Delete OrderEdit by ID
Deleting an OrderEdit does not affect the related Order.
manage_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
version Int | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id}?version={version} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}
Delete OrderEdit by Key
Deleting an Order Edit does not affect the related Order.
manage_order_edits:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
key String |
|
version Int | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key}?version={version} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"id": "df20c5ea-b114-4aab-b330-740b0e9f3099","version": 1,"resource": {"typeId": "order","id": "ed454f4e-c43a-485f-a86f-046c691b1363"},"key": "order-edit-key","createdAt": "2018-10-04T15:22:31.639Z","lastModifiedAt": "2018-10-04T15:22:31.639Z","stagedActions": [{"action": "setCustomerEmail","email": "user@localhost"}],"result": {"preview": {"type": "Order","id": "ed454f4e-c43a-485f-a86f-046c691b1363","version": 3,"customerId": "bf5d96ce-4704-45b2-8842-d409dd34cdfc","customerEmail": "user@localhost","createdAt": "2018-05-15T12:40:17.301Z","lastModifiedAt": "2018-05-15T12:40:17.301Z","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"country": "DE","orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"shippingInfo": {"shippingMethodName": "DHL","price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"shippingRate": {"price": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2},"tiers": []},"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"taxCategory": {"typeId": "tax-category","id": "fdeb9625-10f8-476c-a549-5d5c6d1bd412"},"deliveries": [],"shippingMethod": {"typeId": "shipping-method","id": "d18b3f77-92de-4893-b6e3-b5c9c8c1eb96"},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 479,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 570,"fractionDigits": 2}},"shippingMethodState": "MatchesCart"},"taxMode": "Platform","inventoryMode": "None","taxRoundingMode": "HalfEven","taxCalculationMode": "LineItemLevel","origin": "Customer","lineItems": [{"id": "31099128-dba8-40a7-bb6c-d12857149ff8","productId": "d6d0c517-572e-4d26-b80e-ffce825334a4","name": {"en": "GIRLS CREW"},"productType": {"typeId": "product-type","id": "6dc75271-b0e5-4ae9-9158-faa1fff65f7b","version": 2},"productSlug": {"en": "girls-crew1522841378290"},"variant": {"id": 1,"sku": "sku_GIRLS_CREW_variant1_1522841378290","prices": [{"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"}],"images": [{"url": "https://www.commercetools.com/cli/data/253234387_1.jpg","dimensions": {"w": 1400,"h": 1400}}],"attributes": [],"assets": []},"price": {"value": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"id": "b5595b13-bbb8-44ab-a2e2-89c18edf1b22"},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "19% MwSt","amount": 0.19,"includedInPrice": true,"country": "DE","id": "rrsT1Jbw","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "60a64e06-b4e8-4205-a0f3-94bc203e2d6d"}}],"priceMode": "Platform","totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 2857,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3400,"fractionDigits": 2}},"lineItemMode": "Standard","perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"transactionFee": true,"discountCodes": [],"cart": {"typeId": "cart","id": "6c97e772-9769-4419-8adc-501c7c5b6088"},"shippingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"billingAddress": {"id": "51RkSh-E","salutation": "Mr","firstName": "user","lastName": "lastname","streetName": "streetname","streetNumber": "2","postalCode": "101256","city": "Berlin","country": "DE","building": "34","pOBox": "12344","email": "user@example.com"},"itemShippingAddresses": [],"shipping": [],"shippingMode": "Single"},"messagePayloads": [{"email": "user@localhost","type": "OrderCustomerEmailSet"},{"edit": {"typeId": "order-edit","id": "df20c5ea-b114-4aab-b330-740b0e9f3099"},"result": {"type": "Applied","appliedAt": "2018-10-04T15:29:14.091Z","excerptBeforeEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 1},"excerptAfterEdit": {"totalPrice": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxedPrice": {"totalNet": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3336,"fractionDigits": 2},"totalGross": {"type": "centPrecision","currencyCode": "EUR","centAmount": 3970,"fractionDigits": 2},"taxPortions": [{"rate": 0.19,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "19% MwSt"}]},"version": 3}},"type": "OrderEditApplied"}],"type": "PreviewSuccess"},"comment": "sample-comment"}