2 min read
Call the API from WordPress
function credicorp_products() {
$cached = get_transient('credicorp_products');
if ($cached !== false) {
return $cached;
}
$res = wp_remote_get('https://api.credicorp.co.uk/public/v1/products', [
'timeout' => 10,
'headers' => ['Accept' => 'application/json'],
]);
if (is_wp_error($res)) {
return [];
}
$data = json_decode(wp_remote_retrieve_body($res), true)['data'];
set_transient('credicorp_products', $data, HOUR_IN_SECONDS);
return $data;
}Use `wp_remote_get`, never raw cURL, so you inherit WordPress's HTTP layer and filters. Cache the response in a transient for an hour, and render it from a shortcode or block so editors can drop the product list into any page.
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 transients?
A transient caches the catalogue in the WordPress object cache so every page load doesn't hit the API. An hour TTL keeps the list fresh without risking rate limits.
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.
Related reading

Quickstart: choose the right base URL — sandbox vs production
Every Credicorp API integration should read its base host from configuration, never hard-code it. Development…
Read →
Quickstart: get an indicative loan quote from the public API
POST /public/v1/quote turns an amount and term into an illustrative repayment. Send the requested amount and…
Read →
Quickstart: handle Credicorp API error responses
Every Credicorp API error uses the same envelope: { error: { type, code, message, request_id } }. Branch on…
Read →
Quickstart: list Credicorp business-finance products
GET /public/v1/products returns the live catalogue of Credicorp business-finance products. Each item carries…
Read →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.