For one of my customers I have setup an integration between their ERP and multiple Adobe Commerce instances.
In order to the number of routes and maintenance we have implemented the integrations using a ‘channel configuration’ driven approach.
This customer has multi-hierarchy setup within their ERP (multiple concerns with multiple companies underneath). Depending on various flags we determine:
- Features that need to be enabled within the integration (i.e. all channels require product prices to be send but certain channels need VAT calculated or need other types of supplements included into the price)
- Determine the Adobe Commerce instance the data needs to be send to
To prevent having to maintain multiple sets of configurations (i.e. sending requests to the correct Adobe Commerce instance), we have setup a transformer that contains a said ‘sales channel configuration’. This sales channel configuration all kind of information needed to setup more ‘dynamic’ routes.
However, in order to do so we had to opt for the less secure bearer token authentication as we are unable to dynamically invoke oAuth 1 (or dynamically refer to an existing oAuth 1 HTTP authentication). Since this now exposes our customer to increased risks we would like to request the ability to dynamically load other configurations, i.e. by allowing a placeholder to refer to the identifier of that configuration.
- Generic Adobe Commerce HTTP client (identifier: generic-ac-client)
- B2C Adobe Commerce HTTP authentication (identifier: b2c-ac-auth)
- B2B Adobe Commerce HTTP authentication (identifier: b2b-ac-auth)
Then the HTTP client (generic-ac-client) would be used in all routes but the HTTP authentication would be driven by a ‘sales channel configuration’ value containing the identifier of the HTTP authentication:
The above serves as an inspiration.