Testing
Test mode behaves exactly like live: the same validation, retries and error shapes. The data is fake but deterministic, every response carries "mode": "test", and nothing is charged.
Two kinds of test credential
| What | Sandbox credential | Your own test credentials |
|---|---|---|
| How to get it | Printed in the Quickstart | Sign in and request them |
| Who uses it | Everyone | Only your team |
| Can change | Yes, we may rotate it | Only when you rotate your secret |
| Data | Fake, deterministic | Fake, deterministic |
| Charged | Never | Never |
Magic postcodes
In test mode, these postcodes trigger each outcome. Other valid postcodes in England and Wales return fake, deterministic answers.
| Postcode | Status | Result |
|---|---|---|
ZZ1 1AA | 201 or 200 | A valuation (201) or a street analysis (200) |
ZZ1 2AA | 403 | insufficient-credits |
ZZ1 3AA | 403 | account-blocked |
ZZ1 4AA | 422 | outside-coverage |
ZZ1 5AA | 422 | floor-area-required |
ZZ1 6AA | 503 | data-unavailable |
ZZ1 7AA | 504 | timeout |
For example, to check how your code handles a property outside coverage:
curl -X POST https://api.checkmystreet.co.uk/partners/v1/valuations \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: 9d41e7a2-6c3b-4f18-8e5a-0b7c2d9f4a61" \
-H "Content-Type: application/json" \
-d '{ "postcode": "ZZ1 4AA", "propertyType": "flat", "bedrooms": 2 }'
The response is a 422 problem document with the type outside-coverage.
Keep test figures away from customers
Test figures are fake. Check mode before you show or store a result:
if (valuation.mode === "test") {
// Fake, deterministic figures: never show these to a customer
}
Before you go live
- Handle every outcome in the magic postcode table.
- Send an
Idempotency-Keywith everyPOST. - Retry
503and504with the same key, and honourRetry-Afteron429, but stop on adaily_limit. - Cache tokens for their 30 minute lifetime.
- Never show a result carrying
"mode": "test"to a customer.
Live credentials follow approval and a first top-up by card. Get access explains the steps.