2 min read
Read the envelope
Do not guess. The error envelope pinpoints the problem.
{
"error": {
"type": "invalid_request_error",
"code": "consent_required",
"message": "fields.consent must equal \"yes\".",
"param": "fields.consent"
}
}
Map code to fix
Common enquiry-submission codes:
| code | Fix |
|---|---|
consent_required | Send fields.consent: "yes" |
invalid_email | Correct fields.email |
form_required | Set the form key |
payload_too_large | Trim fields under 16 KiB |
invalid_dept | Use a valid dept or omit it |
Do not retry blindly
A 422 is deterministic — the same request will fail again. Fix the field, then resend. See Retrying failed requests.
Frequently asked questions
Why 422 and not 400?
A 400 means the body could not be parsed at all. A 422 means it parsed fine but a value broke a business rule — error.param tells you which value.
Can I get multiple errors at once?
The envelope reports the first failing field. Fix it and resend; if another field is also wrong, you will get its error next.
Funding for UK limited companies
Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.