--- title: 2021-04 release notes description: Update your app from API version 2021-01 to 2021-04. api_name: release-notes source_url: html: https://shopify.dev/docs/api/release-notes/previous-versions/2021-04?itcat=partner_blog&itterm=api_deprecation_update_2021-04 md: https://shopify.dev/docs/api/release-notes/previous-versions/2021-04.md?itcat=partner_blog&itterm=api_deprecation_update_2021-04 --- ExpandOn this page * [Breaking changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#breaking-changes) * [Graph​QL Admin API changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#graphql-admin-api-changes) * [Graph​QL Storefront API changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#graphql-storefront-api-changes) * [REST Admin API changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#rest-admin-api-changes) # 2021-04 release notes 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. | Release date | Date version is no longer supported | | - | - | | April 1, 2021 | April 1, 2022 | 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](https://shopify.dev/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](https://shopify.dev/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](https://shopify.dev/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](https://shopify.dev/docs/api/storefront/reference/checkouts/checkout) and the total current and original duties applied to an [order](https://shopify.dev/docs/api/storefront/reference/orders/order). * Using the [Checkout](https://shopify.dev/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`](https://shopify.dev/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`](https://shopify.dev/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`](https://shopify.dev/docs/api/payments-apps/latest/objects/PaymentSessionActionsRedirect). *** ## Graph​QL Admin API changes Below are all the changes currently introduced in the 2021-04 version of the GraphQL Admin API. ### Next action for payment apps #### Breaking As of API version 2021-04, payment apps that use the `redirectUrl` field on [`PaymentSession`](https://shopify.dev/docs/api/payments-apps/latest/objects/PaymentSession) must update their apps to use the `nextAction` 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. **New types** * `PaymentSessionActionsRedirect` object was added * `PaymentSessionNextAction` object was added * `PaymentSessionNextActionAction` enum was added * `PaymentSessionNextActionContext` union was added ### Revenue attribution 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 [Ad Conversion API](https://shopify.dev/docs/api/admin-graphql/latest/objects/apprevenueattributionrecord) to capture the details of externally collected revenue. Note This API is under a private program and isn't available to all partners. **New types** * `AppRevenueAttributionRecord` object was added * `AppRevenueAttributionRecordInput` input object was added * `AppRevenueAttributionType` enum was added * `revenueAttributionRecords` connection was added to object `AppInstallation` **New mutations** * `appRevenueAttributionRecordCreate` mutation was added * `appRevenueAttributionRecordDelete` mutation was added ### Discount codes As of API version 2021-04, you can query the `discountCodeCount` field on [`QueryRoot`](https://shopify.dev/docs/api/admin-graphql/latest/objects/queryroot) to retrieve a count of discount codes for a shop. You can also asynchronously add discount redeem codes in bulk using the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql/latest/objects/discountredeemcodebulkadd). **New fields** * `discountCodeCount` field was added to object `QueryRoot` * `discountRedeemCodeBulkCreation` field was added to object `QueryRoot` **New types** * `DiscountRedeemCodeBulkCreationCode` object was added * `DiscountRedeemCodeBulkCreation` object was added * `DiscountRedeemCodeInput` input object was added **New mutations** * `discountRedeemCodeBulkAdd` mutation was added ### Subscription policy Apps can now read and write the [subscription policy](https://shopify.dev/docs/api/admin-graphql/latest/objects/shoppolicytype) that merchants have configured for their store. **New value** * `SUBSCRIPTION_POLICY` value was added to enum `ShopPolicyType` ### Metafields You can now query a metafield by ID from the query root of the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql/latest/objects/queryroot). **New field** * `metafield` field was added to object `QueryRoot` ### Script tag caching As of API version 2021-04, you can query the [ScriptTag](https://shopify.dev/docs/api/admin-graphql/latest/queries/scripttag) object to determine whether the Shopify CDN (content delivery network) can cache and serve a script tag. **New field** * `cache` field was added to object `ScriptTag` * `cache` field was added to input object `ScriptTagInput` ### Eligibility for international pricing As of API version 2021-04, you can query the [ShopFeatures](https://shopify.dev/docs/api/admin-graphql/latest/objects/shopfeatures) object to determine whether a shop can enable international price rules and price overrides. **New field** * `internationalPriceRules` field was added to object `ShopFeatures` * `internationalPriceOverrides` field was added to object `ShopFeatures` ### Gift cards As of API version 2021-04, you can manage gift cards using the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql/latest/objects/giftcard). **New types** * `giftCard` object was added * `giftCardCreateInput` input object was added * `giftCardUpdateInput` input object was added * `giftCards` connection was added to `QueryRoot` * `giftCardUserError` type was added **New mutations** * `giftCardCreate` mutation was added * `giftCardUpdate` mutation was added * `giftCardDisable` mutation was added **New field** * `giftCardsCount` field was added to object `QueryRoot` ### Payment partner refunds As of API version 2021-04, you can use [RefundSession](https://shopify.dev/docs/api/payments-apps/graphql/reference/common-objects/refundsession) to issue refunds against payments that have been processed by Payments Partner gateways. **New types** * `RefundSession` object was added **New fields** * `id` field was added to object `RefundSession` * `status` field was added to object `RefundSession` **New mutations** * `refundSessionReject` mutation was added * `refundSessionResolve` mutation was added ### External video support As of API version 2021-04, you can [query for video](https://shopify.dev/docs/api/admin-graphql/latest/objects/externalvideo) hosted outside of Shopify and filter by the value of `host`. **New types** * `MediaHost` enum was added and is returned by `ExternalVideo` object **New fields** * `host` field was added to object `ExternalVideo` ### Contextual pricing As of API version 2021-04, you can use [price lists](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceList) to specify either fixed prices or adjusted relative prices that override initial product variant prices. Refer to [Support different pricing models using the price list API](https://shopify.dev/docs/apps/build/markets/build-catalog) for more information. **New types** * `PriceListAdjustmentType` enum was added * `PriceListPriceOriginType` enum was added * `PriceListParentUpdateInput` enum was added * `PriceListParentCreateInput` object was added * `PriceListPriceUserError` object was added * `PriceListAdjustment` object was added * `PriceListAdjustmentInput` object was added * `PriceListParent` object was added * `PriceListUpdateInput` object was added * `PriceListCreateInput` object was added * `PriceListUserError` object was added * `PriceListPrice` object was added * `PriceListPriceInput` object was added * `PriceListContextRule` object was added * `PriceListContextRuleInput` object was added * `PriceListPriceOriginType` object was added * `PriceList` object was added **New fields** * `price_list_price_active_bulk_import` field was added to object `QueryRoot` * `price_list` field was added to object `QueryRoot` * `price_lists` field was added to object `QueryRoot` **New mutations** * `priceListCreate` mutation was added * `priceListDelete` mutation was added * `priceListFixedPricesAdd` mutation was added * `priceListFixedPricesDelete` mutation was added * `priceListUpdate` mutation was added *** ## Graph​QL Storefront API changes Below are all the changes currently introduced in the 2021-04 version of the GraphQL Storefront API. ### Duties As of API version 2021-04, you can query the total duties applied to line items in the [checkout](https://shopify.dev/docs/api/storefront/reference/checkouts/checkout) and the total current and original duties applied to an [order](https://shopify.dev/docs/api/storefront/reference/orders/order). **New fields** * `totalDuties` field was added to object `Checkout` * `currentTotalDuties` field was added to object `Order` * `originalTotalDuties` field was added to object `Order` ### External video support As of API version 2021-04, you can [query for video](https://shopify.dev/docs/api/storefront/reference/products/externalvideo) hosted outside of Shopify and filter by the value of `host`. **New types** * `MediaHost` enum was added and is returned by `ExternalVideo` object. **New fields** * `host` field was added to object `ExternalVideo` *** ## REST Admin API changes Below are all the changes currently introduced in the 2021-04 version of the REST Admin API. ### Discounts applied to checkouts As of API version 2021-04, you can use the [Checkout](https://shopify.dev/docs/api/admin-rest/latest/resources/checkout) resource to retrieve information about how a discount was applied to a checkout. **New property** * `application_type` property was added to `applied_discounts` property on Checkout resource * `application_type` property was added to `line_items` property (within the `applied_discounts` property) on Checkout resource Possible values for `application_type` include: * `automatic`: The discount was [applied automatically](https://shopify.dev/docs/apps/build/discounts#discount-methods). * `discount_code`: The merchant or customer entered a [discount code](https://shopify.dev/docs/apps/build//discounts#discount-methods). * `manual`: The discount was applied manually by the merchant or an app. * `script`: The discount was applied by a [Shopify Script](https://help.shopify.com/en/manual/checkout-settings/script-editor). ### Delivery methods As of API version 2021-04, you can use the [`FulfillmentOrder`](https://shopify.dev/docs/api/admin-rest/latest/resources/fulfillmentorder) resource to retrieve the type of method used to transfer a product or service to a customer. **New property** * `delivery_method` property was added to resource `FulfillmentOrder` ### Discount codes As of API version 2021-04, you can use the [DiscountCode](https://shopify.dev/docs/api/admin-rest/latest/resources/discountcode) resource to retrieve a count of discount codes for a shop. **New endpoint** * `/admin/api/2021-04/discount_codes/count.json`: Retrieves a count of discount codes for a shop. *** * [Breaking changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#breaking-changes) * [Graph​QL Admin API changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#graphql-admin-api-changes) * [Graph​QL Storefront API changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#graphql-storefront-api-changes) * [REST Admin API changes](https://shopify.dev/docs/api/release-notes/previous-versions/2021-04#rest-admin-api-changes)