S/4HANA API
Hi! I have recently worked with the integration https://www.makini.io/integrations/sap from Makini and I can tell you where the pitfalls may be. Firstly, it is worth remembering that the SAP S/4HANA API is very sensitive to the data format. Often, errors occur precisely because of the mismatch of formats or types of data transferred in requests. For example, if you transfer a date, it is important that it is in ISO format (yyyy-mm-dd), and if this is financial data, then the currency and accuracy up to two decimal places must be strictly specified. As for authentication, this is a separate topic altogether. SAP uses several types of authentication, including OAuth 2.0, which at first glance may seem quite standard, but in practice there are nuances. It is important to correctly configure client IDs and secrets in the API settings, and also make sure that all permissions (scopes) are specified correctly. Very often users forget that to access certain data, they need to add read or write permissions for specific objects, such as materials, orders, etc. When I connected the API, I had to fine-tune the access rights. For example, if you want to get data on orders, you need to request permission for this in advance through the SAP interface. And by the way, make sure that all the endpoints you use are up-to-date for the version of SAP S/4HANA you are working with. I had a situation where old endpoints were used by mistake, which led to query execution errors.
By the way, I also encountered the problem of incorrect authentication in SAP S/4HANA. From my own experience, I noticed that sometimes it is not immediately clear what exactly prevents successful authentication, because the errors may not be very obvious, and the errors in the logs are often too general. In general, the main thing is to strictly follow the instructions for setting up OAuth and carefully check all permissions.