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 Shopify admin UI, and your app receives the result. This means you don't need to build custom forms.

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

  • Resource creation: Invoke admin workflows to create products, collections, discounts, or other Shopify resources.
  • Resource editing: Open existing Shopify resources for editing using their admin workflows.
  • Workflow completion: Await the result of an intent to determine whether the merchant completed or cancelled the operation.
  • Admin consistency: Use native Shopify admin workflows instead of building custom forms for resource management.

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——
Anchor to invoke
invoke
{ (query: ): Promise<>; (intentURL: string, options?: ): Promise<>; }

Invoke an intent using the object syntax.

Invoke an intent using the URL syntax.

URL format: action:type[,value][?params].

Anchor to response
response

If in an intent workflow, provides mechanisms to resolve the intent with a given response.

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'
'error'
Anchor to issues
issues
Issue[]
Anchor to message
message
string
Anchor to SuccessIntentResponse

SuccessIntentResponse

'ok'
{ [key: string]: unknown; }

When your app is opened through an app intent (for example, via an admin.app.intent.link target), the platform delivers the incoming intent to your embedded app in two complementary ways:

  • shopify.intents.request: A subscribable that exposes the current intent request to your app. Read the current request synchronously from shopify.intents.request.value. When your app isn't running inside an intent workflow, the value is null. Use shopify.intents.request.subscribe(callback) to react to changes if the host updates the current intent without reloading the iframe (for example, when a single-page app navigates between intent targets).
  • ?intent=<URL-encoded JSON>: On the initial page load, the same payload is appended to your app's URL as a single intent query parameter. Read it from the incoming request URL when server-side rendering (for example, in a Remix loader or Next.js getServerSideProps), or from window.location in client-side code before App Bridge is ready.

Both paths expose the same action, type, value, and data fields. The exact contents of data differ slightly between the two paths. See the data row of the table for details.

FieldTypeDescription
actionstringThe operation the merchant is performing (for example, 'create' or 'edit').
typestringThe intent type declared under [[extensions.targeting.intents]] in your extension's shopify.extension.toml. See Register your extension as an intent. For example, application/email.
valueunknownThe primary resource identifier when present. The exact shape is defined by your intent schema's value field; for an application/email intent that might be a campaign ID like '42'. Optional.
data{ [key: string]: unknown }Additional input fields defined by your intent's schema.

From shopify.intents.request.value: the raw data from the original invocation, with no merging.

From the URL intent= JSON: the same data, additionally merged with any input-schema fields whose mapTo is 'form_data' (or the schema default). Fields declared with mapTo: 'query_param' arrive as separate query parameters on the launch URL (not inside the intent= JSON); fields with mapTo: 'param' land in the URL path. Optional.

Note: Read the intent payload once on load and store it in your app's state, or subscribe to it if your app stays mounted across intent transitions. The request tells you what to render. The merchant then completes the workflow in your UI, and you report the result through shopify.intents.response.

The URL intent= JSON may include additional internal fields beyond the four documented above. Those are runtime-only and not part of the public contract; treat them as Shopify-internal and don't rely on them in your app.

The response methods resolve an app intent from inside the extension that's handling it. When your extension implements an app intent (for example, through an admin.app.intent.link target), call one of these methods to return control to the invoker with the appropriate outcome.

  • ok(data?): Resolves the intent with a success response. The optional data object is returned to the invoker as response.data.
  • error(message, issues?): Resolves the intent with an error response. The message describes the failure, and issues is an optional array of Standard Schema validation issues.
  • closed(): Resolves the intent as closed, indicating the merchant cancelled the workflow without completing it.

Each method returns a promise that resolves once the response has been delivered.

Anchor to closed
closed
() => Promise<void>
required

If in an intent workflow, resolves the intent with a closed response.

Anchor to error
error
(message: string, issues?: Issue[]) => Promise<void>
required

If in an intent workflow, resolves the intent with an error response and the provided message and issues, if any.

(data?: { [key: string]: unknown; }) => Promise<void>
required

If in an intent workflow, resolves the intent with a success response and the provided data, if any.


Was this page helpful?