Quickstart

Quickstart: Debug a failing public API call

When a call fails, work from the network inward: prove reachability, read the exact status and error code, then reproduce with a bare curl. This recipe gives you the exact code, uses only the unauthenticated public ring, and links to the endpoints and the application flow so the reader always has a next step.

2 min read

healthz firstProve reachability
error.codeRead the real cause
curl -vReproduce bare

Isolate the layer

Run healthz first. A non-200 there means the problem is network, proxy or TLS, not your request. If healthz is fine, the issue is in the specific call.

Read the real error

curl -v -X POST https://api.credicorp.co.uk/public/v1/quote \
  -H 'Content-Type: application/json' \
  -d '{"amount": 999999999}'

-v shows the status line, response headers (including X-Request-Id) and the error envelope. A 400 with invalid_amount tells you exactly what to fix.

Common causes

  • Wrong host (production vs sandbox) — check your base URL.
  • Missing Content-Type: application/json on a POST.
  • A field out of range — read the product's min_amount/max_amount first.
  • A corporate proxy rewriting or blocking the request — test from another network.

Frequently asked questions

Where do I start?

With healthz, to separate a network problem from a request problem. Then read the exact status and error.code before changing any code.

What if curl works but my code fails?

The difference is almost always a header or the body encoding. Compare your request to the working curl byte for byte.

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.