Dynamic price request to company management system

Hello Everyone!
Please Help!!
I have a client who sells products for animal care and nutrition.
There are different types of users (private individuals, wholesalers, pharmacists) who correspond to different price lists.

In addition to this, the client has rather complex rules for the calculation of product prices and shipping costs, which depend on the quantities and types of products placed in the cart and on any exemptions that users are entitled to.

For the job in question it is not necessary to know these rules.
The development version of the site is on Magento 2, and is almost complete as far as the front-end is concerned.

The client’s IT technician has created and manages the company’s management software, which deals with the definition of price lists and orders collected offline.

After a grueling negotiation (he’s not very collaborative) I managed to convince him to set up a minimal HTTP API (s) endpoint that allows us the following actions:

Given a list of products with their quantities and a user ID, obtain the prices of the products themselves and the shipping costs.

Send a confirmed order to the management system, in the form of a json with list of products with the relative quantities and a user data (with relative user ID), upon confirmation of an order, a JSON identical to the previous one must be sent, but to a different endpoint, which allows the confirmed and paid order to be sent to the management system.

Ideally I want a custom module for Magento to take care of requesting prices from the API before each view of the cart / checkout and apply the amounts obtained to the order lines and shipping costs.

It’s possible?
Can someone please kindly help me.
Thank you.

HI Wakuseo,

You probably want to gain the trust and cooperation of the IT person in charge of the management system. Find out why he doesn’t want to cooperate with you. Why was he left out of the decision process regarding the ecommerce website?

It is possible to create a Magento custom module that does what you are describing.
I would argue that if you are not sure if it is possible, you are probably not going to be able to do it.

Getting the prices after the order is confirmed might be too late.

Magento 2 has a robust API that you can use to load the prices from the management system. In a similar scenario for a client that has 26 price lists and thousands of SKUs, I used Magento’s API to load the prices using tier pricing. Didn’t need a custom module to load the prices.