Whether the request is in progress. Type: boolean.
error
Any error produced by the request. Type: ApiError | unknown.
carts
The page of quote type carts if no error was encountered. Type: Page<Cart>.
refetch
Method to resend the request. Type: () ⇒ Promise<void>.
useFetchQuoteById
Hook to use to make a request to fetch a quote by id.
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
quoteId
Id of the parent quote. Type: string.
Response
isFetching
Whether the request is in progress. Type: boolean.
error
Any error produced by the request. Type: ApiError | unknown.
quote
The quote if no error was encountered. Type: Cart.
refetch
Method to resend the request. Type: () ⇒ Promise<void>.
Quote Actions & Modification
useUpdateQuoteInfo
Hook to use to make a request to update a quote’s name or expiration date.
Only sellers can set the latter field.
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
Response
updateQuoteInfo
Function to make the request. Type: (quote: Cart, request: UpdateCartInfoRequest) ⇒ Promise<Cart | undefined>. See UpdateCartInfoRequest.
quote
The updated quote. Type: Cart.
error
Any error produced by the request. Type: ApiError | unknown.
useChangeQuoteStatus
Hook to use to make a request to change a quote’s status.
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
Response
changeQuoteStatus
Function to make the request. Type: (selectedQuote: Cart, status: string) ⇒ Promise<void>.
error
Any error produced by the request. Type: ApiError | unknown.
useDeleteQuote
Hook to use to make a request to delete a quote by id.
Only for sellers.
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
Response
deleteQuote
Function to make the request. Type: (selectedQuote: Cart) ⇒ Promise<void>.
error
Any error produced by the request. Type: ApiError | unknown.
useMakeQuoteActive
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
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
setCart
The callback needed to handle setting the app’s cart state. Type: (cart: Cart | null) ⇒ void.
Response
makeQuoteActive
Method to send the request. Takes the quote type cart to make active. Type: (selectedQuote: Cart) ⇒ Promise<void>.
error
Any error produced by the request. Type: ApiError | unknown.
useConvertExpiredToCart
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.
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
setCart
The callback needed to handle setting the app’s cart state. Type: (cart: Cart | null) ⇒ void.
Response
convertToCart
Callback function to send the request. Type: (selectedQuote: Cart, type?: string) ⇒ void. type is the Cart#type, default is STANDARD.
Notes & History
useFetchNotes
Hook to use to make a request to fetch a list of notes for a quote.
Props
quoteClient
The client used to make the request. This comes from the @broadleaf/commerce-cart SDK.
quoteId
Id of the parent quote. Type: string.
quoteItemId
(Optional) Id of the parent quote item. Type: string.
Response
fetchNotes
Function to make the request. Type: () ⇒ Promise<void>.