2021-04 release notes
We're no longer publishing API release notes. Instead, you can find the latest updates on Shopify APIs in our developer 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, 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, 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 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 and the total current and original duties applied to an order.
- Using the Checkout resource, you can now retrieve information about how a discount was applied to a checkout.
Anchor to Breaking changesBreaking 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.
Anchor to Next action for payment appsNext action for payment apps
As of API version 2021-04, payment apps that use the redirectUrl field on 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:
action: The action that the payment app must perform.REDIRECTindicates the need to redirect the customer after they've completed their payment andnilspecifies that no next action is required to complete the payment process.context: Any data required to perform the action. Currently,contextcan only bePaymentSessionActionsRedirect.
Anchor to GraphQL Admin API changesGraph QL Admin API changes
Below are all the changes currently introduced in the 2021-04 version of the GraphQL Admin API.
Anchor to Next action for payment appsNext action for payment apps
Anchor to BreakingBreaking
As of API version 2021-04, payment apps that use the redirectUrl field on 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
PaymentSessionActionsRedirectobject was addedPaymentSessionNextActionobject was addedPaymentSessionNextActionActionenum was addedPaymentSessionNextActionContextunion was added
Anchor to Revenue attribution ,[object Object]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 to capture the details of externally collected revenue.
This API is under a private program and isn't available to all partners.
New types
-
AppRevenueAttributionRecordobject was added -
AppRevenueAttributionRecordInputinput object was added -
AppRevenueAttributionTypeenum was added -
revenueAttributionRecordsconnection was added to objectAppInstallationNew mutations
-
appRevenueAttributionRecordCreatemutation was added -
appRevenueAttributionRecordDeletemutation was added
Anchor to Discount codes ,[object Object]Discount codes
As of API version 2021-04, you can query the discountCodeCount field on 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.
New fields
-
discountCodeCountfield was added to objectQueryRoot -
discountRedeemCodeBulkCreationfield was added to objectQueryRootNew types
-
DiscountRedeemCodeBulkCreationCodeobject was added -
DiscountRedeemCodeBulkCreationobject was added -
DiscountRedeemCodeInputinput object was addedNew mutations
-
discountRedeemCodeBulkAddmutation was added
Anchor to Subscription policy ,[object Object]Subscription policy
Apps can now read and write the subscription policy that merchants have configured for their store.
New value
SUBSCRIPTION_POLICYvalue was added to enumShopPolicyType
Anchor to Metafields ,[object Object]Metafields
You can now query a metafield by ID from the query root of the GraphQL Admin API.
New field
metafieldfield was added to objectQueryRoot
Anchor to Script tag caching ,[object Object]Script tag caching
As of API version 2021-04, you can query the ScriptTag object to determine whether the Shopify CDN (content delivery network) can cache and serve a script tag.
New field
cachefield was added to objectScriptTagcachefield was added to input objectScriptTagInput
Anchor to Eligibility for international pricing ,[object Object]Eligibility for international pricing
As of API version 2021-04, you can query the ShopFeatures object to determine whether a shop can enable international price rules and price overrides.
New field
internationalPriceRulesfield was added to objectShopFeaturesinternationalPriceOverridesfield was added to objectShopFeatures
Anchor to Gift cards ,[object Object]Gift cards
As of API version 2021-04, you can manage gift cards using the GraphQL Admin API.
New types
-
giftCardobject was added -
giftCardCreateInputinput object was added -
giftCardUpdateInputinput object was added -
giftCardsconnection was added toQueryRoot -
giftCardUserErrortype was addedNew mutations
-
giftCardCreatemutation was added -
giftCardUpdatemutation was added -
giftCardDisablemutation was addedNew field
-
giftCardsCountfield was added to objectQueryRoot
Anchor to Payment partner refunds ,[object Object]Payment partner refunds
As of API version 2021-04, you can use RefundSession to issue refunds against payments that have been processed by Payments Partner gateways.
New types
-
RefundSessionobject was addedNew fields
-
idfield was added to objectRefundSession -
statusfield was added to objectRefundSessionNew mutations
-
refundSessionRejectmutation was added -
refundSessionResolvemutation was added
Anchor to External video support ,[object Object]External video support
As of API version 2021-04, you can query for video hosted outside of Shopify and filter by the value of host.
New types
-
MediaHostenum was added and is returned byExternalVideoobjectNew fields
-
hostfield was added to objectExternalVideo
Anchor to Contextual pricing ,[object Object]Contextual pricing
As of API version 2021-04, you can use price lists 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 for more information.
New types
-
PriceListAdjustmentTypeenum was added -
PriceListPriceOriginTypeenum was added -
PriceListParentUpdateInputenum was added -
PriceListParentCreateInputobject was added -
PriceListPriceUserErrorobject was added -
PriceListAdjustmentobject was added -
PriceListAdjustmentInputobject was added -
PriceListParentobject was added -
PriceListUpdateInputobject was added -
PriceListCreateInputobject was added -
PriceListUserErrorobject was added -
PriceListPriceobject was added -
PriceListPriceInputobject was added -
PriceListContextRuleobject was added -
PriceListContextRuleInputobject was added -
PriceListPriceOriginTypeobject was added -
PriceListobject was addedNew fields
-
price_list_price_active_bulk_importfield was added to objectQueryRoot -
price_listfield was added to objectQueryRoot -
price_listsfield was added to objectQueryRootNew mutations
-
priceListCreatemutation was added -
priceListDeletemutation was added -
priceListFixedPricesAddmutation was added -
priceListFixedPricesDeletemutation was added -
priceListUpdatemutation was added
Anchor to GraphQL Storefront API changesGraph QL Storefront API changes
Below are all the changes currently introduced in the 2021-04 version of the GraphQL Storefront API.
As of API version 2021-04, you can query the total duties applied to line items in the checkout and the total current and original duties applied to an order.
New fields
totalDutiesfield was added to objectCheckoutcurrentTotalDutiesfield was added to objectOrderoriginalTotalDutiesfield was added to objectOrder
Anchor to External video support ,[object Object]External video support
As of API version 2021-04, you can query for video hosted outside of Shopify and filter by the value of host.
New types
-
MediaHostenum was added and is returned byExternalVideoobject.New fields
-
hostfield was added to objectExternalVideo
Anchor to REST Admin API changesREST Admin API changes
Below are all the changes currently introduced in the 2021-04 version of the REST Admin API.
Anchor to Discounts applied to checkouts ,[object Object]Discounts applied to checkouts
As of API version 2021-04, you can use the Checkout resource to retrieve information about how a discount was applied to a checkout.
New property
-
application_typeproperty was added toapplied_discountsproperty on Checkout resource -
application_typeproperty was added toline_itemsproperty (within theapplied_discountsproperty) on Checkout resourcePossible values for
application_typeinclude: -
automatic: The discount was applied automatically. -
discount_code: The merchant or customer entered a discount code. -
manual: The discount was applied manually by the merchant or an app. -
script: The discount was applied by a Shopify Script.
Anchor to Delivery methods ,[object Object]Delivery methods
As of API version 2021-04, you can use the FulfillmentOrder resource to retrieve the type of method used to transfer a product or service to a customer.
New property
delivery_methodproperty was added to resourceFulfillmentOrder
Anchor to Discount codes ,[object Object]Discount codes
As of API version 2021-04, you can use the 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.