Skip to main content

How to Fetch dynamic pricing from P21 to Magento?

By |January 17, 2018 January 3rd, 2022No Comments

Why Dynamic Pricing?

In B2B commerce, pricing is always dynamic and no two businesses would want the same product, same quality for the same cost. It differs time and time again based on a plethora of reasons and one simple fact that “every customer has different values and they expect way different pricing”. This dynamic pricing is ideally updated in the ERP and it’s carried over during direct sales. Nevertheless, when it comes to an online store, implementing this dynamic pricing gets tricky and cumbersome. How complicated and time-consuming would it be to manually fix the price for every B2B customer at the backend? It’s an unimaginable, laborious task considering the pace business are running now.

As a solution, this article sheds light on a method that could fetch pricing details from P21 (an ERP software) to Magento (an eCommerce platform).

An insight into the protocol

Dynamic Product Pricing is the core need for most of the B2B entities to function and this is difficult to maintain on the Magento end owing to the complexity. On the other hand, P21 ERP is kind of flexible with respect to the pricing structure and allows Discounted Pricing, Contract Pricing, Custom Pricing, Group Pricing, to name a few. Maintaining all these data on Magento could be bulky and is not an efficient way of handling the pricing. To leverage Magento’s capabilities and P21’s pricing structure, a solid real-time integration between these two entities becomes critical, and that’s the very purpose of the protocol explained in here. The protocol acts as a solution to pull the pricing from P21 dynamically based on the customer group into Magento. However, this event doesn’t restrict the static pricing structure that’s already allocated for irrelevant groups in the Magento.


How does it work?

The protocol is backed by the RESTful API. A RESTful API is based on Representational State Transfer architectural style and this breaks down a particular transaction into several small modules, thus allowing the programmer to take immense flexibility on every part of the transaction. That said, we use the REST API as a service to transfer information between P21 and Magento. Below are few use cases where this model would work:

  1. A B2B customer(signed in) searches for a product and goes to the category page. He sees the targeted pricing which is based out of the pricing rules generated from P21 side.
  2. In the product detail page, the B2B customer sees the targeted pricing as well as the tier pricing based out on the rules generated on P21.
  3. B2B customer tries to do a bulk order from the quick order tab. The pricing is generated based on the rules generated on P21.

Below are the steps involved to connect P21 with Magento to fetch Dynamic Pricing:Step 1: Magento sends the access credentials to P21. Step 2: Subsequently, P21 sends the access token back to P21.Access token and credentials - p21 & magentoStep 3: After receiving the access token, Magento pricing plugin fetches the unique identifiers from Magento (eg: P21 customer id etc) and sends it to P21. Step 4: Subsequently, P21 sends the relevant information (for the particular access Id provided) back to Magento.Step 5: Thus the exact price is displayed on the Magento frontend product page. img1

Hope this article turned out to be useful. Should you have any queries about this protocol, do reach us.

P21 ERP integration is now done quick and smooth with our team od Magento developers. Let’s integrate your Magento store Now.


Author Iyappan

Iyappan is a Certified Magento Developer Plus Technical Architect at DCKAP. He is passionate about Magento. He is the 'go-to' guy for all our Magento needs. A cool-headed, hands-on veteran of many end-to-end implementations.

More posts by Iyappan

Discover What You’re Missing

Get the weekly email full of actionable ideas and insights you can use at work and home.