Bank Transfers

To better understand and test the bank transfer system, you can use the following sample data. This allows you to simulate real transactions and ensure that everything works as expected.


❗️

IMPORTANT

Make sure you have the Sandbox Environment enabled to perform the corresponding tests.

Setting up an order for bank transfer payment

  1. Setup: Ensure you have access to the Ecart Pay API environment, use the Sandbox base URL and a valid authorization key.
  2. Create a Test Order: Simulate a test order within your Ecart Pay sandbox environment. Ensure the order ID matches the sample data provided.
Image 1. Payment Methods

Image 1. Payment Methods

  1. Initiate a Bank Transfer Test: Use the sample JSON data to trigger a bank transfer. Make sure to replace any dynamic fields, if required.
  • claveRastreo must always be unique for each transaction.
  • monto must match the amount being tested.
Image 2. Order Generated with the amount (monto).

Image 2. Order Generated with the amount (monto).

  • cuentaBeneficiario must correspond to the beneficiary's account to which the money is being transferred.
Image 3. Beneficiary's Account

Image 3. Beneficiary's Account

  1. Verify Response: After sending the POST request, check the response for confirmation of successful processing.
Image 4. Order Paid.

Image 4. Order Paid.

  1. Error Handling: Test for potential errors, such as invalid CLABE or incorrect amounts. This helps ensure the robustness of the integration.
  2. End-to-End Testing: Complete the testing cycle by verifying that the transferred amount is reflected in the Ecart Pay system and marked as paid for the corresponding order.


Testing webhooks functionality

You can setup a webhook for the transfer.created event to gather more information from the payload. For this test, it is not necesary to create an order.

Endpoint

POST https://sandbox.ecartpay.com/webhooks/stp

Headers

  • Authorization:kGUoIbyplThmrLZblVWXYTfhFCIPYSWmc60xgBY7

Request Body

{
    "clave": "1188439031",
    "fechaOperacion": "20260312",
    "institucionOrdenante": "40012",
    "institucionBeneficiaria": "90646",
    "claveRastreo": "BB2331S2411QF3166QQFW86489E4494RT",	// Must be a unique value, change any digit
    "monto": "400.00",
    "tipoPago": "1",
    "tipoOperacion": "0",
    "nombreBeneficiario": "Hugo Morin",
    "tipoCuentaBeneficiario": "40",
    "cuentaBeneficiario": "646010142603011960",
    "rfcCurpBeneficiario": "MOGH950915DL5",
    "conceptoPago": "Prueba",
    "referenciaNumerica": "2208240",
    "empresa": "ECARTPAY",
    "nombreOrdenante": "Paulina Rivera Gonzalez",
    "tipoCuentaOrdenante": "40",
    "cuentaOrdenante": "012930012422432535",
    "rfcCurpOrdenante": "RIGP990911PL7"
}

Request example

To simulate the bank transfer, you can use the following cURL command:

curl --location 'https://sandbox.ecartpay.com/webhooks/stp' \
--header 'Authorization: kGUoIbyplThmrLZblVWXYTfhFCIPYSWmc60xgBY7' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cf_bm=ugpOCNq3d0tLB8EhuGNcKcAVExZnvIoGgSYrFb_pyus-1773348035.92657-1.0.1.1-fTOTl0kzL9IFaJgNPCbJDRXu7G8fE6ufLLc4SwIYjbqvOIqDBSObw1W9oHI3mvOfU0aE0lNOHqfBbhDw5RXfbR.wJUQloFExnBd2Q_oPVLqlPZ0duxhnHauGrIsgVe8n; lang=en' \
--data '{
    "clave": "1188439031",
    "fechaOperacion": "20260312",
    "institucionOrdenante": "40012",
    "institucionBeneficiaria": "90646",
    "claveRastreo": "BB2331S2411QF3166QQFW86489E4494RT",
    "monto": "400.00",
    "tipoPago": "1",
    "tipoOperacion": "0",
    "nombreBeneficiario": "Hugo Morin",
    "tipoCuentaBeneficiario": "40",
    "cuentaBeneficiario": "646010142603011960",
    "rfcCurpBeneficiario": "MOGH950915DL5",
    "conceptoPago": "Prueba",
    "referenciaNumerica": "2208240",
    "empresa": "ECARTPAY",
    "nombreOrdenante": "Paulina Rivera Gonzalez",
    "tipoCuentaOrdenante": "40",
    "cuentaOrdenante": "012930012422432535",
    "rfcCurpOrdenante": "RIGP990911PL7"
}'

Response example

Exito

Webhook payload

{
  "event": "transfer.created",
  "data": {
    "_id": "69b3251004895e4df9d8dab6",
    "account_id": "68a4c3150b28a9584305a2a6",
    "activity_id": "69b3251004895e4df9d8daae",
    "transaction_id": "69b3251004895e4df9d8daba",
    "status": "paid",
    "amount": 385.5,
    "currency": "MXN",
    "numeric_reference": "2208240",
    "ordering_bank": "BBVA MEXICO",
    "ordering_name": "Paulina Rivera Gonzalez",
    "ordering_account": "012930012422432535",
    "ordering_tax_id": "RIGP990911PL7",
    "beneficiary_account": "646010142603011960",
    "beneficiary_tax_id": "MOGH950915DL5",
    "folio": "BB2331S2411QF3166QQFW86489E4494RT",
    "concept": "Prueba",
    "order": null,
    "charges": [],
    "fee": 14.5,
    "operation_date": "20260312",
    "total": 400,
    "customer_id": "68cdcbfed75e4961c7188672"
  }
}

By leveraging this testing data and endpoint, developers can ensure the smooth integration of bank transfers into their workflows, providing customers with a reliable and efficient payment method.