Use the provider's definitions
Read error codes or messages according to the API documentation. Separate authentication issues, invalid service inputs, insufficient balance, and temporary availability problems where the contract distinguishes them. Do not infer a final order outcome from an unfamiliar string.
Choose the appropriate response
Invalid quantities need correction and approval; an unavailable service needs a scope review; an uncertain transport result needs reconciliation. A generic retry loop cannot solve all of these problems and may create duplicate purchases in ambiguous cases.
Keep safe diagnostic context
Record the internal reference and non-sensitive request fields needed to investigate. Remove credentials from logs and reports. Preserve the original error alongside your normalized category so support can see what the provider actually returned.
Decision checklist
| Decision | What to check |
|---|---|
| Category | Documented error meaning |
| Action | Correction review or retry |
| Evidence | Original safe response context |
Worked example
A hypothetical response explicitly rejects a 50-unit request because the minimum is 100. Repeating the same request every minute will not make it valid. The next step is to obtain approval for a compatible quantity or service.
Example figures explain the decision; they are not current prices or promised results.