Note API
The Note API provides access to the order note attached to the checkout. Use this API to display, add, update, or remove order notes that buyers use for delivery instructions or special requests.
Anchor to Use casesUse cases
- Display the order note: Show the buyer the note they've attached to the checkout.
- Add or update an order note: Let buyers write delivery or gift instructions during checkout.
- Remove an order note: Clear the note when the buyer no longer needs it.
Supported targets
- purchase.
checkout. actions. render-before - purchase.
checkout. block. render - purchase.
checkout. cart-line-item. render-after - purchase.
checkout. cart-line-list. render-after - purchase.
checkout. chat. render - purchase.
checkout. contact. render-after - purchase.
checkout. delivery-address. render-after - purchase.
checkout. delivery-address. render-before - purchase.
checkout. footer. render-after - purchase.
checkout. header. render-after - purchase.
checkout. payment-method-list. render-after - purchase.
checkout. payment-method-list. render-before - purchase.
checkout. pickup-location-list. render-after - purchase.
checkout. pickup-location-list. render-before - purchase.
checkout. pickup-location-option-item. render-after - purchase.
checkout. pickup-point-list. render-after - purchase.
checkout. pickup-point-list. render-before - purchase.
checkout. reductions. render-after - purchase.
checkout. reductions. render-before - purchase.
checkout. shipping-option-item. details. render - purchase.
checkout. shipping-option-item. render-after - purchase.
checkout. shipping-option-list. render-after - purchase.
checkout. shipping-option-list. render-before - purchase.
thank-you. announcement. render - purchase.
thank-you. block. render - purchase.
thank-you. cart-line-item. render-after - purchase.
thank-you. cart-line-list. render-after - purchase.
thank-you. chat. render - purchase.
thank-you. customer-information. render-after - purchase.
thank-you. footer. render-after - purchase.
thank-you. header. render-after
Supported targets
- purchase.
checkout. actions. render-before - purchase.
checkout. block. render - purchase.
checkout. cart-line-item. render-after - purchase.
checkout. cart-line-list. render-after - purchase.
checkout. chat. render - purchase.
checkout. contact. render-after - purchase.
checkout. delivery-address. render-after - purchase.
checkout. delivery-address. render-before - purchase.
checkout. footer. render-after - purchase.
checkout. header. render-after - purchase.
checkout. payment-method-list. render-after - purchase.
checkout. payment-method-list. render-before - purchase.
checkout. pickup-location-list. render-after - purchase.
checkout. pickup-location-list. render-before - purchase.
checkout. pickup-location-option-item. render-after - purchase.
checkout. pickup-point-list. render-after - purchase.
checkout. pickup-point-list. render-before - purchase.
checkout. reductions. render-after - purchase.
checkout. reductions. render-before - purchase.
checkout. shipping-option-item. details. render - purchase.
checkout. shipping-option-item. render-after - purchase.
checkout. shipping-option-list. render-after - purchase.
checkout. shipping-option-list. render-before - purchase.
thank-you. announcement. render - purchase.
thank-you. block. render - purchase.
thank-you. cart-line-item. render-after - purchase.
thank-you. cart-line-list. render-after - purchase.
thank-you. chat. render - purchase.
thank-you. customer-information. render-after - purchase.
thank-you. footer. render-after - purchase.
thank-you. header. render-after
Anchor to PropertiesProperties
The shopify global object provides note data for the current checkout. Access the following properties on shopify to read the order note. Available to purchase extension targets.
- Anchor to notenotenoteSubscribableSignalLike<string | undefined>SubscribableSignalLike<string | undefined>requiredrequired
A note left by the customer to the merchant, either in their cart or during checkout.
The value is
undefinedif the buyer hasn't entered a note. Use this to display or react to order-level instructions such as delivery preferences or gift messages.
SubscribableSignalLike
Represents a reactive signal interface that provides both immediate value access and subscription-based updates. Enables real-time synchronization with changing data through the observer pattern. This interface extends `ReadonlySignalLike` with deprecated fields that are still supported for backwards compatibility.
- current
The current value of the signal. Equivalent to `.value`, accessing this property subscribes to changes when used in a reactive context.
T - destroy
Cleans up the subscription and releases any resources held by this signal. After calling `destroy()`, the signal stops receiving updates from the main thread.
() => Promise<void> - subscribe
Subscribes to value changes and calls the provided function whenever the value updates. Returns an unsubscribe function to clean up the subscription. Use to automatically react to changes in the signal's value.
(fn: (value: T) => void) => () => void - value
The current value of the signal. This property provides immediate access to the current value without requiring subscription setup. Use for one-time value checks or initial setup.
T
Anchor to MethodsMethods
The shopify global object provides methods to modify note data. Access the following methods on shopify to add, update, or remove the order note. Available to purchase.checkout extension targets.
- Anchor to applyNoteChangeapplyNoteChangeapplyNoteChange(change: NoteChange) => Promise<NoteChangeResult>(change: NoteChange) => Promise<NoteChangeResult>requiredrequired
Sets or removes the buyer's note on the checkout. On success, the
noteproperty updates to reflect the change.NoteThis method returns an error if the cart instruction
is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.Note:This method returns an error if the cart instruction
is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.Note: This method returns an error if the <a href="/docs/api/checkout-ui-extensions/latest/apis/cart-instructions#properties-propertydetail-instructions">cart instruction</a> <code><span class="PreventFireFoxApplyingGapToWBR">notes.can<wbr/>Update<wbr/>Note</span></code> is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
NoteChange
The input for `applyNoteChange()`. Pass either a `NoteUpdateChange` (with `type: 'updateNote'`) to set the note or a `NoteRemoveChange` (with `type: 'removeNote'`) to clear it.
NoteRemoveChange | NoteUpdateChangeNoteRemoveChange
Clears the buyer's note from the checkout. Pass this to `applyNoteChange()` to remove any existing note.
- type
Identifies this as a note removal. Set this when creating a change to clear the buyer's note.
'removeNote'
NoteUpdateChange
Sets or replaces the buyer's note on the checkout. Pass this to `applyNoteChange()` to update the note.
- note
The text to set as the buyer's note. This replaces any existing note entirely rather than appending to it.
string - type
Identifies this as a note update. Set this when creating a change to set or replace the buyer's note.
'updateNote'
NoteChangeResult
The result of calling `applyNoteChange()`. Use the `type` property to determine whether the change succeeded or failed.
NoteChangeResultSuccess | NoteChangeResultErrorNoteChangeResultSuccess
The result of a successful note change. The `type` property is `'success'`.
- type
Indicates that the note change was applied successfully.
'success'
NoteChangeResultError
The result of a failed note change. Check the `message` property for details about what went wrong.
- message
A message that explains the error. This message is useful for debugging. It isn't localized and shouldn't be displayed to the buyer. Render your own localized error text rather than displaying this message to the buyer.
string - type
Indicates that the note change couldn't be applied. Check the `message` property for details.
'error'
Anchor to Best practicesBest practices
- Use
NoteRemoveChangeto clear the note: To remove a note, pass{ type: 'removeNote' }instead of updating with an empty string. This cleanly sets the note value toundefined. - Check for
undefined, not empty string: Thenotevalue isundefinedwhen no note exists, not''. Usenote === undefinedrather thannote === ''when determining whether a note is present.
Anchor to LimitationsLimitations
- Note changes aren't available when the buyer uses an accelerated checkout method such as Apple Pay or Google Pay.