Skip to main content
Debit Cards

This guide will walk you through the process of integrating debit card payments using EBANX Direct. Youโ€™ll learn how to securely process transactions, handle authorizations, and manage payment captures, ensuring a smooth and efficient payment experience for your customers. Follow the steps below to start accepting debit card payments with EBANX.

Requirementsโ€‹

  • API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.

Instructionsโ€‹

Follow the steps below.

  1. Select your environment

    Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.

    https://sandbox.ebanx.com/ws/direct
  2. Choose your features

    Select a country to explore available features.

  3. Define your parameters

    You must provide required parameters for payment requests. These parameters ensure successful completion of transactions.

    Essential parameters

    • payment.payment_type_code - Specifies the payment method to be used for the transaction.
    • payment.currency_code - Three-letter code of the payment currency.
    • payment.amount_total - Total amount to be charged.
    • payment.card - Card details such as card number, expiration date, CVV, and cardholder name.

    Additional parameters

    • EBANX Integration Key - Used to authenticate and authorize API requests.
    • Customer Information
      • Includes details such as the customer name, email, address and document number (Depends on the requirements of the payment method or local regulations).
      • While not mandatory for all countries or payment methods, providing this information can enhance security and increase the likelihood of successful processing.
    • Additional Context - Extra data for specific methods or countries.

    To learn more about API parameters, please refer to the
    API Reference Guide chevron_right
  4. Sample request

    Use the following example to initiate a payment request. Select another country from the dropdown if needed.

    Brazil | Using Sandbox URL
    curl -X POST \
    --location 'https://sandbox.ebanx.com/ws/direct' \
    --header 'Content-Type: application/json' \
    --data '{
    "integration_key": "your_ebanx_integration_key",
    "operation": "request",
    "payment": {
    "name": "Josรฉ Silva",
    "email": "jose@example.com",
    "document": "853.513.468-93",
    "address": "Rua E",
    "street_number": "1040",
    "city": "Maracanaรบ",
    "state": "CE",
    "zipcode": "61919-230",
    "country": "br",
    "phone_number": "8522847035",
    "payment_type_code": "debitcard",
    "merchant_payment_code": "ecc9be4512a",
    "currency_code": "BRL",
    "installments": 1,
    "amount_total": 100,
    "card": {
    "card_number": "4111111111111111",
    "card_name": "Josรฉ Silva",
    "card_due_date": "12/2019",
    "card_cvv": "123",
    "threeds_eci": "05",
    "threeds_cryptogram": "AAIBAkl0NwmHglFBAXQ3AAAAAAA",
    "threeds_xid": "AAIBAkl0NwmHglFBAXQ3AAAAAAA",
    "threeds_version": "2",
    "threeds_trxid": "AAIBAkl0NwmHglFBAXQ3AAAAAAA"
    }
    }
    }'

    When using tokenized card information, the card object should be as follows:

    card: {
    token: "card_token_here"
    }

    Or for recurrent transactions:

    "card": {
    "token": "card_token_here",
    "network_token_mode": "recurrent"
    }
    For more information about card tokenization, please refer to the
    Card Tokenization Guidechevron_right


  5. Sample response

    Each request returns a response similar to the example below.

    Brazil | Using Sandbox URL
    {
    "payment": {
    "hash": "59ad5f00945fa382ab051651440826da7701533249b3a475",
    "merchant_payment_code": "ecc9be4512a",
    "order_number": null,
    "status": "CO",
    "status_date": "2017-09-04 14:11:12",
    "open_date": "2017-09-04 14:11:11",
    "confirm_date": "2017-09-04 14:11:12",
    "transfer_date": null,
    "amount_br": "100.38",
    "amount_ext": "100.00",
    "amount_iof": "0.38",
    "currency_rate": "1.0000",
    "currency_ext": "BRL",
    "due_date": "2017-09-07",
    "installments": "1",
    "payment_type_code": "debitcard",
    "details": {
    "billing_descriptor": ""
    },
    "transaction_status": {
    "acquirer": "EBANX",
    "code": "OK",
    "description": "Sandbox - Test debit card, transaction captured"
    },
    "pre_approved": true,
    "capture_available": false
    },
    "status": "SUCCESS"
    }


  6. Capture a pending payment

    Two-Step Payments Only

    This step applies when auto_capture is set to false, changing the payment status from pending (PE) to confirmed (CO).

    1. Overviewโ€‹

    • In the first step, the payment was authorized and is pending (PE).
    • The payment needs to be captured to change its status to confirmed (CO).
    • Uncaptured payments will automatically expire.


    2. Get Hash, or Merchant Payment Codeโ€‹

    Get the hash or merchant_payment_code from the authorized pending (PE) transaction.

    {
    "payment": {
    "hash": "59ad5f00945fa382ab051651440826da7701533249b3a475", // example hash
    "country": "br",
    "merchant_payment_code": "ecc9be4512a", // example merchant payment code
    "order_number": null,
    "status": "PE", // Pending
    ...
    ...
    ... // remainder of the response
    },
    }

    3. Send a request to capture the paymentโ€‹

    To capture the payment, send a request to ws/capture using the Hash or Merchant Payment Code.

    Examples:

    -using Hash

    curl -X POST \
    --location 'https://sandbox.ebanx.com/ws/capture' \
    --header 'Content-Type: application/json' \
    --data
    {
    integration_key: "your_ebanx_integration_key",
    hash: "59ad5f00945fa382ab051651440826da7701533249b3a475",
    }

    -using Merchant Payment Code

    curl -X POST \
    --location 'https://sandbox.ebanx.com/ws/capture' \
    --header 'Content-Type: application/json' \
    --data
    {
    integration_key: "your_ebanx_integration_key",
    merchant_payment_code: "ecc9be4512a"
    }

    4. Successful captureโ€‹

    A successful capture will return a response similar to the one below.

    {
    "payment": {
    "hash": "59ad5f00945fa382ab051651440826da7701533249b3a475",
    "country": "br",
    "merchant_payment_code": "ecc9be4512a",
    "order_number": null,
    "status": "CO", // Confirmed
    ...
    ...
    ... // remainder of the response
    },
    "status": "SUCCESS"
    }
    API Reference

    The API reference for ws/capture can be found here. We recommend reviewing all available options.

  7. Congratulations!

    You have completed the necessary steps to create a debit card payment.


Resourcesโ€‹

Use the following resources when testing in your sandbox environment.

Still need help?

Help Image

We hope this article was helpful. If you still have questions, you can explore the following options: