Associate Orders

This feature is part of Composable Commerce for B2B and will be subject to additional terms and pricing.

Associate Orders allow Associates to interact with Orders on behalf of a Business Unit.

Associates can view, create, and update Orders on behalf of a Business Unit. The actions a given Associate is allowed to perform depends on the specific roles and permissions they hold within the Business Unit.

Get Order in BusinessUnit

The Associate must have the ViewMyOrders or ViewOthersOrders Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.

Get Order in BusinessUnit by ID

GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/{id}

If the Order exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

id
String

id of the Order.

Query parameters:
expand
The parameter can be passed multiple times.
Response:
200Orderasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: Orderjson
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Get Order in BusinessUnit by OrderNumber

GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/order-number={orderNumber}

If the Order exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

orderNumber
String

orderNumber of the Order. Should be provided in URL-encoded format.

Query parameters:
expand
The parameter can be passed multiple times.
Response:
200Orderasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/order-number={orderNumber} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: Orderjson
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Query Orders in BusinessUnit

GET
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders
OAuth 2.0 Scopes:
view_orders:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

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:
200OrderPagedQueryResponseasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: OrderPagedQueryResponsejson
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}
]
}

Check if Order exists in BusinessUnit

Check if Order exists by ID

HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/{id}

Checks if an Order exists for a given id. Returns a 200 OK status if the Order exists or a 404 Not Found otherwise.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

id
String

id of the Order.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"

Check if Order exists by OrderNumber

HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/order-number={orderNumber}

Checks if an Order exists for a given orderNumber. Returns a 200 OK status if the Order exists or a 404 Not Found otherwise.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

orderNumber
String

orderNumber of the Order. Should be provided in URL-encoded format.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/order-number={orderNumber} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"

Check if Order exists by Query Predicate

HEAD
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders

Checks if an Order exists for a given Query Predicate. Returns a 200 OK status if any Orders match the Query Predicate or a 404 Not Found otherwise.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

Query parameters:
where
The parameter can be passed multiple times.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"

Create Order in BusinessUnit

The Associate must have the CreateMyOrders or CreateOthersOrders Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.

Create Order from Cart in BusinessUnit

POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders

Creates an Order from a Cart in a BusinessUnit. The Cart must have a shipping address set before creating an Order. Creating an Order fails with an InvalidOperation if the Cart does not reference the same BusinessUnit as the businessUnitKey path parameter.

Specific Error Codes:

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:OrderFromCartDraftasapplication/json
Response:
201Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"cart" : {
"id" : "7c2e2694-aefe-43d7-888e-6a99514caaca",
"typeId" : "cart"
},
"version" : 10
}
DATA
201 Response Example: Orderjson
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Create Order from Quote in BusinessUnit

POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/quotes

Creates an Order from a Quote in a BusinessUnit. Creating an Order fails with an InvalidOperation if the Quote does not reference the same BusinessUnit as the businessUnitKey path parameter.

Specific Error Codes:

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

Request Body:OrderFromQuoteDraftasapplication/json
Response:
201Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/quotes -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"quote" : {
"id" : "40d04a85-34d3-4769-a1b6-ecd00db2a587",
"typeId" : "quote"
},
"version" : 1
}
DATA
201 Response Example: Orderjson
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Update Order in BusinessUnit

The Associate must have the UpdateMyOrders or UpdateOthersOrders Permission. If a required Permission is missing, an AssociateMissingPermission error is returned.

Update Order in BusinessUnit by ID

POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/{id}

If the Order exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

id
String

id of the Order.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:
application/json
version
Int

Expected version of the Order on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned.

actions
Array of OrderUpdateAction

Update actions to be performed on the Order.

Response:
200Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeOrderState",
"orderState" : "Complete"
} ]
}
DATA
200 Response Example: Orderjson
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Update Order in BusinessUnit by OrderNumber

POST
https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/order-number={orderNumber}

If the Order exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

associateId
String

id of the Customer who is acting on behalf of the BusinessUnit.

businessUnitKey
String

key of the BusinessUnit.

orderNumber
String

orderNumber of the Order. Should be provided in URL-encoded format.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:
application/json
version
Int

Expected version of the Order on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned.

actions
Array of OrderUpdateAction

Update actions to be performed on the Order.

Response:
200Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders/order-number={orderNumber} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeOrderState",
"orderState" : "Complete"
} ]
}
DATA
200 Response Example: Orderjson
{
"type": "Order",
"id": "92f5a867-bf19-47ab-982c-6720a03a3921",
"version": 1,
"createdAt": "2017-01-04T19:54:49.797Z",
"lastModifiedAt": "2017-01-04T19:54:49.797Z",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"orderState": "Open",
"syncInfo": [],
"returnInfo": [],
"refusedGifts": [],
"taxMode": "External",
"inventoryMode": "None",
"taxRoundingMode": "HalfEven",
"customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9",
"businessUnit": {
"typeId": "business-unit",
"key": "ba-france-123"
},
"lineItems": [
{
"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9",
"productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094",
"name": {
"en": "MyProduct"
},
"productType": {
"typeId": "product-type",
"id": "a5c7e173-9754-4f02-9b18-a600896ae0e1",
"version": 21
},
"productSlug": {
"de": "neues-produkt-slug-1234678",
"en": "new-product-slug-12345678"
},
"variant": {
"id": 1,
"sku": "some-sku-123",
"prices": [
{
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"id": "6d36dc85-6131-495d-9f20-d00f411d4124"
}
],
"images": [],
"attributes": [
{
"name": "text",
"value": "attribute-value"
},
{
"name": "enum",
"value": {
"key": "test",
"label": "test"
}
}
],
"assets": []
},
"price": {
"id": "6d36dc85-6131-495d-9f20-d00f411d4124",
"value": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
}
},
"quantity": 1,
"discountedPricePerQuantity": [],
"taxRate": {
"name": "Bla",
"amount": 0.1,
"includedInPrice": false,
"country": "DE",
"subRates": []
},
"state": [
{
"quantity": 1,
"state": {
"typeId": "state",
"id": "7c2e2694-aefe-43d7-888e-6a99514caaca"
}
}
],
"priceMode": "Platform",
"lineItemMode": "Standard",
"totalPrice": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1000
},
"totalGross": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 1100
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 634,
"fractionDigits": 2
},
"name": "Bla"
}
]
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}