--- title: Automatic Discount Functions now apply to B2B sessions - Shopify developer changelog description: Shopify’s developer changelog documents all changes to Shopify’s platform. Find the latest news and learn about new platform opportunities. source_url: html: https://shopify.dev/changelog/automatic-discount-functions-now-apply-to-b2b-sessions md: https://shopify.dev/changelog/automatic-discount-functions-now-apply-to-b2b-sessions.md --- [Back to Developer changelog](https://shopify.dev/changelog) December 6, 2023 Tags: * Action Required * API # Automatic Discount Functions now apply to B2B sessions 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](https://shopify.dev/docs/api/functions/reference/product-discounts/graphql/common-objects/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](https://help.shopify.com/en/manual/b2b/draft-orders).