A job corresponds to some long running task that the client should poll for status.
Anchor to FieldsFields
- Anchor to donedone•Boolean!non-null
This indicates if the job is still queued or has been run.
- •ID!non-null
A globally-unique ID that's returned when running an asynchronous mutation.
- Anchor to queryquery•Query
Root This field will only resolve once the job is done. Can be used to ask for object(s) that have been changed by the job.
Anchor to QueriesQueries
- •query
Returns a Job resource by ID. Used to check the status of internal jobs and any applicable changes.
- •ID!required
ID of the job to query.
Arguments
- •ID!
Anchor to MutationsMutations
- •mutation
Adds products to a
Collectionasynchronously and returns aJobto track the operation's progress. This mutation handles large product sets efficiently by processing them in the background.You can poll the returned job using the
jobquery to monitor completion status.- •ID!required
The ID of the collection that's being updated.
- Anchor to productIdsproduct•[ID!]!
Ids required The IDs of the products that are being added to the collection. If the collection's sort order is manual, the products will be added in the order in which they are provided.
Arguments
- •ID!
- •mutation
Duplicates a collection.
An existing collection ID and new title are required.
Publication Duplication
Publications may be excluded by passing
in the input.Metafields
Metafield values are not duplicated if the unique values capability is enabled.
- Anchor to inputinput•Collection
Duplicate Input! required The input for duplicating a collection.
Arguments
- •mutation
Removes multiple products from a collection in a single operation. This mutation can process large product sets (up to 250 products) and may take significant time to complete for collections with many products.
For example, when ending a seasonal promotion, merchants can remove all sale items from a "Summer Clearance" collection at once rather than editing each product individually.
Use
to:- Bulk-remove products from collections efficiently
- Clean up collection membership during catalog updates
- Implement automated collection management workflows
The operation processes asynchronously to avoid timeouts and performance issues, especially for large product sets.
Learn more about collection management.
- •ID!required
The ID of the collection to remove products from. The ID must reference an existing manual collection.
- Anchor to productIdsproduct•[ID!]!
Ids required The IDs of products to remove from the collection. The mutation doesn't validate that the products belong to the collection or whether the products exist.
Arguments
- •mutation
Asynchronously reorders products within a specified collection. Instead of returning an updated collection, this mutation returns a job, which should be polled. The
must be.How to use this mutation:
- Provide only the products that actually moved in the
moveslist; do not send the entire product list. For example: to move the product at index 1 to index N, send a single move for that product with. - Each move is applied sequentially in the order provided.
is a zero-based index within the collection at the moment the move is applied (after any prior moves in the list).- Products not included in
moveskeep their relative order, aside from any displacement caused by the moves. - If
is greater than or equal to the number of products, the product is placed at the end.
Example:
- Initial order: [A, B, C, D, E] (indices 0..4)
- Moves (applied in order):
- E -> newPosition: 1
- C -> newPosition: 4
- Result: [A, E, B, D, C]
Displaced products will have their position altered in a consistent manner with no gaps.
- •ID!required
The ID of the collection on which to reorder products.
- Anchor to movesmoves•[Move
Input!]! required A list of moves to perform, evaluated in order. Provide only products whose positions changed; do not send the full list.
is a zero-based index evaluated at the time each move is applied (after any prior moves).values do not need to be unique, and if a value is greater than or equal to the number of products, the product is moved to the end. Up to 250 moves are supported.
Arguments
- Provide only the products that actually moved in the
- •mutation
Updates a collection, modifying its properties, products, or publication settings. Collections help organize products together in the online store and other sales channels.
Use the
mutation to programmatically modify collections in scenarios such as:- Updating collection details, like title, description, or image
- Modifying SEO metadata for better search visibility
- Changing which products are included (using rule updates for smart collections)
- Publishing or unpublishing collections across different sales channels
- Updating custom data using metafields
There are two types of collections with different update capabilities:
- Custom (manual) collections: You can update collection properties, but rule sets can't be modified since products are manually selected.
- Smart (automated) collections: You can update both collection properties and the rules that automatically determine which products are included.
When updating rule sets for smart collections, the operation might be processed asynchronously. In these cases, the mutation returns a
jobobject that you can use to track the progress of the update.
To publish or unpublish collections to specific sales channels, use the dedicated
andmutations.Learn more about using metafields with smart collections.
- Anchor to inputinput•Collection
Input! required The updated properties for the collection.
Arguments
- •mutation
Merges two customers.
- Anchor to customerOneIdcustomer•ID!
One Id required The ID of the first customer that will be merged.
- Anchor to customerTwoIdcustomer•ID!
Two Id required The ID of the second customer that will be merged.
- Anchor to overrideFieldsoverride•Customer
Fields Merge Override Fields The fields to override the default customer merge rules.
Arguments
- •mutation
Enqueue the removal of a delivery profile.
- •ID!required
The ID of the delivery profile to remove.
Arguments
- •ID!
- •mutation
Deletes multiple automatic discounts in a single operation, providing efficient bulk management for stores with extensive discount catalogs. This mutation processes deletions asynchronously to handle large volumes without blocking other operations.
For example, when cleaning up expired seasonal promotions or removing outdated automatic discounts across product categories, merchants can delete dozens of discounts simultaneously rather than processing each individually.
Use
to:- Remove multiple automatic discounts efficiently
- Clean up expired or obsolete promotions
- Streamline discount management workflows
- Process large-scale discount removals asynchronously
The operation returns a job object for tracking deletion progress and any validation errors encountered during processing.
Learn more about discount management.
- Anchor to searchsearch•String
The search query for filtering automatic discounts to delete.
For more information on the list of supported fields and search syntax, refer to the AutomaticDiscountNodes query section.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search to use for filtering automatic discounts to delete.
- •[ID!]
The IDs of the automatic discounts to delete.
Arguments
- •mutation
Activates multiple code discounts asynchronously using one of the following:
- A search query
- A saved search ID
- A list of discount code IDs
For example, you can activate discounts for all codes that match a search criteria, or activate a predefined set of discount codes.
- Anchor to searchsearch•String
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search for filtering discounts to activate. Saved searches represent customer segments that merchants have built in the Shopify admin.
- •[ID!]
The IDs of the discounts to activate.
Arguments
- •mutation
Deactivates multiple code-based discounts asynchronously using one of the following:
- A search query
- A saved search ID
- A list of discount code IDs
For example, you can deactivate discounts for all codes that match a search criteria, or deactivate a predefined set of discount codes.
- Anchor to searchsearch•String
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search for filtering discounts to deactivate. Saved searches represent customer segments that merchants have built in the Shopify admin.
- •[ID!]
The IDs of the discounts to deactivate.
Arguments
- •mutation
Deletes multiple code-based discounts asynchronously using one of the following:
- A search query
- A saved search ID
- A list of discount code IDs
For example, you can delete discounts for all codes that match a search criteria, or delete a predefined set of discount codes.
- Anchor to searchsearch•String
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the saved search for filtering discounts to delete. Saved searches represent customer segments that merchants have built in the Shopify admin.
- •[ID!]
The IDs of the discounts to delete.
Arguments
- •mutation
Asynchronously delete discount codes in bulk that customers can use to redeem a discount.
- Anchor to discountIddiscount•ID!
Id required The ID of the
object that the codes will be removed from. For example,. You can use thequery to retrieve the ID.- Anchor to searchsearch•String
A filter made up of terms, connectives, modifiers, and comparators that you can use to search for code discounts. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
For a list of accepted values for the
searchfield, refer to thequeryargument on thequery.- Anchor to savedSearchIdsaved•ID
Search Id The ID of a saved search.
Arguments
- •mutation
Adds tags to multiple draft orders.
- Anchor to searchsearch•String
The conditions for filtering draft orders on. See the detailed search syntax.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the draft order saved search for filtering draft orders on.
- •[ID!]
The IDs of the draft orders to add tags to.
- •[String!]!required
List of tags to be added.
Arguments
- •mutation
Deletes multiple draft orders.
- Anchor to searchsearch•String
The conditions for filtering draft orders on. See the detailed search syntax.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the draft order saved search for filtering draft orders on.
- •[ID!]
The IDs of the draft orders to delete.
Arguments
- •mutation
Removes tags from multiple draft orders.
- Anchor to searchsearch•String
The conditions for filtering draft orders on. See the detailed search syntax.
- Anchor to savedSearchIdsaved•ID
Search Id The ID of the draft order saved search for filtering draft orders on.
- •[ID!]
The IDs of the draft orders to remove tags from.
- •[String!]!required
List of tags to be removed.
Arguments
- •mutation
Deletes all external marketing activities. Deletion is performed by a background job, as it may take a bit of time to complete if a large number of activities are to be deleted. Attempting to create or modify external activities before the job has completed will result in the create/update/upsert mutation returning an error.
- •mutation
Updates a
's configuration and settings. You can modify the definition's name, description, validation rules, access settings, capabilities, and constraints.The mutation updates access settings that control visibility across different APIs, such as the GraphQL Admin API, Storefront API, and Customer Account API. It also enables capabilities like admin filtering or unique value validation, and modifies constraints that determine which resource subtypes the definition applies to.
NoteThe type, namespace, key, and owner type identify the definition and so can't be changed.
Learn more about updating metafield definitions.
- Anchor to definitiondefinition•Metafield
Definition Update Input! required The input fields for the metafield definition update.
Arguments
- •mutation
Asynchronously delete metaobjects and their associated metafields in bulk.
- Anchor to wherewhere•Metaobject
Bulk Delete Where Condition! required Specifies the condition by which metaobjects are deleted. Exactly one field of input is required.
Arguments
- •mutation
Cancels an order, with options for refunding, restocking inventory, and customer notification.
CautionOrder cancellation is irreversible. An order that has been cancelled can't be restored to its original state.
Use the
mutation to programmatically cancel orders in scenarios such as:- Customer-requested cancellations due to size, color, or other preference changes
- Payment processing failures or declined transactions
- Fraud detection and prevention
- Insufficient inventory availability
- Staff errors in order processing
- Wholesale or B2B order management workflows
The
mutation provides flexible refund options including refunding to original payment methods or issuing store credit. If a payment was only authorized (temporarily held) but not yet charged, that hold will be automatically released when the order is cancelled, even if you choose not to refund other payments.The mutation supports different cancellation reasons: customer requests, payment declines, fraud, inventory issues, staff errors, or other unspecified reasons. Each cancellation can include optional staff notes for internal documentation (notes aren't visible to customers).
An order can only be cancelled if it meets the following criteria:
- The order hasn't already been cancelled.
- The order has no pending payment authorizations.
- The order has no active returns in progress.
- The order has no outstanding fulfillments that can't be cancelled.
Orders might be assigned to locations that become deactivated after the order was created. When cancelling such orders, inventory behavior depends on payment status:
- Paid orders: Cancellation will fail with an error if restocking is enabled, since inventory can't be returned to deactivated locations.
- Unpaid orders: Cancellation succeeds but inventory is not restocked anywhere, even when the restock option is enabled. The committed inventory effectively becomes unavailable rather than being returned to stock at the deactivated location.
After you cancel an order, you can still make limited updates to certain fields (like notes and tags) using the
.For partial refunds or more complex refund scenarios on active orders, such as refunding only specific line items while keeping the rest of the order fulfilled, consider using the
mutation instead of full order cancellation.Learn how to build apps that integrate with order management and fulfillment processes.
- Anchor to orderIdorder•ID!
Id required The ID of the order to be canceled.
- Anchor to refundrefund•BooleanDeprecated
- Anchor to refundMethodrefund•Order
Method Cancel Refund Method Input Indicates how to refund the amount paid by the customer. Authorized payments will be voided regardless of this setting.
- Anchor to restockrestock•Boolean!required
Whether to restock the inventory committed to the order. For unpaid orders fulfilled from locations that have been deactivated, inventory will not be restocked to the deactivated locations even if this argument is set to true.
- Anchor to reasonreason•Order
Cancel Reason! required The reason for canceling the order.
- Anchor to notifyCustomernotify•Boolean
Customer Default:false Whether to send a notification to the customer about the order cancellation.
- Anchor to staffNotestaff•String
Note Default:null A staff-facing note about the order cancellation. This is not visible to the customer. Maximum length of 255 characters.
Arguments
- •mutation
Creates a payment for an
Orderusing a stored. A payment mandate represents the customer's authorization to charge their payment method for deferred payments, such as pre-orders or try-before-you-buy purchases.The mutation processes the payment asynchronously and returns a
Jobfor tracking the payment status. You can specify the payment amount to collect, and use theargument to either immediately capture the payment or only authorize it for later capture. Each payment request requires a uniqueto prevent duplicate charges. Subsequent calls with the same key return the original payment result rather than creating a new payment.Learn more about deferred payments and payment mandates and idempotent requests.
- •ID!required
The ID of the order to collect the balance for.
- Anchor to paymentScheduleIdpayment•ID
Schedule Id The ID of the payment schedule to collect the balance for.
- Anchor to idempotencyKeyidempotency•String!
Key required A unique key to identify the payment request.
- Anchor to mandateIdmandate•ID!
Id required The mandate ID used for payment.
- Anchor to amountamount•Money
Input The payment amount to collect.
- Anchor to autoCaptureauto•Boolean
Capture Default:true Whether the payment should be authorized or captured. If
false, then the authorization of the payment is triggered.
Arguments
- •ID!
- •mutation
Duplicates a product.
If you need to duplicate a large product, such as one that has many variants that are active at several locations, you might encounter timeout errors.
To avoid these timeout errors, you can instead duplicate the product asynchronously.
In API version 2024-10 and higher, include
synchronous: falseargument in this mutation to perform the duplication asynchronously.In API version 2024-07 and lower, use the asynchronous
.Metafield values are not duplicated if the unique values capability is enabled.
- Anchor to productIdproduct•ID!
Id required The ID of the product to be duplicated.
- Anchor to newTitlenew•String!
Title required The new title of the product.
- Anchor to newStatusnew•Product
Status Status The new status of the product. If no value is provided the status will be inherited from the original product.
- Anchor to includeImagesinclude•Boolean
Images Default:false Specifies whether or not to duplicate images.
- Anchor to includeTranslationsinclude•Boolean
Translations Default:false Specifies whether or not to duplicate translations.
- Anchor to synchronoussynchronous•BooleanDefault:true
Specifies whether or not to run the mutation synchronously.
Arguments
- •mutation
Reorders media attached to a product, changing their sequence in product displays. The operation processes asynchronously to handle products with large media collections.
Specify the product ID and an array of moves, where each move contains a media ID and its new zero-based position.
NoteOnly include media items that need repositioning. Unchanged items maintain their relative order automatically.
The mutation returns a
Jobto track the reordering progress. Poll the job status to determine when the operation completes and media positions update across all sales channels.Learn more about reordering product media.
- •ID!required
The ID of the product on which to reorder medias.
- Anchor to movesmoves•[Move
Input!]! required A list of moves to perform which will be evaluated in order.
Arguments
- •ID!
- •mutation
Asynchronously queries and charges all subscription billing cycles whose billingAttemptExpectedDate values fall within a specified date range and meet additional filtering criteria. The results of this action can be retrieved using the subscriptionBillingCycleBulkResults query.
- Anchor to billingAttemptExpectedDateRangebilling•Subscription
Attempt Expected Date Range Billing Cycles Date Range Selector! required Specifies the date range within which the
values of the billing cycles should fall.- Anchor to filtersfilters•Subscription
Billing Cycle Bulk Filters Criteria to filter the billing cycles on which the action is executed.
- Anchor to inventoryPolicyinventory•Subscription
Policy Billing Attempt Inventory Policy Default:PRODUCT_VARIANT_INVENTORY_POLICY The behaviour to use when updating inventory.
Arguments
- •mutation
Asynchronously queries all subscription billing cycles whose billingAttemptExpectedDate values fall within a specified date range and meet additional filtering criteria. The results of this action can be retrieved using the subscriptionBillingCycleBulkResults query.
- Anchor to billingAttemptExpectedDateRangebilling•Subscription
Attempt Expected Date Range Billing Cycles Date Range Selector! required Specifies the date range within which the
values of the billing cycles should fall.- Anchor to filtersfilters•Subscription
Billing Cycle Bulk Filters Criteria to filter the billing cycles on which the action is executed.
Arguments
- •mutation
Creates or updates theme files in an online store theme. This mutation allows batch operations on multiple theme files, either creating new files or overwriting existing ones with the same filename.
NoteYou can process a maximum of 50 files in a single request.
Each file requires a filename and body content. The body must specify a
typewith the correspondingvalue. The mutation returns ajobfield for tracking asynchronous operations and anfield with details about the processed files.- Anchor to themeIdtheme•ID!
Id required The theme to update.
- Anchor to filesfiles•[Online
Store Theme Files Upsert File Input!]! required The files to update.
Arguments
- •mutation
Asynchronously delete URL redirects in bulk.
- •mutation
Asynchronously delete URLRedirect objects in bulk by IDs. Learn more about URLRedirect objects.
- •[ID!]!required
Arguments
- •[ID!]!
- •mutation
Asynchronously delete redirects in bulk.
- Anchor to savedSearchIdsaved•ID!
Search Id required The ID of the URL redirect saved search for filtering.
Arguments
- •mutation
Asynchronously delete redirects in bulk.
- Anchor to searchsearch•String!required
Search query for filtering redirects on (both Redirect from and Redirect to fields).
Arguments
- •mutation
- •ID!required
Arguments
- •ID!