Quickstart

Quickstart: use the Credicorp public API in Express

Here is the idiomatic way to call the Credicorp public API from Express. Fetch the product catalogue, cache it, and read the base host from configuration — the same shape you extend later for pricing and quotes, always keeping partner secrets server-side.

2 min read

ExpressIdiomatic integration
cacheCatalogue changes rarely
configBase URL from env

Call the API from Express

const express = require('express');
const app = express();
const BASE = process.env.CREDICORP_BASE;

app.get('/api/products', async (req, res) => {
  try {
    const upstream = await fetch(`${BASE}/products`);
    const body = await upstream.json();
    res.set('Cache-Control', 'public, max-age=3600').json(body);
  } catch (e) {
    res.status(502).json({ error: 'upstream_unavailable' });
  }
});

Proxy the public read through your own Express route when you want to add caching, shape the payload, or keep a single origin for your front-end. This is also the pattern you extend later to add authenticated partner calls, keeping secrets on the server.

Point at sandbox in development

Set the base URL to https://sandbox.credicorp.co.uk/public/v1 in development and CI, and to https://api.credicorp.co.uk/public/v1 in production — driven by the one environment variable your framework already exposes. See choosing a base URL.

Next steps

From here you can add a quote form, an enquiry submission or an embeddable product picker. Send applicants to apply to start a real journey.

Frequently asked questions

Why proxy a public read?

To add your own caching, trim the payload for your UI, or unify your front-end's origin. It is also the seam where you later add authenticated partner calls safely.

Should I cache the product list?

Yes. The catalogue changes infrequently, so cache it for the response's max-age. This keeps the API off your hot path and well under the rate limit.

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.