Class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost
- All Implemented Interfaces:
ErrorableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost>,ClientRequestCommand<Cart>,CreateHttpRequestCommand,HttpRequestCommand<Cart>,RequestCommand<Cart>
Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in Active CartState.
The new Cart does not contain Payments or Deliveries. The State of Line Items and Custom Line Items is reset to initial.
If the Cart exists in the Project but does not reference the requested BusinessUnit, this method returns an InvalidOperation error.
Specific Error Codes:
CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
.withProjectKey("{projectKey}")
.asAssociate()
.withAssociateIdValue("{associateId}")
.inBusinessUnitKeyWithBusinessUnitKeyValue("{businessUnitKey}")
.carts()
.replicate()
.post(null)
.execute()
-
Nested Class Summary
Nested classes/interfaces inherited from class io.vrap.rmf.base.client.ApiMethod
ApiMethod.ParamEntry<K,V> -
Constructor Summary
ConstructorsConstructorDescriptionByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost(ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost t) ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost(ApiHttpClient apiHttpClient, String projectKey, String associateId, String businessUnitKey, ReplicaCartDraft replicaCartDraft) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(ApiHttpClient client) executeBlocking(ApiHttpClient client, Duration timeout) getBody()inthashCode()intcom.fasterxml.jackson.core.type.TypeReference<Cart>voidsetAssociateId(String associateId) voidsetBusinessUnitKey(String businessUnitKey) voidsetProjectKey(String projectKey) toString()withBody(ReplicaCartDraft replicaCartDraft) Methods inherited from class io.vrap.rmf.base.client.ApiMethod
addHeader, addQueryParam, addQueryParams, contentType, createHttpRequest, execute, execute, execute, execute, execute, execute, execute, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, executeBlocking, getFirstQueryParam, getHeaders, getQueryParam, getQueryParams, getQueryParamUriString, getQueryParamUriStrings, send, sendBlocking, sendBlocking, with, with, withHeader, withHeaders, withHttpRequest, withoutHeader, withoutQueryParam, withQueryParam, withQueryParamsMethods inherited from interface io.vrap.rmf.base.client.ClientRequestCommand
executeBlockingMethods inherited from interface io.vrap.rmf.base.client.CreateHttpRequestCommand
createHttpRequestMethods inherited from interface com.commercetools.api.client.ErrorableTrait
asErrorableTrait, asErrorableTraitToBaseTypeMethods inherited from interface io.vrap.rmf.base.client.RequestCommand
executeBlocking
-
Constructor Details
-
ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost
public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost(ApiHttpClient apiHttpClient, String projectKey, String associateId, String businessUnitKey, ReplicaCartDraft replicaCartDraft) -
ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost
public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost(ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost t)
-
-
Method Details
-
resultType
- Specified by:
resultTypein interfaceHttpRequestCommand<Cart>
-
executeBlocking
- Specified by:
executeBlockingin interfaceClientRequestCommand<Cart>- Specified by:
executeBlockingin classApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost,Cart>
-
execute
- Specified by:
executein interfaceClientRequestCommand<Cart>- Specified by:
executein classApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost,Cart>
-
getProjectKey
-
getAssociateId
-
getBusinessUnitKey
-
setProjectKey
-
setAssociateId
-
setBusinessUnitKey
-
getBody
-
withBody
public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyCartsReplicatePost withBody(ReplicaCartDraft replicaCartDraft) -
equals
-
hashCode
public int hashCode() -
toString
-
reflectionHashCode
public int reflectionHashCode()
-