Class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsPost

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

Creates a Cart in the BusinessUnit referenced by businessUnitKey. As such, the businessUnit field on CartDraft is ignored for this request. Creating a Cart can fail with an InvalidOperation if the referenced ShippingMethod in the CartDraft has a predicate that does not match the Cart.

Specific Error Codes:

  • DiscountCodeNonApplicable
  • InvalidItemShippingDetails
  • MatchingPriceNotFound
  • MissingTaxRateForCountry


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