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
Endpoint | Hook |
---|---|
removeFromCart | useRemoveFromCart |
removePromoCode | useRemovePromoCode |
updateLineItem | useUpdateLineItem |
placeOrder | usePlaceOrder |
getProduct | useProduct |
getPaymentMethods | usePaymentMethods |
addPromoCode | useAddPromoCode |
updateCart | useUpdateCart |
getCart | useCart |
getOrder | useOrder |
addToCart | useAddToCart |