Skip to main content

Intents API

The Intents API launches Shopify's native admin interfaces for creating and editing resources. When your extension calls an intent, merchants complete their changes using the standard admin UI, and your extension receives the result. This means you don't need to build custom forms.

Use this API to build workflows like adding products to collections from bulk actions, creating multiple related resources in sequence (like a product, collection, and discount for a promotion), opening specific resources for editing from custom buttons, or launching discount creation with pre-selected types.

If you do render a form on an intent screen, the screen can close and tear down the runtime before async saves settle. Return a promise from your submit handler and call event.waitUntil(promise). See Handle async submission on the Form reference.

  • Resource creation: Launch Shopify's native creation forms for products, collections, discounts, and other resources directly from your app home page.
  • Resource editing: Open existing resources for editing without building custom forms.
  • Multi-step workflows: Chain intent invocations to create related resources in sequence, like a product, collection, and discount for a promotion.
  • Settings management: Navigate merchants to specific Shopify settings pages like store details, order processing, or gift card expiration.

The invoke method launches a Shopify admin workflow for creating or editing resources. The method returns a promise that resolves to an activity handle you can await to get the workflow result.

The method accepts either:

  • String query: ${action}:${type},${value} with optional second parameter (IntentQueryOptions)
  • Object: Properties for action, type, value, and data

IntentQueryOptions parameters

Optional parameters for the invoke method when using the string query format:

  • value (string): The resource identifier for edit operations (for example, 'gid://shopify/Product/123'). Required when editing existing resources. Omit for create operations.
  • data ({ [key: string]: unknown }): Additional context required by specific resource types. For example, discounts require a type, variants require a product ID, and metaobjects require a definition type.

Supported resources

The following tables show which resource types you can create or edit, and what values you need to pass for value and data for each operation.

Article

Articles are blog posts published on the Online Store. Use this to create or edit articles for merchant blogs.

ActionTypeValueData
createshopify/Article——
editshopify/Articlegid://shopify/Article/{id}—

Catalog

Catalogs are product groupings that organize products for different markets or channels. Use this to create or edit catalogs for B2B or multi-market selling.

ActionTypeValueData
createshopify/Catalog——
editshopify/Cataloggid://shopify/Catalog/{id}—

Collection

Collections are groups of products organized manually or by automated rules. Use this to create or edit product collections.

ActionTypeValueData
createshopify/Collection——
editshopify/Collectiongid://shopify/Collection/{id}—

Customer

Customers are profiles with contact information, order history, and metadata. Use this to create or edit customer accounts.

ActionTypeValueData
createshopify/Customer——
editshopify/Customergid://shopify/Customer/{id}—

Delivery profile

Delivery profiles define shipping rates and rules for products across locations and zones. Use this to create or edit shipping configurations for different product groups.

ActionTypeValueData
createshopify/DeliveryProfile——
editshopify/DeliveryProfilegid://shopify/DeliveryProfile/{id}—

Discount

Discounts are price reductions applied to products, orders, or shipping. Use this to create or edit discount codes and automatic discounts. Creating discounts requires specifying a discount type.

ActionTypeValueData
createshopify/Discount—{ type: 'amount-off-product' | 'amount-off-order' | 'buy-x-get-y' | 'free-shipping' }
editshopify/Discountgid://shopify/Discount/{id}—

Location

Locations are physical or virtual places where merchants store inventory and fulfill orders. Use this to create or edit locations for managing stock and fulfillment.

ActionTypeValueData
createshopify/Location——
editshopify/Locationgid://shopify/Location/{id}—

Market

Markets are geographic regions with customized pricing, languages, and domains. Use this to create or edit markets for international selling.

ActionTypeValueData
createshopify/Market——
editshopify/Marketgid://shopify/Market/{id}—

Menu

Menus are navigation structures for the Online Store. Use this to create or edit menu structures and links.

ActionTypeValueData
createshopify/Menu——
editshopify/Menugid://shopify/Menu/{id}—

Metafield definition

Metafield definitions are schemas that define custom data fields for resources. Use this to create or edit metafield definitions that merchants can use to add structured data to products, customers, and other resources.

ActionTypeValueData
createshopify/MetafieldDefinition—{ ownerType: 'Product' }
editshopify/MetafieldDefinitiongid://shopify/MetafieldDefinition/{id}{ ownerType: 'Product' }

Metaobject

Metaobjects are custom structured data entries based on metaobject definitions. Use this to create or edit metaobject instances that store complex custom data. Requires a definition type.

