2022-04 release notes
Release date | Date version is no longer supported |
---|---|
April 1, 2022 | July 5, 2023 |
The 2022-04 version of Shopify's APIs includes new ways to search and filter customers using customer segments, organize products on storefronts, and manage fulfillment and shipping for specific delivery expectations.
The 2022-04 version of Shopify's APIs also includes new ways to manage app subscription discounts, and provides new Storefront API functionality that enables you to retrieve information about delivery methods.
What's new in 2022-04
The following features were added in version 2022-04 of Shopify's APIs.
GraphQL Admin API changes:
- Read and modify a new API_PERMISSION metafield owner type.
- Categorize apps using the
AppPublicCategory
enum from thepublicCategory
field that was added to the App object. - Give limited-time discounts on app charges using subscription discounts.
- Issue prorated credits for the unused portion of an app subscription by using the
appSubscriptionCancel
mutation. - Search and filter a shop's customers using customer
segments
. - Retrieve, add, and update the details about a customer's consent to receive marketing material by email using the
emailMarketingConsent
field on theCustomerInput
input object. - Embed and retrieve the origin of videos that are hosted outside of Shopify by using the
embedUrl
field from theExternalVideo
object. - Retrieve the range of time that a delivery is expected to be completed by using the
maxDeliveryDateTime
andminDeliveryDateTime
fields that were added to theDeliveryMethod
object. - Retrieve the latest date and time that items in a fulfillment order need to be fulfilled by using the
fulfillBy
field on theFulfillmentOrder
object. - Create, update, and delete markets and their settings by using the
Market
object. - Retrieve product taxonomy nodes using the
productTaxonomyNodes
connection. - Retrieve attributes of different media types by using the
originalFileSize
field on theGenericFile
,MediaImage
, andVideo
objects, or by using theduration
field on aVideo
object. - Apps installed on Shopify Plus can retrieve information about store staff member Shopify accounts using the
StaffMember
object. - Identify the sales channel that an order came from by using the
ChannelInformation
object. - Add custom attributes to subscriptions by using the
SubscriptionDraft
andSubscriptionContract
objects. - Calculate fulfillment intervals regardless of whether the attempt to create billing for a subscription was successful by using the
originTime
field that was added to theSubscriptionBillingAttempt
object and theSubscriptionBillingAttemptInput
input object.
GraphQL Storefront API changes:
- Query a group of delivery options that are available for the line items in a cart, based on the specified shipping address, by using the
deliveryGroups
connection on theCart
object. - Retrieve SEO information associated with a collection by using the
seo
field on theCollection
object. - Embed and retrieve the origin of videos that are hosted outside of Shopify by using the
originURL
andembedUrl
fields on theExternalVideo
object. - Support multiple languages on storefronts by using the
Language
object. - Replicate a merchant's online store navigation menu on custom storefronts by using the
menu
query. - Query Shopify-hosted videos and generic files that are referenced by a metafield in a shop by using the
MetafieldReference
union. - Query the ID of a shop by using the
id
field in theShop
object.
GraphQL Payments Apps API changes:
- Mark a payment as pending by using the
paymentSessionPending
mutation.
REST Admin API changes
- Customer saved searches are deprecated. Use the GraphQL customer
Segment
object instead. - Retrieve the range of time that a delivery is expected to be completed, and the latest date and time when all items in a fulfillment order need to be fulfilled, by using the
FulfillmentOrder
resource. - Retrieve, add, and update information about a customer's consent to receive email marketing by using the
email_marketing_consent
field on theCustomer
resource. - Identify the sales channel that an order came from by using the
Checkout
andOrder
resources.
Breaking changes
Anchor link to section titled "Breaking changes"These changes require special attention. If your app uses these API resources, and you don’t adjust your usage of the resources according to the following instructions, then your app might break when you update to this API version.
Non-encoded object IDs in the GraphQL Storefront API
Anchor link to section titled "Non-encoded object IDs in the GraphQL Storefront API"Most object types in Shopify's GraphQL APIs have an id
field. The id
field represents the globally-unique identifier for an individual record. Currently, Shopify serves Base64-encoded object IDs from the supported stable versions of the GraphQL Storefront API.
As of January 3, 2022, Shopify began serving non-encoded object IDs from the unstable
version of the GraphQL Storefront API. The 2022-04
release is the first stable version that doesn't serve Base64-encoded object IDs.
If you're caching, persisting to a database, or parsing IDs, then you need to migrate your app.
Saved searches elements removed from the GraphQL Admin API
Anchor link to section titled "Saved searches elements removed from the GraphQL Admin API"You can no longer use the following mutations on the customerSavedSearches
query in the GraphQL Admin API:
SavedSearchCreate
SavedSearchDelete
SavedSearchUpdate
Use the following mutations instead:
SegmentCreate
SegmentDelete
SegmentUpdate
Saved searches elements removed from the REST Admin API
Anchor link to section titled "Saved searches elements removed from the REST Admin API"The following endpoints were removed from the CustomerSavedSearch
resource in the REST Admin API:
search
count
create
destroy
index
show
update
Use the following endpoints instead:
- Instead of
search
, usecustomerSegmentMembers
- Instead of
count
, usesegmentCount
- Instead of
create
, usesegmentCreate
- Instead of
destroy
, usesegmentDelete
- Instead of
show
, usesegment
- Instead of
update
, usesegmentUpdate
Saved search discount elements removed from the GraphQL Admin API
Anchor link to section titled "Saved search discount elements removed from the GraphQL Admin API"The following types were removed from the GraphQL Admin API:
DiscountCustomerSavedSearches
objectDiscountCustomerSavedSearchesInput
input object
Use the following elements instead:
DiscountCustomerSegments
objectDiscountCustomerSegmentsInput
input object
Saved search fields and properties removed from price rule elements in the GraphQL Admin API
Anchor link to section titled "Saved search fields and properties removed from price rule elements in the GraphQL Admin API"The following fields were removed from the GraphQL Admin API:
savedSearches
field from thePriceRuleCustomerSelection
objectsavedSearchesIds
field from thePriceRuleCustomerSelectionInput
input object
Use the following fields instead:
segments
field from thePriceRuleCustomerSelection
objectsegmentIds
field from thePriceRuleCustomerSelectionInput
input object
Saved search property removed from PriceRule element in the GraphQL Admin API
Anchor link to section titled "Saved search property removed from PriceRule element in the GraphQL Admin API"The prerequisite_saved_search_ids
property from the PriceRule
resource in the REST Admin API is deprecated. Use the customer_segment_prerequisite_ids
from the PriceRule
resource instead.
Deprecated countries
field in the GraphQL Admin API
Anchor link to section titled "Deprecated countries field in the GraphQL Admin API"As of API version 2022-04, the countries
field on the PriceListContextRuleInput
input object is deprecated. Use the marketId
field instead.
Deprecated fields on the Customer
object in the GraphQL Admin API
Anchor link to section titled "Deprecated fields on the Customer object in the GraphQL Admin API"As of API version 2022-04, the following fields on the Customer
object are deprecated:
- The
totalSpent
andtotalSpentV2
fields were removed. Use theamountSpent
field instead. - The
ordersCount
field was removed. Use thenumberOfOrders
field instead. - The
hasNote
field was removed. Thenote
field is still in use. - The
hasTimelineComment
field was removed. Use theevents
connection and aquery
argument containingverb:comment
, or look for aCommentEvent
in the__typename
of events.
Deprecated status
field in the GraphQL Payment Apps API
Anchor link to section titled "Deprecated status field in the GraphQL Payment Apps API"As of API version 2022-04, the status
field on the PaymentSession
, RefundSession
, CaptureSession
, and VoidSession
objects is deprecated. Use the state
field instead.
GraphQL Admin API changes
Anchor link to section titled "GraphQL Admin API changes"Below are all the changes currently introduced in the 2022-04 version of the GraphQL Admin API.
API permission owner type for metafields
As of API version 2022-04, a new API_PERMISSION
owner type is available for metafields. A metafield with this permission type is only readable and writable by the app that owns the metafield.
New value
API_PERMISSION
value was added toMetafieldOwnerType
enum
New type
HasMetafields
interface was added toAppInstallation
object
App fields and public category
As of API version 2022-04, the App
object includes several new fields, including the publicCategory
field. The publicCategory
field introduces the AppPublicCategory
enum, which represents the public-facing category for an app.
New fields
publicCategory
field was added toApp
objectpreviouslyInstalled
field was added toApp
objectwebhookApiVersion
field was added toApp
objectrequestedAccessScopes
field was added toApp
objectavailableAccessScopes
field was added toApp
objectdeveloperType
field was added toApp
object
New types
AppPublicCategory
enum was added
App subscription billing discounts
As of API version 2022-04, you can use the GraphQL Admin API to offer limited-time discounts on recurring app charges using the Billing API. You can define either a percentage or a fixed amount discount, which is applied to a designated number of billing intervals. For example, you can apply a 20% discount to six billing cycles.
Learn more about app billing discounts.
New types
AppRecurringPricing
object was addedAppRecurringPricingInput
input object was addedAppSubscriptionDiscount
object was addedAppSubscriptionDiscountAmount
object was addedAppSubscriptionDiscountInput
input object was addedAppSubscriptionDiscountPercentage
object was addedAppSubscriptionDiscountValueInput
input object was addedAppSubscriptionDiscountValue
union was added
New fields
discount_value
field was added toInvoiceCharge
object
App subscription prorate
As of API version 2022-04, you can issue prorated credits for the unused portion of an app subscription when using the appSubscriptionCancel mutation.
New argument
prorate
argument was added toappSubscriptionCancel
mutation
Customer segmentation
As of API version 2022-04, you can use the GraphQL Admin API to search and filter customers using customer segments.
For details about the breaking changes that were introduced in this API version, refer to Breaking changes.
Removed fields
savedSearches
field was removed fromPriceRuleCustomerSelection
objectsavedSearchesIds
field was removed fromPriceRuleCustomerSelectionInput
input object
Removed types
DiscountCustomerSavedSearches
object was removedDiscountCustomerSavedSearchesInput
input object was removed
New mutations
SegmentCreate
mutation was addedSegmentDelete
mutation was addedSegmentUpdate
mutation was added
New types
SegmentAssociationFilterValue
object was addedSegmentAssociationFilter
object was addedSegmentAttributeStatistics
object was addedSegmentBooleanFilter
object was addedCustomerEmailAddress
object was addedCustomerPhoneNumber
object was addedSegmentDateFilter
object was addedDiscountCustomerSegmentsInput
object was addedDiscountCustomerSegments
object was addedDiscountCustomerSegments
type was added toDiscountCustomerSelection
unionSegmentEnumFilterValue
object was addedSegmentEnumFilter
object was addedSegmentEventFilterValue
object was addedSegmentEventFilter
object was addedSegmentFloatFilter
object was addedSegmentIntegerFilter
object was addedSegmentFilter
interface was addedCustomerSegmentMember
object was addedSegmentMigration
object was addedSegmentValue
object was addedSegment
object was addedSegmentMembership
object was addedSegmentMembershipResponse
object was addedSegmentStatistics
object was addedSegmentStringFilterValue
object was addedSegmentStringFilter
object was added
New values
BOTH_CUSTOMER_AND_SEGMENT_PREREQUISITES_SELECTED
value was added toPriceRuleErrorCode
enumBOTH_SAVED_SEARCH_AND_SEGMENT_PREREQUISITES_SELECTED
value was added toPriceRuleErrorCode
enumCUSTOMER_SEGMENT_EXCEEDED_MAX
value was added toPriceRuleErrorCode
enumCUSTOMER_SEGMENT_INVALID
value was added toPriceRuleErrorCode
enumCUSTOMER_SEGMENT_PREREQUISITE_DUPLICATE
value was added toPriceRuleErrorCode
enumCREATED_AT
value was added toCustomerSortKeys
enum
New fields
customerSegments
field was added toDiscountCustomerSelectionInput
input objectcustomerSegmentMembership
field was added toQueryRoot
objectsegmentCount
field was added toQueryRoot
objectsegmentIds
field was added toPriceRuleCustomerSelectionInput
input objectsegment
field was added toQueryRoot
objectsegments
field was added toPriceRuleCustomerSelection
objectunsubscribeUrl
field was added toCustomer
object
New connections
CustomerSegmentMemberConnection
connection was added toCustomerSegmentMember
objectsegmentFilterSuggestions
connection was added toQueryRoot
objectsegmentFilters
connection was added toQueryRoot
objectcustomerSegmentMembers
connection was added toQueryRoot
objectsegmentMigrations
connection was added toQueryRoot
objectsegmentValueSuggestions
connection was added toQueryRoot
objectsegments
connection was added toQueryRoot
object
Deprecated countries field
As of API version 2022-04, the countries
field on the PriceListContextRuleInput
input object is deprecated. Use the marketId
field instead.
Removed fields
countries
field was removed fromPriceListContextRuleInput
Deprecated fields on Customer
As of API version 2022-04, several fields are removed from the Customer
object.
Removed fields
totalSpent
andtotalSpentV2
fields were removed. Use theamountSpent
field instead.ordersCount
field was removed. Use theamountSpent
field instead.hasNote
field was removed. Thenote
field is still in use.hasTimelineComment
field was removed. Use theevents
connection and aquery
argument containingverb:comment
, or look for aCommentEvent
in the__typename
of events.
Email marketing consent
As of API version 2022-04 you can use the GraphQL Admin API to retrieve, add, and update the details about a customer's consent to receive marketing material by email using channel-specific fields. You can also subscribe to the CUSTOMERS_MARKETING_CONSENT_UPDATE
webhook topic to get notified when a customer updates their marketing consent.
The acceptsMarketing
, acceptsMarketingUpdatedAt
, and marketingOptInLevel
fields on the Customer
object and CustomerInput
input object are deprecated. Use the emailMarketingConsent
field on the CustomerInput
input object instead.
Deprecated fields
acceptsMarketing
field is deprecated onCustomer
object andCustomerInput
input objectacceptsMarketingUpdatedAt
field is deprecated onCustomer
object andCustomerInput
input objectmarketingOptInLevel
field is deprecated onCustomer
object andCustomerInput
input object
New types
CustomerEmailMarketingConsentState
object was addedCustomerEmailMarketingConsentInput
input object was addedCustomerEmailMarketingConsentUpdateInput
input object was addedCustomerEmailAddressMarketingState
enum was addedCustomerEmailMarketingConsentUpdateUserErrorCode
enum was addedCustomerEmailMarketingState
enum was addedCustomerEmailMarketingConsentUpdatePayload
payload was added
New mutation
customerEmailMarketingConsentUpdate
mutation was added
New fields
emailMarketingConsent
field was added toCustomer
objectemailMarketingConsent
field was added toCustomerInput
input object, forcustomerCreate
andcustomerUpdate
mutations
Error codes for translation
As of API version 2022-04, the INVALID_LOCALE_FOR_SHOP
error code on the TranslationErrorCode
enum is used to represent all errors related to the locale
field on the Translation
object. Previous versions use INVALID_CODE
for the same errors.
Externally-hosted videos
As of API version 2022-04, you can use the GraphQL Admin API to query the origin and embed URLs of videos hosted outside of Shopify.
New fields
originUrl
field was added toExternalVideo
objectembedUrl
field was added toExternalVideo
object
Fulfillment: Delivery time
As of API version 2022-04, you can use the GraphQL Admin API to query a range of time when a delivery is expected to be completed.
New fields
maxDeliveryDateTime
field was added toDeliveryMethod
objectminDeliveryDateTime
field was added toDeliveryMethod
object
Fulfillment: Fulfillment time
As of API version 2022-04, you can use the GraphQL Admin API to query the latest date and time when all items in a fulfillment order need to be fulfilled.
New fields
fulfillBy
field was added toFulfillmentOrder
object
Markets
As of API version 2022-04, you can use the GraphQL Admin API to create, update, and delete markets and their settings. A market is a group of one or more regions that you want to target for international sales.
New fields
alternateLocales
field was added toMarketWebPresence
objectbaseCurrency
field was added toMarketCurrencySettings
objectcode
field was added toMarketRegionCountry
objectcurrencySettings
field was added toMarket
objectdefaultLocale
field was added toMarketWebPresence
objectdomain
field was added toMarketWebPresence
objectenabled
field was added toMarket
objectlocalCurrencies
field was added toMarketCurrencySettings
objectlocale
field was added toMarketWebPresenceRootUrl
objectid
field was added toMarket
objectid
field was added toMarketRegionCountry
objectid
field was added toMarketWebPresence
objectmarket
field was added toMarketWebPresence
objectmarket
field was added toPriceListContextRule
objectmarketId
field was added toPriceListContextRuleInput
input objectmarketWebPresence
field was added toDomain
objectname
field was added toMarketRegionCountry
objectpricelist
field was added toMarket
objectprimary
field was added toMarket
objectrootUrls
field was added toMarketWebPresence
objectsubfolderSuffix
field was added toMarketWebPresence
objecturl
field was added toMarketWebPresenceRootUrl
objectwebPresence
field was added toMarket
object
New connections
regions
connection was added toMarket
object
New mutations
marketCreate
mutation was addedmarketDelete
mutation was addedmarketCurrencySettingsUpdate
mutation was addedmarketRegionDelete
mutation was addedmarketRegionCreate
mutation was addedmarketRegionsCreate
mutation was addedmarketUpdate
mutation was addedmarketWebPresenceCreate
mutation was addedmarketWebPresenceDelete
mutation was addedmarketWebPresenceUpdate
mutation was added
New error codes
CURRENCY_MARKET_MISMATCH
error code was added toPriceListUserError
user errorMARKET_CURRENCY_MISMATCH
error code was added toPriceListUserError
user errorCONTEXT_RULE_LIMIT_ONE_OPTION
error code was added toPriceListUserError
user errorCONTEXT_RULE_MARKET_NOT_FOUND
error code was added toPriceListUserError
user errorCONTEXT_RULE_MARKET_TAKEN
error code was added toPriceListUserError
user errorCURRENCY_NOT_SUPPORTED
error code was added toPriceListUserError
user errorPRICE_LIST_NOT_ALLOWED_FOR_PRIMARY_MARKET
error code was added toPriceListUserError
user error
New types
CurrencySettings
object was added toMarket
objectCurrencySettingsUpdateInput
input object was added toMarket
objectMarket
object was addedMarketCurrencySettingsUserError
user error was addedMarketCreateInput
input object was addedMarketRegionCountry
object was addedMarketUserError
user error was addedMarketWebPresenceRootUrl
object was addedRegionCreateInput
input object was added toMarket
objectWebPresence
object was added toMarket
objectWebPresenceCreateInput
input object was added toMarket
objectWebPresenceUpdateInput
input object was added toMarket
object
Improvements to GraphQL connections
As of API version 2022-04, we've added a nodes
field on the Connection
object. When you only query node
on edges
, you can simplify the query. We've also added the startCursor
and endCursor
fields on the PageInfo
object, which allows you to simplify the shape of return data for pagination.
For more information, refer to Paginating results with GraphQL.
New fields
nodes
field was added toConnection
objectstartCursor
field was added toPageInfo
objectendCursor
field was added toPageInfo
object
Metafield definition visibility
To allow custom storefronts to display your metafields, you can now use the GraphQL Admin API to toggle Storefront API access to metafield definitions. Metafield definitions enable you to define additional validation constraints for metafields and edit metafield values in context. By default, values for metafields aren't accessible to custom storefronts.
Example use cases for accessing the Storefront API might include merchants who sell their Shopify products through a non-Shopify website, a video game, or another custom shopping experience.
New fields
visibleToStorefrontApi
field was added to the following GraphQL Admin API resources:
MetafieldDefinition
objectStandardMetafieldDefinitionTemplate
objectMetafieldDefinitionInput
input objectMetafieldDefinitionUpdateInput
input objectStandardMetafieldDefinitionEnable
mutation
Metafield definition error codes
As of API version 2022-04, we've added an error code that returns when a metafield definition is created with invalid characters in the key
or namespace
fields. The namespace
and key
fields can contain only alphanumeric characters, hyphens, and underscores.
New error code
INVALID_CHARACTER
error code was added toMetafieldDefinitionCreateUserErrorCode
enum
Metafield element index
As of API version 2022-04, you can use the GraphQL Admin API to include the element index in metafield error messages when an array element fails validation.
New fields
elementIndex
field was added toMetafieldsSetUserError
object
Product taxonomy
You can now query the GraphQL Admin API to retrieve the nodes of a product taxonomy. This includes all of the standard and custom product types associated with a product.
New connection
productTaxonomyNodes
connection was added toQueryRoot
Rich media enhancements
As of API version 2022-04, you can use the GraphQL Admin API to query Shopify-hosted videos that are referenced by a metafield in a merchant's store. You can also query specific attributes of media types, such as the original file size of a generic file (for example, a .pdf
or json
file), media image, or video.
New types
Video
type was added toMetafieldReference
unionFile
interface type was added toVideo
object
New fields
previewImageSource
field was added toFileUpdateInput
input objectoriginalFileSize
field was added toGenericFile
objectoriginalFileSize
field was added toMediaImage
objectoriginalFileSize
field was added toVideo
objectduration
field was added toVideo
object
New values
VIDEO
value was added toFileContentType
enum
New error codes
NON_IMAGE_MEDIA_PER_SHOP_LIMIT_EXCEEDED
error code was added toFilesUserError
Staff member data
You can now use the GraphQL Admin API to request data about store staff member Shopify accounts.
New object
StaffMember
object was added
Sales channel attribution
As of API version 2022-04, you can use the GraphQL Admin API to identify the sales channel that an order came from. For example, you can now identify whether orders made through the Facebook channel app came from Facebook Marketplace, Instagram, or Messenger. Similarly, for orders made through connector apps, you can identify whether orders are attributable to specific sales channels rather than to the connector app.
For an order to be correctly attributed to a channel, you need to register the channels that your app manages. After your request has been processed, refer to the list of your registered channels in the Partner Dashboard, on the app's Marketplace extension. From there, set the specified handle as the source_name in your request.
New objects
AvailableChannelDefinitionsByChannel
object was addedChannelDefinition
object was addedChannelInformation
object was added
New fields
channelInformation
field was added toOrder
objectregisteredSourceUrl
field added toOrder
objectsourceIdentifier
field was added toOrder
objectsourceName
field was added toDraftOrderInput
Input objecfchannelDefinitionsforInstalledChannels
field was added toShop
object
New argument
sourceName
argument was added toDraftOrderComplete
mutation
Subscriptions: Custom attributes
As of API version 2022-04, you can add custom attributes to a subscription draft or subscription contract. Custom attributes are copied to new orders that are generated from a subscription contract.
New fields
customAttributes
field was added toSubscriptionDraft
objectcustomAttributes
field was added toSubscriptionDraftInput
input objectcustomAttributes
field was added toSubscriptionContract
object
Subscriptions: Fulfillment intervals
When you create a subscription billing attempt, you can now calculate fulfillment intervals regardless of whether the attempt was successfully completed. This option prevents fulfillment from being pushed to the next anchor date when billing happens after the current anchor date.
New fields
originTime
field was added toSubscriptionBillingAttempt
objectoriginTime
field was added toSubscriptionBillingAttemptInput
object
Subscriptions: Payment methods
As of API version 2022-04, the CustomerPaymentMethodRevocationReason
enum includes a new value: MERGED
. This value is assigned when a customer replaces a payment method with another existing payment method, leaving the revoked payment method with no associated subscription contracts. The associated subscription contracts are migrated to the other payment method.
New value
MERGED
value was added toCustomerPaymentMethodRevocationReason
enum
GraphQL Storefront API changes
Anchor link to section titled "GraphQL Storefront API changes"Below are all the changes currently introduced in the 2022-04 version of the GraphQL Storefront API.
Cart
As of API version 2022-04, you can use the GraphQL Storefront API to query a group of delivery options that are available for the line items in a cart, based on the specified shipping address.
Delivery groups are only available for logged-in customers that have a full default address.
Refer the cartCreate and customerCreate mutations to learn more about how to create a cart for a logged-in customer.
New types
CartDeliveryGroup
object was addedCartDeliveryOption
object was addeddeliveryGroups
connection was added toCart
objectDeliveryMethodType
enum was added
Collections
As of API version 2022-04, you can use the Storefront API to query SEO information associated with a collection.
New field
seo
field was added toCollection
object
Externally-hosted videos
As of API version 2022-04, you can use the GraphQL Storefront API to query the origin and embed URLs of videos hosted outside of Shopify.
New field
originUrl
field was added toExternalVideo
objectembedUrl
field was added toExternalVideo
object
Filtering data
As of API version 2022-04, the Storefront API includes a BOOLEAN
value on the FilterType
enum. The BOOLEAN
value is assigned when a filter is based off of a boolean
metafield type.
New value
BOOLEAN
value was added toFilterType
enum
Improvements to GraphQL connections
As of API version 2022-04, we've added a nodes
field on the Connection
object. When you only query node
on edges
, you can simplify the query. We've also added the startCursor
and endCursor
fields on the PageInfo
object, which allows you to simplify the shape of return data for pagination.
For more information, refer to Paginating results with GraphQL.
New fields
nodes
field was added toConnection
objectstartCursor
field was added toPageInfo
objectendCursor
field was added toPageInfo
object
Languages
As of API version 2022-04, you can use the inContext
directive to contextualize any query in one of the shop's available languages. You can configure the languages available for each country context within the shop’s Markets settings. You can access a list of available languages using the Localization
object.
For more information, refer to Support multiple languages on storefronts.
New type
Language
object was added
New fields
availableLanguages
field was added toCountry
objectavailableLanguages
field was added toLocalization
objectlanguage
field was added toLocalization
object
New argument
language
argument was added toInContext
directive
Navigation menu
As of API version 2022-04, you can use the Storefront API to query a navigation menu by its handle. The menu field returns a Menu object, and can be used to replicate a merchant's online store navigation menu on custom storefronts.
New types
Menu
object was addedMenuItem
object was addedMenuItemType
enum was added
New field
menu
field was added toQueryRoot
object
Non-encoded object IDs
Most object types in Shopify's GraphQL APIs have an id
field. The id
field represents the globally-unique identifier for an individual record. Currently, Shopify serves Base64-encoded object IDs from the supported stable versions of the GraphQL Storefront API.
As of January 3, 2022, Shopify began serving non-encoded object IDs from the unstable
version of the GraphQL Storefront API. The 2022-04
release is the first stable version that doesn't serve Base64-encoded object IDs.
If you're caching, persisting to a database, or parsing IDs, then you need to migrate your app.
Rich media enhancements
As of API version 2022-04, you can use the GraphQL Storefront API to query Shopify-hosted videos and generic files (for example, .pdf
and .json
files) that are referenced by a metafield in a merchant's store.
New types
GenericFile
was addedGenericFile
type was added toMetafieldReference
unionVideo
type was added toMetafieldReference
union
Shop ID
As of API version 2022-04, you can use the GraphQL Storefront API to query the ID of a shop.
New field
id
field was added toShop
object
GraphQL Payments Apps API changes
Anchor link to section titled "GraphQL Payments Apps API changes"Below are all the changes currently introduced in the 2022-04 version of the GraphQL Payments Apps API.
Deprecated status field
As of API version 2022-04, the status
field on the PaymentSession
, RefundSession
, CaptureSession
, and VoidSession
objects is deprecated. Use the state
field instead.
Removed fields
status
field was removed fromPaymentSession
objectstatus
field was removed fromRefundSession
objectstatus
field was removed fromCaptureSession
objectstatus
field was removed fromVoidSession
object
New fields
state
field was added toPaymentSession
objectstate
field was added toRefundSession
objectstate
field was added toCaptureSession
objectstate
field was added toVoidSession
object
Pending payments
As of API version 2022-04, you can use the GraphQL Payments Apps API to mark an offsite payment as pending. You can mark a payment as pending if the payment can't be completed within a reasonable amount of time. This means that customers won't need to wait for slow transactions to finish before their order is completed.
New types
paymentSessionPending
mutation was addedPaymentSessionPendingUserError
object was addedPENDING
value was added toPaymentSessionStatusCode
enum
New arguments
pendingExpiresAt
argument was added topaymentSessionPending
mutationreason
argument was added topaymentSessionPending
mutation
REST Admin API changes
Anchor link to section titled "REST Admin API changes"Below are all the changes currently introduced in the 2022-04 version of the REST Admin API.
Customer segmentation
As of API version 2022-04, you can use the REST Admin API to search for customers using filters.
For details about the breaking changes that were introduced in this API version, refer to Breaking changes.
Removed endpoints
count
endpoint was removed fromCustomerSavedSearch
resourcecreate
endpoint was removed fromCustomerSavedSearch
resourcedestroy
endpoint was removed fromCustomerSavedSearch
resourceindex
endpoint was removed fromCustomerSavedSearch
resourcesearch
endpoint was removed fromCustomerSavedSearch
resourceshow
endpoint was removed fromCustomerSavedSearch
resourceupdate
endpoint was removed fromCustomerSavedSearch
resource
Removed properties
prerequisite_saved_search_ids
property was removed fromPriceRule
resource
New properties
customer_segment_prerequisite_ids
property was added toPriceRule
resource
Delivery and fulfillment time
As of API version 2022-04, you can use the REST Admin API to query the following information:
- A range of time when a delivery is expected to be completed
- The latest date and time when all items in a fulfillment order need to be fulfilled
New properties
delivery_method.max_delivery_date_time
property was added toFulfillmentOrder
resourcedelivery_method.min_delivery_date_time
property was added toFulfillmentOrder
resourcefulfill_by
property was added toFulfillmentOrder
resource
Email marketing consent
As of API version 2022-04, you can use the REST Admin API to retrieve, add, and update the details about a customer's consent to receive marketing material by email using channel-specific fields. You can also subscribe to the customers_marketing_consent/update
webhook topic to get notified when a customer updates their marketing consent.
The accepts_marketing
, accepts_marketing_updated_at
, and marketing_opt_in_level
properties on the Customer
resource are deprecated. Use the email_marketing_consent
property instead.
Deprecated properties
accepts_marketing
property is deprecated onCustomer
resourceaccepts_marketing_updated_at
property is deprecated onCustomer
resourcemarketing_opt_in_level
property is deprecated onCustomer
resource
New property
email_marketing_consent
property was added toCustomer
resource
Sales channel attribution
As of API version 2022-04, you can use the REST Admin API Checkout
and Order
resources to identify the sales channel that an order came from. For example, you can identify whether orders made through the Facebook channel app came from Facebook Marketplace, Instagram, or Messenger. Similarly, for orders made through connector apps, you can identify whether orders are attributable to specific sales channels rather than to the connector app.
For an order to be correctly attributed to a channel, you need to register the channels that your app manages. After your request has been processed, refer to the list of your registered channels in the Partner Dashboard, on the app's Marketplace extension. From there, set the specified handle as the source_name in your request.
New properties
source_identifier
was added toCheckout
resourcesource_identifier
was added toOrder
resourcesource_name
was added toCheckout
resourcesource_url
was added toCheckout
resourcesource_url
was added toOrder
resource