Skip to main content
The Sandbox environment lets you test the full payment flow without real transactions.

How it works

At Safefy, there is no separate URL for Sandbox and Production. The environment is determined by the API credential type you use.
Credential typeEnvironmentBehavior
SandboxTestingSimulated payments, fictitious balance
ProductionLiveReal PIX transactions
API URL: https://api-payment.safefypay.com.br
The same URL is used for both environments. What changes is the credential used for authentication.

Creating credentials

In the Safefy dashboard, you can create credentials for each environment:
1

Access the dashboard

Go to app.safefypay.com.br and select your organization.
2

Go to Credentials

In the side menu, open the API credentials section.
3

Create the credential

Choose Sandbox for tests or Production for live transactions.
4

Save the Client Secret

The Client Secret is shown only once. Store it safely.

Simulating payments

In Sandbox, you can simulate different transaction statuses using the simulation endpoint:
curl -X POST https://api-payment.safefypay.com.br/v1/transactions/{id}/simulate \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "action": "complete" }'

Available actions

ActionCurrent statusNew statusDescription
completePendingCompletedSimulates a confirmed payment
expirePendingExpiredSimulates expiration
failPendingFailedSimulates failure
refundCompletedRefundedSimulates a refund
The simulation endpoint works only with Sandbox credentials. In Production, payments are processed automatically by the PIX system.

Full test flow

1

Create a transaction

Use Sandbox credentials to create a PIX transaction.
2

Show the QR Code

Display the qrCode or copyAndPaste in your interface.
3

Simulate the payment

Use the /simulate endpoint with action: complete.
4

Receive the webhook

Your callbackUrl will receive the transaction.completed event.
5

Validate the flow

Check that your application released the product/service correctly.

Simulating cashouts

You can also simulate cashout processing:
curl -X POST https://api-payment.safefypay.com.br/v1/cashouts/{id}/simulate \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "action": "Complete" }'
ActionDescription
CompleteSimulates a completed cashout
FailSimulates a cashout failure
RejectSimulates a rejected cashout

Test data

In Sandbox, you can use any valid data to create transactions and customers:
{
  "name": "Joao da Silva Test",
  "email": "[email protected]",
  "document": "12345678901",
  "documentType": "CPF"
}

Going to Production

When your integration is ready:
  1. Create a Production credential in the dashboard
  2. Replace the Client ID and Client Secret in your system
  3. Remove calls to the /simulate endpoint
  4. Test with low-value transactions first

Create a test transaction

Try creating a transaction in the playground.