pixcli
Guides

Efí Sandbox Guide

Set up and test with the Efí sandbox environment

Creating an Efí Account

  1. Go to dev.efipay.com.br
  2. Click "Criar Conta" (Create Account)
  3. Fill in your details (CPF or CNPJ)
  4. Verify your email
  5. Accept the terms

Creating a Sandbox Application

Once logged in:

  1. Click "Aplicações" (Applications)
  2. Click "Criar nova aplicação" (Create new application)
  3. Choose a name (e.g., "pixcli Test")
  4. Select Sandbox environment
  5. Click "Criar" (Create)

Downloading the Certificate

For sandbox:

  1. Go to your application
  2. Click "Certificados" (Certificates)
  3. Download the sandbox P12 certificate
  4. Save it to ~/.pixcli/certs/sandbox.p12

The sandbox certificate has no password.

Getting OAuth Credentials

From your application dashboard:

  1. Find "Client ID" — copy this value
  2. Find "Client Secret" — copy this value

You'll enter these during pixcli config init.

Configuration

pixcli config init

When prompted:

  • Backend: efi
  • Environment: sandbox
  • Client ID: Paste from dashboard
  • Client Secret: Paste from dashboard
  • Certificate: /home/user/.pixcli/certs/sandbox.p12
  • Password: (leave blank)
  • Pix key: Any value (doesn't need to be real)

Testing Balance

pixcli --sandbox balance

If successful:

💰 Account Balance
   Available: R$0.00

(Sandbox starts with R$0.00.)

Creating Test Charges

pixcli charge create --amount 25.00 --key "email@example.com"

In sandbox, charges under R$10.00 are automatically confirmed without needing to scan the QR code. Perfect for testing.

Simulating Payments

In the Efí sandbox dashboard, you can manually confirm charges:

  1. Go to "Cobranças" (Charges)
  2. Find your test charge
  3. Click "Simular Pagamento" (Simulate Payment)

The payment appears in pixcli pix list immediately.

Webhook Testing

Register a sandbox webhook:

pixcli --sandbox webhook register --key "email@example.com" --url "https://webhook.site"

webhook.site provides free webhook testing URLs that capture and display all requests.

Then create a charge and simulate a payment in the dashboard — you'll see the webhook event appear in webhook.site in real-time.

Sandbox webhooks do NOT require mTLS. This makes testing much simpler than production.

Sandbox Quirks

BehaviorNotes
Auto-confirm < R$10Charges under R$10 settle instantly
No real paymentsCharges never touch actual bank accounts
Instant settlementConfirmed charges settle immediately (no 1-3 day wait)
No mTLS for webhooksAny HTTPS endpoint works
Temporary dataSandbox data may be cleared periodically

Next Steps

On this page