Recipe

Submit a contact form to the enquiries endpoint

Wire any contact form to POST /public/v1/enquiries in a few lines. Collect the visitor’s answers into a flat fields object, set fields.consent to "yes", pick a form key and an optional dept, and post it. On success you get a 201 with the enquiry id; on a validation slip you get a 422 you can surface back to the user.

2 min read

201On success
consentAlways required
≤60 keysFlat fields object

Step 1 — build the payload

Keep fields flat — string, number or boolean values only, up to 60 keys, ≤16 KiB encoded. Include a valid email if you collect one, and always set consent.

{
  "form": "contact-us",
  "dept": "support",
  "fields": {
    "name": "Jordan Ellis",
    "email": "[email protected]",
    "company": "Example Trading Ltd",
    "message": "Please call me about working capital.",
    "consent": "yes"
  }
}

Step 2 — post it

curl -sS -X POST https://hub.credicorp.co.uk/public/v1/enquiries \
  -H 'Content-Type: application/json' \
  -d @enquiry.json

Step 3 — handle the response

A 201 returns {id, status:"new"} — show a thank-you and keep the id for support. A 422 means a validation rule failed (missing consent, bad email, oversized fields); read the error code and prompt the user to fix it. See the reference and error handling.

The consent gate is not optional. Present a clear checkbox on your form, only set fields.consent = "yes" when the user ticks it, and never hard-code it. You are the controller for the data you collect — see Privacy and PII.

Frequently asked questions

What is the form field for?

It is the forms-registry key — a slug identifying which form the submission came from (1–64 chars, [a-z0-9_-]). It helps route and label the enquiry.

What if the user does not tick consent?

Do not submit. fields.consent must be "yes" or the API returns a 422. Block submission client-side until the box is ticked, and never set it on the user’s behalf.

Can I send nested objects in fields?

No. fields must be flat — string, number or boolean values only. Flatten any structure before you send it.

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.