Testing the charge
After creating a PIX charge you can simulate the payment in the staging environment so that your implementation receives the same webhook flow used in production.
Required – send the required authentication headers for Lulipay API requests.
Endpoint
POST https://gateway.lulipay.com/v1/payins/simulations
Headers
| Name | Type | Description |
|---|---|---|
| Content-Type | String | application/json |
| x-api-token | String | Authentication token (required) |
| x-country-code | String | Country code (required, e.g. BR) |
| x-provider | String | Provider name (required) |
| x-provider-id | String | Provider identifier assigned by Lulipay |
Request Body
| Name | Type | Description |
|---|---|---|
| transaction_id | String | ID returned when the QR Code was created |
| status | String | completed |
{
"transaction_id": "bac1b8d7-24ce-4b53-b6d9-babd3aa60968",
"status": "completed"
}
cURL example
curl --request POST \
--url https://gateway.lulipay.com/v1/payins/simulations \
--header 'Content-Type: application/json' \
--header 'x-api-token: YOUR_API_TOKEN' \
--header 'x-country-code: BR' \
--header 'x-provider: YOUR_PROVIDER_NAME' \
--header 'x-provider-id: YOUR_PROVIDER_ID' \
--data '{
"transaction_id": "bac1b8d7-24ce-4b53-b6d9-babd3aa60968",
"status": "completed"
}'
Response 200 OK
{
"message": "Charge successfully marked as completed in staging environment"
}
When this endpoint is triggered the charge status is updated to completed and the configured webhook is delivered exactly as it would be in production.
A QR Code status can be
paidorwaiting. Without calling this test endpoint the charge remainswaiting.
Test Environment
Use the following base URL for testing:
https://gateway.lulipay.com/v1
Test Credentials
API Credentials
{
"api_key": "test_api_key",
"api_secret": "test_api_secret",
"merchant_id": "test_merchant_id"
}
Test PIX Keys
| Type | Value | Description |
|---|---|---|
| CPF | 123.456.789-01 | Test CPF |
| CNPJ | 12.345.678/0001-90 | Test CNPJ |
| test@zenetpay.com | Test email | |
| Phone | +5511999999999 | Test phone |
| Random | 123e4567-e89b-12d3-a456-426614174000 | Test random key |
Test Scenarios
1. Successful Payment
- Generate QR Code
- Use test PIX key to pay
- Payment should be confirmed instantly
2. Failed Payment
- Generate QR Code
- Use test PIX key with insufficient funds
- Payment should fail with error
3. Expired Payment
- Generate QR Code with short expiration
- Wait for expiration
- Payment should be marked as expired
Configure Webhook
Request
{
"webhook_url": "https://your-domain.com/webhook",
"events": ["payment.received", "payment.failed"]
}
Best Practices
- Use test environment for all development
- Test all scenarios before going to production
- Verify webhooks are working correctly
- Test error handling thoroughly
- Monitor test transactions
Common Issues
| Issue | Solution |
|---|---|
| Invalid test credentials | Use provided test credentials |
| Webhook not received | Check webhook configuration |
| Payment not confirmed | Verify test PIX key |
| Invalid QR Code | Check QR Code generation parameters |
Support
For testing issues, contact:
- Email: contato@lulipay.com.br
- Support Hours: 24/7