All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.client.shop.CartService Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client.shop;

import java.util.Currency;
import io.sphere.client.CommandRequest;
import io.sphere.client.FetchRequest;
import io.sphere.client.QueryRequest;
import io.sphere.client.model.VersionedId;
import io.sphere.client.shop.model.Cart;
import io.sphere.client.shop.model.CartUpdate;
import com.neovisionaries.i18n.CountryCode;

/** Sphere HTTP API for working with shopping carts in a given project. */
public interface CartService {
    /** Creates a request that finds a cart by given id. */
    FetchRequest byId(String id);

    /** Finds the active cart for given customer. */
    FetchRequest forCustomer(String customerId);

    /** Queries all carts.
     *
     * @deprecated since 0.49.0. Use {@link #query()} instead.
     **/
    @Deprecated
    QueryRequest all();

    /** Queries carts. */
    QueryRequest query();

    /** Creates a cart in the backend. */
    CommandRequest createCart(Currency currency, String customerId, Cart.InventoryMode inventoryMode);

    /** Creates a cart in the backend. */
    CommandRequest createCart(Currency currency, String customerId, CountryCode country, Cart.InventoryMode inventoryMode);

    /** Creates an anonymous cart in the backend. */
    CommandRequest createCart(Currency currency, CountryCode country, Cart.InventoryMode inventoryMode);

    /** Creates an anonymous cart in the backend. */
    CommandRequest createCart(Currency currency, Cart.InventoryMode inventoryMode);

    /** Creates an anonymous cart in the backend with {@code Cart.InventoryMode#None}. */
    CommandRequest createCart(Currency currency);

    /** Updates a cart in the backend. */
    CommandRequest updateCart(VersionedId cartId, CartUpdate update);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy