This question already has an answer here:
- HTTP status code for a partial successful request 4 answers
I am working on a use case where I have a dependency on a downstream API. The issue is that a single resource for me is made up of multiple resources for the downstream service. So a single write to my API may be internally multiple calls to the external service and any one of those calls may fail.
In the case of everything being good I am returning a 200 OK empty response and in the case of an invalid request or server error I am returning a separate error response. What should I return in the case of partial success? I am aware of the 207 Multi-status response code but am not sure if that is applicable here since that looks like it's more applicable to a batch operation. A 207 response with a list of failed sub entities looks like the best bet as of now. Any ideas of a more cleaner way would be appreciated.