Currently, I have a rest API service which serves to many different consumers. One of the endpoints of API is for retrieving an order. Inside a single application, I am making 5 different service calls to other external API's to generate and return the response to the caller.
Half of my API's consumers do not need the response of the 3 other services (there are 5 external service calls in total to generate the response). Some of them only want to see the basic information about the order. For those consumers, only 2 API call is enough to generate their content on their side.
However, for the rest of the other consumers, they do use the entire response
Sometimes, because of that, the response time increases rapidly. Even though the consumer does not want to use the response of the specific service, they have to wait for that service in any case.
Is there a way to determine which services should we call depending on the consumer's request?
Shortly, I want my system to determine which service needs to be called depending on the consumer of the API.
note: application is monolithic. it is not a microservice. all 5 API calls are being done within the same application.