Skip to content
跨境独立站开店
News

2021 update archive | Shopify API: April Release Information

This article summarizes the API features released in April 2021. Please take advantage of the latest API features to improve the quality of your application.

Check Shopify registration offers in your regionSee current offer

This article summarizes the API features released in April 2021. Please take advantage of the latest API features to improve the quality of your application.

The new version includes a Price List API, significantly improving the pricing flow based on buyers' global locations. Additionally, new features in the 2021-04 version include bulk discount code management using GraphQL and customs information functionality via the Storefront API.

The 2021-04 release coincides with the deprecation of the 2020-04 version, so please check your API health report to ensure compatibility and remember to make the necessary modifications as planned.

1. Price List API

The latest version makes global pricing easier than ever with the addition of the Price List API. The Price List API allows you to create sets of rules that change product prices based on specific "contextual rules" related to the buyer's location. If a price list exists for the product a customer orders and their location, the storefront will automatically adjust the price based on these rules.

The following is an example of a mutation to implement a discounted price list for Canadian customers:

The price list supports fixed prices or relative price adjustments and is applicable to any country worldwide. When prices are increased or decreased, they are automatically applied to the online store and at checkout, requiring no additional work from the merchant or code insertion in the app.

In the example above, a Canadian buyer is trying to purchase a sweater from an American store. If no price list is set, the default behavior is to apply the exchange rate, devalue it, and display that price. With a price list, you can also apply a specific fixed price (e.g., 35.00 Canadian dollars) or a pre-set adjusted relative price.

2. Handling of customs duties via the Storefront API

In version 2021-04, customs information will be returned via the Storefront API. To support this new feature, there are specification changes to how order and checkout resources are interpreted. For example, some total amounts will include customs duties, while others will not. For reference, total amounts that previously included taxes now include customs duties.

Total amount excluding customs duties:

  • Checkout.lineItemsSubtotalPrice
  • Checkout.subtotalPriceV2
  • Order.currentSubtotalPrice
  • Order.subtotalPriceV2

Total amount including customs duties:

  • Checkout.paymentDueV2
  • Checkout.totalPriceV2
  • Order.currentTotalPrice
  • Order.totalPriceV2

For more details on the addition of customs duties to the Storefront API, please refer to the Developer Changelog.

3. Improvement of the Discount Code API

Version 2021-04 introduces several changes to how applications manage discount codes in GraphQL. Instead of individually querying to update discount codes associated with pricing rules, you can now add interchangeable discount codes in bulk.

Examples of mutations:

Variables:

Additionally, a mutation called discountCodeCount has been added, allowing you to count the number of discount codes associated with a specific shop. Apps that previously used REST to create bulk codes or utilize counting endpoints can now use GraphQL and benefit from the features added by these new mutations.

Please check for the latest information regarding changes.

Original text: Shayne Parmelee Translation: Toshiro Abe

read more

  • Things you should know about Shopify's development store
  • Until Fracta becomes a Shopify Plus partner
  • Create an accessible Shopify theme.
  • A Conversation with Shopify Evangelists: On Community Growth
  • How to create a customizable brand logo section
  • 4 tips for creating a profitable affiliate blog
  • Reasons to stop responding to RFPs
  • How to differentiate yourself from competitors: How to be chosen by clients?
  • About GraphQL and API rate limiting
  • Why do storefronts using Hydrogen perform so well?

Grow your business with the Shopify Partner Program. Whether you offer marketing, customization, web design, or development services, the Shopify Partner Program will guide you to success. Joining the program is free, offers revenue-sharing opportunities, and provides access to a wealth of tools to grow your business. Join our passionate commerce community today!

Share this article

  • Share on Facebook
  • Share on X
  • Share on LinkedIn

Related reading

View all
Tools and apps

ShareASale Cross-border Seller Registration and Onboarding Guide

This step-by-step tutorial for cross-border sellers to register and join the ShareASale affiliate platform includes 12 steps, including filling in valid contact information, setting the commission rate that the ShareASale merchant is willing to pay, setting the tracking validity period and currency unit, setting affiliate management rules, setting tracking codes, testing tracking codes, and paying the ShareASale membership fee and commission.

View offer
Shopify

Start free and explore current offers

Visit Shopify for trial duration, eligible plans and promotions available in your region.

Register free with ShopifyAffiliate disclosure