Chord OMS
...
Next.js
SDK Reference
useProduct
5min
this page's documentation only applies to chord's next js starter prior to the release of the react docid\ ewxkrz0jhh0zpphikkcri the next js starter now uses the react sdk and does not use the methods documented on this page check out the react sdk reference for complete documentation, and the react sdk migration guide docid\ qmilhjfpz9wbjyzbe50ku for details on how to upgrade the useproduct hook returns a set of functions for product related operations example import { useproduct } from ' /hooks/actions' // inside a function component const { createstockrequest } = useproduct() returns the useproduct hook returns an object with these properties property description createstockrequest functions createstockrequest the createstockrequest adds the customer to a product variant wait list in the oms when the variant is marked back in stock, customers on the wait list will automatically receive an email notification arguments createstockrequest(options) argument type description options email string the email address to sent an email to when the variant is back in stock options sku string the variant sku options slug string for kits only, the slug of the kit returns promise\<void> a promise that resolves when the stock request has been created example import { useproduct } from ' /hooks/actions' export default () => { const { createstockrequest } = useproduct() await createstockrequest({ email, sku }) }