Shopify Scripts

Scripts lets you add custom server-side logic to a checkout, and change the behavior of payment methods, shipping rates, and checkout line items.

Shopify Scripts lets developers change shipping rates and payment methods directly at Shopify checkout. You can use these scripts to do the following:

  • Hide shipping rates for B2B customers
  • Add handling times to shipping rates
  • Prioritize preferred payment methods
  • Hide manual payment methods for non-eligible customers

Benefits

Benefits of Shopify Scripts include the following:

Redesigned developer experience

We redesigned the experience of writing and configuring Scripts to make it more powerful for developers and simpler for merchants.

Co-located and run in Shopify

Scripts are co-located and run directly in Shopify, so they scale with Shopify checkout.

Better performance

Your most complex scripts can run in less than 10 ms.

We rebuilt Scripts from the ground up using WebAssembly. This new architecture speeds up the development process, improves reliability, and makes your scripts run much faster.

Declarative rather than procedural APIs

The new Scripts APIs are declarative APIs, whereas the previous Shopify Editor scripts were procedural. This means that you tell the Shopify Scripts APIs what you want to do, and Shopify figures out how best to do it. For example, rather than letting you modify the checkout or the cart directly, we expose a list of well-defined, supported features that you can interact with and that will work predictably.

Scripts APIs are also strongly typed, so more errors appear at compile time rather than at run time.

What are the Scripts APIs?

Scripts APIs let you customize the checkout experience for customers:

Next steps

On this page