
Syncing SAP Business One Price Lists, Volume and Period Discounts to Magento
SAP Business One and Magento store prices in very different ways. SAP works through a priority order: special prices for a customer, discount groups, period and volume discounts, then the price list. Magento simply takes the lowest price it can find. If you copy SAP's tables across one by one, customers will sooner or later see a price in the shop that SAP would never have charged. The safer approach is to let the sync work out what SAP would charge, and send Magento that result.
Price mismatches turn up in a lot of ERP-connected shops, and the connector code is often working exactly as written. The two systems just follow different pricing rules, and nobody wrote down how one should translate into the other.
This guide is written for developers and whoever looks after pricing in SAP Business One. It maps each SAP price type to Magento, with the API calls for both sides, and ends with a test you can run before a customer spots the gap.
Key takeaways
- SAP Business One picks a price by priority order; Magento always shows the lowest price it receives.
- Let the sync calculate the effective price with SAP’s rules and send Magento one price per customer group, quantity break and date range.
- Map price lists to customer groups, volume discounts to tier prices and period discounts to dated catalog price rules or a scheduled sync.
- Sync only what changed, use the bulk API and an indexer on schedule, and check prices with a test matrix before customers do.
How SAP Business One decides a price
When a sales employee adds an item to an order, SAP Business One looks for a price in a fixed order and stops at the first match. With the default "Effective Price" setting, the order is:
- Blanket agreement. A price agreed in a contract with this customer beats everything else.
- Special price for the business partner. A fixed price or discount for one customer and one item. It can carry its own date ranges and quantity breaks.
- Discount group. A percentage for a group of items, for example everything from one manufacturer or item group. It only supplies a discount, so SAP keeps looking for a price to apply it to.
- Period and volume discount. Date-limited prices and quantity breaks, defined per price list.
- Price list. The base price from the list assigned to the customer.
Two details here affect the shop directly.
Each customer has one price list. Period and volume discounts hang off that price list, so a customer only ever sees the discounts of their own list.
The "Effective Price" setting can change the rules. On the business partner (and globally under General Settings), SAP can be set to pick the lowest or highest price from all sources instead of using the priority order. Check which mode your company uses before you design the sync. It changes the answer.
In the database, special prices sit in tables OSPP (header), SPP1 (date ranges) and SPP2 (quantity breaks). Period and volume discounts for a price list use the same tables, with a card code of * plus the price list number, for example *1 for price list 1. Through the Service Layer, both appear in the SpecialPrices entity.
Where those prices go in Magento
Magento has no idea what a price list or a business partner is. It has products, customer groups and a handful of price types. The job is to map one model onto the other.
| SAP Business One | Magento equivalent | Notes |
|---|---|---|
| Base price list (e.g. retail) | Product price | One list becomes the default price per website |
| Other price lists (wholesale, dealer, export) | One customer group per price list, with a group price (tier price at quantity 1) | Assign each Magento customer to the group that matches their SAP price list |
| Volume discounts (quantity breaks) | Tier prices per customer group | Tier prices have no date fields |
| Period discounts (date ranges) | Catalog price rule with from/to dates, or a scheduled sync that swaps tier prices on the start and end date | special_price has dates but applies to every customer group |
| Discount groups (% per item group or manufacturer) | Catalog price rule filtered by attribute and customer group | Keep the item group or manufacturer as a product attribute |
| Special prices for one customer | Customer-specific price module, or a shared catalogue per company on Adobe Commerce B2B | Magento Open Source has no per-customer price out of the box |
| Blanket agreements | Usually left in SAP | Rarely worth mirroring in the shop |
If several prices apply to the same product, Magento always shows the lowest one: base price, special price, tier price, catalog rule, whichever is cheapest. SAP's default mode does the opposite, taking the most specific price even when it's higher.
Say a customer has a special price of €10 in SAP, while their price list's volume discount drops to €9.50 at 50 units. SAP charges €10, because the special price wins. Magento, given both, charges €9.50. That's the gap from the opening example.
Reading prices from SAP, writing them to Magento
The examples below use the SAP Business One Service Layer and the Magento REST API. Hostnames, credentials and codes are placeholders.
1. Log in to the Service Layer and read the price data
SL=https://sap-host:50000/b1s/v1
# Start a session (the cookie holds the session ID)
curl -s -c sl.cookie -X POST "$SL/Login" \
-H "Content-Type: application/json" \
-d '{"CompanyDB":"SBO_DEMO","UserName":"api_user","Password":"***"}'
# All price-list prices for one item
curl -s -b sl.cookie "$SL/Items('A00001')?\$select=ItemCode,ItemPrices"
# Special prices for one customer, with date ranges and quantity breaks
curl -s -b sl.cookie "$SL/SpecialPrices?\$filter=CardCode eq 'C20000'"
# Period and volume discounts defined on price list 2
curl -s -b sl.cookie "$SL/SpecialPrices?\$filter=CardCode eq '*2'"For a real sync you'd page through results with $top and $skip and only fetch what changed since the last run.
2. Work out the effective price per customer, quantity and date
This is the part that needs to follow SAP's priority order. In simplified form:
def effective_price(customer, item, qty, day):
"""Return the price SAP would charge, using default priority."""
special = find_special_price(customer.card_code, item, qty, day)
if special is not None:
return special # customer special price wins
base = price_list_price(customer.price_list, item)
period_volume = find_special_price(f"*{customer.price_list}", item, qty, day)
price = period_volume if period_volume is not None else base
discount = discount_group_percent(customer.card_code, item)
return round(price * (1 - discount / 100), 2)The helper functions read from the data you fetched in step 1. Customers without special prices or customer-level discount groups share the result of their price list, so you can calculate those once per customer group. Only customers with their own special prices need individual results, which go to the customer-specific price module. If your company uses the "lowest price" mode instead, replace the early return with a min() over all sources.
3. Write the results to Magento as tier prices
curl -s -X POST "https://shop.example.com/rest/V1/products/tier-prices" \
-H "Authorization: Bearer $MAGENTO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"prices": [
{"sku": "A00001", "price": 9.50, "price_type": "fixed",
"website_id": 0, "customer_group": "Wholesale", "quantity": 1},
{"sku": "A00001", "price": 8.90, "price_type": "fixed",
"website_id": 0, "customer_group": "Wholesale", "quantity": 50}
]}'POST adds or updates the prices you send. PUT on the same endpoint replaces all tier prices for the SKUs in the request, which is useful when a quantity break was deleted in SAP and has to disappear from the shop too.
When the price matrix gets big
Price data grows faster than people expect. Take 5,000 SKUs, 12 price lists and 3 quantity breaks each. That's 180,000 tier price rows before a single customer-specific price. Add 200 customers with their own special prices and you're past a quarter of a million rows.
Magento's database copes with that easily. The trouble starts when the sync pushes all of it every hour. A few habits help:
Sync changes, not everything. Keep a hash of the last price you sent per SKU, group and quantity, and only send rows whose hash changed. A nightly full comparison can catch anything the delta sync missed.
Send large batches asynchronously. Magento's bulk API queues the work instead of making the sync wait for each request:
# One HTTP call, many requests, processed by the queue
curl -s -X POST "https://shop.example.com/rest/async/bulk/V1/products/tier-prices" \
-H "Authorization: Bearer $MAGENTO_TOKEN" \
-H "Content-Type: application/json" \
-d @tier-price-batches.json
# Make sure a consumer is processing the queue
bin/magento queue:consumers:start async.operations.allKeep the price indexer on schedule. With "Update on Save", every price change reindexes inside the API request. Under a big import that means slow syncs and locked tables.
bin/magento indexer:set-mode schedule catalog_product_priceWatch the cache. Every changed price invalidates cached product and category pages. A large import in the middle of the day can empty the full-page cache just when traffic is high. Run big price changes overnight, and avoid them entirely during peak weeks (see our peak season checklist).
Mistakes that cause wrong prices, and how to catch them
When a price is wrong, check these first:
Build a test matrix. Before go-live, and again after every change to pricing in SAP, compare prices across a small grid. A few customers (one per price list, plus some with special prices), a few items, quantities just under and over each break, and dates inside and outside each period. For every combination, write down the price SAP gives on a draft sales quotation and the price the Magento cart shows for the same login and quantity. Thirty rows is often enough to find every class of mistake above.
Automate that comparison once it works. A nightly job that checks the same grid and alerts on any difference will catch a broken price before a customer does.
Frequently asked questions
+Can Magento show customer-specific prices from SAP Business One?
+How do SAP volume discounts appear in Magento?
+Can Magento handle SAP period discounts with start and end dates?
+Why does Magento show a lower price than SAP?
+How often should prices sync between SAP Business One and Magento?
Need help with SAP prices in Magento?
Ingold Solutions builds and supports the SAP Business One connector for Magento, which syncs prices, including period and volume discounts, along with products, customers, stock and orders. As an SAP Silver Partner and Adobe Solution Partner, we set up both sides: the pricing in SAP and how it shows in the shop.
If your customers keep seeing prices that don't match their invoices, we'll go through your price setup and build the test matrix with you.
Frequency Ask Question
Yes, but not out of the box on Magento Open Source. Price lists map well to customer groups. Prices for individual customers need a customer-specific price module, or shared catalogues per company on Adobe Commerce B2B.
As tier prices: one row per customer group and quantity break. Magento shows them on the product page and applies them in the cart automatically.
Tier prices have no dates, so use catalog price rules with from and to dates, or schedule the sync to update tier prices when a period starts and ends.
Usually because Magento received more than one price for the same product and picked the lowest. SAP’s default setting picks the most specific price instead. Calculate the effective price during the sync and send Magento only that.
Price changes are less frequent than stock changes. A delta sync every 15 to 60 minutes is usually enough, with large updates run overnight.




