Class ByProjectKeyInStoreKeyByStoreKeyMeCartsPostString

All Implemented Interfaces:
Deprecatable201Trait<ByProjectKeyInStoreKeyByStoreKeyMeCartsPostString>, ErrorableTrait<ByProjectKeyInStoreKeyByStoreKeyMeCartsPostString>, ExpandableTrait<ByProjectKeyInStoreKeyByStoreKeyMeCartsPostString>, ClientRequestCommand<Cart>, CreateHttpRequestCommand, HttpRequestCommand<Cart>, RequestCommand<Cart>

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

The store field in the created Cart is set to the Store specified by the storeKey path parameter.

Specific Error Codes:

  • CountryNotConfiguredInStore
  • DiscountCodeNonApplicable
  • InvalidItemShippingDetails
  • MatchingPriceNotFound
  • MissingTaxRateForCountry


   CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
            .withProjectKey("{projectKey}")
            .inStoreKeyWithStoreKeyValue("{storeKey}")
            .me()
            .carts()
            .post("")
            .execute()