NoteAPI
API
The API for interacting with the note applied to checkout.
Anchor to orderstatusapiOrderStatusApi
The API object provided to this and other customer-account.order-status
extension targets.
- Anchor to notenoteStatefulRemoteSubscribable<string | undefined>required
A note left by the customer to the merchant, either in their cart or during checkout.
Docs_OrderStatus_NoteApi
- note
A note left by the customer to the merchant, either in their cart or during checkout.
StatefulRemoteSubscribable<string | undefined>
export interface Docs_OrderStatus_NoteApi
extends Pick<OrderStatusApi<any>, 'note'> {}
Was this section helpful?
Anchor to useNoteuse Note()
use Note()
Returns the proposed note
applied to the checkout.
Anchor to useNote-returnsReturns
string | undefined
UseNoteGeneratedType
Returns the proposed `note` applied to the checkout.
string | undefined
export function useNote<
Target extends RenderOrderStatusExtensionTarget = RenderOrderStatusExtensionTarget,
>(): string | undefined {
const api = useApi<Target>();
const extensionTarget = api.extension.target;
if (!('note' in api)) {
throw new ExtensionHasNoFieldError('note', extensionTarget);
}
return useSubscription(api.note);
}
Was this section helpful?