CartContext
The cart context available if the CartProvider is used previously in the React components tree.
Properties
setCart
(cart: Omit<Cart, "refundable_amount" | "refunded_total">) => voidRequiredA state function used to set the cart object.
pay
UseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartPaymentSessionReq, unknown>RequiredA mutation used to select a payment processor during checkout.
Using it is equivalent to using the useSetPaymentSession mutation.
pay
UseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartPaymentSessionReq, unknown>RequiredcreateCart
UseMutationResult<Response<StoreCartsRes>, Error, undefined | StorePostCartReq, unknown>RequiredA mutation used to create a cart.
Using it is equivalent to using the useCreateCart mutation.
startCheckout
UseMutationResult<Response<StoreCartsRes>, Error, void, unknown>RequiredA mutation used to initialize payment sessions during checkout.
Using it is equivalent to using the useCreatePaymentSession mutation.
completeCheckout
UseMutationResult<Response<StoreCompleteCartRes>, Error, void, unknown>RequiredA mutation used to complete the cart and place the order.
Using it is equivalent to using the useCompleteCart mutation.
updateCart
UseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartReq, unknown>RequiredA mutation used to update a cart’s details such as region, customer email, shipping address, and more.
Using it is equivalent to using the useUpdateCart mutation.
updateCart
UseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartReq, unknown>RequiredaddShippingMethod
UseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartShippingMethodReq, unknown>RequiredA mutation used to add a shipping method to the cart during checkout.
Using it is equivalent to using the useAddShippingMethodToCart mutation.
addShippingMethod
UseMutationResult<Response<StoreCartsRes>, Error, StorePostCartsCartShippingMethodReq, unknown>RequiredtotalItems
numberRequiredThe number of items in the cart.
cart
Omit<Cart, "refundable_amount" | "refunded_total">The currently-used cart.
cart
Omit<Cart, "refundable_amount" | "refunded_total">Was this section helpful?