The API version release date and the date that the version is no longer supported
Release date Date version is no longer supported
July 1, 2022 July 1, 2023
The 2022-07 version of Shopify's APIs includes new ways to manage deferred purchase options and app discount types. This release also includes new ways to create and manage discounts with Function APIs. **What's new in 2022-07** The following features were added in version 2022-07 of Shopify's APIs. GraphQL Admin API changes: - Use Shopify Functions to [build a discounts experience](/docs/apps/build/discounts). - Set [deadlines for fulfillment orders](/docs/api/admin-graphql/latest/mutations/fulfillmentOrdersSetFulfillmentDeadline). - Create [discount combinations](/docs/api/admin-graphql/latest/objects/DiscountCombinesWith) in your app. - [Create](/docs/api/admin-graphql/latest/mutations/sellingPlanGroupCreate) and [manage](/docs/api/admin-graphql/latest/mutations/sellingPlanGroupUpdate) deferred purchase options. - Create a [delegate access token](/docs/api/admin-graphql/latest/mutations/delegateAccessTokenCreate). - Permit a SKU to be stocked at multiple fulfillment services or merchant-managed locations. - Specify the Multipurpose Internet Mail Extensions (MIME) type of [generic files](/docs/api/admin-graphql/latest/objects/genericfile) being created, updated, or deleted. - Manage [dispute evidence](/docs/api/admin-graphql/latest/queries/disputeEvidence). - Use a customer's [payment mandate](/docs/api/admin-graphql/latest/mutations/orderCreateMandatePayment) to trigger a payment for the remaining balance on an order or create a payment schedule. - Confirm that the phone field of a delivery address for a subscription is properly formatted in the [`subscriptionContractCreate`](/docs/api/admin-graphql/latest/mutations/subscriptionContractCreate) and [`subscriptionDraftUpdate`](/docs/api/admin-graphql/latest/mutations/subscriptionDraftUpdate) mutations. - Specify a fixed cutoff day in subscription apps. - Extend the trial of an app subscription with the [AppSubscriptionTrialExtend](/docs/api/admin-graphql/latest/mutations/appSubscriptionTrialExtend) mutation. - Subscribe to the `app_subscriptions/approaching_capped_amount` webhook topic to get notified when the balance used on an app subscription crosses 90% of the capped amount. - Set the replacement behavior for a merchant with an existing subscription by using the [`replacementBehavior`](/docs/api/admin-graphql/latest/mutations/appSubscriptionCreate#argument-replacementbehavior) argument that was added to the `appSubscriptionCreate` mutation. GraphQL Storefront API changes: - Query the [`Cart` object](/docs/api/storefront/latest/objects/cart) to retrieve the total number of items in a cart (`totalQuantity`) as well as the [`CartLineEstimatedCost` object](/docs/api/storefront/latest/objects/cartlineestimatedcost). - [`HasMetafields`](/docs/api/storefront/latest/interfaces/hasmetafields) now accepts a list of metafield namespaces and keys, and returns a list of associated metafields that match the given namespaces and keys. `HasMetafields.metafields` paginated connection is deprecated. - Set [checkout charges](/docs/api/admin-graphql/latest/objects/SellingPlanCheckoutCharge) for deferred purchase options to secure customers' commitments to orders before the orders are fulfilled. - Query the [`urlRedirect`](/docs/api/storefront/latest/objects/urlredirect) object to retrieve information about a URL redirect on an online store. GraphQL Function API changes: - Create an [order discount](/docs/api/functions/reference/order-discounts) that's applied to all merchandise in the cart. - Create a [product discount](/docs/api/functions/reference/product-discounts) that's applied to a particular product or product variant in the cart. - Create a [shipping discount](/docs/api/functions/reference/shipping-discounts) that's applied to one or more shipping rates at checkout. REST Admin API changes: - Use the [`/set_fulfillment_orders_deadline`](/docs/api/admin-rest/latest/resources/fulfillmentorder#post-fulfillment-orders-set-fulfillment-orders-deadline) endpoint to set the latest date and time by which fulfillment orders need to be fulfilled. - Use the Rest Admin API to manage dispute evidence. - Use the Rest Admin API to permit a SKU to be stocked at multiple fulfillment services or merchant-managed locations. - The REST Admin API no longer supports XML-format responses and payloads. If you're using XML for REST Admin API requests and payloads, then you need to switch to using JSON format. ## 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. ### Cart As of API version 2022-07, the `estimatedCost` field on the [`Cart`](/docs/api/storefront/latest/objects/Cart) and [`CartLine`](/docs/api/storefront/latest/objects/CartLine) objects in the Storefront API has been deprecated. Use `cost` instead to determine the estimated cost that the buyer will pay at checkout. The 2022-07 version of the Storefront API also changes how `discountAllocations` on the `Cart` and `CartLine` objects are returned: - `Cart.discountAllocations` now returns discount allocations that are applied to the entire `Cart`. - `CartLine.discountAllocations` now only returns discount allocations that are applied to the specific `CartLine`. - `CartLine.total` now reflects the line total with only line-level discounts applied. It doesn't include discounts applied to the entire `Cart`. ### Deprecated properties on the `Order` resource in the REST Admin API As of API version 2022-07, the following `customer` object properties on the REST Admin API's [`Order`](/docs/api/admin-rest/latest/resources/order) resource have been deprecated: - `last_order_id` - `last_order_name` - `orders_count` - `total_spent` Use the [`Customer`](/docs/api/admin-rest/latest/resources/customer) resource instead to access these properties. ### Enhancements As of API version 2022-07 all GraphQL schemas will start using the `@deprecated` directive for input fields and arguments which have been deprecated. API versions 2022-04 and below will continue to use the description for deprecation warnings. You should use a GraphQL client that supports deprecated input fields and arguments when using GraphQL API versions 2022-07 or higher. ### Fulfillment endpoints removed from the REST Admin API As of API version 2022-07, the following endpoints have been removed from the `Fulfillment` resource in the [REST Admin API](/docs/api/admin-rest): - `/orders/{order_id}/fulfillments.json` - `/orders/{order_id}/fulfillments/{fulfillment_id}.json` - `/orders/{order_id}/fulfillments/{fulfillment_id}/complete.json` - `/orders/{order_id}/fulfillments/{fulfillment_id}/open.json` - `/orders/{order_id}/fulfillments/{fulfillment_id}/cancel.json` Use the [`FulfillmentOrder`](/docs/api/admin-rest/latest/resources/fulfillmentorder) resource instead. ### Fulfillment types and mutations removed from the GraphQL Admin API As of API version 2022-07, the following types and mutations have been removed from the [GraphQL Admin API](/docs/api/admin-graphql): **Removed types** - `DraftFulfillment`: Use [`FulfillmentOrder`](/docs/api/admin-graphql/latest/objects/FulfillmentOrder) instead. **Removed mutations** - `fulfillmentCreate`: Use [`fulfillmentCreateV2`](/docs/api/admin-graphql/latest/mutations/fulfillmentCreateV2) instead. - `fulfillmentTrackingInfoUpdate`: Use [`fulfillmentTrackingInfoUpdateV2`](/docs/api/admin-graphql/latest/mutations/fulfillmentTrackingInfoUpdateV2) instead. ### Metafields As of API version 2022-07, the `HasMetafields.metafields` paginated connection in the Storefront API is deprecated. Previously, this connection enabled you to paginate over all visible metafields in a given resource. `HasMetafields.metafields` now accepts a list of metafield namespaces and keys, and returns a list of associated metafields that match the given namespaces and keys. For more information, refer to the [`HasMetafields`](/docs/api/storefront/latest/interfaces/hasmetafields) interface. ### Removed checkout mutations As of API version 2022-07, the following mutations have been removed from the Storefront API: - `checkoutGiftCardApply`: Use [checkoutGiftCardAppend](/docs/api/storefront/latest/mutations/checkoutgiftcardsappend) instead. - `checkoutGiftCardRemove`: Use [checkoutGiftCardRemoveV2](/docs/api/storefront/latest/mutations/checkoutgiftcardremovev2) instead. - `checkoutEmailUpdate`: Use [checkoutEmailUpdateV2](/docs/api/storefront/latest/mutations/checkoutemailupdatev2) instead. - `checkoutDiscountCodeApply`: Use [checkoutDiscountCodeApplyV2](/docs/api/storefront/latest/mutations/checkoutdiscountcodeapplyv2) instead. - `checkoutCustomerAssociate`: Use [checkoutCustomerAssociateV2](/docs/api/storefront/latest/mutations/checkoutcustomerassociatev2) instead. - `checkoutCustomerDisassociate`: Use [checkoutCustomerDisassociateV2](/docs/api/storefront/latest/mutations/checkoutcustomerdisassociatev2) instead. - `checkoutCompleteWithTokenizedPayment`: Use [checkoutCompleteWithTokenizedPaymentV3](/docs/api/storefront/latest/mutations/checkoutcompletewithtokenizedpaymentv3) instead. - `checkoutCompleteWithTokenizedPaymentV2`: Use [checkoutCompleteWithTokenizedPaymentV3](/docs/api/storefront/latest/mutations/checkoutcompletewithtokenizedpaymentv3) instead. - `checkoutShippingAddressUpdate`: Use [checkoutShippingAddressUpdateV2](/docs/api/storefront/latest/mutations/checkoutshippingaddressupdatev2) instead. - `checkoutCompleteWithCreditCard`: Use [checkoutCompleteWithCreditCardV2](/docs/api/storefront/latest/mutations/checkoutCompleteWithCreditCardV2) instead. - `checkoutAttributesUpdate`: Use [checkoutAttributesUpdateV2](/docs/api/storefront/latest/mutations/checkoutAttributesUpdateV2) instead. ### Removed support for XML-format responses and payloads The REST Admin API no longer supports XML-format responses and payloads. Requests that expect an XML response will result in a `404` error. Requests that send an XML payload will result in a `415` error. If you're using XML for REST Admin API requests and payloads, then you need to switch to using JSON format. ### Shipping and fulfillment As of API version 2022-07, the `permitsSkuSharing` field was added to the [GraphQL Admin API](/docs/api/admin-graphql/latest/objects/FulfillmentService#field-fulfillmentservice-permitsskusharing) and [REST Admin API](/docs/api/admin-rest/latest/resources/fulfillmentservice#resource-object). If you set `permitsSkuSharing` to `true`, then a fulfillment service can stock inventory at multiple fulfillment services or merchant-managed locations. However, setting `permitsSkuSharing` to `true` causes some behavior to break. As a result, the following fields have been deprecated: | Field | Behavior | What to use instead | |---|---|---| | `fulfillmentService` on `ProductVariant`