Class ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete

java.lang.Object
io.vrap.rmf.base.client.ApiMethod<T,TResult>
io.vrap.rmf.base.client.TypeApiMethod<ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete,Cart>
com.commercetools.api.client.ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete
All Implemented Interfaces:
ConflictingTrait<ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete>, Deprecatable200Trait<ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete>, ErrorableTrait<ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete>, ExpandableTrait<ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete>, VersionedTrait<ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDDelete>, ClientRequestCommand<Cart>, CreateHttpRequestCommand, HttpRequestCommand<Cart>, RequestCommand<Cart>

Deletes the Cart for a given id in a Store. Returns a 200 OK status if successful.

A ResourceNotFound error is returned in the following scenarios:

  • If no Cart exists in the Store for the given id.
  • If the Cart exists in the Project but does not belong to a Store, or the Cart's store field references a different Store.
  • If the Cart exists in the Project but does not have either a customerId that matches the customer:{id} scope, or an anonymousId that matches the anonymous_id:{id} scope.


   CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
            .withProjectKey("{projectKey}")
            .inStoreKeyWithStoreKeyValue("{storeKey}")
            .me()
            .carts()
            .withId("{ID}")
            .delete()
            .withVersion(version)
            .execute()