Skip to main content

Draft Order API

The Draft Order API provides read-only access to draft order data. Use this API to get draft order information and build contextual experiences based on the selected draft order context. The API offers draft order details for implementing order-specific functionality and workflows.

  • Draft order access: Access the draft order identifier to implement specific functionality.
  • Order display: Build extensions that display order information or management tools.
  • Contextual UI: Create interfaces that adapt based on the draft order context.
  • External integrations: Link draft order data with external systems or order management platforms.

The shopify global object provides draft order details for the active context. Access the following properties on shopify to get draft order information including the order identifier, name, and associated customer.

number
required

The unique identifier for the draft order. Use for draft order lookups, implementing order-specific functionality, and integrating with external systems.

string
required

The name of the draft order as configured by the merchant. Use for draft order identification, displays, and customer-facing interfaces.

Anchor to customerId
customerId
number

The unique identifier of the customer associated with the draft order. Returns undefined if no customer is associated. Use for customer-specific functionality and personalized experiences.


  • Use draft order ID for data lookups: Use the draft order ID to fetch additional draft order information from external systems, order management platforms, or Shopify APIs when building comprehensive draft order experiences.
  • Implement draft order-specific features: Use the draft order context to enable specialized functionality like draft order conversion, customer assignment, or order modification workflows.
  • Validate draft order access: Verify that the draft order ID is valid before performing draft order-specific operations or external API calls.

Draft order data reflects the current POS session and may not include real-time updates from other channels until the session is refreshed.


Was this page helpful?