> Note:
> We're no longer publishing API release notes. Instead, you can find the latest updates on Shopify APIs in our [developer changelog](https://shopify.dev/changelog). You can filter updates by area. For example, you can filter API updates by the API name and version, such as GraphQL Admin API changes in version 2025-04.


<table>
  <tr>
    <th>Release date</th>
    <th>Date version is no longer supported</th>
  </tr>
  <tr>
    <td>April 1, 2021</td>
    <td>April 1, 2022</td>
  </tr>
</table>

The 2021-04 release contains support for building custom price cards for individual product variants, managing gift cards, and creating discount codes in bulk using the GraphQL Admin API.

This release also includes support for duties in the Storefront API and the ability to retrieve information about discounts applied to a checkout using the REST Admin API.

**What’s new in 2021-04**

The following features were added in version 2021-04 of Shopify's APIs:

- Using the [Price List API](/docs/api/admin-graphql/latest/objects/PriceList), you can now change the prices of products based on specific context rules about the customer's location. If a price list exists for the product and geography the customer is ordering from, then the storefront will charge a different price based on those rules.
- Using the [GiftCard API](/docs/api/admin-graphql/latest/objects/giftcard), you can now create, retrieve, update, and disable gift cards for a store.
- When managing discounts, it's now possible to add redeemable [discount codes in bulk](/docs/api/admin-graphql/latest/objects/discountredeemcodebulkadd) rather than make individual queries to update discount codes associated with a given price rule.
- Shopify now returns information about duties through the Storefront API. You can query the total duties applied to line items in the [checkout](/docs/api/storefront/reference/checkouts/checkout) and the total current and original duties applied to an [order](/docs/api/storefront/reference/orders/order).
- Using the [Checkout](/docs/api/admin-rest/latest/resources/checkout) resource, you can now retrieve information about how a discount was applied to a checkout.

## 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.


### Next action for payment apps

As of API version 2021-04, payment apps that use the `redirectUrl` field on [`PaymentSession`](/docs/api/payments-apps/latest/objects/PaymentSession) must update their apps to use the `nextAction` field.

Previously, payment apps that were processing a payment needed to use the `redirectUrl` field to redirect the customer after they completed their payment offsite. This `redirectUrl` field was specific to offsite payments only.

To support payment methods other than offsite, and other actions that might need to occur depending on the type of payment, we've added the following fields on [`PaymentSessionNextAction`](/docs/api/payments-apps/latest/objects/PaymentSessionNextAction):

- `action`: The action that the payment app must perform. `REDIRECT` indicates the need to redirect the customer after they've completed their payment and `nil` specifies that no next action is required to complete the payment process.
- `context`: Any data required to perform the action. Currently, `context` can only be [`PaymentSessionActionsRedirect`](/docs/api/payments-apps/latest/objects/PaymentSessionActionsRedirect).

## GraphQL Admin API changes

Below are all the changes currently introduced in the 2021-04 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>Next action for payment apps <span id="next-action-for-payment-apps" class="heading-flag breaking"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, payment apps that use the <code class="text-highlight text-highlight--grey">redirectUrl</code> field on <a href="/docs/api/payments-apps/latest/objects/PaymentSession"><code class="text-highlight text-highlight--grey">PaymentSession</code></a> must update their apps to use the <code class="text-highlight text-highlight--grey">nextAction</code> field. This allows payment apps to support payment methods other than offsite and other actions that might need to occur depending on the type of payment.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">PaymentSessionActionsRedirect</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PaymentSessionNextAction</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PaymentSessionNextActionAction</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">PaymentSessionNextActionContext</code> union 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>Revenue attribution <span id="revenue-attribution"></span></h3>
  </div>
  <div class="accordion-content">
    <p>If you run ads on the Shopify App Store, have a valid billing exemption, and want to attribute revenue generated outside of the Billing API to your ad campaigns, then you can use the <a href="/docs/api/admin-graphql/latest/objects/apprevenueattributionrecord">Ad Conversion API</a> to capture the details of externally collected revenue.</p>
<aside class="note">
  <h4>Note</h4>
  <p>
