Skip to main content
Log inSign up

Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our privacy policy and our cookie policy.

productSet and customerSet mutations now support upserts and custom IDs

As of version 2025-04, the productSet and customerSet mutations of the GraphQL Admin API support upserting (creating or updating) records by identifier.

When identifier is provided, these mutations use it to check for an existing record. If an existing record is found, then the mutation updates it with the data provided in input. Otherwise, the mutation creates a new record.

The identifier gives developers a straightforward, idempotent mechanism to create and subsequently update records with the same shape of inputs, without the need for extra queries to check if records exist. For identifiers, productSet allows handle, id, and customId. customerSet allows phone, email, and customId.

This extends previously existing behaviour on productSet, which updates a record if id is provided in the input and otherwise creates a new record. The customerSet mutation was previously released only to the unstable version of the API.

Read more about using Custom IDs.

Was this section helpful?