Class ByProjectKeyCartsPostString

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

Creates a Cart in the Project.

If the referenced ShippingMethod in the CartDraft has a predicate that does not match, or if the Shipping Method is not active, an InvalidOperation error is returned.

When using InventoryMode ReserveOnCart:

  • If only some Line Items can be reserved, the Cart creation succeeds, however, the items that could not be reserved are removed and reservation warnings are returned in the response.
  • If none of the Line Items can be reserved, the Cart creation fails with an InvalidOperation error.

Specific Error Codes:



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