This API is under a private program and isn&#39;t available to all partners.</p>
</aside>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">AppRevenueAttributionRecord</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">AppRevenueAttributionRecordInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">AppRevenueAttributionType</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">revenueAttributionRecords</code> connection was added to object <code class="text-highlight text-highlight--grey">AppInstallation</code></li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">appRevenueAttributionRecordCreate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">appRevenueAttributionRecordDelete</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>Discount codes <span id="discount-codes-graphql-admin"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can query the <code class="text-highlight text-highlight--grey">discountCodeCount</code> field on <a href="/docs/api/admin-graphql/latest/objects/queryroot"><code class="text-highlight text-highlight--grey">QueryRoot</code></a> to retrieve a count of discount codes for a shop. You can also asynchronously add discount redeem codes in bulk using the <a href="/docs/api/admin-graphql/latest/objects/discountredeemcodebulkadd">GraphQL Admin API</a>.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">discountCodeCount</code> field was added to object <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
<li><code class="text-highlight text-highlight--grey">discountRedeemCodeBulkCreation</code> field was added to object <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">DiscountRedeemCodeBulkCreationCode</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountRedeemCodeBulkCreation</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">DiscountRedeemCodeInput</code> input object was added</li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">discountRedeemCodeBulkAdd</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>Subscription policy <span id="discount-codes-graphql-admin"></span></h3>
  </div>
  <div class="accordion-content">
    <p>Apps can now read and write the <a href="/docs/api/admin-graphql/latest/objects/shoppolicytype">subscription policy</a> that merchants have configured for their store.</p>
<p><strong>New value</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">SUBSCRIPTION_POLICY</code> value was added to enum <code class="text-highlight text-highlight--grey">ShopPolicyType</code></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"></span></h3>
  </div>
  <div class="accordion-content">
    <p>You can now query a metafield by ID from the query root of the <a href="/docs/api/admin-graphql/latest/objects/queryroot">GraphQL Admin API</a>.</p>
<p><strong>New field</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">metafield</code> field was added to object <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Script tag caching <span id="script-tag-caching"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can query the <a href="/docs/api/admin-graphql/latest/queries/scripttag">ScriptTag</a> object to determine whether the Shopify CDN (content delivery network) can cache and serve a script tag.</p>
<p><strong>New field</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">cache</code> field was added to object <code class="text-highlight text-highlight--grey">ScriptTag</code></li>
<li><code class="text-highlight text-highlight--grey">cache</code> field was added to input object <code class="text-highlight text-highlight--grey">ScriptTagInput</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Eligibility for international pricing <span id="eligibility-international-pricing"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can query the <a href="/docs/api/admin-graphql/latest/objects/shopfeatures">ShopFeatures</a> object to determine whether a shop can enable international price rules and price overrides.</p>
<p><strong>New field</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">internationalPriceRules</code> field was added to object <code class="text-highlight text-highlight--grey">ShopFeatures</code></li>
<li><code class="text-highlight text-highlight--grey">internationalPriceOverrides</code> field was added to object <code class="text-highlight text-highlight--grey">ShopFeatures</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Gift cards <span id="gift-cards"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can manage gift cards using the <a href="/docs/api/admin-graphql/latest/objects/giftcard">GraphQL Admin API</a>.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">giftCard</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">giftCardCreateInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">giftCardUpdateInput</code> input object was added</li>
<li><code class="text-highlight text-highlight--grey">giftCards</code> connection was added to <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
<li><code class="text-highlight text-highlight--grey">giftCardUserError</code> type was added</li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">giftCardCreate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">giftCardUpdate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">giftCardDisable</code> mutation was added</li>
</ul>
<p><strong>New field</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">giftCardsCount</code> field was added to object <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Payment partner refunds <span id="payment-partner-refunds"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can use <a href="/docs/api/payments-apps/graphql/reference/common-objects/refundsession">RefundSession</a> to issue refunds against payments that have been processed by Payments Partner gateways.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">RefundSession</code> object was added</li>
</ul>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">id</code> field was added to object <code class="text-highlight text-highlight--grey">RefundSession</code></li>
<li><code class="text-highlight text-highlight--grey">status</code> field was added to object <code class="text-highlight text-highlight--grey">RefundSession</code></li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">refundSessionReject</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">refundSessionResolve</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>External video support <span id="vimeo"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can <a href="/docs/api/admin-graphql/latest/objects/externalvideo">query for video</a> hosted outside of Shopify and filter by the value of <code class="text-highlight text-highlight--grey">host</code>.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">MediaHost</code> enum was added and is returned by <code class="text-highlight text-highlight--grey">ExternalVideo</code> object</li>
</ul>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">host</code> field was added to object <code class="text-highlight text-highlight--grey">ExternalVideo</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Contextual pricing <span id="contextual-pricing"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can use <a href="/docs/api/admin-graphql/latest/objects/PriceList">price lists</a> to specify either fixed prices or adjusted relative prices that override initial product variant prices. Refer to <a href="/docs/apps/build/markets/build-catalog">Support different pricing models using the price list API</a> for more information.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">PriceListAdjustmentType</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListPriceOriginType</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListParentUpdateInput</code> enum was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListParentCreateInput</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListPriceUserError</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListAdjustment</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListAdjustmentInput</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListParent</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListUpdateInput</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListCreateInput</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListUserError</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListPrice</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListPriceInput</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListContextRule</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListContextRuleInput</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceListPriceOriginType</code> object was added</li>
<li><code class="text-highlight text-highlight--grey">PriceList</code> object was added</li>
</ul>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">price_list_price_active_bulk_import</code> field was added to object <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
<li><code class="text-highlight text-highlight--grey">price_list</code> field was added to object <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
<li><code class="text-highlight text-highlight--grey">price_lists</code> field was added to object <code class="text-highlight text-highlight--grey">QueryRoot</code></li>
</ul>
<p><strong>New mutations</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">priceListCreate</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">priceListDelete</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">priceListFixedPricesAdd</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">priceListFixedPricesDelete</code> mutation was added</li>
<li><code class="text-highlight text-highlight--grey">priceListUpdate</code> mutation was added</li>
</ul>
  </div>
