# Bancolombia

> Learn how to use Bancolombia as one of your payment methods in Colombia with EBANX Direct API.

# Botón Bancolombia

This page explains how to add **Botón Bancolombia** to your existing Direct API integration. Direct API integration is basically the same for all payment methods, only varying the `payment_type_code` and some additional required fields.

## Requirements

- **API authentication** - All API requests must be authenticated using [JWS (JSON Web Signature)](/docs/get-started/api-authentication/jws-authentication). The legacy `integration_key` is being deprecated — if you still use it, follow the [Migration Guide](/docs/get-started/api-authentication/jws-migration) to transition to JWS. If you don't have credentials yet, complete the [Merchant Signup Form](https://www.ebanx.com/en/contact/).
- **Familiarity with EBANX Direct** - This setup follows the same general structure as other payment methods, with a few unique parameters.

## How it works

- **Customer checkout** - Customer chooses Bancolombia as the payment option during checkout on the merchant's site.
- **Payment request** - You initiate a payment request through the [EBANX API](/api-reference?api=pay-in), specifying Bancolombia as the payment method "**payment_type_code**": "**bancolombia-button**". EBANX generates the payment details and a link for the customer.
- **Customer redirect** - You redirect your customer to the Bancolombia link, where they can see the payment amount and instructions for completing the transfer.
- **Customer completes the payment** - Customer logs in to Bancolombia and authorizes the transaction (e.g., via bank transfer, debit card, or PSE).
- **EBANX receives payment confirmation** - EBANX receives confirmation from Bancolombia.
- **Merchant notified** - EBANX notifies you of the successful payment, allowing you to fulfill your order.

## Instructions

Follow the steps below.

### 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.

- **Cross-border sandbox:** `https://sandbox.ebanxpay.com/ws/direct`
- **Cross-border production:** `https://api.ebanxpay.com/ws/direct`
- **Local sandbox:** `https://sandbox-local-latam.ebanxpay.com/ws/direct`
- **Local production:** `https://api-local-latam.ebanxpay.com/ws/direct`

Check the method's availability for your country and tenant in [Payment Methods by Country](/docs/pay-in/processing/payment-methods/payment-methods-overview#payment-methods-by-country). Questions about tenant and environment? Check our [API Operability](/docs/get-started/api-operability) and [API Endpoints](/docs/get-started/api-endpoints).

### Define your parameters

With **Botón Bancolombia**, customers are redirected to a secure third-party website to complete the payment quickly and safely. To obtain this redirection link, call the **/ws/direct** endpoint with the required parameters.

  At the API Reference Guide, select Colombia and{" "}
  Botón Bancolombia from the dropdown menus.

### Sample request

Use the following example to initiate a request.

```bash
curl -X POST \
  --location 'https://sandbox.ebanxpay.com/ws/direct' \
  --header 'Content-Type: application/json' \
  --data '{
    "integration_key": "{{integration_key}}",
    "payment": {
        "name": "John Doe",
        "email": "john.doe@example.com",
        "document": "{{tax_id}}",
        "phone_number": "5555555555",
        "country": "co",
        "payment_type_code": "bancolombia-button",
        "merchant_payment_code": "{{unique_merchant_code}}",
        "currency_code": "COP",
        "amount_total": 99.85
    }
}'
```

> **Local processing in Colombia requires IVA data**
> If your Colombian payments are processed by EBANX as a local entity (`LOCAL_LATAM`) and your merchant account is enabled for single transaction and parameter taxes, the request body must also split the charged amount between the local and cross-border portions and declare the Colombian IVA (value-added tax). Add `single_transaction.amount_local`, `single_transaction.amount_crossborder`, and `taxes.iva_co` to the `payment` object. When `amount_local` is positive, omitting the `taxes` object is rejected with `BP-TX-01` and omitting `taxes.iva_co` with `BP-TX-02`. Sending `single_transaction` without the capability enabled is rejected with `BP-ST-00`.

The example below repeats the request above with the fields required for local processing highlighted:

