This is the early access documentation preview for Custom Views. This documentation might not be in sync with our official documentation.

My Orders

The My Orders API creates and provides access to Orders scoped to a specific Customer. The endpoints require an access token from the password flow or anonymous session flow.

The My Orders API intentionally provides no write access on an Order. This provides extra security in scenarios when a mobile or browser application communicates directly with the Composable Commerce API on behalf of a customer. For example, the mobile application cannot set the order number. If you need to modify a protected field available on the full Order resource, do it from a trusted, server-side application. Use an API Extension to make the modification during the API call.

Orders cannot be changed via this API once created, and paymentState and orderNumber cannot be set.

Representations

Find below the representations for the request payloads that are specific for My Orders, the response representations are equal to the ones for the general Orders documented there.

MyOrderFromCartDraft

id
String

id of the Cart from which the Order is created.

version
Int

Current version of the Cart from which the Order is created.

MyOrderFromQuoteDraft BETA

id
String

id of the Quote from which the Order is created.

version
Int

Current version of the Quote from which the Order is created.

quoteStateToAccepted
Boolean

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

Default: false

Get Order

Get Order by ID

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

Region in which the Project is hosted.

projectKey
String

key of the Project.

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}/me/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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Get Order in Store

Get Order in Store by ID

GET
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/orders/{id}

If the Order exists in the Project but does not have the store field, or the store field references a different Store, this method returns a ResourceNotFound error.

OAuth 2.0 Scopes:
manage_my_orders:{projectKey} , manage_my_orders:{projectKey}:{storeKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

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}/in-store/key={storeKey}/me/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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Query Orders

GET
https://api.{region}.commercetools.com/{projectKey}/me/orders
OAuth 2.0 Scopes:
manage_my_orders:{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:
200OrderPagedQueryResponseasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/me/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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}
]
}

Query Orders in Store

GET
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/orders
OAuth 2.0 Scopes:
manage_my_orders:{projectKey} , manage_my_orders:{projectKey}:{storeKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

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:
200OrderPagedQueryResponseasapplication/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}
]
}

Check if Order exists

Check if Order exists by ID

HEAD
https://api.{region}.commercetools.com/{projectKey}/me/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:
manage_my_orders:{projectKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

id
String

id of the Order.

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

Check if Order exists in Store

HEAD
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/orders/{id}

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

OAuth 2.0 Scopes:
manage_my_orders:{projectKey} , manage_my_orders:{projectKey}:{storeKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

id
String

id of the Order.

Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/orders/{id} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Check if Order exists by Query Predicate

HEAD
https://api.{region}.commercetools.com/{projectKey}/me/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:
manage_my_orders:{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}/me/orders -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}'

Check if Order exists in Store by Query Predicate

HEAD
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/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:
manage_my_orders:{projectKey} , manage_my_orders:{projectKey}:{storeKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

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

Create Order

Create Order from Cart

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

The Cart must have a shipping address set for taxes to be calculated. When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyCarts Permission.

Creating an Order produces the OrderCreated Message.

Specific Error Codes:

OAuth 2.0 Scopes:
manage_my_orders:{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:MyOrderFromCartDraftasapplication/json
Response:
201Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/me/orders -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}' \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"id" : "7c2e2694-aefe-43d7-888e-6a99514caaca",
"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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Create Order from Quote BETA

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

When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyQuotes Permission.

Creating an Order produces the OrderCreated Message.

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.

Request Body:MyOrderFromQuoteDraftasapplication/json
Response:
201Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/me/orders/quotes -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}' \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"id" : "40d04a85-34d3-4769-a1b6-ecd00db2a587",
"version" : 1,
"quoteStateToAccepted" : true
}
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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}

Create Order in Store

Create Order in Store from Cart

POST
https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/orders

The Cart must have a shipping address set for taxes to be calculated. When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyCarts Permission.

Creating an Order produces the OrderCreated Message.

Specific Error Codes:

OAuth 2.0 Scopes:
manage_my_orders:{projectKey} , manage_my_orders:{projectKey}:{storeKey}
Path parameters:
region
String

Region in which the Project is hosted.

projectKey
String

key of the Project.

storeKey
String

key of the Store.

Query parameters:
expand
The parameter can be passed multiple times.
Request Body:MyOrderFromCartDraftasapplication/json
Response:
201Orderasapplication/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/me/orders -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}' \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"id" : "7c2e2694-aefe-43d7-888e-6a99514caaca",
"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
}
},
"perMethodTaxRate": [],
"taxedPricePortions": []
}
],
"customLineItems": [],
"discountCodes": [],
"origin": "Customer",
"shipping": [],
"shippingMode": "Single"
}