Class ByProjectKeyCartsReplicatePost

java.lang.Object
io.vrap.rmf.base.client.ApiMethod<T,TResult>
io.vrap.rmf.base.client.BodyApiMethod<T,TResult,TBody>
io.vrap.rmf.base.client.TypeBodyApiMethod<ByProjectKeyCartsReplicatePost,Cart,ReplicaCartDraft>
com.commercetools.api.client.ByProjectKeyCartsReplicatePost
All Implemented Interfaces:
ErrorableTrait<ByProjectKeyCartsReplicatePost>, io.vrap.rmf.base.client.ClientRequestCommand<Cart>, io.vrap.rmf.base.client.CreateHttpRequestCommand, io.vrap.rmf.base.client.HttpRequestCommand<Cart>, io.vrap.rmf.base.client.RequestCommand<Cart>

public class ByProjectKeyCartsReplicatePost extends io.vrap.rmf.base.client.TypeBodyApiMethod<ByProjectKeyCartsReplicatePost,Cart,ReplicaCartDraft> implements ErrorableTrait<ByProjectKeyCartsReplicatePost>

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.



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

    Nested classes/interfaces inherited from class io.vrap.rmf.base.client.ApiMethod

    io.vrap.rmf.base.client.ApiMethod.ParamEntry<K extends Object,V extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ByProjectKeyCartsReplicatePost(io.vrap.rmf.base.client.ApiHttpClient apiHttpClient, String projectKey, ReplicaCartDraft replicaCartDraft)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    CompletableFuture<io.vrap.rmf.base.client.ApiHttpResponse<Cart>>
    execute(io.vrap.rmf.base.client.ApiHttpClient client)
     
    io.vrap.rmf.base.client.ApiHttpResponse<Cart>
    executeBlocking(io.vrap.rmf.base.client.ApiHttpClient client, Duration timeout)
     
     
     
    int
     
    int
     
    com.fasterxml.jackson.core.type.TypeReference<Cart>
     
    void
    setProjectKey(String projectKey)
     
     
    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, withQueryParams

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.vrap.rmf.base.client.ClientRequestCommand

    executeBlocking

    Methods inherited from interface io.vrap.rmf.base.client.CreateHttpRequestCommand

    createHttpRequest

    Methods inherited from interface com.commercetools.api.client.ErrorableTrait

    asErrorableTrait, asErrorableTraitToBaseType

    Methods inherited from interface io.vrap.rmf.base.client.RequestCommand

    executeBlocking
  • Constructor Details

    • ByProjectKeyCartsReplicatePost

      public ByProjectKeyCartsReplicatePost(io.vrap.rmf.base.client.ApiHttpClient apiHttpClient, String projectKey, ReplicaCartDraft replicaCartDraft)
    • ByProjectKeyCartsReplicatePost

      public ByProjectKeyCartsReplicatePost(ByProjectKeyCartsReplicatePost t)
  • Method Details