π§ Working in progress β the envelope below is the contract. It is not yet returned by every
endpoint.
Error envelope
Every error returns this shape:
Every response β success or error β also carries the identifier in an
X-Request-Id header, so
you can log it for calls that succeed. You can also send X-Request-Id yourself: pass your own
correlation id and it is carried into our logs, which makes a support request much easier to trace.
Status codes
Business outcomes are not errors
Some endpoints return a200/422 with a business outcome rather than an error envelope:
- An ineligible quote returns
200witheligible: falseand afailuresarray. - An order returns a
status(placed/ineligible/rejected/ β¦) βineligible/rejectedcome back as422withfailures/reason. - A report that isnβt ready returns
200withstatus: registeredβ read the status rather than treating it as an error.