Class ByProjectKeyMeCartsPostString

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

Creates a Cart 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.

Specific Error Codes:

  • DiscountCodeNonApplicable
  • InvalidItemShippingDetails
  • MatchingPriceNotFound
  • MissingTaxRateForCountry


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