Order Edits

Order Edits allow you to make financial changes to the purchase agreement after the Order has been placed.

Order Edits are entities which can hold one or more proposed financial changes to an Order. Before being applied, the Order Edit can be previewed to understand how the changes will affect an Order.

If no financial aspect of an Order should be changed, you can directly update the Order using update actions and the Update Order endpoint.

If the Order contains no deliveries or payments, you can alternatively replicate the Order as a new Cart.

For more information, see Update an Order.

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: 2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$
resource

Reference to the Order updated with this edit.

stagedActions

Update actions applied to the Order referenced by resource.

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.

createdByBETA

IDs and references that created the OrderEdit.

lastModifiedAt

Date and time (UTC) the Order Edit was last updated.

lastModifiedByBETA

IDs and references that last modified the OrderEdit.

OrderEditDraft

key
String

User-defined unique identifier for the Order Edit.

MinLength: 2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$
resource

Reference to the Order updated with this edit.

stagedActions

Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

comment
String

User-defined description regarding the Order Edit.

dryRun
Boolean

Set to true if you want to peview the edited Order first without persisting it (dry run). A dry run allows checking for potential errors when trying to apply the stagedActions.

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
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 withTotal=false. When the results are filtered with a Query Predicate, total is subject to a limit.

results
Array of OrderEdit

OrderEdits matching the query.

OrderEditResult

Indicates the current state of an Order Edit. The result field cannot be queried when the state is PreviewSuccess or PreviewFailure as these results are dynamically generated.

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 stagedActions (incl. optional Order API Extensions) are applied.

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

GET
https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id}
OAuth 2.0 Scopes:
view_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the OrderEdit.

Query parameters:
expand
The parameter can be passed multiple times.
Response:
200OrderEditasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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

GET
https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key}
OAuth 2.0 Scopes:
view_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the OrderEdit.

Query parameters:
expand
The parameter can be passed multiple times.
Response:
200OrderEditasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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

GET
https://api.{region}.commercetools.com/{projectKey}/orders/edits
OAuth 2.0 Scopes:
view_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

Query parameters:
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
offset
Int

Number of elements skipped.

withTotal
Boolean

Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.

Default: true
Response:
200OrderEditPagedQueryResponseasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/edits -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: OrderEditPagedQueryResponsejson
{
"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

HEAD
https://api.{region}.commercetools.com/{projectKey}/orders/edits/{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.

OAuth 2.0 Scopes:
view_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the OrderEdit.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"

Check if OrderEdit exists by Key

HEAD
https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={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.

OAuth 2.0 Scopes:
view_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the OrderEdit.

Response:
200
Request Example:cURL
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

HEAD
https://api.{region}.commercetools.com/{projectKey}/orders/edits

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.

OAuth 2.0 Scopes:
view_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

Query parameters:
where
The parameter can be passed multiple times.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/orders/edits -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"

Create OrderEdit

POST
https://api.{region}.commercetools.com/{projectKey}/orders/edits

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.

You can only create an Order Edit if the InventoryMode of the Order and its LineItems is None.

OAuth 2.0 Scopes:
manage_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:OrderEditDraftasapplication/json
Response:
201OrderEditasapplication/json
Request Example:cURL
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
201 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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

The stagedActions field cannot be updated if the Order Edit result is OrderEdit Applied.

Update OrderEdit by ID

POST
https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id}
OAuth 2.0 Scopes:
manage_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the OrderEdit.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:
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

Update actions to be performed on the Order Edit.

dryRun
Boolean

If set to true, the Order Edit is applied on the Order without persisting it.

Response:
200OrderEditasapplication/json
Request Example:cURL
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
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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

POST
https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key}
OAuth 2.0 Scopes:
manage_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the OrderEdit.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:
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

Update actions to be performed on the Order Edit.

dryRun
Boolean

If set to true, the Order Edit is applied on the Order without persisting it.

Response:
200OrderEditasapplication/json
Request Example:cURL
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
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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.

