Developer changelog

Subscribe to the changelog to stay up to date on recent changes to Shopify’s APIs and other developer products, as well as preview upcoming features and beta releases.

Get updates by RSS

Automatic Discount Functions now apply to B2B sessions


Action required

As of December 6th, 2023, Automatic Discounts created using Shopify Functions will apply by default to B2B customers. Previously, it wasn't possible to target B2B customers with discounts. Discount codes created using Shopify Functions are also available, but gated behind a beta flag, so merchants will need to explicitly opt-in for their store.

App developers can use the BuyerIdentity.purchasingCompany attribute on the Cart input to detect a B2B customer, and use that to customize the discount behavior for a merchant’s B2B audience. Examples of this could include:

  • a discount that applies to B2B customers only
  • a discount that applies to a specific B2B company only
  • a discount that applies to D2C customers only

Note: at this time, discounts are not compatible for B2B customers configured to Submit all orders as drafts for review.