We would like to get your inputs on a requirement to send additional information as part of the error response. We have a synchronous API which internally performs the below API callouts in the mentioned sequence below.
- Get Quote details
- Perform Credit Check
- Update Credit Check Result into quote
- Update Payment Status
- Submit Quote to Product Order In OM
Now, the ask is if any of the steps from 3 to 5 failed, we need to send "what is the reason of failure + what is the credit check result from step 2".
Below is the existing sample error response defined for step 5 failure.
{
"code": "EditQuoteError",
"reason": "Error in editing quote",
"message": "Error in editing quote",
"status": "500"
}
- In the above error response, if we have to indicate credit check result from step 2, how can we do it?
- Are we allowed to extend the error response to add an optional attribute like creditCheckResult as below?
- Or any other standard approach we have as per TMF OpenAPI guideline?
{
"code": "EditQuoteError",
"reason": "Error in editing quote",
"message": "Error in editing quote",
"status": "500",
"creditCheckResult': "RED"
}
#OpenDigitalArchitecture------------------------------
Pritam Roy
Principal Solutions Architect
Tech Mahindra Limited
------------------------------