<table>
  <caption>The API version release date and the date that the version is no longer supported</caption>
  <thead>
    <tr>
      <th scope="col">Release date</th>
      <th scope="col">Date version is no longer supported</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td scope="row">July 1, 2022</td>
      <td scope="row">July 1, 2023</td>
   </tr>
  </tbody>
 </table>

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` <ul><li>[GraphQL Admin API](/docs/api/admin-graphql/latest/objects/ProductVariant)</li><li>[REST Admin API](/docs/api/admin-rest/latest/resources/product-variant#resource-object)</li><ul> | If you set `fulfillmentService` as `manual`, then it no longer means that a product variant is strictly stocked at a self-managed location. <br></br>As a result, apps can't use the `fulfillmentService` alone to determine whether the item is stocked at a third-party location or not. | <ul><li><strong>GraphQL Admin API</strong>: Use [InventoryLevelConnection](/docs/api/admin-graphql/latest/connections/InventoryLevelConnection) and [InventoryLevel.location](/docs/api/admin-graphql/latest/objects/InventoryLevel#field-inventorylevel-location).</li><br><li><strong>REST Admin API</strong>: Use the [InventoryLevel](/docs/api/admin-rest/latest/resources/inventorylevel) resource.</li> |
| `fulfillmentService` on `LineItem`<ul><li>[GraphQL Admin API](/docs/api/admin-graphql/latest/objects/LineItem)</li><li>[REST Admin API](/docs/api/admin-rest/latest/resources/order)</li></ul> | When an order is created for a product variant that's stocked at a third-party service that has opted into SKU sharing, then the `LineItem.fulfillmentService` handle is set to the third-party service.<br></br> This is different from `ProductVariant.fulfillmentService`, where the handle is set to `manual`.<br>Shopify only assigns a given line item to a single location at checkout. As a result, for all orders, `lineItem.fulfillmentService` will be accurate upon order creation, but it can become inaccurate post-checkout if the merchant takes certain actions. | <ul><li><strong>GraphQL Admin API</strong>: Use [FulfillmentOrder.assignedLocation](/docs/api/admin-graphql/latest/objects/FulfillmentOrder#field-fulfillmentorder-assignedlocation)<br></li><li><strong>REST Admin API</strong>: Use [FulfillmentOrder.assigned_location_id](/docs/api/admin-rest/latest/resources/fulfillmentorder#resource-object).</li></ul>|
| `fulfillmentServiceId` on `ProductVariantInput` <ul><li>[GraphQL Admin API](/docs/api/admin-graphql/latest/input-objects/ProductVariantInput#field-productvariantinput-fulfillmentserviceid)</li></ul> | If a merchant updates a product variant’s `fulfillmentService` to a handle that belongs to a third-party service that has opted into SKU sharing, then the request succeeds but the `fulfillmentService` is set to `manual`.<br></br>As a result, the handle is no longer set to the third-party service's handle. | Not applicable |

### Validation on subscription mutations

As of API version 2022-07, the `phone` field of the delivery address for a subscription is validated on the [`subscriptionContractCreate`](/docs/api/admin-graphql/latest/mutations/subscriptionContractCreate) and [`subscriptionDraftUpdate`](/docs/api/admin-graphql/latest/mutations/subscriptionDraftUpdate) mutations in the GraphQL Admin API.

The validation enables you to confirm that a phone number is properly formatted and prevents errors that might occur when processing subscription payments with invalid data.

## GraphQL Admin API changes

The following are all the changes currently introduced in the 2022-07 version of the GraphQL Admin API.

<div class="accordion-container">
  <div class="accordion-controls">
    <button class="accordion-control" data-accordion-control-type="expand-all" type="button">Expand all</button>
  </div>
  <div class="accordion-content-container">
    <div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>App discount types</h3>
  </div>
  <div class="accordion-content">
    <p><span id="script-discount-types"></p>
<p>As of API version 2022-07, you use the GraphQL Admin API to create a new discount type in your app. <a href="/docs/apps/build/discounts">Learn how</a>.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">AppDiscountType</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">AppDiscountTypes</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticApp</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticAppInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountCodeApp</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountCodeAppInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">HasMetafields</code> interface was added to <code class="text-highlight text-highlight--grey">DiscountAutomaticNode</code> object</li>
<li><code class="text-highlight text-highlight--grey">HasMetafields</code> interface was added to <code class="text-highlight text-highlight--grey">DiscountCodeNode</code> object</li>
<li><code class="text-highlight text-highlight--grey">HasMetafields</code> interface was added to <code class="text-highlight text-highlight--grey">DiscountNode</code> object</li>
<li><code class="text-highlight text-highlight--grey">HasMetafieldDefinitions</code> interface was added to <code class="text-highlight text-highlight--grey">DiscountAutomaticNode</code> object</li>
<li><code class="text-highlight text-highlight--grey">HasMetafieldDefinitions</code> interface was added to <code class="text-highlight text-highlight--grey">DiscountCodeNode</code> object</li>
<li><code class="text-highlight text-highlight--grey">HasMetafieldDefinitions</code> interface was added to <code class="text-highlight text-highlight--grey">DiscountNode</code> object</li>
<li><code class="text-highlight text-highlight--grey">DISCOUNT</code> value was added to <code class="text-highlight text-highlight--grey">MetafieldOwnerType</code> enum</li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">DiscountCodeAppCreate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountCodeAppUpdate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticAppCreate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticAppUpdate</code> mutation was added</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>App discount combinations<span id="app-discount-combinations"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the GraphQL Admin API to create discount combinations in your app.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">AppDiscountType</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">AppDiscountTypes</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticApp</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticAppInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountCombinesWith</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountCombinesWithInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountClass</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountNode</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountNodeConnection</code> connection was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountNodeEdge</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountSortKeys</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">MerchandiseDiscountClass</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">ShippingDiscountClass</code> enum was added</li>
</ul>
<p><strong>New fields</strong></p>
<p><code class="text-highlight text-highlight--grey">combinesWith</code> and <code class="text-highlight text-highlight--grey">discountClass</code> fields were added to the following objects:</p>
<ul>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticBasic</code></li>
<li><code class="text-highlight text-highlight--grey">DiscountAutomaticBxgy</code></li>
<li><code class="text-highlight text-highlight--grey">DiscountCodeBasic</code></li>
<li><code class="text-highlight text-highlight--grey">DiscountCodeBxgy</code></li>
<li><code class="text-highlight text-highlight--grey">DiscountCodeFreeShipping</code></li>
<li><code class="text-highlight text-highlight--grey">PriceRule</code></li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">discountAutomaticAppCreate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">discountAutomaticAppUpdate</code> mutation was added</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Braintree as a legacy subscription payment gateway<span id="braintree-legacy"></span></h3>
  </div>
  <div class="accordion-content">
    <aside class="note beta">
  <h4>Beta</h4>
  <p>
Connecting Braintree as a legacy subscription payment gateway is in beta. To use this feature, you need to enable the <code class="text-highlight text-highlight--grey">legacy_subscriptions_braintree</code> beta flag in your store.</p>
</aside>
<p>As of API version 2022-07, you can connect Braintree as a legacy subscription payment gateway and migrate each pay-as-you-go contract to Shopify. After the migration, you&#39;ll use Shopify Payments as the primary payment gateway. For more information, refer to <a href="/docs/apps/build/purchase-options/subscriptions/migrate-to-subscriptions-api/migrate-subscription-contracts">Migrating existing subscription contracts to Shopify</a>.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">CustomerPaymentMethodRemoteInput</code> input object was added</li>
</ul>
<p><strong>New error codes</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">braintree_not_enabled_for_subscriptions</code> error code was added to <code class="text-highlight text-highlight--grey">CustomerPaymentMethodRemoteUserErrorCode</code> enum</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Checkout charges for deferred purchase options <span id="checkout-charges-deferred-purchase-options"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can set <a href="/docs/api/admin-graphql/latest/objects/SellingPlanCheckoutCharge">checkout charges</a> for deferred purchase options to secure customers&#39; commitments to orders before the orders are fulfilled. The remaining balance amount is charged at a later date.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">checkoutCharge</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlan</code> object</li>
<li><code class="text-highlight text-highlight--grey">checkoutChargeAmount</code> field was added to <code class="text-highlight text-highlight--grey">CartEstimatedCost</code> object</li>
<li><code class="text-highlight text-highlight--grey">checkoutChargeAmount</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlanAllocation</code> object</li>
<li><code class="text-highlight text-highlight--grey">remainingBalanceChargeAmount</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlanAllocation</code> object</li>
</ul>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutCharge</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargeValue</code> union was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargeType</code> enum was added</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Customer statistics<span id="deferred-purchase-options"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the <a href="/docs/api/admin-graphql/latest/objects/CustomerStatistics">GraphQL Admin API</a> to query customer statistics like predicted spend.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">CustomerStatistics</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">CustomerPredictedSpendTier</code> enum was added to <code class="text-highlight text-highlight--grey">CustomerStatistics</code> object</li>
</ul>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">predictedSpendTier</code> field was added to <code class="text-highlight text-highlight--grey">CustomerStatistics</code> object</li>
<li><code class="text-highlight text-highlight--grey">statistics</code> field was added to <code class="text-highlight text-highlight--grey">Customer</code>object</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Deadlines for fulfillment orders</h3>
  </div>
  <div class="accordion-content">
    <p><span id="deadlines-for-fulfillment orders"></p>
<p>As of API version 2022-07, you can use the <a href="/docs/api/admin-graphql/latest/mutations/fulfillmentOrdersSetFulfillmentDeadline">GraphQL Admin API</a> to set the latest date and time by which fulfillment orders need to be fulfilled.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">FulfillmentOrdersSetFulfillmentDeadlinePayload</code> payload was added</li>
<li><code class="text-highlight text-highlight--grey">FulfillmentOrdersSetFulfillmentDeadlineUserErrorCode</code> enum was added</li>
</ul>
<p><strong>New mutation</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">fulfillmentOrdersSetFulfillmentDeadline</code> mutation was added</li>
</ul>
<p><strong>New error code</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">FULFILLMENT_ORDERS_NOT_FOUND</code> error code was added to <code class="text-highlight text-highlight--grey">FulfillmentOrdersSetFulfillmentDeadlineUserErrorCode</code> enum</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Deferred purchase options: Pre-order and try before you buy<span id="deferred-purchase-options"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the GraphQL Admin API to <a href="/docs/api/admin-graphql/latest/mutations/sellingPlanGroupCreate">create</a> and <a href="/docs/api/admin-graphql/latest/mutations/sellingPlanGroupUpdate">manage</a> deferred purchase options to provide merchants and customers with various ways to sell and buy products, beyond the &quot;buy now, pay now, and ship now&quot; experience and subscriptions. Shopify supports pre-orders and try before you buys as use cases for deferred purchase options.</p>
<p>There&#39;s no single API to create a specific deferred purchase option. Instead, a deferred purchase option has configurations for pricing, delivery, inventory, and billing policies. For more information, refer to <a href="/docs/apps/build/purchase-options/deferred">Deferred purchase options</a>.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">category</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlan</code> object</li>
<li><code class="text-highlight text-highlight--grey">inventoryPolicy</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlan</code> object</li>
<li><code class="text-highlight text-highlight--grey">fixed</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlanBillingPolicyInput</code> object</li>
<li><code class="text-highlight text-highlight--grey">fixed</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlanDeliveryPolicyInput</code> object</li>
</ul>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutCharge</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargePercentageValue</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFixedBillingPolicy</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFixedBillingPolicyInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFixedDeliveryPolicy</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFixedDeliveryPolicyInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanInventoryPolicyInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargeInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargeValueInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargeType</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCheckoutChargeValue</code> union was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanCategory</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanRemainingBalanceChargeTrigger</code>enum was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFulfillmentTrigger</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFixedDeliveryPolicyIntent</code>enum was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanFixedDeliveryPolicyPreAnchorBehavior</code>enum was added</li>
<li><code class="text-highlight text-highlight--grey">SellingPlanReserve</code> enum was added</li>
</ul>
<p><strong>New error codes</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">BILLING_AND_DELIVERY_POLICY_TYPES_MUST_BE_THE_SAME</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">CHECKOUT_CHARGE_VALUE_AND_TYPE_MUST_MATCH</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">FULFILLMENT_EXACT_TIME_NOT_ALLOWED</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">INCLUSION</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">NOT_FOUND</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">ONLY_NEED_ONE_BILLING_POLICY_TYPE</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">FULFILLMENT_EXACT_TIME_REQUIRED</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">ONLY_NEED_ONE_CHECKOUT_CHARGE_VALUE</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">ONLY_NEED_ONE_DELIVERY_POLICY_TYPE</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">ONLY_ONE_OF_FIXED_OR_RECURRING_BILLING</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">ONLY_ONE_OF_FIXED_OR_RECURRING_DELIVERY</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">REMAINING_BALANCE_CHARGE_EXACT_TIME_NOT_ALLOWED</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">REMAINING_BALANCE_CHARGE_EXACT_TIME_REQUIRED</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">REMAINING_BALANCE_CHARGE_TIME_AFTER_CHECKOUT_MUST_BE_GREATER_THAN_ZERO</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">REMAINING_BALANCE_CHARGE_TRIGGER_NO_REMAINING_BALANCE_ON_PARTIAL_PERCENTAGE_CHECKOUT_CHARGE</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">REMAINING_BALANCE_CHARGE_TRIGGER_NO_REMAINING_BALANCE_ON_PRICE_CHECKOUT_CHARGE</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">REMAINING_BALANCE_CHARGE_TRIGGER_ON_FULL_CHECKOUT</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">SELLING_PLAN_ANCHORS_NOT_ALLOWED</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">SELLING_PLAN_ANCHORS_REQUIRED</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">SELLING_PLAN_FIXED_PRICING_POLICIES_LIMIT</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">TOO_BIG</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
<li><code class="text-highlight text-highlight--grey">WRONG_LENGTH</code> error code was added to <code class="text-highlight text-highlight--grey">SellingPlanGroupUserErrorCode</code> enum</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Delegate access tokens <span id="delegate-accesss-tokens"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the <a href="/docs/api/admin-graphql/latest/mutations/delegateAccessTokenCreate">GraphQL Admin API</a> to create a delegate access token. A delegate access token is an access token with a subset of the total permissions of an app.</p>
<p>For more information, refer to <a href="/docs/apps/build/authentication-authorization/access-tokens/use-delegate-tokens">Delegate OAuth access tokens to subsystems</a>.</p>
<p><strong>New mutation</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">delegateAccessTokenCreate</code> mutation was added</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Hold automations</h3>
  </div>
  <div class="accordion-content">
    <p><span id= "fulfillment-hold-automations" class="heading-flag breaking"></span> %</p>
<p>As of API version 2022-07, you can use the <a href="/docs/api/admin-graphql/latest/objects/MailingAddress">GraphQL Admin API</a> to hold fulfillments on unvalidated mailing addresses and ensure merchants check prior to requesting fulfillment.</p>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Improved Rejections</h3>
  </div>
  <div class="accordion-content">
    <p><span id= "fulfillment-improved-rejections" class="heading-flag breaking"></span></p>
<p>As of API version 2022-07, you can use the <a href="/docs/api/admin-graphql/latest/mutations/fulfillmentOrderRejectFulfillmentRequest">GraphQL Admin API</a> <code class="text-highlight text-highlight--grey">fulfillmentOrderRejectFulfillmentRequest</code> mutation has improved rejections with optional arguments.</p>
<p>For more information, refer to the <a href="/changelog/fulfillment-service-sku-sharing">changelog post</a>.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">warnings</code>field was added to <code class="text-highlight text-highlight--grey">FulfillmentOrderLineItem</code> object</li>
</ul>
<p><strong>New arguments</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">reason</code> argument was added to <code class="text-highlight text-highlight--grey">fulfillmentOrderRejectFulfillmentRequest</code> mutation</li>
<li><code class="text-highlight text-highlight--grey">lineItems</code> argument was added to <code class="text-highlight text-highlight--grey">fulfillmentOrderRejectFulfillmentRequest</code> mutation</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>MIME type for generic files</h3>
  </div>
  <div class="accordion-content">
    <p><span id="mime-type-generic-file"></p>
<p>Use the <a href="/docs/api/admin-graphql/latest/objects/genericfile">GraphQL Admin API</a> to specify the Multipurpose Internet Mail Extensions (MIME) type of generic files being created, updated, or deleted. Response bodies return either <code class="text-highlight text-highlight--grey">nil</code> or the MIME type of the generic file, such as <code class="text-highlight text-highlight--grey">model/usd</code> or <code class="text-highlight text-highlight--grey">application/pdf</code>.</p>
<p><strong>New field</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">mimeType</code> was added to <code class="text-highlight text-highlight--grey">GenericFile</code> object</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Payment mandates <span id="payment-mandates"></span></h3>
  </div>
  <div class="accordion-content">
    <p>A payment mandate is the payment method and permission that a customer gives to the merchant to debit money. As of API version 2022-07, you can use the <a href="/docs/api/admin-graphql/latest/mutations/orderCreateMandatePayment">GraphQL Admin API</a> to use a customer&#39;s payment mandate to trigger a payment for the remaining balance on an order or create a payment schedule. For more information, refer to <a href="/docs/apps/build/purchase-options/deferred#charging-the-remaining-balance">Charging the remaining balance</a>.</p>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Payments dispute evidences API <span id="payments-dispute-evidences-api-graphql"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the GraphQL Admin API to manage dispute evidence.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">dispute</code> field was added to <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
<li><code class="text-highlight text-highlight--grey">disputeEvidence</code> field was added to <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
</ul>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">ShopifyPaymentsDisputeEvidence</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">ShopifyPaymentsDisputeFileUpload</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">ShopifyPaymentsDisputeFulfillment</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">ShopifyPaymentsDisputeEvidenceUpdateInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">ShopifyPaymentsDisputeFileUploadUpdateInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">ShopifyPaymentsDisputeEvidenceFileType</code> enum was added</li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">disputeEvidenceUpdate</code> mutation was added</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Removed fulfillment types and mutations <span id="removed-fulfillment-support" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the following types and mutations have been removed from the <a href="/docs/api/admin-graphql">GraphQL Admin API</a>:</p>
<p><strong>Removed types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">DraftFulfillment</code>: Use <a href="/docs/api/admin-graphql/latest/objects/FulfillmentOrder"><code class="text-highlight text-highlight--grey">FulfillmentOrder</code></a> instead.</li>
</ul>
<p><strong>Removed mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">fulfillmentCreate</code>: Use <a href="/docs/api/admin-graphql/latest/mutations/fulfillmentCreateV2"><code class="text-highlight text-highlight--grey">fulfillmentCreateV2</code></a> instead.</li>
<li><code class="text-highlight text-highlight--grey">fulfillmentTrackingInfoUpdate</code>: Use <a href="/docs/api/admin-graphql/latest/mutations/fulfillmentTrackingInfoUpdateV2"><code class="text-highlight text-highlight--grey">fulfillmentTrackingInfoUpdateV2</code></a> instead.</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Selling plan anchor <span id="selling-plan-anchor"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the GraphQL Admin API to specify a fixed cutoff day in subscription apps.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">cutoffDay</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlanAnchorInput</code> input object</li>
<li><code class="text-highlight text-highlight--grey">cutoffDay</code> field was added to <code class="text-highlight text-highlight--grey">SellingPlanAnchor</code> object</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>SKU at multiple fulfillment services or merchant-managed locations <span id="sku-at-multiple-fulfillment-services-or-merchant-managed-locations-graphql"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the GraphQL Admin API to permit a Stock Keeping Unit (SKU) to be stocked at multiple fulfillment services or merchant-managed locations.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">permitsSkuSharing</code> field was added to <code class="text-highlight text-highlight--grey">FulfillmentService</code> object</li>
</ul>
<p><strong>New arguments</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">permitsSkuSharing</code> argument was added to <code class="text-highlight text-highlight--grey">fulfillmentServiceCreate</code> mutation</li>
<li><code class="text-highlight text-highlight--grey">permitsSkuSharing</code> argument was added to <code class="text-highlight text-highlight--grey">fulfillmentServiceUpdate</code> mutation</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Validation on subscription mutations<span id="validations-on-subscription-mutations" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the <code class="text-highlight text-highlight--grey">phone</code> field of the delivery address for a subscription is validated on the <a href="/docs/api/admin-graphql/latest/mutations/subscriptionContractCreate"><code class="text-highlight text-highlight--grey">subscriptionContractCreate</code></a> and <a href="/docs/api/admin-graphql/latest/mutations/subscriptionDraftUpdate"><code class="text-highlight text-highlight--grey">subscriptionDraftUpdate</code></a> mutations.</p>
<p>The validation enables you to confirm that a phone number is properly formatted and prevents errors that might occur when processing subscription payments with invalid data.</p>
  </div>
</div>
  </div>
</div>


## GraphQL Storefront API changes

The following are all the changes currently introduced in the 2022-07 version of the GraphQL Storefront API.

<div class="accordion-container">
  <div class="accordion-controls">
    <button class="accordion-control" data-accordion-control-type="expand-all" type="button">Expand all</button>
  </div>
  <div class="accordion-content-container">
    <div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>App subscriptions  <span id="app-subs"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can extend the trial of an app subscription with the <a href="/docs/api/admin-graphql/latest/mutations/appSubscriptionTrialExtend">AppSubscriptionTrialExtend</a> mutation.</p>
<p>For usage-based app subscriptions, you can now subscribe to the <code class="text-highlight text-highlight--grey">app_subscriptions/approaching_capped_amount</code> webhook topic to get notified when the balance used on an app subscription crosses 90% of the capped amount.</p>
<p>API version 2022-07 enables you to set the replacement behavior for a merchant with an existing subscription by using the <a href="/docs/api/admin-graphql/latest/mutations/appSubscriptionCreate#argument-replacementbehavior"><code class="text-highlight text-highlight--grey">replacementBehavior</code></a> argument that was added to the <code class="text-highlight text-highlight--grey">appSubscriptionCreate</code> mutation. For example you can set the behavior to immediately cancel the merchant&#39;s current app subscription and replace it with the newly created app subscription.</p>
<p><strong>New argument</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">replacementBehavior</code> argument was added to <code class="text-highlight text-highlight--grey">appSubscriptionCreate</code> mutation</li>
</ul>
<p><strong>New type</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">AppSubscriptionReplacementBehavior</code> enum was added</li>
</ul>
<p><strong>New mutation</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">AppSubscriptionTrialExtend</code> mutation was added</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Cart<span id="cart" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can query the <a href="/docs/api/storefront/latest/objects/cart"><code class="text-highlight text-highlight--grey">Cart</code> object</a> to retrieve the total number of items in a cart (<code class="text-highlight text-highlight--grey">totalQuantity</code>).</p>
<p>You can also query the <a href="/docs/api/storefront/latest/objects/cartlineestimatedcost"><code class="text-highlight text-highlight--grey">CartLineEstimatedCost</code> object</a> to retrieve the unit price (<code class="text-highlight text-highlight--grey">amount</code>) and the unit price comparisons with other sellers (<code class="text-highlight text-highlight--grey">compareAtAmount</code>) of a merchandise line in a cart. For more information, refer to <a href="/docs/storefronts/headless/building-with-the-storefront-api/markets/international-pricing">Support international pricing on storefronts</a>.</p>
<p>Additionally, you can query the <code class="text-highlight text-highlight--grey">attribute</code> field on the <code class="text-highlight text-highlight--grey">Cart</code> and <code class="text-highlight text-highlight--grey">CartLine</code> objects to retrieve attributes associated with the entire cart, or with a cart line.</p>
<p><strong>Breaking changes</strong></p>
<p>The <code class="text-highlight text-highlight--grey">estimatedCost</code> field on the <a href="/docs/api/storefront/latest/objects/Cart"><code class="text-highlight text-highlight--grey">Cart</code></a> and <a href="/docs/api/storefront/latest/objects/CartLine"><code class="text-highlight text-highlight--grey">CartLine</code></a> objects has been deprecated. Use <code class="text-highlight text-highlight--grey">cost</code> insteed to determine the estimated cost that the buyer will pay at checkout.</p>
<p>The 2022-07 version of the Storefront API also changes how <code class="text-highlight text-highlight--grey">discountAllocations</code> on the <code class="text-highlight text-highlight--grey">Cart</code> and <code class="text-highlight text-highlight--grey">CartLine</code> objects are returned:</p>
<ul>
<li><code class="text-highlight text-highlight--grey">Cart.discountAllocations</code> now returns discount allocations that are applied to the entire <code class="text-highlight text-highlight--grey">Cart</code>.</li>
<li><code class="text-highlight text-highlight--grey">CartLine.discountAllocations</code> now only returns discount allocations that are applied to the specific <code class="text-highlight text-highlight--grey">CartLine</code>.</li>
<li><code class="text-highlight text-highlight--grey">CartLine.total</code> now reflects the line total with only line-level discounts applied. It doesn&#39;t include discounts applied to the entire <code class="text-highlight text-highlight--grey">Cart</code>.</li>
</ul>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">attribute</code> field was added to <code class="text-highlight text-highlight--grey">Cart</code> object</li>
<li><code class="text-highlight text-highlight--grey">attribute</code> field was added to <code class="text-highlight text-highlight--grey">CartLine</code> object</li>
<li><code class="text-highlight text-highlight--grey">discountAllocations</code> field was added to <code class="text-highlight text-highlight--grey">Cart</code> object</li>
<li><code class="text-highlight text-highlight--grey">cost</code> field was added to <code class="text-highlight text-highlight--grey">Cart</code> object</li>
<li><code class="text-highlight text-highlight--grey">cost</code> field was added to <code class="text-highlight text-highlight--grey">CartLine</code> object</li>
<li><code class="text-highlight text-highlight--grey">totalQuantity</code> field was added to <code class="text-highlight text-highlight--grey">Cart</code> object</li>
<li><code class="text-highlight text-highlight--grey">amount</code> field was added to <code class="text-highlight text-highlight--grey">CartLineEstimatedCost</code> object</li>
<li><code class="text-highlight text-highlight--grey">compareAtAmount</code> field was added to <code class="text-highlight text-highlight--grey">CartLineEstimatedCost</code> object</li>
</ul>
<p><strong>Deprecated fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">estimatedCost</code> field has been deprecated on the <code class="text-highlight text-highlight--grey">Cart</code> object</li>
<li><code class="text-highlight text-highlight--grey">estimatedCost</code> field has been deprecated on the <code class="text-highlight text-highlight--grey">CartLine</code> object</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Metafields<span id="metafields" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the <code class="text-highlight text-highlight--grey">HasMetafields.metafields</code> paginated connection is deprecated. Previously, this connection enabled you to paginate over all visible metafields in a given resource.</p>
<p><code class="text-highlight text-highlight--grey">HasMetafields.metafields</code> now accepts a list of metafield namespaces and keys, and returns a list of associated metafields that match the given namespaces and keys.</p>
<p>For more information, refer to the <a href="/docs/api/storefront/latest/interfaces/hasmetafields"><code class="text-highlight text-highlight--grey">HasMetafields</code></a> interface.</p>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Removed checkout mutations<span id="removed-checkout-mutations" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the following mutations have been removed from the Storefront API:</p>
<ul>
<li><code class="text-highlight text-highlight--grey">checkoutGiftCardApply</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutgiftcardsappend">checkoutGiftCardAppend</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutGiftCardRemove</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutgiftcardremovev2">checkoutGiftCardRemoveV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutEmailUpdate</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutemailupdatev2">checkoutEmailUpdateV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutDiscountCodeApply</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutdiscountcodeapplyv2">checkoutDiscountCodeApplyV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutCustomerAssociate</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutcustomerassociatev2">checkoutCustomerAssociateV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutCustomerDisassociate</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutcustomerdisassociatev2">checkoutCustomerDisassociateV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutCompleteWithTokenizedPayment</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutcompletewithtokenizedpaymentv3">checkoutCompleteWithTokenizedPaymentV3</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutCompleteWithTokenizedPaymentV2</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutcompletewithtokenizedpaymentv3">checkoutCompleteWithTokenizedPaymentV3</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutShippingAddressUpdate</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutshippingaddressupdatev2">checkoutShippingAddressUpdateV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutCompleteWithCreditCard</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutCompleteWithCreditCardV2">checkoutCompleteWithCreditCardV2</a> instead.</li>
<li><code class="text-highlight text-highlight--grey">checkoutAttributesUpdate</code>: Use <a href="/docs/api/storefront/latest/mutations/checkoutAttributesUpdateV2">checkoutAttributesUpdateV2</a> instead.</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>URL redirects <span id="url-redirects"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can query the <a href="/docs/api/storefront/latest/objects/urlredirect"><code class="text-highlight text-highlight--grey">urlRedirect</code></a> object to retrieve information about a URL redirect on an online store. For example, you can query both the URL that users are redirected from and the URL where users will be redirected to.</p>
<p><strong>New type</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">UrlRedirect</code> object was added</li>
</ul>
<p><strong>New connection</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">urlRedirects</code> connection was added to <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
</ul>
  </div>
</div>
  </div>
</div>


## GraphQL Function APIs changes

[Shopify Functions](/docs/apps/build/functions) allow developers to customize the backend logic that powers parts of Shopify. [Function APIs](/docs/api/functions) are new APIs that are available as of the 2022-07 release. Function APIs let you extend your app code into Shopify. For example, you can use Function APIs to customize many aspects of the checkout experience.

<div class="accordion-container">
  <div class="accordion-controls">
    <button class="accordion-control" data-accordion-control-type="expand-all" type="button">Expand all</button>
  </div>
  <div class="accordion-content-container">
    <div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Function APIs for discounts <span id="function-apis-for-discounts"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the following Function APIs for discounts are available:</p>
<ul>
<li><strong><a href="/docs/api/functions/reference/order-discounts">Order Discount API</a></strong>: Create a new type of discount that&#39;s applied to all merchandise in the cart.</li>
<li><strong><a href="/docs/api/functions/reference/product-discounts">Product Discount API</a></strong>: Create a new type of discount that&#39;s applied to a particular product or product variant in the cart.</li>
<li><strong><a href="/docs/api/functions/reference/shipping-discounts">Shipping Discount API</a></strong>: Create a new type of discount that&#39;s applied to one or more shipping rates at checkout.</li>
</ul>
<p>Learn how to use a Function API to <a href="/docs/apps/build/discounts">create a new discount type for merchants</a>.</p>
  </div>
</div>
  </div>
</div>


## REST Admin API changes

The following are all the changes currently introduced in the 2022-07 version of the REST Admin API.

<div class="accordion-container">
  <div class="accordion-controls">
    <button class="accordion-control" data-accordion-control-type="expand-all" type="button">Expand all</button>
  </div>
  <div class="accordion-content-container">
    <div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Deadlines for fulfillment orders <span id="rest_deadlines_for_fulfillment_orders"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the <a href="/docs/api/admin-rest/latest/resources/fulfillmentorder#post-fulfillment-orders-set-fulfillment-orders-deadline"><code class="text-highlight text-highlight--grey">/set_fulfillment_orders_deadline</code></a> endpoint has been added to the <a href="/docs/api/admin-rest/latest/resources/fulfillmentorder">FulfillmentOrder</a> resource. You can use this endpoint to set the latest date and time by which fulfillment orders need to be fulfilled.</p>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Deprecated properties on the Order resource <span id="deprecated_properties_on_the_order_resource" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the following <code class="text-highlight text-highlight--grey">customer</code> object properties on the REST Admin API&#39;s <a href="/docs/api/admin-rest/latest/resources/order"><code class="text-highlight text-highlight--grey">Order</code></a> resource have been deprecated:</p>
<ul>
<li><code class="text-highlight text-highlight--grey">last_order_id</code></li>
<li><code class="text-highlight text-highlight--grey">last_order_name</code></li>
<li><code class="text-highlight text-highlight--grey">orders_count</code></li>
<li><code class="text-highlight text-highlight--grey">total_spent</code></li>
</ul>
<p>Use the <a href="/docs/api/admin-rest/latest/resources/customer"><code class="text-highlight text-highlight--grey">Customer</code></a> resource instead to access these properties.</p>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Payments dispute evidences API <span id="payments-dispute-evidences-api-rest"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the Rest Admin API to manage dispute evidence.</p>
<p><strong>New resources</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">dispute_evidences</code> resource was added</li>
<li><code class="text-highlight text-highlight--grey">dispute_file_uploads</code> resource was added</li>
</ul>
<p><strong>New endpoints</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">show</code> endpoint was added to <code class="text-highlight text-highlight--grey">dispute_evidences</code> resource</li>
<li><code class="text-highlight text-highlight--grey">update</code> endpoint was added to <code class="text-highlight text-highlight--grey">dispute_evidences</code> resource</li>
<li><code class="text-highlight text-highlight--grey">create</code> endpoint was added to <code class="text-highlight text-highlight--grey">dispute_file_uploads</code> resource</li>
<li><code class="text-highlight text-highlight--grey">destroy</code> endpoint was added to <code class="text-highlight text-highlight--grey">dispute_file_uploads</code> resource</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Removed endpoints on the Fulfillment resource <span id="removed_endpoints_on_the_fulfillment_resource" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, the following endpoints have been removed from the <code class="text-highlight text-highlight--grey">Fulfillment</code> resource in the <a href="/docs/api/admin-rest">REST Admin API</a>:</p>
<ul>
<li><code class="text-highlight text-highlight--grey">POST /orders/{order_id}/fulfillments.json</code></li>
<li><code class="text-highlight text-highlight--grey">PUT/PATCH /orders/{order_id}/fulfillments/{fulfillment_id}.json</code></li>
<li><code class="text-highlight text-highlight--grey">POST /orders/{order_id}/fulfillments/{fulfillment_id}/complete.json</code></li>
<li><code class="text-highlight text-highlight--grey">POST /orders/{order_id}/fulfillments/{fulfillment_id}/open.json</code></li>
<li><code class="text-highlight text-highlight--grey">POST /orders/{order_id}/fulfillments/{fulfillment_id}/cancel.json</code></li>
</ul>
<p>Use the <a href="/docs/api/admin-rest/latest/resources/fulfillmentorder"><code class="text-highlight text-highlight--grey">FulfillmentOrder</code></a> resource instead.</p>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>SKU at multiple fulfillment services or merchant-managed locations <span id="sku-at-multiple-fulfillment-services-or-merchant-managed-locations-rest"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2022-07, you can use the REST Admin API to permit a Stock Keeping Unit (SKU) to be stocked at multiple fulfillment services or merchant-managed locations.</p>
<p><strong>New properties</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">permits_sku_sharing</code> property was added to <code class="text-highlight text-highlight--grey">FulfillmentService</code> resource</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>XML responses and payloads <span id="xml_responses_payloads" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>The REST Admin API no longer supports XML-format responses and payloads. Requests that expect an XML response will result in a <code class="text-highlight text-highlight--grey">404</code> error. Requests that send an XML payload will result in a <code class="text-highlight text-highlight--grey">415</code> error.</p>
<p>If you&#39;re using XML for REST Admin API requests and payloads, then you need to switch to using JSON format.</p>
  </div>
</div>
  </div>
</div>