Skip to main content

Intents

The Intents API provides a way to invoke existing admin workflows for creating, editing, and managing Shopify resources.

The invoke API is a function that accepts either a string query or an options object describing the intent to invoke and returns a Promise that resolves to an activity handle for the workflow.

Intent Format

Intents are invoked using a string query format: ${action}:${type},${value}

Where:

  • action - The operation to perform (create or edit)
  • type - The resource type (e.g., shopify/Product)
  • value - The resource identifier (only for edit actions)

Supported Resources

Article

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

Catalog

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

Collection

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

Customer

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

Discount

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

Market

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

Menu

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

Metafield Definition

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

Metaobject

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

Metaobject Definition

ActionTypeValueData
createshopify/MetaobjectDefinition——
editshopify/MetaobjectDefinitiongid://shopify/MetaobjectDefinition/{id}—

Page

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

Product

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

Product Variant

ActionTypeValueData
createshopify/ProductVariant—{ productId: 'gid://shopify/Product/{id}' }
editshopify/ProductVariantgid://shopify/ProductVariant/{id}—
{ (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].

Was this section helpful?

Supported actions that can be performed on resources.

  • create: Opens a creation workflow for a new resource
  • edit: Opens an editing workflow for an existing resource (requires value parameter)
'create' | 'edit'
Was this section helpful?

Supported resource types that can be targeted by intents.

'shopify/Article' | 'shopify/Catalog' | 'shopify/Collection' | 'shopify/Customer' | 'shopify/Discount' | 'shopify/Market' | 'shopify/Menu' | 'shopify/MetafieldDefinition' | 'shopify/Metaobject' | 'shopify/MetaobjectDefinition' | 'shopify/Page' | 'shopify/Product' | 'shopify/ProductVariant'
Was this section helpful?

Options for invoking intents when using the query string format.

{ [key: string]: unknown; }

Additional data required for certain intent types. For example:

  • Discount creation requires { type: 'amount-off-product' | 'amount-off-order' | 'buy-x-get-y' | 'free-shipping' }
  • ProductVariant creation requires { productId: 'gid://shopify/Product/123' }
  • Metaobject creation requires { type: 'shopify--color-pattern' }
string

The resource identifier for edit actions (e.g., 'gid://shopify/Product/123').

Was this section helpful?

Response object returned when the intent workflow completes.

Anchor to ClosedIntentResponse

ClosedIntentResponse

'closed'
'error'
Issue[]
string
Anchor to SuccessIntentResponse

SuccessIntentResponse

{ [key: string]: unknown; }
Was this section helpful?

Creating a collection

const activity = await shopify.intents.invoke('create:shopify/Collection');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Collection created:', response.data);
}

Preview

Intents for each Shopify resource type

Anchor to example-articleArticle

Anchor to example-create-articleCreate article

Create a new article. Opens the article creation workflow.

Anchor to example-edit-articleEdit article

Edit an existing article. Requires an article GID.

Was this section helpful?

Create article

const activity = await shopify.intents.invoke('create:shopify/Article');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Article created:', response.data);
}

Create a new catalog. Opens the catalog creation workflow.

Edit an existing catalog. Requires a catalog GID.

Was this section helpful?

Create catalog

const activity = await shopify.intents.invoke('create:shopify/Catalog');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Catalog created:', response.data);
}

Create a new collection. Opens the collection creation workflow.

Edit an existing collection. Requires a collection GID.

Was this section helpful?

Create collection

const activity = await shopify.intents.invoke('create:shopify/Collection');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Collection created:', response.data);
}

Create a new customer. Opens the customer creation workflow.

Edit an existing customer. Requires a customer GID.

Was this section helpful?

Create customer

const activity = await shopify.intents.invoke('create:shopify/Customer');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Customer created:', response.data);
}

Create a new discount. Opens the discount creation workflow. Requires a discount type.

Edit an existing discount. Requires a discount GID.

Was this section helpful?

Create discount

const activity = await shopify.intents.invoke('create:shopify/Discount', {
data: {type: 'amount-off-product'},
});

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Discount created:', response.data);
}

Create a new market. Opens the market creation workflow.

Edit an existing market. Requires a market GID.

Was this section helpful?

Create market

const activity = await shopify.intents.invoke('create:shopify/Market');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Market created:', response.data);
}

Was this section helpful?

Create menu

const activity = await shopify.intents.invoke('create:shopify/Menu');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Menu created:', response.data);
}

Create a new metafield definition. Opens the metafield definition creation workflow.

Edit an existing metafield definition. Requires a metafield definition GID.

Was this section helpful?

Create metafield definition

const activity = await shopify.intents.invoke(
'create:shopify/MetafieldDefinition',
{data: {ownerType: 'product'}},
);

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Metafield definition created:', response.data);
}

Create a new metaobject. Opens the metaobject creation workflow. Requires a type.

Edit an existing metaobject. Requires a metaobject GID.

Was this section helpful?

Create metaobject

const activity = await shopify.intents.invoke('create:shopify/Metaobject', {
data: {type: 'shopify--color-pattern'},
});

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Metaobject created:', response.data);
}

Create a new metaobject definition. Opens the metaobject definition creation workflow.

Edit an existing metaobject definition. Requires a metaobject definition GID.

Was this section helpful?

Create metaobject definition

const activity = await shopify.intents.invoke(
'create:shopify/MetaobjectDefinition',
);

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Metaobject definition created:', response.data);
}

Create a new page. Opens the page creation workflow.

Edit an existing page. Requires a page GID.

Was this section helpful?

Create page

const activity = await shopify.intents.invoke('create:shopify/Page');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Page created:', response.data);
}

Create a new product. Opens the product creation workflow.

Edit an existing product. Requires a product GID.

Was this section helpful?

Create product

const activity = await shopify.intents.invoke('create:shopify/Product');

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Product created:', response.data);
}

Create a new product variant. Opens the variant creation workflow. Requires a product ID.

Edit an existing product variant. Requires a variant GID.

Was this section helpful?

Create variant

const activity = await shopify.intents.invoke('create:shopify/ProductVariant', {
data: {productId: 'gid://shopify/Product/123456789'},
});

const response = await activity.complete;

if (response.code === 'ok') {
console.log('Product variant created:', response.data);
}