Pular para o conteúdo principal

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

NameTypeDescription
Content-TypeStringapplication/json
x-api-tokenStringAuthentication token (required)
x-country-codeStringCountry code (required, e.g. BR)
x-providerStringProvider name (required)
x-provider-idStringProvider identifier assigned by Lulipay

Request Body

NameTypeDescription
transaction_idStringID returned when the QR Code was created
statusStringcompleted
{
"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 paid or waiting. Without calling this test endpoint the charge remains waiting.

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

TypeValueDescription
CPF123.456.789-01Test CPF
CNPJ12.345.678/0001-90Test CNPJ
Emailtest@zenetpay.comTest email
Phone+5511999999999Test phone
Random123e4567-e89b-12d3-a456-426614174000Test random key

Test Scenarios

1. Successful Payment

  1. Generate QR Code
  2. Use test PIX key to pay
  3. Payment should be confirmed instantly

2. Failed Payment

  1. Generate QR Code
  2. Use test PIX key with insufficient funds
  3. Payment should fail with error

3. Expired Payment

  1. Generate QR Code with short expiration
  2. Wait for expiration
  3. Payment should be marked as expired

Configure Webhook

Request

{
"webhook_url": "https://your-domain.com/webhook",
"events": ["payment.received", "payment.failed"]
}

Best Practices

  1. Use test environment for all development
  2. Test all scenarios before going to production
  3. Verify webhooks are working correctly
  4. Test error handling thoroughly
  5. Monitor test transactions

Common Issues

IssueSolution
Invalid test credentialsUse provided test credentials
Webhook not receivedCheck webhook configuration
Payment not confirmedVerify test PIX key
Invalid QR CodeCheck QR Code generation parameters

Support

For testing issues, contact: