Mutation
The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start.
Anchor to FieldsFields
- cartAttributesUpdate (CartAttributesUpdatePayload)
- cartBuyerIdentityUpdate (CartBuyerIdentityUpdatePayload)
- cartCreate (CartCreatePayload)
- cartDeliveryAddressesAdd (CartDeliveryAddressesAddPayload)
- cartDeliveryAddressesRemove (CartDeliveryAddressesRemovePayload)
- cartDeliveryAddressesReplace (CartDeliveryAddressesReplacePayload)
- cartDeliveryAddressesUpdate (CartDeliveryAddressesUpdatePayload)
- cartDiscountCodesUpdate (CartDiscountCodesUpdatePayload)
- cartGiftCardCodesAdd (CartGiftCardCodesAddPayload)
- cartGiftCardCodesRemove (CartGiftCardCodesRemovePayload)
- cartGiftCardCodesUpdate (CartGiftCardCodesUpdatePayload)
- cartLinesAdd (CartLinesAddPayload)
- cartLinesRemove (CartLinesRemovePayload)
- cartLinesUpdate (CartLinesUpdatePayload)
- cartMetafieldDelete (CartMetafieldDeletePayload)
- cartMetafieldsSet (CartMetafieldsSetPayload)
- cartNoteUpdate (CartNoteUpdatePayload)
- cartSelectedDeliveryOptionsUpdate (CartSelectedDeliveryOptionsUpdatePayload)
- customerAccessTokenCreate (CustomerAccessTokenCreatePayload)
- customerAccessTokenCreateWithMultipass (CustomerAccessTokenCreateWithMultipassPayload)
- customerAccessTokenDelete (CustomerAccessTokenDeletePayload)
- customerAccessTokenRenew (CustomerAccessTokenRenewPayload)
- customerActivate (CustomerActivatePayload)
- customerActivateByUrl (CustomerActivateByUrlPayload)
- customerAddressCreate (CustomerAddressCreatePayload)
- customerAddressDelete (CustomerAddressDeletePayload)
- customerAddressUpdate (CustomerAddressUpdatePayload)
- customerCreate (CustomerCreatePayload)
- customerDefaultAddressUpdate (CustomerDefaultAddressUpdatePayload)
- customerEmailMarketingSubscribe (CustomerEmailMarketingSubscribePayload)
- customerRecover (CustomerRecoverPayload)
- customerReset (CustomerResetPayload)
- customerResetByUrl (CustomerResetByUrlPayload)
- customerSmsMarketingSubscribe (CustomerSmsMarketingSubscribePayload)
- customerUpdate (CustomerUpdatePayload)
- shopPayPaymentRequestSessionCreate (ShopPayPaymentRequestSessionCreatePayload)
- shopPayPaymentRequestSessionSubmit (ShopPayPaymentRequestSessionSubmitPayload)
- Anchor to cartAttributesUpdatecart•Cart
Attributes Update Attributes Update Payload Updates the attributes on a
Cart. Attributes are custom key-value pairs that store additional information, such as gift messages, special instructions, or order notes.- Anchor to attributesattributes•[Attribute
Input!]! required An array of key-value pairs that contains additional information about the cart.
The input must not contain more than
250values.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
Arguments
- Anchor to cartBuyerIdentityUpdatecart•Cart
Buyer Identity Update Buyer Identity Update Payload Updates the buyer identity on a
Cart, including contact information, location, and checkout preferences. The buyer's country determines international pricing and should match their shipping address.Use this mutation to associate a logged-in customer via access token, set a B2B company location, or configure checkout preferences like delivery method. Preferences prefill checkout fields but don't sync back to the cart if overwritten at checkout.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to buyerIdentitybuyer•Cart
Identity Buyer Identity Input! required The customer associated with the cart. Used to determine international pricing. Buyer identity should match the customer's shipping address.
Arguments
- Anchor to cartCreatecart•Cart
Create Create Payload Creates a new
Cartfor a buyer session. You can optionally initialize the cart with merchandise lines, discount codes, gift card codes, buyer identity for international pricing, and custom attributes.The returned cart includes a
that directs the buyer to complete their purchase.- Anchor to inputinput•Cart
Input The fields used to create a cart.
Arguments
- Anchor to cartDeliveryAddressesAddcart•Cart
Delivery Addresses Add Delivery Addresses Add Payload Adds delivery addresses to a
Cart. A cart can have up to 20 delivery addresses. One address can be marked as selected for checkout, and addresses can optionally be marked as one-time use so they aren't saved to the customer's account.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressesaddresses•[Cart
Selectable Address Input!]! required A list of delivery addresses to add to the cart.
The input must not contain more than
250values.
Arguments
- Anchor to cartDeliveryAddressesRemovecart•Cart
Delivery Addresses Remove Delivery Addresses Remove Payload Removes delivery addresses from a
Cartby their IDs, allowing batch removal in a single request.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressIdsaddress•[ID!]!
Ids required A list of delivery addresses by handle to remove from the cart.
The input must not contain more than
250values.
Arguments
- Anchor to cartDeliveryAddressesReplacecart•Cart
Delivery Addresses Replace Delivery Addresses Replace Payload Replaces all delivery addresses on a
Cartwith a new set of addresses in a single operation. Unlike, which modifies existing addresses, this mutation removes all current addresses and sets the provided list as the new delivery addresses.One address can be marked as selected, and each address can be flagged for one-time use or configured with a specific validation strategy.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressesaddresses•[Cart
Selectable Address Input!]! required A list of delivery addresses to replace on the cart.
The input must not contain more than
250values.
Arguments
- Anchor to cartDeliveryAddressesUpdatecart•Cart
Delivery Addresses Update Delivery Addresses Update Payload Updates one or more delivery addresses on a
Cart. Each address can be modified to change its details, set it as the pre-selected address for checkout, or mark it for one-time use so it isn't saved to the customer's account.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressesaddresses•[Cart
Selectable Address Update Input!]! required The delivery addresses to update.
The input must not contain more than
250values.
Arguments
- Anchor to cartDiscountCodesUpdatecart•Cart
Discount Codes Update Discount Codes Update Payload Updates the discount codes applied to a
Cart. This mutation replaces all existing discount codes with the provided list, so pass an empty array to remove all codes. Discount codes are case-insensitive.After updating, check each
in the cart'sfield to see whether the code is applicable to the cart's current contents.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to discountCodesdiscount•[String!]!
Codes required The case-insensitive discount codes that the customer added at checkout.
The input must not contain more than
250values.
Arguments
- Anchor to cartGiftCardCodesAddcart•Cart
Gift Card Codes Add Gift Card Codes Add Payload Adds gift card codes to a
Cartwithout replacing any codes already applied. Gift card codes are case-insensitive.To replace all gift card codes instead of adding to them, use
.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to giftCardCodesgift•[String!]!
Card Codes required The case-insensitive gift card codes to add.
The input must not contain more than
250values.
Arguments
- Anchor to cartGiftCardCodesRemovecart•Cart
Gift Card Codes Remove Gift Card Codes Remove Payload Removes gift cards from a
Cartusing their IDs. You can retrieve the IDs of applied gift cards from the cart'sfield.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to appliedGiftCardIdsapplied•[ID!]!
Gift Card Ids required The gift cards to remove.
The input must not contain more than
250values.
Arguments
- Anchor to cartGiftCardCodesUpdatecart•Cart
Gift Card Codes Update Gift Card Codes Update Payload Updates the gift card codes applied to the cart. Unlike
, which adds codes without replacing existing ones, this mutation sets the gift card codes for the cart. Gift card codes are case-insensitive.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to giftCardCodesgift•[String!]!
Card Codes required The case-insensitive gift card codes.
The input must not contain more than
250values.
Arguments
- Anchor to cartLinesAddcart•Cart
Lines Add Lines Add Payload Adds one or more merchandise lines to an existing
Cart. Each line specifies the product variant to purchase. Quantity defaults to1if not provided.You can add up to 250 lines in a single request. Use
to configure each line's merchandise, quantity, selling plan, custom attributes, and any parent relationships for nested line items such as warranties or add-ons.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to lineslines•[Cart
Line Input!]! required A list of merchandise lines to add to the cart.
The input must not contain more than
250values.
Arguments
- Anchor to cartLinesRemovecart•Cart
Lines Remove Lines Remove Payload Removes one or more merchandise lines from a
Cart. Accepts up to 250 line IDs per request. Returns the updated cart along with any errors or warnings.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to lineIdsline•[ID!]!
Ids required The merchandise line IDs to remove.
The input must not contain more than
250values.
Arguments
- Anchor to cartLinesUpdatecart•Cart
Lines Update Lines Update Payload Updates one or more merchandise lines on a
Cart. You can modify the quantity, swap the merchandise, change custom attributes, or update the selling plan for each line. You can update a maximum of 250 lines per request.Omitting the
attributesfield or setting it to null preserves existing line attributes. Pass an empty array to clear all attributes from a line.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to lineslines•[Cart
Line Update Input!]! required The merchandise lines to update.
The input must not contain more than
250values.
Arguments
- Anchor to cartMetafieldDeletecart•Cart
Metafield Delete Metafield Delete Payload Deletes a cart metafield.
NoteThis mutation won't trigger Shopify Functions. The changes won't be available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
Note:This mutation won't trigger Shopify Functions. The changes won't be available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
Note: This mutation won't trigger <a href="https://shopify.dev/docs/api/functions">Shopify Functions</a>. The changes won't be available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
- Anchor to inputinput•Cart
Metafield Delete Input! required The input fields used to delete a cart metafield.
Arguments
- Anchor to cartMetafieldsSetcart•Cart
Metafields Set Metafields Set Payload Sets
Metafieldvalues on a cart, creating new metafields or updating existing ones. Accepts up to 25 metafields per request.Cart metafields can automatically copy to order metafields when an order is created, if there's a matching order metafield definition with the cart to order copyable capability enabled.
NoteThis mutation doesn't trigger Shopify Functions. Changes aren't available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
Note:This mutation doesn't trigger Shopify Functions. Changes aren't available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
Note: This mutation doesn't trigger <a href="https://shopify.dev/docs/api/functions">Shopify Functions</a>. Changes aren't available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
- Anchor to metafieldsmetafields•[Cart
Metafields Set Input!]! required The list of Cart metafield values to set. Maximum of 25.
The input must not contain more than
250values.
Arguments
- Anchor to cartNoteUpdatecart•Cart
Note Update Note Update Payload Updates the note on a
Cart. The note is a text field that stores additional information, such as a personalized message from the buyer or special instructions for the order.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to notenote•String!required
The note on the cart.
Arguments
- Anchor to cartSelectedDeliveryOptionsUpdatecart•Cart
Selected Delivery Options Update Selected Delivery Options Update Payload Updates the selected delivery option for one or more
objects in a cart. Each delivery group represents items shipping to a specific address and offers multiple delivery options with different costs and methods.Use this mutation when a customer chooses their preferred shipping method during checkout. The
identifies whichto select for each delivery group.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to selectedDeliveryOptionsselected•[Cart
Delivery Options Selected Delivery Option Input!]! required The selected delivery options.
The input must not contain more than
250values.
Arguments
- Anchor to customerAccessTokenCreatecustomer•Customer
Access Token Create Access Token Create Payload Token access required For legacy customer accounts only.
Creates a
using the customer's email and password. The access token is required to read or modify theCustomerobject, such as updating account information or managing addresses.The token has an expiration time. Use
to extend the token before it expires, or create a new token if it's already expired.CautionThis mutation handles customer credentials. Always transmit requests over HTTPS and never log or expose the password.
Caution:This mutation handles customer credentials. Always transmit requests over HTTPS and never log or expose the password.
Caution: This mutation handles customer credentials. Always transmit requests over HTTPS and never log or expose the password.
- Anchor to inputinput•Customer
Access Token Create Input! required The fields used to create a customer access token.
Arguments
- Anchor to customerAccessTokenCreateWithMultipasscustomer•Customer
Access Token Create With Multipass Access Token Create With Multipass Payload Token access required Creates a
using a multipass token instead of email and password. This enables single sign-on for customers who authenticate through an external system.If the customer doesn't exist in Shopify, then a new customer record is created automatically. If the customer exists but the record is disabled, then the customer record is re-enabled.
CautionMultipass tokens are only valid for 15 minutes and can only be used once. Generate tokens on-the-fly when needed rather than in advance.
Caution:Multipass tokens are only valid for 15 minutes and can only be used once. Generate tokens on-the-fly when needed rather than in advance.
Caution: Multipass tokens are only valid for 15 minutes and can only be used once. Generate tokens on-the-fly when needed rather than in advance.
- Anchor to multipassTokenmultipass•String!
Token required A valid multipass token to be authenticated.
Arguments
- Anchor to customerAccessTokenDeletecustomer•Customer
Access Token Delete Access Token Delete Payload Token access required Permanently destroys a
. Use this mutation when a customer explicitly signs out or when you need to revoke the token. Useto generate a new token with the customer's credentials.CautionThis action is irreversible. The customer needs to sign in again to obtain a new access token.
Caution:This action is irreversible. The customer needs to sign in again to obtain a new access token.
Caution: This action is irreversible. The customer needs to sign in again to obtain a new access token.
- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
Arguments
- Anchor to customerAccessTokenRenewcustomer•Customer
Access Token Renew Access Token Renew Payload Token access required Extends the validity of a
before it expires. The renewed token maintains authenticated access to customer operations.Renewal must happen before the token's
time. If a token has already expired, then useto generate a new token with the customer's credentials.CautionStore access tokens securely. Never store tokens in plain text or insecure locations, and avoid exposing them in URLs or logs.
Caution:Store access tokens securely. Never store tokens in plain text or insecure locations, and avoid exposing them in URLs or logs.
Caution: Store access tokens securely. Never store tokens in plain text or insecure locations, and avoid exposing them in URLs or logs.
- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
Arguments
- Anchor to customerActivatecustomer•Customer
Activate Activate Payload Token access required Activates a customer account using an activation token received from the
mutation. The customer sets their password during activation and receives afor authenticated access.For a simpler approach that doesn't require parsing the activation URL, use
instead.CautionThis mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.
Caution:This mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.
Caution: This mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.
- •ID!required
Specifies the customer to activate.
- Anchor to inputinput•Customer
Activate Input! required The fields used to activate a customer.
Arguments
- •ID!
- Anchor to customerActivateByUrlcustomer•Customer
Activate By Url Activate By Url Payload Token access required Activates a customer account using the full activation URL from the
mutation. This approach simplifies activation by accepting the complete URL directly, eliminating the need to parse it for the customer ID and activation token. Returns afor authenticating subsequent requests.CautionStore the returned access token securely. It grants access to the customer's account data.
Caution:Store the returned access token securely. It grants access to the customer's account data.
Caution: Store the returned access token securely. It grants access to the customer's account data.
- Anchor to activationUrlactivation•URL!
Url required The customer activation URL.
- Anchor to passwordpassword•String!required
A new password set during activation.
Arguments
- Anchor to customerAddressCreatecustomer•Customer
Address Create Address Create Payload Token access required Creates a new
for aCustomer. Use the customer's access token to identify them. Successful creation returns the new address.Each customer can have multiple addresses.
- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
- Anchor to addressaddress•Mailing
Address Input! required The customer mailing address to create.
Arguments
- Anchor to customerAddressDeletecustomer•Customer
Address Delete Address Delete Payload Token access required Permanently deletes a specific
for aCustomer. Requires a valid customer access token to authenticate the request.CautionThis action is irreversible. You can't recover the deleted address.
Caution:This action is irreversible. You can't recover the deleted address.
Caution: This action is irreversible. You can't recover the deleted address.
- •ID!required
Specifies the address to delete.
- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
Arguments
- •ID!
- Anchor to customerAddressUpdatecustomer•Customer
Address Update Address Update Payload Token access required Updates an existing
for aCustomer. Requires a customer access token to identify the customer, an ID to specify which address to modify, and anaddresswith the updated fields.- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
- •ID!required
Specifies the customer address to update.
- Anchor to addressaddress•Mailing
Address Input! required The customer’s mailing address.
Arguments
- Anchor to customerCreatecustomer•Customer
Create Create Payload Token access required Creates a new
Customeraccount with the provided contact information and login credentials. The customer can then sign in for things such as accessing their account, viewing order history, and managing saved addresses.CautionThis mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.
Caution:This mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.
Caution: This mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.
- Anchor to inputinput•Customer
Create Input! required The fields used to create a new customer.
Arguments
- Anchor to customerDefaultAddressUpdatecustomer•Customer
Default Address Update Default Address Update Payload Token access required Updates the default address of an existing
Customer. Requires a customer access token to identify the customer and an address ID to specify which address to set as the new default.- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
- Anchor to addressIdaddress•ID!
Id required ID of the address to set as the new default for the customer.
Arguments
- Anchor to customerEmailMarketingSubscribecustomer•Customer
Email Marketing Subscribe Email Marketing Subscribe Payload Token access required Subscribes a customer to the newsletter with an email address.
- Anchor to emailemail•String!required
The customer's email address.
Arguments
- Anchor to customerRecovercustomer•Customer
Recover Recover Payload Token access required Sends a reset password email to the customer. The email contains a reset password URL and token that you can pass to the
ormutation to reset the customer's password.This mutation is throttled by IP. With private access, you can provide a
header instead of the request IP. The header is case-sensitive.CautionEnsure the value provided to
is trusted. Unthrottled access to this mutation presents a security risk.Caution:Ensure the value provided to
is trusted. Unthrottled access to this mutation presents a security risk.Caution: Ensure the value provided to <code><span class="PreventFireFoxApplyingGapToWBR">Shopify-Storefront-Buyer-I<wbr/>P</span></code> is trusted. Unthrottled access to this mutation presents a security risk.
- Anchor to emailemail•String!required
The email address of the customer to recover.
Arguments
- Anchor to customerResetcustomer•Customer
Reset Reset Payload Token access required Resets a customer's password using the reset token from a password recovery email. On success, returns the updated
Customerand a newfor immediate authentication.Use the
mutation to send the password recovery email that provides the reset token. Alternatively, useif you have the full reset URL instead of the customer ID and token.CautionThis mutation handles sensitive customer credentials. Validate password requirements on the client before submission.
Caution:This mutation handles sensitive customer credentials. Validate password requirements on the client before submission.
Caution: This mutation handles sensitive customer credentials. Validate password requirements on the client before submission.
- •ID!required
Specifies the customer to reset.
- Anchor to inputinput•Customer
Reset Input! required The fields used to reset a customer’s password.
Arguments
- •ID!
- Anchor to customerResetByUrlcustomer•Customer
Reset By Url Reset By Url Payload Token access required Resets a customer's password using the reset URL from a password recovery email. The reset URL is generated by the
mutation.On success, returns the updated
Customerand a newfor immediate authentication.CautionThis mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.
Caution:This mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.
Caution: This mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.
- Anchor to resetUrlreset•URL!
Url required The customer's reset password url.
- Anchor to passwordpassword•String!required
New password that will be set as part of the reset password process.
Arguments
- Anchor to customerSmsMarketingSubscribecustomer•Customer
Sms Marketing Subscribe Sms Marketing Subscribe Payload Token access required Subscribes a customer to the newsletter with a phone number.
- Anchor to phoneNumberphone•String!
Number required The customer's phone number.
Arguments
- Anchor to customerUpdatecustomer•Customer
Update Update Payload Token access required Updates a customer's personal information such as name, password, and marketing preferences. Requires a valid
to authenticate the customer making the update.If the customer's password is updated, then all previous access tokens become invalid. The mutation returns a new access token in the payload to maintain the customer's session.
CautionPassword changes invalidate all existing access tokens. Ensure your app handles the new token returned in the response to avoid logging the customer out.
Caution:Password changes invalidate all existing access tokens. Ensure your app handles the new token returned in the response to avoid logging the customer out.
Caution: Password changes invalidate all existing access tokens. Ensure your app handles the new token returned in the response to avoid logging the customer out.
- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
- Anchor to customercustomer•Customer
Update Input! required The customer object input.
Arguments
- Anchor to shopPayPaymentRequestSessionCreateshop•Shop
Pay Payment Request Session Create Pay Payment Request Session Create Payload Creates a Shop Pay payment request session for processing payments. The session includes a checkout URL where customers complete their purchase and a token for subsequent operations like submitting the payment.
The
must be unique across all orders to ensure accurate reconciliation.For a complete integration guide including the JavaScript SDK setup and checkout flow, refer to the Shop Component API documentation. For implementation steps, see the development journey guide. For common error scenarios, see the troubleshooting guide.
- Anchor to sourceIdentifiersource•String!
Identifier required A unique identifier for the payment request session.
- Anchor to paymentRequestpayment•Shop
Request Pay Payment Request Input! required A payment request object.
Arguments
- Anchor to shopPayPaymentRequestSessionSubmitshop•Shop
Pay Payment Request Session Submit Pay Payment Request Session Submit Payload Finalizes a Shop Pay payment request session. Call this mutation after creating a session with
.The
argument ensures the payment transaction occurs only once, preventing duplicate charges. On success, returns awith the processing status and a receipt token.For a complete integration guide including the JavaScript SDK setup and checkout flow, refer to the Shop Component API documentation. For implementation steps, see the development journey guide. For common error scenarios, see the troubleshooting guide.
- Anchor to tokentoken•String!required
A token representing a payment session request.
- Anchor to paymentRequestpayment•Shop
Request Pay Payment Request Input! required The final payment request object.
- Anchor to idempotencyKeyidempotency•String!
Key required The idempotency key is used to guarantee an idempotent result.
- Anchor to orderNameorder•String
Name The order name to be used for the order created from the payment request.
Arguments