```bash
curl -X POST \
  --location 'https://sandbox.ebanxpay.com/ws/direct' \
  --header 'Content-Type: application/json' \
  --data '{
    "integration_key": "{{integration_key}}",
    "payment": {
        "name": "John Doe",
        "email": "john.doe@example.com",
        "currency_code": "COP",
        "amount_total": 99.85,
        "single_transaction": {
            "amount_local": 99.85,
            "amount_crossborder": 0
        },
        "taxes": {
            "iva_co": 0
        },
        "merchant_payment_code": "{{unique_merchant_code}}",
        "payment_type_code": "bancolombia-button",
        "country": "co"
    }
}'
```

### Sample response

A successful request returns a response like the example below, with the third-party website link provided in the **payment.redirect_url** parameter.

```json
{
  "redirect_url": "{{redirect_url}}",
  "payment": {
    "hash": "59acc5f00945fa382ab051651440826da7701533249b3a475",
    "country": "co",
    "merchant_payment_code": "{{unique_merchant_code}}",
    "status": "PE",
    "status_date": "{{YYYY-MM-DD HH:mm:ss}}",
    "open_date": "{{YYYY-MM-DD HH:mm:ss}}",
    "confirm_date": null,
    "transfer_date": null,
    "amount_br": "99.85",
    "amount_ext": "99.85",
    "amount_iof": "1",
    "currency_rate": "1",
    "currency_ext": "COP",
    "due_date": "{{YYYY-MM-DD}}",
    "instalments": "1",
    "payment_type_code": "bancolombia-button",
    "pre_approved": false,
    "redirect_url": "{{redirect_url}}"
  },
  "status": "SUCCESS"
}
```

[Merchant Area](https://dashboard.ebanx.com)

### Redirect customer to the returned URL

Redirect your customer to the URL returned in the parameter `redirect_url`. After the redirection, your customer will be at a third-party website with all the necessary purchase details to finalize their payment securely.

#### **Testing Bancolombia in a sandbox environment**

In our Sandbox environment, we provide a Bancolombia simulation interface to test bank transfer payments. This mock interface allows you to simulate different payment outcomes:

- Simulate Authorized = YES: Confirms the payment as successful.
- Simulate Authorized = NO: Denies the payment.
- Leave Pending: Leaves the payment in a pending state.

This simulation mimics the real production flow, where users are redirected to their Internet Banking to complete transactions, enabling you to thoroughly test authorized and unauthorized payments.

![Bancolombia sandbox authorization interface with payment simulation options](/img/docs/pay-in/processing/payment-methods/country-specific/colombia/bancolombia-authorization-sandbox.png)

### Monitor payment for status changes

**Notifications**

- EBANX will send a notification whenever a payment status changes.

- Make sure your system is set up to receive notifications from EBANX for any changes in payment status.

- [Learn more about Payment Notifications](/docs/pay-in/management/status-and-retrieval/payment-notifications)

**Status**

- After receiving a notification that status has changed, retrieve the payment status.

- When a payment is confirmed, the status will change from **pending** (**PE**) to **confirmed** (**CO**).
  If the customer does not complete the payment, the status will eventually change to **canceled (CA)**.

- [Learn more about Retrieving Payment Status](/docs/pay-in/management/status-and-retrieval/retrieve-payment)

### Congratulations!

You have successfully integrated **Bancolombia**.

For more information, refer to the [Direct API reference guide](/api-reference?api=pay-in&page=direct)

## Resources

Use the following resources when testing in your sandbox environment.
- [Sample Cards](/docs/pay-in/dev-tools/sandbox-simulation/test-credit-cards)
- [API Reference](/api-reference)
- [Mock Customer Data](/docs/pay-in/dev-tools/sandbox-simulation/test-customer-data)
- [Error Codes](/docs/pay-in/dev-tools/response-codes/api-error-codes)
## Still need help?

If you still have questions, you can explore the following options:

- **Merchant support:** Contact our support team at [sales.engineering@ebanx.com](mailto:sales.engineering@ebanx.com) for assistance.
- **Not a partner yet?** Complete the [Merchant Signup Form](https://business.ebanx.com/en/request-contact), and our commercial team will reach out to you.
