2 min read
Point tests at sandbox
BASE = 'https://sandbox.credicorp.co.uk/public/v1'
def test_products_have_amount_range():
data = requests.get(f'{BASE}/products').json()['data']
assert data, 'catalogue should not be empty'
for p in data:
assert p['min_amount'] < p['max_amount']
Snapshot with confidence
Because sandbox fixtures are stable, you can snapshot a full response and assert it byte-for-byte. If a snapshot changes unexpectedly, the API contract changed — exactly what you want a test to catch.
Never test against production
Production data moves and its limits are tighter. Keep CI on the sandbox so a test run never submits a real enquiry or trips a live rate limit.
Frequently asked questions
Is sandbox data realistic?
It mirrors the shape and ranges of production while staying fixed, so it is realistic enough to test structure and edge cases without moving underneath you.
Can I run these tests in CI?
Yes — that is the point. Sandbox has looser limits and no side effects, so it is safe to run on every commit.
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: Mock the public API in unit tests
For fast unit tests, mock the API with a recorded fixture instead of a live call — reserve the sandbox for…
Read →
Quickstart: verify connectivity with the healthz endpoint
Before you debug an integration, prove you can reach the API at all with GET /public/v1/healthz. It is a…
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.