Class ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost

All Implemented Interfaces:
ConflictingTrait<ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost>, Deprecatable201Trait<ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost>, ErrorableTrait<ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost>, ExpandableTrait<ByProjectKeyInStoreKeyByStoreKeyMeOrdersPost>, ClientRequestCommand<Order>, CreateHttpRequestCommand, HttpRequestCommand<Order>, RequestCommand<Order>

Creates an Order in a Store from a Cart for the Customer or anonymous user. The customerId or anonymousId field on the Order is automatically set based on the customer:{id} or anonymous_id:{id} scope.

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

If the Cart's customerId does not match the customer:{id} scope, or the anonymousId does not match the anonymous_id:{id} scope, a ResourceNotFound error is returned.

Creating an Order produces the OrderCreated Message.

Specific Error Codes:

  • AssociateMissingPermission
  • CountryNotConfiguredInStore
  • DiscountCodeNonApplicable
  • InvalidItemShippingDetails
  • MatchingPriceNotFound
  • MissingTaxRateForCountry
  • OutOfStock
  • PriceChanged
  • ShippingMethodDoesNotMatchCart


   CompletableFuture<ApiHttpResponse<com.commercetools.api.models.order.Order>> result = apiRoot
            .withProjectKey("{projectKey}")
            .inStoreKeyWithStoreKeyValue("{storeKey}")
            .me()
            .orders()
            .post(null)
            .execute()