2 min read
Call the API from Laravel Livewire
class FinanceOptions extends Component
{
public array $products = [];
public function mount(): void {
$this->products = cache()->remember('cc_products', 3600,
fn () => Http::get(config('services.credicorp.base').'/products')
->json('data'));
}
public function render() { return view('livewire.finance-options'); }
}In a Livewire component, fetch and cache the catalogue in mount() and render it in the Blade view. Livewire keeps the interaction server-driven, so no secret ever reaches the browser.
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 Laravel Livewire?
Yes — it changes infrequently. Cache it for the response's max-age using Laravel Livewire's caching layer, so the API stays off your hot path and under the rate limit.
Where does the base URL belong?
In Laravel Livewire's configuration, read from an environment variable per environment, so the same build runs against sandbox and production by changing one value.
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: Cache the product catalogue correctly
The catalogue changes rarely, so caching it removes the API from your hot path and keeps you well under the…
Read →
Quickstart: handle Credicorp API error responses
Every Credicorp API error uses the same envelope: { error: { type, code, message, request_id } }. Branch on…
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.