My Orders

The My Orders endpoint creates and provides access to orders scoped to a specific user. The endpoint requires an access token from the password flow or anonymous session flow.

The My Orders endpoint intentionally provides no write access to the fields on an Order. This provides extra security in scenarios when the client application must communicate directly with the commercetools API on behalf of a customer, such as commerce in a mobile application.

Representations

Responses are equal to the responses on the order endpoint, but requests differ. Orders can not be changed via this endpoint once created, and paymentState and orderNumber can not be set.

MyOrderFromCartDraft

  • id - String - Required
    The unique ID of the cart from which an order is created.
  • version - Number - Required

Get Order by ID

Endpoint: /{projectKey}/me/orders/{id}
Method: GET
OAuth2 Scopes: manage_my_orders:{projectKey}
Response Representation: Order

Query Orders

Endpoint: /{projectKey}/me/orders
Method: GET
OAuth2 Scopes: manage_my_orders:{projectKey}
Response Representation: PagedQueryResult with the results array of Order
Query Parameters:

Create Order from a Cart

Creates an order from a Cart. The cart must have a shipping address set which is used for the tax calculation.

The cart data is copied to the created order.

Endpoint: /{projectKey}/me/orders
Method: POST
OAuth2 Scopes: manage_my_orders:{projectKey}
Request Representation: MyOrderFromCartDraft
Response Representation: Order

Specific Error Codes:

This method produces the OrderCreated message.