Best Way to Apply Discounts for B2B and B2C on Shopify (ERP Integration)

Hi,

What is the best approach to apply discounts consistently for both B2B and B2C customers on Shopify while ensuring seamless integration with our ERP?

We can retrieve customers and company customers using segments, but applying discounts or overriding prices for a specific segment is challenging.

Previously, the priceRuleCreate mutation in v2024-07 provided the functionality we needed, but it has been deprecated. The alternative, discountCodeBasicCreate, requires customers to manually enter a discount code, which isn’t ideal. Meanwhile, discountAutomaticBasicCreate automatically applies discounts at checkout (which is what we want), but it does not support customer selection.

Our goal is to apply discounts dynamically for both B2B and B2C customers in a way similar to how segments work while ensuring that these discounts are synchronized with our ERP system. Ideally, we’d like to mix both customer types into a single discount group and have Shopify apply discounts automatically.

What would be the best approach to achieve this? Any insights on integrating this logic with our ERP would be greatly appreciated.

Thanks!