Skip to main content

API

The @hv/commerce packages contains an /api folder that exports code to standup Next.js Route Handlers.

These endpoints each correspond to a React hook @hv/commerce/client export.

Together these are useful for fetching and mutating data in client components.

Endpoints

EndpointHook
removeFromCartuseRemoveFromCart
removePromoCodeuseRemovePromoCode
updateLineItemuseUpdateLineItem
placeOrderusePlaceOrder
getProductuseProduct
getPaymentMethodsusePaymentMethods
addPromoCodeuseAddPromoCode
updateCartuseUpdateCart
getCartuseCart
getOrderuseOrder
addToCartuseAddToCart