Skip to main content

Successful Charges

For charges that should be approved and credited, use one of the following CPF documents:
Document (CPF)Final StatusFlowDescription
00741212439CreditedCreated → Paid → CreditedCharge approved and credited successfully
59730932395CreditedCreated → Paid → CreditedCharge approved and credited successfully

Example - Successful Charge

{
  "pix": {
    "expire_date": "2025-12-31T23:59:59"
  },
  "buyer": {
    "name": "João Silva",
    "document": {
      "type": "CPF",
      "number": "00741212439"
    },
    "email": "[email protected]"
  },
  "amount": 10000,
  "invoice": "unique-invoice-id",
  "country": "BR",
  "currency": "BRL",
  "payment_method": "pix"
}

Rejected Charges

To test a rejected charge, use the following CPF document:
Document (CPF)Final StatusFlowRejection Reason
90836247060RejectedCreated → RejectedThe payment was made from an unauthorized institution.

Example - Rejected Charge

{
  "pix": {
    "expire_date": "2025-12-31T23:59:59"
  },
  "buyer": {
    "name": "Maria Santos",
    "document": {
      "type": "CPF",
      "number": "90836247060"
    },
    "email": "[email protected]"
  },
  "amount": 5000,
  "invoice": "unique-invoice-id",
  "country": "BR",
  "currency": "BRL",
  "payment_method": "pix"
}

Error Simulation

To simulate a 400 error response, use the following CPF document:
Document (CPF)ResponseError Message
76145193026400 Bad RequestFailed to send payin to processor

Example - Error Response

Request
{
  "pix": {
    "expire_date": "2025-12-31T23:59:59"
  },
  "buyer": {
    "name": "Carlos Oliveira",
    "document": {
      "type": "CPF",
      "number": "76145193026"
    },
    "email": "[email protected]"
  },
  "amount": 7500,
  "invoice": "unique-invoice-id",
  "country": "BR",
  "currency": "BRL",
  "payment_method": "pix"
}
Response (400)
{
  "message": "Failed to send payin to processor"
}

Testing Flow

1

Choose test scenario

Decide whether to test a successful charge, rejection, or error response
2

Select test document

Choose the appropriate CPF document from the tables above
3

Create charge

Use the Create Charge endpoint with the test document
4

Monitor status

Check the charge status using webhooks or the Get Unique Charge endpoint
5

Verify completion

Confirm the charge reaches the expected final status

Best Practices

Sandbox Environment: Always use test documents in the sandbox environment. These documents are specifically configured for testing purposes.
Unique Invoice: Always use a unique invoice ID for each charge to avoid duplicates and ensure proper tracking.

Common Test Scenarios

Document: 00741212439Expected Flow: Created → Paid → CreditedExpected Result: Charge approved and credited successfully
{
  "pix": {
    "expire_date": "2025-12-31T23:59:59"
  },
  "buyer": {
    "name": "João Silva",
    "document": {
      "type": "CPF",
      "number": "00741212439"
    },
    "email": "[email protected]"
  },
  "amount": 15000,
  "invoice": "test-charge-success-001",
  "country": "BR",
  "currency": "BRL",
  "payment_method": "pix"
}
Document: 90836247060Expected Flow: Created → RejectedExpected Result: Charge rejected with reason “The payment was made from an unauthorized institution.”
{
  "pix": {
    "expire_date": "2025-12-31T23:59:59"
  },
  "buyer": {
    "name": "Maria Santos",
    "document": {
      "type": "CPF",
      "number": "90836247060"
    },
    "email": "[email protected]"
  },
  "amount": 5000,
  "invoice": "test-charge-rejected-001",
  "country": "BR",
  "currency": "BRL",
  "payment_method": "pix"
}
Document: 76145193026Expected Response: 400 Bad RequestExpected Result: Error message “Failed to send payin to processor”
{
  "pix": {
    "expire_date": "2025-12-31T23:59:59"
  },
  "buyer": {
    "name": "Carlos Oliveira",
    "document": {
      "type": "CPF",
      "number": "76145193026"
    },
    "email": "[email protected]"
  },
  "amount": 7500,
  "invoice": "test-charge-error-001",
  "country": "BR",
  "currency": "BRL",
  "payment_method": "pix"
}

Charge Status Flow

Successful Flow

After creating a charge with a successful test document, the charge will go through:
1

Created

Initial status - Charge created and awaiting payment
2

Paid

Payment received from payer
3

Credited

Amount credited to your account ✓

Rejection Flow

After creating a charge with the rejection test document, the charge will go through:
1

Created

Initial status - Charge created and awaiting payment
2

Rejected

Charge rejected with specific reason ✗

Testing Boleto Payments

For boleto payments, the testing flow is different. After creating a boleto charge, you need to make an additional request to simulate the payment.

Boleto Testing Process

1

Create boleto charge

Use the Create Charge endpoint with payment_method: "boleto"
2

Get our_number

Extract the our_number from the boleto creation response
3

Simulate payment

Make a POST request to v1/payin/payments/pay/{our_number} to simulate the boleto payment
4

Monitor status

The charge will follow: Created → Paid → Credited

Boleto Payment Simulation

To simulate a boleto payment and achieve the “Credited” status:
curl --location 'https://api.sandbox.wepayout.co/v1/payin/payments/pay/{our_number}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE' \
--data-raw '{}'
Replace {our_number} with the actual our_number value from your boleto creation response.
Important: This endpoint only simulates the status change (Created → Paid → Credited). It does not calculate interest, fines, or discounts configured in the boleto.

Example - Complete Boleto Flow

  1. Create Boleto Charge:
{
  "payment_method": "boleto",
  "invoice": "YOUR-INVOICE-CODE",
  "currency": "BRL",
  "amount": 500,
  "country": "BR",
  "buyer": {
    "name": "Buyer Name",
    "email": "[email protected]",
    "document": {
      "type": "CPF",
      "number": "12345678901"
    },
    "address": {
      "street": "Street Name",
      "number": "123",
      "complement": "Apt 456",
      "zipcode": "12345000",
      "city": "City Name",
      "district": "District Name",
      "state_code": "SP"
    }
  },
  "originator_legal_entity": {
    "name": "Company Name",
    "document": "12345678901",
    "helpdesk": "company.com"
  },
  "boleto": {
    "expire_date": "2025-12-31"
  }
}
  1. Extract our_number from response (example: "our_number": "991763554947")
  2. Simulate Payment:
curl --location 'https://api.sandbox.wepayout.co/v1/payin/payments/pay/991763554947' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE' \
--data-raw '{}'
  1. Expected Status Flow: Created → Paid → Credited

Important Notes

Successful Documents

2 approved documentsUse these CPF numbers for charges that complete successfully

Rejection Document

1 rejection documentUse this CPF to test rejection handling

Error Document

1 error documentUse this CPF to test error responses
Production Environment: Never use these test documents in production. They are only valid in the sandbox environment.