Skip to main content

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.

  • 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.
Support
Targets (31)

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.

<string | undefined>
required

A note left by the customer to the merchant, either in their cart or during checkout.

The value is undefined if the buyer hasn't entered a note. Use this to display or react to order-level instructions such as delivery preferences or gift messages.

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 applyNoteChange
applyNoteChange
(change: ) => Promise<>
required

Sets or removes the buyer's note on the checkout. On success, the note property updates to reflect the change.

Note

This method returns an error if the cart instruction notes.canUpdateNote is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.


  • Use NoteRemoveChange to clear the note: To remove a note, pass { type: 'removeNote' } instead of updating with an empty string. This cleanly sets the note value to undefined.
  • Check for undefined, not empty string: The note value is undefined when no note exists, not ''. Use note === undefined rather than note === '' when determining whether a note is present.

  • Note changes aren't available when the buyer uses an accelerated checkout method such as Apple Pay or Google Pay.

Was this page helpful?