2 min read
List products
A single cURL handle is enough for a read-only public call:
<?php
$base = 'https://api.credicorp.co.uk/public/v1';
$ch = curl_init($base . '/products');
curl_setopt_array($ch, [
CURLOPT_RETURNURTRANSFER => true,
CURLOPT_HTTPHEADER => ['Accept: application/json'],
CURLOPT_TIMEOUT => 10,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$payload = json_decode($body, true);
if ($status >= 400) {
$e = $payload['error'] ?? ['code' => 'unknown', 'message' => 'error'];
throw new RuntimeException("{$status} {$e['code']}: {$e['message']}");
}
foreach ($payload['data'] as $product) {
printf("%s \u2014 up to \u00a3%s\n", $product['name'], number_format($product['max_amount']));
}
Guzzle, if you already have it
If your project already depends on Guzzle, the same call is a two-liner and you get exceptions and timeouts for free:
$client = new \GuzzleHttp\Client(['base_uri' => $base, 'timeout' => 10]);
$data = json_decode($client->get('products')->getBody(), true)['data'];
Where to keep the base URL
Do not hard-code the host. In Laravel put it in config/services.php and read it with config('services.credicorp.base'); in plain PHP use an environment variable. Point it at https://sandbox.credicorp.co.uk/public/v1 in development.
Frequently asked questions
Do I need Guzzle?
No. The built-in ext-curl covers every public-ring call. Guzzle is convenient if you already use it, but it is not required for these read-only requests.
How do I verify TLS correctly?
Leave CURLOPT_SSL_VERIFYPEER at its default (true). Never disable certificate verification to work around a local CA issue — install the correct CA bundle instead.
Is there an official PHP SDK?
There is a PHP SDK for the partner ring documented under /sdks/php.html. For the public ring the raw cURL shown here is usually all you need.
Related reading

Quickstart: your first Credicorp public API call with curl
The fastest way to see the Credicorp public API working is a single curl call to GET /public/v1/products. The…
Read →
Quickstart: call the Credicorp public API from Node.js
Node 18+ ships a global fetch, so you can call the Credicorp public API with zero dependencies. This…
Read →
Quickstart: call the Credicorp public API from Python
With the requests library you can call the Credicorp public API in about ten lines of Python. This quickstart…
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 →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.