Sandbox
Test your integration without spending credits and without depending on real data.
A collection with every request in this guide. In Insomnia, import the file and fill in api_key in the environment.
- The address is
https://api-sandbox.brazid.com. Paths, parameters and responses are the same as in production. - Use a sandbox key: in the dashboard, under API keys, pick the Sandbox environment when you create the key. It starts with brz_test_. A sandbox key does not work in production, and a production key does not work in the sandbox (401 with the code
WRONG_ENVIRONMENT). - No lookup uses a credit.
credits_remainingshows your account’s real balance, which does not change. - Only the test CPFs in the table below have data. Any other valid CPF answers 404, and the date of birth must be the one in the table.
- Each lookup takes about 400 ms, so you can see how your code behaves with a real API. One of the CPFs takes 3 seconds, to test timeouts.
- The same requests-per-second limits of your plan apply. Batches and the
batch.completedwebhook also work. - Every response carries the x-brazid-env: sandbox header.
cURL
200 OK
Test CPFs
| CPF | Date of birth | What happens |
|---|---|---|
| Successful lookups | ||
| 529.982.247-25 | 1982-11-26 | Regular holder, fast response. |
| 111.444.777-35 | 1990-05-02 | Regular holder, fast response. |
| 300.000.001-16 | 1993-09-17 | Regular holder. |
| 300.000.003-88 | 1958-07-08 | Long name with accents and an apostrophe (D'ÁVILA). |
| 300.000.004-69 | 2012-10-03 | Holder under 18. |
| Registration status | ||
| 100.000.001-08 | 1988-01-15 | Registration status SUSPENSA. |
| 100.000.002-80 | 1995-12-09 | Registration status PENDENTE DE REGULARIZAÇÃO. |
| 100.000.003-61 | 1969-06-21 | Registration status CANCELADA DE OFÍCIO. |
| 300.000.002-05 | 1984-02-29 | Registration status NULA. |
| Incomplete or unusual data | ||
| 390.533.447-05 | 1976-08-30 | Optional field null: situation comes back null. |
| Slow responses | ||
| 200.000.001-08 | 1991-04-04 | Slow response, 3 seconds. |
| 400.000.001-24 | 1987-12-01 | Very slow response, 9 seconds, to trigger timeouts. |
| Errors | ||
| 000.000.001-91 | 1980-01-01 | Valid CPF with no record: 404. |
| 999.999.990-50 | 1980-01-01 | Simulated provider failure: 503 (in a batch, the item comes back with status error). |
Names and dates are fictional. If the date you send is not the one in the table, the answer is 404, as in production.
Test scenarios
Normal flow
Look up
300.000.001-16with the date from the table and confirm your integration reads name, birthdate and situation.Holder not found (404)
Look up
000.000.001-91, any valid CPF outside the table, or a CPF from the table with a different date of birth. A 404 is a normal result: your system should not treat it as a failure.Provider unavailable (503)
The CPF
999.999.990-50always answers 503. Use it to test retries with growing waits and the message shown to the user. In a batch, the item comes back with status error.Slow response and timeout
The CPF
200.000.001-08takes 3 seconds and400.000.001-24takes 9. With your HTTP client timeout set to 5 seconds, the first should pass and the second should time out.Registration status
The CPFs
100.000.001-08,100.000.002-80,100.000.003-61and300.000.002-05come back with a status other than REGULAR. Test whether your system blocks or flags these holders.Null fields
The CPF
390.533.447-05returns situation as null. Make sure your code does not break on null.Accents and minors
The CPF
300.000.003-88has a long name with accents and an apostrophe, and300.000.004-69belongs to a minor. Check your UTF-8 handling and age rules.Malformed CPF (400 and 422)
No table needed:
1234567890(10 digits) answers 400 and529.982.247-26(wrong check digit) answers 422. The same validations as production apply.Wrong-environment key (401)
Call the sandbox with a production key (or production with a sandbox key) to see the 401 with the code
WRONG_ENVIRONMENT.Rate limit (429)
Your plan’s per-second limit also applies in the sandbox. Send more parallel requests than the limit to see the 429 and the
Retry-Afterheader.
Mixed batch
This batch brings together six situations: three CPFs found, one not found, one with a provider failure and one with an invalid check digit. In the summary, expect found 3, not_found 1, invalid 1 and errors 1.
cURL
summary