Usage
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The purchase transaction ID |
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 | Transaction | undefined | The purchase record |
isLoading | boolean | True while fetching |
isError | boolean | True if an error occurred |
isSuccess | boolean | True if the query succeeded |
error | Error | null | Error details |
refetch | () => void | Re-run the query |
fetchSkuPurchase | (input) => Promise<Transaction> | Imperatively fetch a purchase by ID |
Example Implementation
Related Hooks
- usePurchaseSku — Create the purchase in the first place
- useGetSkuList — Browse available SKUs
