Mutations
addCartItems
Adds new items to an existing shopping cart. This mutation resets selected shipping method of updated stores, and user will need to select shipping method again.
Arguments
input
CartItemsAddInput!
requiredThe input
object contains the unique identifier (ID
) for the cart and the items that need to be added.
fetchBuyerIdentity
Boolean
Set to false
by default.
If set to true
, the buyerIdentity
field will be fetched in the response.
fetchCartLines
Boolean
Set to true
by default.
If set to true
, the cartLines
field will be fetched in the response.
fetchOffer
Boolean
Set to true
by default.
If set to true
, the offers
field will be fetched in the response.
fetchShippingMethods
Boolean
Set to false
by default.
If set to true
, the shippingMethods
field will be fetched in the response.
Returns
CartResponse.*
CartResponse
Any requested field from the CartResponse
object.
Usage
import { RyeClient, Marketplace } from "@rye-api/rye-sdk";
const ryeClient = new RyeClient("<AUTH_HEADER>", "<SHOPPER_IP>");
const result = await ryeClient.addCartItems({
input: {
id: "<CART_ID>",
items: {
shopifyCartItemsInput: [
{
quantity: 1,
variantId: "44346795295022",
},
],
},
},
});
Was this page helpful?