CARNAÚ.
Test environment · Free

Sandbox

You can start using our Sandbox environment right now, no need to contact us. Feel free to test our service and integrate with our API. If you have any questions, just send them to help@carnau.com, we will answer you quickly, pinky promise. We are here to help you integrate with us ASAP.


About our Sandbox environment

Emulates production exactly

Same endpoints, same schemas, same error codes — only the credentials and base URL change.

Isolated server and database

Everything you create in Sandbox only exists in Sandbox. No production data ever touches the test environment.

70% of charges auto-pay

Boletos and Invoices issued in Sandbox are paid automatically within an hour. Use them to seed your test account.

Response times may differ

Sandbox emulates the underlying operations, so response latency may not match production.

What Sandbox doesn't do

Same code in both environments

Production and Sandbox use separate credentials — each environment has its own API ID and private key. To switch, change the "environment" parameter (or the base URL, if you call the REST API directly) and load the credentials for that environment. The resources, schemas, and error codes are identical between environments.

BASE URL - Production

https://api.carnau.com

BASE URL - Sandbox

https://sandbox.api.carnau.com
Python Node PHP Java Go
import carnau

# Example key only — replace with your own.
# Never hardcode private keys in source. Store them in an HSM,
# or at minimum in an encrypted KMS.
private_key_content = """
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
"""

# To go live: change environment to "production" and use your production project id + private key.
# The project id is best loaded from an environment variable, not hardcoded in source.
user = carnau.Project(
    environment="sandbox",
    id="5656565656565656",
    private_key=private_key_content
)

carnau.user = user

Going to production

When you're ready, the switch from Sandbox to live takes a handful of steps.

  1. Open a production account in Web Banking (production also requires CNPJ verification).
  2. Generate a fresh ECDSA key pair for production — never reuse Sandbox keys.
  3. Register the production public key in the production Web Banking.
  4. Switch your code to production. In the SDK: change the environment from "sandbox" to "production" and load the production Project's id and private key. If you call the REST API directly: swap the base URL from sandbox.api.carnau.com to api.carnau.com and use the production signing key.
  5. Update webhook target URLs to production-reachable HTTPS endpoints and re-create the subscriptions in production.
  6. Smoke-test with a small Pix amount before scaling traffic.

What's next

Now that your Sandbox account is open, the integration takes about 2 days end-to-end.

Have a question? Ask Arc.

Arc is our AI assistant trained on the entire Carnaú API. Get an answer in seconds — or talk to a human engineer.