Example: json
{
"action": "setKey",
"key": "keyString"
}

Set StagedActions

The stagedActions field cannot be updated if the Order Edit result is OrderEdit Applied.

action
String
"setStagedActions"
stagedActions

Value to replace the stagedActions of the Order Edit.

Example: json
{
"action": "setStagedActions",
"stagedActions": [
{
"action": "setCountry",
"country": "DE"
}
]
}

Add StagedAction

The stagedActions field cannot be updated if the Order Edit result is OrderEdit Applied.

action
String
"addStagedAction"
stagedAction

Order update action to append to the stagedActions array.

Example: json
{
"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.

Example: json
{
"action": "setComment",
"comment": "commentString"
}

Set Custom Type

action
String
"setCustomType"

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.

Example: json
{
"action": "setCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set CustomField

action
String
"setCustomField"
name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setCustomField",
"name": "exampleStringField",
"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.

Example: json
{
"action": "setOrderNumber",
"orderNumber": "orderNumberString"
}

Set Purchase Order Number

Produces the PurchaseOrderNumberSet Message.

action
String
"setPurchaseOrderNumber"
purchaseOrderNumber
String

Value to set.

Example: json
{
"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

id of an existing Customer. If empty, any existing value is removed.

Example: json
{
"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.

Example: json
{
"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 uses the Customer Group of the assigned Customer.

To reflect the new Customer Group, this update action can result in updates to the Cart. When this occurs, the following errors can be returned: MatchingPriceNotFound and MissingTaxRateForCountry.

action
String
"setCustomerGroup"

Value to set. If empty, any existing value is removed.

Example: json
{
"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 Line Item 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: 2MaxLength: 256Pattern: ^[a-zA-Z0-9_-]
productId
String

id of the published Product.

Either the productId and variantId, or sku must be provided.

variantId
Int

id of the ProductVariant in the Product. If not provided, the Master Variant is used.

Either the productId and variantId, or sku must be provided.

sku
String

SKU of the ProductVariant.

Either the productId and variantId, or sku must be provided.

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 ProductDistribution ChannelRoleEnum. If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

supplyChannel

Used to identify Inventory entries that must be reserved. The Channel must have the InventorySupply ChannelRoleEnum.

externalPrice

Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

externalTotalPrice

Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

externalTaxRate

Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode. If the Cart has Multiple ShippingMode, the Tax Rate is accepted but ignored.

inventoryMode

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

shippingDetails

Container for Line Item-specific addresses.

custom

Custom Fields for the Line Item.

Example: json
{
"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 Line Item price selection.

action
String
"removeLineItem"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

New value to set. If absent or 0, the Line Item is removed from the Cart.

Default: 0
externalPrice

Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

externalTotalPrice

Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

shippingDetailsToRemove

Container for Line Item-specific addresses to remove.

Example: json
{
"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: 2MaxLength: 256Pattern: ^[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 [a-zA-Z0-9_-]{2,256}.

Used to select a Tax Rate when a Cart has the Platform TaxMode. If TaxMode is Platform, this field must not be empty.

externalTaxRate

An external Tax Rate can be set if the Cart has the External TaxMode.

shippingDetails

Container for Custom Line Item-specific addresses.

Default: Standard
custom

Custom Fields for the Custom Line Item.

Example: json
{
"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

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

Example: json
{
"action": "removeCustomLineItem",
"customLineItemId": "{{customLineItemId}}"
}

Add Shopping List

Adds all LineItems of a ShoppingList to the Cart.

action
String
"addShoppingList"

Shopping List that contains the Line Items to be added.

distributionChannel

distributionChannel to set for all LineItems that are added to the Cart. The Channel must have the ProductDistribution ChannelRoleEnum.

supplyChannel

supplyChannel to set for all LineItems that are added to the Cart. The Channel must have the InventorySupply ChannelRoleEnum.

Example: json
{
"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.

Example: json
{
"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 to Platform or Disabled, 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's shippingAddress.
action
String
"changeTaxMode"
taxMode

The new TaxMode.

Example: json
{
"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.

Example: json
{
"action": "changeTaxRoundingMode",
"taxRoundingMode": "HalfUp"
}

Change TaxCalculationMode

Changing the tax calculation mode leads to recalculation of taxes.

action
String
"changeTaxCalculationMode"
taxCalculationMode

New value to set.

Example: json
{
"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

code of a DiscountCode.

Example: json
{
"action": "addDiscountCode",
"code": "discountCodeString"
}

Remove DiscountCode

action
String
"removeDiscountCode"
discountCode

Discount Code to remove from the Cart.

Example: json
{
"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
  • If set, all existing Direct Discounts are replaced. The discounts apply in the order they are added to the list.
  • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
Example: json
{
"action": "setDirectDiscounts",
"discounts": [
{
"value": {
"type": "relative",
"permyriad": 1000
},
"target": {
"type": "lineItems",
"predicate": "1=1"
}
}
]
}

Add Payment

action
String
"addPayment"

Payment to add to the PaymentInfo. Must not be assigned to another Order or active Cart already.

Example: json
{
"action": "addPayment",
"payment": {
"typeId": "payment",
"id": "{{payment-id}}"
}
}

Remove Payment

action
String
"removePayment"

Payment to remove from the PaymentInfo.

Example: json
{
"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.

Example: json
{
"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.

Example: json
{
"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.

Example: json
{
"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 itemShippingAddresses. The new Address must have a key that is unique across this Order.

Example: json
{
"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

key of the Address to remove from itemShippingAddresses.

Example: json
{
"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 key as the Address it will replace.

Example: json
{
"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 shippingAddress.

Value to set.

externalTaxRate

An external Tax Rate can be set if the Cart has the External TaxMode.

Example: json
{
"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 shippingAddress.

shippingMethodName
String

Value to set.

shippingRate

Value to set.

Used to select a Tax Rate when the Order has the Platform TaxMode.

externalTaxRate

An external Tax Rate can be set if the Cart has the External TaxMode.

custom

Custom Fields for the custom Shipping Method.

Example: json
{
"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"

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 External TaxMode.

Example: json
{
"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.

Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

externalTaxRate

External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

custom

Custom Fields for the custom Shipping Method.

Example: json
{
"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 shippingRateInputType.type configured in the Project:

Example: json
{
"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

key of an existing Delivery.

shippingKey
String

key of the ShippingMethod, required for Multiple ShippingMode.

items
Array of DeliveryItem

Items to be included in the Delivery.

address

Address the parcels should be delivered to.

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.

Example: json
{
"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.

action
String
"removeDelivery"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

Example: json
{
"action": "removeDelivery",
"deliveryId": "{{deliveryId}}"
}

Change ShipmentState

Produces the Order Shipment State Changed Message.

action
String
"changeShipmentState"
shipmentState

New shipment status of the Order.

Example: json
{
"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.

Example: json
{
"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.

Example: json
{
"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

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

returnItemKey
String

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

shipmentState

New shipment state of the ReturnItem.

Example: json
{
"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

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

returnItemKey
String

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

paymentState

New Payment status of the ReturnItem.

Example: json
{
"action": "setReturnPaymentState",
"returnItemId": "{{returnItemId}}",
"paymentState": "Refunded"
}

Change OrderState

Produces the Order State Changed Message.

action
String
"changeOrderState"
orderState

New status of the Order.

Example: json
{
"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"

Value to set. If there is no State yet, the new State must be an initial State.

force
Boolean

Set to true to turn off validation.

Default: false
Example: json
{
"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.

The synchronization destination to set. Must not be empty. The referenced Channel must have the Channel Role OrderExport or OrderImport. Otherwise this update action returns an InvalidInput error.

syncedAt

If not set, it defaults to the current date and time.

Example: json
{
"action": "updateSyncInfo",
"channel": {
"typeId": "channel",
"id": "{{channel-id}}"
},
"externalId": "externalId"
}

Set Locale

action
String
"setLocale"
locale

Value to set. Must be one of the Project's languages. If empty, any existing value is removed.

Example: json
{
"action": "setLocale",
"locale": "de-DE"
}

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 store, the provided value must be included in the Store's countries. Otherwise a CountryNotConfiguredInStore error is returned.

Pattern: ^[A-Z]{2}$
Example: json
{
"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"

Value to set. If empty, any existing value will be removed.

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

Example: json
{
"action": "setStore",
"store": {
"key": "{{store-key}}",
"typeId": "store"
}
}

Set Custom Type

action
String
"setCustomType"

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.

Example: json
{
"action": "setCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set CustomField

action
String
"setCustomField"
name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setCustomField",
"name": "exampleStringField",
"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 Line Item price selection.

action
String
"changeLineItemQuantity"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

New value to set. If 0, the LineItem is removed from the Order.

externalPrice

Required when the Line Item uses ExternalPrice LineItemPriceMode. Sets the LineItem price to the given value when changing the quantity of a Line Item.

The LineItem price is updated as described in Line Item price selection.

externalTotalPrice

Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode. If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

Example: json
{
"action": "changeLineItemQuantity",
"lineItemId": "{{lineItemId}}",
"quantity": 2
}

Set LineItem TaxRate

Can be used if the Cart has the External TaxMode.

action
String
"setLineItemTaxRate"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

externalTaxRate

Value to set. If empty, any existing value will be removed.

shippingKey
String

key of the ShippingMethod used for this Line Item. This is required for Carts with Multiple ShippingMode.

Example: json
{
"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. This update action sets the taxedPrice and taxRate on a Line Item and must be used after any price-affecting change occurs.

action
String
"setLineItemTaxAmount"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

externalTaxAmount

Value to set. If empty, any existing value will be removed.

shippingKey
String

key of the ShippingMethod used for this Line Item. This is required for Carts with Multiple ShippingMode.

Example: json
{
"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

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

externalPrice

Value to set. If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

Example: json
{
"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

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

externalTotalPrice

Value to set. If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

Example: json
{
"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 Line Item price selection.

Produces the OrderLineItemDistributionChannelSet Message.

action
String
"setLineItemDistributionChannel"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

distributionChannel
  • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
  • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. The Channel must have the ProductDistribution ChannelRoleEnum.
Example: json
{
"action": "setLineItemDistributionChannel",
"lineItemId": "{{lineItemId}}",
"distributionChannel": {
"typeId": "channel",
"id": "{{channel-id}}"
}
}

Set LineItem ShippingDetails

action
String
"setLineItemShippingDetails"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

shippingDetails

Value to set. If empty, the existing value is removed.

Example: json
{
"action": "setLineItemShippingDetails",
"lineItemId": "{{lineItemId}}",
"shippingDetails": {
"targets": [
{
"addressKey": "addressKeyString",
"quantity": 2
}
]
}
}

Set LineItem Custom Type

action
String
"setLineItemCustomType"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

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.

Example: json
{
"action": "setLineItemCustomType",
"lineItemId": "{{lineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set LineItem CustomField

action
String
"setLineItemCustomField"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setLineItemCustomField",
"lineItemId": "{{lineItemId}}",
"name": "exampleStringField",
"value": "TextString"
}

Transition LineItem State

Produces the Line Item State Transition Message.

action
String
"transitionLineItemState"
lineItemId
String

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

quantity
Int

Number of Line Items that should transition State.

State the Line Item should transition from.

State the Line Item should transition to.

actualTransitionDate

Date and time (UTC) to perform the State transition.

Example: json
{
"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

id of the LineItem to update. Either lineItemId or lineItemKey is required.

lineItemKey
String

key of the LineItem to update. Either lineItemId or lineItemKey is required.

state
Array of ItemState

New status of the Line Items.

Example: json
{
"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

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

quantity
Int

New value to set. If 0, the Custom Line Item is removed from the Order.

Example: json
{
"action": "changeCustomLineItemQuantity",
"customLineItemId": "{{customLineItemId}}",
"quantity": 2
}

Set CustomLineItem TaxRate

Can be used if the Cart has the External TaxMode.

action
String
"setCustomLineItemTaxRate"
customLineItemId
String

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

externalTaxRate

Value to set. If empty, an existing value is removed.

shippingKey
String

key of the ShippingMethod used for this Custom Line Item. This is required for Carts with Multiple ShippingMode.

Example: json
{
"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

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

externalTaxAmount

Value to set. If empty, any existing value is removed.

shippingKey
String

key of the ShippingMethod used for this Custom Line Item. This is required for Carts with Multiple ShippingMode.

Example: json
{
"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

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

money

Value to set. Must not be empty. Can be a negative amount.

Example: json
{
"action": "changeCustomLineItemMoney",
"customLineItemId": "{{customLineItemId}}",
"money": {
"currencyCode": "EUR",
"centAmount": 4000
}
}

Set CustomLineItem ShippingDetails

action
String
"setCustomLineItemShippingDetails"
customLineItemId
String

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

shippingDetails

Value to set. If empty, any existing value is removed.

Example: json
{
"action": "setCustomLineItemShippingDetails",
"customLineItemId": "{{customLineItemId}}",
"shippingDetails": {
"targets": [
{
"addressKey": "addressKey",
"quantity": 1
}
]
}
}

Set CustomLineItem Custom Type

action
String
"setCustomLineItemCustomType"
customLineItemId
String

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

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.

Example: json
{
"action": "setCustomLineItemCustomType",
"customLineItemId": "{{customLineItemId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set CustomLineItem CustomField

action
String
"setCustomLineItemCustomField"
customLineItemId
String

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setCustomLineItemCustomField",
"customLineItemId": "{{customLineItemId}}",
"name": "exampleStringField",
"value": "TextString"
}

Transition CustomLineItem State

Produces the Custom Line Item State Transition Message.

action
String
"transitionCustomLineItemState"
customLineItemId
String

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

quantity
Int

Number of Custom Line Items that should transition State.

State the Custom Line Item should transition from.

State the Custom Line Item should transition to.

actualTransitionDate

Date and time (UTC) to perform the State transition.

Example: json
{
"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

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

customLineItemKey
String

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

state
Array of ItemState

New status of the Custom Line Items.

Example: json
{
"action": "importCustomLineItemState",
"customLineItemId": "{{customLineItemId}}",
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "{{state-id}}"
}
}
]
}

on Billing Address

Set Billing Address Custom Type

action
String
"setBillingAddressCustomType"

Defines the Type that extends the billingAddress with Custom Fields. If absent, any existing Type and Custom Fields are removed from the billingAddress.

fields

Sets the Custom Fields fields for the billingAddress.

Example: json
{
"action": "setBillingAddressCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set Billing Address CustomField

action
String
"setBillingAddressCustomField"
name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setBillingAddressCustomField",
"name": "exampleStringField",
"value": "TextString"
}

on Shipping Address

Set Shipping Address Custom Type

action
String
"setShippingAddressCustomType"

Defines the Type that extends the shippingAddress with Custom Fields. If absent, any existing Type and Custom Fields are removed from the shippingAddress.

fields

Sets the Custom Fields fields for the shippingAddress.

Example: json
{
"action": "setShippingAddressCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set Shipping Address CustomField

action
String
"setShippingAddressCustomField"
name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setShippingAddressCustomField",
"name": "exampleStringField",
"value": "TextString"
}

on ItemShipping Address

Set ItemShipping Address Custom Type

action
String
"setItemShippingAddressCustomType"
addressKey
String

key of the Address in itemShippingAddresses.

Defines the Type that extends the itemShippingAddress with Custom Fields. If absent, any existing Type and Custom Fields are removed from the itemShippingAddress.

fields

Sets the Custom Fields fields for the itemShippingAddress.

Example: json
{
"action": "setItemShippingAddressCustomType",
"addressKey": "{{address-key}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set ItemShipping Address CustomField

action
String
"setItemShippingAddressCustomField"
addressKey
String

key of the Address in itemShippingAddresses.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setItemShippingAddressCustomField",
"addressKey": "{{address-key}}",
"name": "exampleStringField",
"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

key of the ShippingMethod to update. This is required for Orders with Multiple ShippingMode.

externalTaxAmount

Value to set. If empty, any existing value will be removed.

Example: json
{
"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

key of the ShippingMethod to update. This is required for Orders with Multiple ShippingMode.

externalTaxRate

Value to set. If empty, any existing value is removed.

Example: json
{
"action": "setShippingMethodTaxRate",
"shippingKey": "shipping-method-key",
"externalTaxRate": {
"name": "Name",
"amount": 0.19,
"country": "DE"
}
}

on Shipping

Set Shipping Custom Type

This action sets, overwrites, or removes any existing Custom Type and Custom Fields for the Order's shippingMethod or shipping.

action
String
"setShippingCustomType"
shippingKey
String

The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize on a Order with Multiple ShippingMode. Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Order.

Defines the Type that extends the specified ShippingMethod with Custom Fields. If absent, any existing Type and Custom Fields are removed from the ShippingMethod.

fields

Sets the Custom Fields fields for the shippingMethod.

Example: json
{
"action": "setShippingCustomType",
"shippingKey": "shipping-key-express",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set Shipping CustomField

action
String
"setShippingCustomField"
shippingKey
String

The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize on a Order with Multiple ShippingMode. Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Order.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setShippingCustomField",
"shippingKey": "shipping-key-express",
"name": "exampleStringField",
"value": "TextString"
}

on Delivery

Set Delivery Address

Produces the DeliveryAddressSet Message.

action
String
"setDeliveryAddress"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

address

Value to set. If empty, any existing value will be removed.

Example: json
{
"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

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

parcelKey
String

key of an existing Parcel.

measurements

Value to set.

trackingData

Value to set.

items
Array of DeliveryItem

Value to set.

custom

Custom Fields for the Parcel.

Example: json
{
"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.

action
String
"removeParcelFromDelivery"
parcelId
String

id of an existing Parcel.

Either parcelId or parcelKey must be provided.

parcelKey
String

key of an existing Parcel.

Either parcelId or parcelKey must be provided.

Example: json
{
"action": "removeParcelFromDelivery",
"parcelId": "{{parcelId}}"
}

Set Delivery Items

Produces the Delivery Items Updated Message.

action
String
"setDeliveryItems"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

items
Array of DeliveryItem

Value to set. If empty, any existing value is removed.

Example: json
{
"action": "setDeliveryItems",
"deliveryId": "{{deliveryId}}",
"items": [
{
"id": "{{itemId}}",
"quantity": 2
}
]
}

Set Delivery Custom Type

action
String
"setDeliveryCustomType"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

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.

Example: json
{
"action": "setDeliveryCustomType",
"deliveryId": "exampleDeliveryID",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set Delivery CustomField

action
String
"setDeliveryCustomField"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setDeliveryCustomField",
"deliveryId": "exampleDeliveryID",
"name": "exampleStringField",
"value": "TextString"
}

on Delivery Address

Set Delivery Address Custom Type

action
String
"setDeliveryAddressCustomType"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

Defines the Type that extends the Delivery address with Custom Fields. If absent, any existing Type and Custom Fields are removed from the Delivery address.

fields

Sets the Custom Fields fields for the Delivery address.

Example: json
{
"action": "setDeliveryAddressCustomType",
"deliveryId": "{{delivery-id}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set Delivery Address CustomField

action
String
"setDeliveryAddressCustomField"
deliveryId
String

id of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

deliveryKey
String

key of an existing Delivery.

Either deliveryId or deliveryKey must be provided.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setDeliveryAddressCustomField",
"deliveryId": "{{delivery-id}}",
"name": "exampleStringField",
"value": "TextString"
}

on Parcel

Set Parcel Measurements

Produces the ParcelMeasurementsUpdated Message.

action
String
"setParcelMeasurements"
parcelId
String

id of an existing Parcel.

Either parcelId or parcelKey must be provided.

parcelKey
String

key of an existing Parcel.

Either parcelId or parcelKey must be provided.

measurements

Value to set. If empty, any existing value will be removed.

Example: json
{
"action": "setParcelMeasurements",
"parcelId": "{{parcelId}}",
"measurements": {
"heightInMillimeter": 11,
"widthInMillimeter": 11
}
}

Set Parcel Tracking Data

Produces the ParcelTrackingDataUpdated Message.

action
String
"setParcelTrackingData"
parcelId
String

id of an existing Parcel.

Either parcelId or parcelKey must be provided.

parcelKey
String

key of an existing Parcel.

Either parcelId or parcelKey must be provided.

trackingData

Value to set. If empty, any existing value will be removed.

Example: json
{
"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

id of an existing Parcel.

Either parcelId or parcelKey must be provided.

parcelKey
String

key of an existing Parcel.

Either parcelId or parcelKey must be provided.

items
Array of DeliveryItem

Value to set. If empty, any existing value will be removed.

Example: json
{
"action": "setParcelItems",
"parcelId": "{{parcelId}}",
"items": [
{
"id": "{{lineItemId}}",
"quantity": 2
}
]
}

Set Parcel Custom Type

action
String
"setParcelCustomType"
parcelId
String

id of an existing Parcel.

Either parcelId or parcelKey must be provided.

parcelKey
String

key of an existing Parcel.

Either parcelId or parcelKey must be provided.

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.

Example: json
{
"action": "setParcelCustomType",
"parcelId": "exampleParcelID",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set Parcel CustomField

action
String
"setParcelCustomField"
parcelId
String

id of an existing Parcel.

Either parcelId or parcelKey must be provided.

parcelKey
String

key of an existing Parcel.

Either parcelId or parcelKey must be provided.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setParcelCustomField",
"parcelId": "exampleParcelID",
"name": "exampleStringField",
"value": "TextString"
}

on ReturnItem

Set ReturnItem Custom Type

action
String
"setReturnItemCustomType"
returnItemId
String

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

returnItemKey
String

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

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.

Example: json
{
"action": "setReturnItemCustomType",
"returnItemId": "examplereturnItemID",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}

Set ReturnItem CustomField

action
String
"setReturnItemCustomField"
returnItemId
String

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

returnItemKey
String

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

name
String

Name of the Custom Field.

value

If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Example: json
{
"action": "setReturnItemCustomField",
"returnItemId": "exampleReturnItemID",
"name": "exampleStringField",
"value": "TextString"
}

Apply OrderEdit

The stagedActions field cannot be updated if the Order Edit result is OrderEdit Applied.

POST
https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id}/apply

Applying an OrderEdit produces the OrderEditApplied Message.

OAuth 2.0 Scopes:
manage_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the OrderEdit.

Request Body:
application/json

If the editVersion and/or resourceVersion do not match the actual version, a ConcurrentModification error will be returned.

editVersion
Int

Current version of the OrderEdit to be applied.

resourceVersion
Int

Current version of the Order to which the OrderEdit is applied.

Response:
200OrderEditasapplication/json
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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.

DELETE
https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id}
OAuth 2.0 Scopes:
manage_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the OrderEdit.

Query parameters:
version
Int

Last seen version of the resource.

expand
The parameter can be passed multiple times.
Response:
200OrderEditasapplication/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/orders/edits/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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.

DELETE
https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key}
OAuth 2.0 Scopes:
manage_order_edits:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

key
String

key of the OrderEdit.

Query parameters:
version
Int

Last seen version of the resource.

expand
The parameter can be passed multiple times.
Response:
200OrderEditasapplication/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/orders/edits/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: OrderEditjson
{
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"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"
}