ActionTypeValueData
createshopify/Metaobject—{ type: 'shopify--color-pattern' }
editshopify/Metaobjectgid://shopify/Metaobject/{id}{ type: 'shopify--color-pattern' }

Metaobject definition

Metaobject definitions are schemas that define the structure for metaobjects. Use this to create or edit metaobject definitions that determine the fields and data types for custom structured data.

ActionTypeValueData
createshopify/MetaobjectDefinition——
editshopify/MetaobjectDefinition—{ type: 'my_metaobject_definition_type' }

Page

Pages are static content pages for the Online Store. Use this to create or edit pages like About Us, Contact, or custom informational pages.

ActionTypeValueData
createshopify/Page——
editshopify/Pagegid://shopify/Page/{id}—

Product

Products are items sold in the store with pricing, inventory, and variants. Use this to create or edit products.

ActionTypeValueData
createshopify/Product——
editshopify/Productgid://shopify/Product/{id}—

Product variant

Product variants are specific combinations of product options like size and color. Use this to create or edit product variants. Creating variants requires a parent product ID.

ActionTypeValueData
createshopify/ProductVariant—{ productId: 'gid://shopify/Product/{id}' }
editshopify/ProductVariantgid://shopify/ProductVariant/{id}{ productId: 'gid://shopify/Product/{id}' }
Note

When editing products with variants, query the product.hasOnlyDefaultVariant field first. If true, then use the shopify/Product edit intent. If false, then use the shopify/ProductVariant edit intent for specific variants.

Settings

Settings are the configuration options for the store. Use this to invoke and edit settings.

ActionTypeValueData
editsettings/GiftCardExpiration——
editsettings/LocationDefault——
editsettings/NotificationsSenderEmail——
editsettings/NotificationsStaff——
editsettings/OrderIdFormat——
editsettings/OrderProcessing——
editsettings/PaymentCaptureMethod——
editsettings/StoreDefaults——
editsettings/StoreDetails——
export interface { (query: ): Promise<>; (intentURL: string, options?: ): Promise<>; }

The result returned when an intent workflow completes. Check the code property to determine the outcome:

  • 'ok': The merchant completed the workflow successfully.
  • 'error': The workflow failed due to validation or other errors.
  • 'closed': The merchant cancelled without completing.
Anchor to ClosedIntentResponse

ClosedIntentResponse

'closed'

Indicates the workflow was closed without completion. When 'closed', the merchant exited the workflow before finishing.

'error'

Indicates the workflow failed. When 'error', the workflow encountered validation errors or other issues that prevented completion.

Anchor to issues
issues
[]

Specific validation issues or field errors. Present when validation fails on particular fields, allowing you to show targeted error messages.

Anchor to message
message
string

A general error message describing what went wrong. Use this to display feedback when specific field errors aren't available.

Anchor to SuccessIntentResponse

SuccessIntentResponse

'ok'

Indicates successful completion. When 'ok', the merchant completed the workflow and the resource was created or updated.

{ [key: string]: unknown; }

Additional data returned by the workflow, such as the created or updated resource information with IDs and properties.


  • Parse ErrorIntentResponse.issues array for specific feedback: When code: 'error', the issues array contains structured validation errors with field paths and messages. Use this to show specific error feedback rather than generic error messages.
  • Distinguish closed from error: code: 'closed' means the merchant cancelled, while code: 'error' means validation or save failures. Handle these differently. Closed isn't an error state.
  • Query product.hasOnlyDefaultVariant before editing: If the value is false, then use the shopify/ProductVariant edit intent instead of shopify/Product to edit specific variants.
  • Wait for in-flight saves before closing intent screens: When an intent screen contains a form, return a promise from your submit handler and call event.waitUntil(promise). Otherwise the screen might be torn down before the save settles. See the Handle async submission example on the Form reference.

  • Some resources require data for create operations. Discounts need { type: 'amount-off-product' }, variants need { productId: 'gid://...' }, and metaobjects need { type: 'definition-type' }. Missing required data causes the intent to fail.
  • MetaobjectDefinition edit requires { data: { type: 'definition-type' }} instead of passing the GID in value. It's the only resource with this pattern.
  • Intent workflows pause your extension until completion. You can't run other operations while an intent is open.
  • The workflow UI can't be customized. Field order, labels, and validation messages are controlled by Shopify and can't be modified.
  • Your extension only receives the final result. Intermediate workflow state and partial saves aren't communicated back to your extension.

Was this page helpful?