(options?: GetAccessTokenOptions) => Promise<string | undefined>
Hooks provided by @broadleaf/commerce-quote-react
.
Hook to use to make a request to convert an expired Quote into a regular Cart. This hook provides a callback method and an API error if any.
Hook to use to delay a hover action.
For example, keeping a dropdown open for a second after the user’s cursor is no longer hovered over it.
Produces a handleMouseEnter
and a handleMouseLeave
event handler.
An object containing the following:
value
: Whether the hover is active.
boolean
setValue
: Function to set the hover active state.
(value: boolean, event?: MouseEvent<T>) ⇒ void;
openDelay
: The number of milliseconds to wait before setting the active state to true.
number
Default is 500
closeDelay
: The number of milliseconds to wait before setting the active state to false.
number
Default is 500
includeEvent
: Whether to pass the JavaScript event object to setValue
in addition to true
or false
.
boolean
Default is false
Hook to use to make a request to fetch a list of quotes.
An object containing the following:
quoteClient
: Client for making requests.
From @broadleaf/commerce-cart
.
searchParam
: Query param to include in the request in the cq
.
Filters by Quote name.
string
Not required.
sort
: Sort param to include, e.g., name,asc
string
fromDate
: Date to use as the starting point for filtering quotes by create date.
string
toDate
: Date to use as the ending point for filtering quotes by create date.
string
pagination
: Additional pagination props
Hook to use to make a request to fetch a list of CartActionAudits
for a quote.
An object containing the following:
quoteClient
: The client used to make the request.
This comes from the @broadleaf/commerce-cart
SDK.
quoteId
: Id of the parent quote.
string
An object containing the following:
fetchChangeHistory
: Function to make the request.
() ⇒ Promise<void>
changeHistory
: Page of audits.
Page
of CartActionAudit
error
: Any error produced by the request.
ApiError | unknown
Hook to use to make a request to fetch a list of notes for a quote.
An object containing the following:
quoteItemId
: Optional. Id of the parent quote item.
quoteClient
: The client used to make the request.
This comes from the @broadleaf/commerce-cart
SDK.
quoteId
: Id of the parent quote.
string
An object containing the following:
fetchNotes
: Function to make the request.
() ⇒ Promise<void>
notes
: Page of notes.
Page
of CartNote
error
: Any error produced by the request.
ApiError | unknown
Hook that wraps react-intl’s useIntl()
and returns only the formatMessage
function.
Hook to use to make a request to set a quote as active.
This will make the quote active in the app’s state and change the quote’s status to EDITING
if not already one of the following statuses:
DRAFTING
EDITING
PUBLISHED
ASSIGNED
Hook to use to make a request to fetch the allowed user operations for the specified scopes.
An object containing the following:
userOperationInfo
: The user operation info if no error is encountered.
errorUserOperations: Any error produced by the request.
ApiError | unknown
loading: Whether the request is in progress.
boolean
refetch
: Function to resend the request.
() ⇒ Promise<UserOperationInformation | undefined>
Hook to use to make a request to update a quote’s name or expiration date. Only sellers can set the latter field.
An object containing the following:
quoteClient
: The client used to make the request.
This comes from the @broadleaf/commerce-cart
SDK.