Supporting B2B customers
The shops can express different prices for specific customer groups. Such prices may be valid only in specific time periods.
Customer price groups (B2C systems)
Used in B2C systems.
A given customer may only be in one price group. Default is group 0 (the regular prices)
API
-
User shows the customer specific item id's in the
items_overridefield. If this field is populated, items need to be (re-)loaded, should they have been loaded before the customers authentication already. -
/api/user provides this data.
-
/api/items?i=1,2,3 can fetch a list of items.
After authentication, all item related calls will provide the customer specific (gross) price. If items have been cached before, they need to be re-fetched with data for this specific customer. Also, this information shall not be cached and shown for other visitors or customers.
Ideas
TODO GH Rabattstaffel? Impl as in b2c?
Wholesale customers (B2B systems)
used for PCGclassic Wholesale B2B Backends.
Customers can be in several price groups that have special prices or packaging.
Wholesale Shops differ to regular shops:
- prices are provided netto for wholesale customers
- vat is for information only, not to be part of any calculation
- a optional validity time range may be provided on the price and it should be shown. If the target delivery day is outside the given time frame, the regular price is shown, still with the indication of the timeframe and the price
- the unit has an additional description (packaging information), to be shown too.
- items.bbdays might be of interest
- B2B shops are customer shops: anonymous / guest sessions do not get meaningful assortment data (item counts and prices may come back empty or zero, and B2BInfo is never included). UIs should hide prices and ordering for unauthenticated visitors and prompt for a login instead.
API
-
The bind call provides information about the system. If the ShopUrl.b2b field is true, it's a wholesale system.
-
User shows the customer specific item id's in the
items_overridefield. If this field is populated, items need to be (re-)loaded, should they have been loaded before the customers authentication already. -
/api/user provides this data.
Before Authentication, all Data of items in a configured guest group are returned, with their base settings. In that stage, dont show prices. (Item-calls as well as the Navigation-call.) This also applies to the category, subgroup and rubric counts and the navigation positions delivered by the Navigation-call: they reflect the guest group before authentication (or everything, if no guest group is configured), and the authenticated customer's group(s) afterwards. Navigation positions are always returned, possibly with a count of 0 - hide those in the UI. So after authentication, re-fetch the navigation too, not only the items.
After authentication, all item related calls will provide the customer specific (net) price. If items have been cached before, they need to be re-fetched with data for this specific customer. Also, this information shall not be cached and shown for other visitors or customers.
Before fetching items again, make sure a date selection happened.
-
/api/items?i=1,2,3 can fetch a list of items, which should carry additional B2BInfo. Note that only since items22 we return B2BInfo — older items calls (items20/items21) and item1 do not.
-
in case a b2b Item Information exists (should), the items calls return an additional Response Type B2BInfo. If that is the case, the customer shall be shown these options and only these options — they replace the item's regular (anonymous) variant. Do not offer the item's base price/unit as an additional pick next to them; the regular price only serves as the fallback for options whose validity range does not cover the target delivery day. There might be several pricing or packaging options per item, resulting in several pick options in a UI; pre-select the first one. Each
B2BInforecord carries the netprice, theunitandpackagingdescription and an optionalvalidFrom/validUntilrange; if the target delivery day is outside that range, the regular price applies but the option is still shown (with the range and the regular price). -
B2BInfo is bound to the customer's wholesale group (
cgroupid), so it is only returned on an authenticated customer session — anonymous and guest sessions get an empty list. This also means B2BInfo must never be cached or pre-rendered into shared pages. In named-key response formats the key isb2binfo(singular). -
Ordering a picked option: place the option's
unitidin the order position —oposfield 3 (unitid) of neworder8, together with the option's unit text in field 2. That is how the backend knows which price/packaging variant was ordered. A cart therefore has to key its lines by item id plus unitid, so the same item can be in the cart with several packaging variants.
Related
See how to implement a date selection, as the lookup of the customer specific data requires a selected delivery date.
about discount options or discount tiers may also change the price option for a specific customer.