Class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyOrdersPost

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

Creates an Order from a Cart in a BusinessUnit. The Cart must have a shipping address set before creating an Order. Creating an Order fails with an InvalidOperation if the Cart does not reference the same BusinessUnit as the businessUnitKey path parameter.

Specific Error Codes:

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


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