Quickstart

Quickstart: call the Credicorp public API from Dart / Flutter

Here is the idiomatic Dart / Flutter way to make your first Credicorp public API call. List the live products from GET /public/v1/products, set a timeout, and turn the documented error envelope into an error you can handle — the pattern every other public-ring call reuses.

2 min read

Dart / FlutterFirst call
timeoutBound every request
data[]Unwrap the envelope

List products

import 'package:http/http.dart' as http;
import 'dart:convert';

final res = await http.get(
  Uri.parse('https://api.credicorp.co.uk/public/v1/products'),
  headers: {'Accept': 'application/json'},
).timeout(const Duration(seconds: 10));
if (res.statusCode >= 400) throw Exception(res.body);
final data = jsonDecode(res.body)['data'];

In Flutter, use the http package and decode with dart:convert. Fetch off the UI isolate and open the enquiry handoff with url_launcher in an in-app web view.

Use the sandbox in development

Point the base host at https://sandbox.credicorp.co.uk/public/v1 in development and CI, and at https://api.credicorp.co.uk/public/v1 in production, driven by one environment variable. See choosing a base URL.

Next steps

From here, request a quote, submit an enquiry, and send applicants to apply. Handle errors with the shared error envelope.

Frequently asked questions

Where do I run the request in Flutter?

Await it in an async method (e.g. a FutureBuilder or a state manager). The http package already runs I/O off the UI thread.

How do I handle errors in Dart / Flutter?

Check the status code and read the error object from the body — error.code is the stable machine string to branch on. The pattern is identical across every endpoint.

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.