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.

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.

<