Quickstart

Quickstart: Build a product comparison table

Rendering a comparison table straight from GET /public/v1/products gives readers an always-current view of what Credicorp offers. This recipe shows the exact code, uses only the unauthenticated public ring, and links out to the endpoints and the application flow so the reader always has a next step.

2 min read

1 callProducts drives the table
sortableSort by APR or amount
liveNever hand-edited

Fetch and render

Map the product array into rows and add a click-to-sort header. The data is already structured for a table:

const { data } = await (await fetch(`${BASE}/products`)).json();
data.sort((a, b) => a.representative_apr - b.representative_apr);
table.tBodies[0].innerHTML = data.map(p =>
  `<tr><td>${p.name}</td>` +
  `<td data-sort="${p.max_amount}">\u00a3${p.max_amount.toLocaleString()}</td>` +
  `<td data-sort="${p.representative_apr}">${p.representative_apr}%</td></tr>`
).join('');

Keep it honest

Label representative figures clearly and link each row to a firm quote or to apply. A comparison table is a signpost, not an offer.

Frequently asked questions

Where do the columns come from?

Straight from each product object — name, min_amount/max_amount, representative_apr and type. No extra calls are needed.

How do I keep it current?

Fetch on a cache TTL rather than hard-coding rows. When Credicorp changes the catalogue, your table updates on the next refresh.

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.