Quickstart

Quickstart: use the Credicorp public API in Symfony

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

2 min read

SymfonyIdiomatic integration
cacheCatalogue changes rarely
configBase URL from env

Call the API from Symfony

use Symfony\Contracts\HttpClient\HttpClientInterface;

class CredicorpClient {
    public function __construct(private HttpClientInterface $http) {}
    public function products(): array {
        return $this->http->request('GET',
            'https://api.credicorp.co.uk/public/v1/products',
            ['timeout' => 10])->toArray()['data'];
    }
}

Inject Symfony's HttpClientInterface and call toArray() to decode. Configure a scoped client with the base URI in framework.yaml and cache responses with the Cache component.

Sandbox first

Set the base URL to https://sandbox.credicorp.co.uk/public/v1 in development and CI. See choosing a base URL.

Next steps

Add a quote form or an enquiry submission, and send applicants to apply. Handle failures with the shared error envelope.

Frequently asked questions

Should I cache the catalogue in Symfony?

Yes — it changes infrequently. Cache it for the response's max-age using Symfony's caching layer, so the API stays off your hot path and under the rate limit.

Where does the base URL belong?

In Symfony's configuration, read from an environment variable per environment, so the same build runs against sandbox and production by changing one value.

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.