Usage
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The SKU identifier |
getBearerToken | () => Promise<string> | Yes | Function returning the auth token |
queryOptions | UseQueryOptions | No | React Query options (e.g. staleTime, enabled) |
Return Value
| Property | Type | Description |
|---|---|---|
data | Sku | undefined | The SKU data |
isLoading | boolean | True while fetching |
isError | boolean | True if an error occurred |
isSuccess | boolean | True if the query succeeded |
error | Error | null | Error when isError is true |
refetch | () => void | Re-run the query |
fetchSku | (input) => Promise<Sku> | Imperatively fetch a SKU with custom params |
Example Implementation
Related Hooks
- useGetSkuList — Fetch a paginated list of available SKUs
- usePurchaseSku — Purchase a SKU once you have its ID