</div>
  </div>
</div>


## GraphQL Storefront API changes

Below are all the changes currently introduced in the 2021-04 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>Duties <span id="duties"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can query the total duties applied to line items in the <a href="/docs/api/storefront/reference/checkouts/checkout">checkout</a> and the total current and original duties applied to an <a href="/docs/api/storefront/reference/orders/order">order</a>.</p>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">totalDuties</code> field was added to object <code class="text-highlight text-highlight--grey">Checkout</code></li>
<li><code class="text-highlight text-highlight--grey">currentTotalDuties</code> field was added to object <code class="text-highlight text-highlight--grey">Order</code></li>
<li><code class="text-highlight text-highlight--grey">originalTotalDuties</code> field was added to object <code class="text-highlight text-highlight--grey">Order</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>External video support <span id="vimeo"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can <a href="/docs/api/storefront/reference/products/externalvideo">query for video</a> hosted outside of Shopify and filter by the value of <code class="text-highlight text-highlight--grey">host</code>.</p>
<p><strong>New types</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">MediaHost</code> enum was added and is returned by <code class="text-highlight text-highlight--grey">ExternalVideo</code> object.</li>
</ul>
<p><strong>New fields</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">host</code> field was added to object <code class="text-highlight text-highlight--grey">ExternalVideo</code></li>
</ul>
  </div>
</div>
  </div>
</div>


## REST Admin API changes

Below are all the changes currently introduced in the 2021-04 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>Discounts applied to checkouts <span id="something"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can use the <a href="/docs/api/admin-rest/latest/resources/checkout">Checkout</a> resource to retrieve information about how a discount was applied to a checkout.</p>
<p><strong>New property</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">application_type</code> property was added to <code class="text-highlight text-highlight--grey">applied_discounts</code> property on Checkout resource</li>
<li><code class="text-highlight text-highlight--grey">application_type</code> property was added to <code class="text-highlight text-highlight--grey">line_items</code> property (within the <code class="text-highlight text-highlight--grey">applied_discounts</code> property) on Checkout resource</li>
</ul>
<p>Possible values for <code class="text-highlight text-highlight--grey">application_type</code> include:</p>
<ul>
<li><code class="text-highlight text-highlight--grey">automatic</code>: The discount was <a href="/docs/apps/build/discounts#discount-methods">applied automatically</a>.</li>
<li><code class="text-highlight text-highlight--grey">discount_code</code>: The merchant or customer entered a <a href="/docs/apps/build//discounts#discount-methods">discount code</a>.</li>
<li><code class="text-highlight text-highlight--grey">manual</code>: The discount was applied manually by the merchant or an app.</li>
<li><code class="text-highlight text-highlight--grey">script</code>: The discount was applied by a <a rel="external noreferrer noopener" target="_blank" href="https://help.shopify.com/en/manual/checkout-settings/script-editor">Shopify Script</a>.</li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Delivery methods <span id="discount-codes"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can use the <a href="/docs/api/admin-rest/latest/resources/fulfillmentorder"><code class="text-highlight text-highlight--grey">FulfillmentOrder</code></a> resource to retrieve the type of method used to transfer a product or service to a customer.</p>
<p><strong>New property</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">delivery_method</code> property was added to resource <code class="text-highlight text-highlight--grey">FulfillmentOrder</code></li>
</ul>
  </div>
</div>
<div class="accordion-item">
  <div class="accordion-link">
    <div class="chevron-up"></div>
    <div class="chevron-down"></div>
    <h3>Discount codes <span id="discount-codes"></span></h3>
  </div>
  <div class="accordion-content">
    <p>As of API version 2021-04, you can use the <a href="/docs/api/admin-rest/latest/resources/discountcode">DiscountCode</a> resource to retrieve a count of discount codes for a shop.</p>
<p><strong>New endpoint</strong></p>
<ul>
<li><code class="text-highlight text-highlight--grey">/admin/api/2021-04/discount_codes/count.json</code>: Retrieves a count of discount codes for a shop.</li>
</ul>
  </div>
</div>
  </div>
</div>