Guía de activación: Pago Directo

Esta guía te muestra cómo activar el nuevo método de pago "Pago Directo" en cada una de nuestras integraciones disponibles.


🔗 Link de pago

  1. Ingresa a tu panel de administración. https://panel.conekta.com/

  2. Haz click en la opción "Link de pago" del menú lateral y luego haz click en el botón "Crear Link".

  3. Completa los datos del link de pago a crear. Por defecto todos nuestros métodos de pago se encuentran habilitados al crear un link de pago desde esta sección, puedes verlo haciendo click en el botón "Configuración avanzada".

  4. Verás las opciones de pago, entre ellas "Pago Directo".


Si estás creando link de pago por API, el método de pago pay_by_bank (Pago Directo) se habilitará automáticamente si tu cuenta lo tiene configurado. Puedes contactar a soporte para activarlo.

curl --request POST \
  --url https://api.conekta.io/checkouts \
  --header 'accept: application/vnd.conekta-v2.3.0+json' \
  -u key_eYvWV7gSDkNYXsmr: \
  --header 'content-type: application/json' \
  --data '{
    "name": "Payment Link Name",
    "type": "PaymentLink",
    "recurrent": false,
    "expires_at": 1590882634,
    "needs_shipping_contact": true,
    "order_template": {
        "line_items": [{
            "name": "Red Wine",
            "unit_price": 1000,
            "quantity": 10
        }],
        "currency": "MXN",
        "customer_info": {
            "name": "Juan Perez",
            "email": "[email protected]",
            "phone": "5566982090"
        }
    }
 }'

Notas de los campos:

  • unit_price: con este valor y quantity se calculará el parámetro amount de la petición.

📘 Ver documentación detallada →


💻 Componente de pago

Para el componente de pago, el método de pago pay_by_bank (Pago Directo) se habilitará automáticamente si tu cuenta lo tiene configurado. Puedes contactar a soporte para activarlo.

curl --request POST \
     --url https://api.conekta.io/orders \
     --header 'Accept-Language: es' \
     --header 'accept: application/vnd.conekta-v2.3.0+json' \
     --header 'authorization: Bearer {PRIVATE KEY}' \
     --header 'content-type: application/json' \
     --data '
{
  "checkout": {
    "type": "Integration",
    "name": "Example"
  },
  "customer_info": {
    "name": "DevTest",
    "email": "[email protected]",
    "phone": "5522997233"
  },
  "pre_authorize": false,
  "currency": "MXN",
  "line_items": [
    {
      "brand": "Cohiba",
      "description": "Imported From Mex.",
      "name": "Box of Cohiba S1s",
      "quantity": 1,
      "unit_price": 500000
    }
  ]
}
'
{
  "livemode": false,
  "amount": 500000,
  "currency": "MXN",
  "payment_status": null,
  "amount_refunded": 0,
  "split_payment": null,
  "customer_info": {
    "email": "[email protected]",
    "phone": "5522997233",
    "name": "DevTest",
    "corporate": null,
    "customer_id": null,
    "date_of_birth": null,
    "national_id": null,
    "object": "customer_info"
  },
  "shipping_contact": null,
  "channel": {
    "segment": "Checkout",
    "checkout_request_id": "asdf1234-as12-as12-as12-asdf1234",
    "checkout_request_type": "Integration",
    "id": "channel_1234tZPskykbcNoM"
  },
  "fiscal_entity": null,
  "checkout": {
    "id": "asdf1234-as12-as12-as12-asdf1234",
    "name": "PRUEBA CHECKOUT SCOUT_MEXICO",
    "livemode": false,
    "emails_sent": 0,
    "success_url": "",
    "failure_url": "",
    "payments_limit_count": null,
    "paid_payments_count": 0,
    "sms_sent": 0,
    "status": "Issued",
    "type": "Integration",
    "recurrent": false,
    "starts_at": 1752559200,
    "expires_at": 1752818399,
    "allowed_payment_methods": ["card", "cash", "bank_transfer", "bnpl"],
    "exclude_card_networks": [],
    "needs_shipping_contact": false,
    "monthly_installments_options": [],
    "monthly_installments_enabled": false,
    "redirection_time": null,
    "force_3ds_flow": false,
    "plan_id": null,
    "metadata": {},
    "can_not_expire": false,
    "three_ds_mode": null,
    "max_failed_retries": null,
    "object": "checkout",
    "is_redirect_on_failure": false,
    "on_demand_enabled": false
  },
  "object": "order",
  "id": "ord_1234tZPskykbcNoL",
  "metadata": {},
  "is_refundable": false,
  "processing_mode": null,
  "created_at": 1752604883,
  "updated_at": 1752604883,
  "line_items": {
    "object": "list",
    "has_more": false,
    "total": 1,
    "data": [
      {
        "name": "Box of Cohiba S1s",
        "description": "Imported From Mex.",
        "unit_price": 500000,
        "quantity": 1,
        "sku": null,
        "tags": null,
        "brand": "Cohiba",
        "type": null,
        "object": "line_item",
        "id": "line_item_1234tZPskykbcNoL",
        "parent_id": "ord_1234tZPskykbcNoL",
        "metadata": {},
        "antifraud_info": {}
      }
    ]
  },
  "shipping_lines": null,
  "tax_lines": null,
  "discount_lines": null,
  "charges": null
}

📘 Ver documentación detallada →


🌐 Checkout redireccionado

Similar a la creación de Link de pago por API y a la configuración del Componente de pago, el método de pago pay_by_bank (Pago Directo) se habilitará automáticamente si tu cuenta lo tiene configurado. Puedes contactar a soporte para activarlo.

curl -H "Accept: application/vnd.conekta-v2.3.0+json" \
     -H "Content-type: application/json" \
     -H 'Authorization: Bearer key_XXXXXXX' \
     -X POST -d '{
        "currency": "MXN",
        "customer_info": {
           "customer_id": "cus_2nHprwaWFn7QJ21Lj"
        },
       "line_items": [{
           "name": "Box of Cohiba S1s",
           "unit_price": 35000,
           "quantity": 1
       }],
       "shipping_lines": [{
           "amount": 0
       }],
       "checkout": {
           "type": "HostedPayment",
           "success_url": "https://www.mysite.com/payment/confirmation",
           "failure_url": "https://www.mysite.com/payment/failure",
           "monthly_installments_enabled": true,
           "monthly_installments_options": [3, 6, 9, 12],
           "redirection_time": 4
        },
       "shipping_contact": {
          "phone": "+5215555555555",
          "receiver": "Marvin Fuller",
          "address": {
            "street1": "Nuevo Leon 4",
            "country": "MX",
            "postal_code": "06100"
          }
       }
}' https://api.conekta.io/orders

Notas de los campos:

  • redirection_time: tiempo de redirección al Success-Failure URL, umbrales de 4 a 120 seg.
<?php
require __DIR__ . '/../../vendor/autoload.php';

use Conekta\Api\OrdersApi;
use Conekta\ApiException;
use Conekta\Configuration;
use Conekta\Model\OrderRequest;

$apiKey = getenv("CONEKTA_API_KEY");
$config = Configuration::getDefaultConfiguration()->setAccessToken($apiKey);


$apiInstance = new OrdersApi(null, $config);
$accept_language = 'es';
$rq = new OrderRequest([
    'currency' => 'MXN',
    'customer_info' => [
        'name' => 'fran carrero',
        'email'=> '[email protected]',
        'phone' => '+5218181818181'
    ],
    'line_items' => [
        [
            'name' => 'Box of Cohiba S1s',
            'unit_price' => 35000,
            'quantity' => 1
        ]
    ],
    'shipping_lines' => [
        [
            'amount' => 1500,
            'carrier' => 'FEDEX'
        ]
    ],
    'checkout' => [
        'monthly_installments_enabled' => true,
        'type' => 'HostedPayment',
        'success_url' => 'https://www.example.com/success',
        'failure_url' => 'https://www.example.com/failure',
        'monthly_installments_options' => [3, 6, 12],
        'redirection_time' => 4 //Redirect time to Success-Failure URL, thresholds 4 to 120 sec.
    ],
    'shipping_contact' =>[
        'phone' => '+5218181818181',
        'receiver' => 'Marvin Fuller',
        'address' => [
            'street1' => '250 Alexis St',
            'city' => 'Red Deer',
            'state' => 'Alberta',
            'country' => 'CA',
            'postal_code' => '01000'
        ]
    ]
]);
try {
    $result = $apiInstance->createOrder($rq, $accept_language);
    $json_string = json_encode($result, JSON_PRETTY_PRINT);
    print_r($json_string);

    echo $result ->getCheckout()->getUrl();

} catch (ApiException $e) {
    echo 'Exception when calling OrdersApi->createOrder: ', $e->getMessage(), PHP_EOL;

}
valid_order_with_checkout = {
   line_items: [
       {
           name: 'Box of Cohiba S1s',
           description: 'Imported From Mex.',
           unit_price: 120000,
           quantity: 1,
           sku: 'cohbs1',
           category: 'food',
           tags: ['food', 'mexican food']
       }
   ],
   checkout: {
       expires_at: Time.now.to_i + 259200,
       failure_url: "testredirect.com",
       force_2fa_flow: true,
       success_url: "testredirect.com",
       monthly_installments_enabled: true,
       monthly_installments_options: [3, 6, 9, 12],
       type: "HostedPayment",
       redirection_time: 4 # Tiempo de Redirección al Success/Failure URL, umbrales de 4 a 120 seg.
   },
   customer_info: {
       customer_id: customer.id
   },
   currency: 'mxn',
   metadata: {test: 'extra info'}
}
order = Conekta::Order.create(valid_order_with_checkout)
puts order.inspect
order = self.client.Order.create(order)
checkout = order.createCheckout({
       "currency": "MXN",
       "customer_info": {
          "customer_id": "cus_2o3FvMEBiKitVK1vQ"
       },
      "line_items": [{
          "name": "Box of Cohiba S1s",
          "unit_price": 300000,
          "quantity": 1
      }],
      "shipping_lines": [{
          "amount": 0
      }],
      "checkout": {
          "type":"HostedPayment",
          "success_url": "testredirect.com",
          "failure_url": "testredirect.com",
          "multifactor_authentication": False,
          "monthly_installments_enabled": True,
          "monthly_installments_options": [3,6,9,12,18],
          "expires_at": 1609891200,
          "redirection_time": 4 //Tiempo de Redirección al Success/Failure URL, umbrales de 4 a 120 seg.
      
       },
      "shipping_contact": {
         "phone": "+5215555555555",
         "receiver": "Marvin Fuller",
         "address": {
           "street1": "Nuevo Leon 4",
           "country": "MX",
           "postal_code": "06100"
         }
      }
   })
conekta.Order.create({
       "currency": "MXN",
       "customer_info": {
          "customer_id": customer.id
       },
      "line_items": [{
          "name": "Box of Cohiba S1s",
          "unit_price": 300000,
          "quantity": 1
      }],
      "shipping_lines": [{
          "amount": 0
      }],
      "checkout": {
          "type":"HostedPayment",
          "success_url": "testredirect.com",
          "failure_url": "testredirect.com",
          "multifactor_authentication": False,
          "monthly_installments_enabled": True,
          "monthly_installments_options": [3,6,9,12,18],
          "expires_at": 1609891200,
          "redirection_time": 4 //Tiempo de Redirección al Success/Failure URL, umbrales de 4 a 120 seg.
       },
      "shipping_contact": {
         "phone": "+5215555555555",
         "receiver": "Marvin Fuller",
         "address": {
           "street1": "Nuevo Leon 4",
           "country": "MX",
           "postal_code": "06100"
         }
      }
   }, function(err, res) {
      if(err){
        console.log(err);
        return;
      }
      console.log(res.toObject());
  });
using Newtonsoft.Json;

var validOrderWithCheckout = new
  {
    currency: "MXN",
    customer_info = new 
      {
        customer_id = "cus_2o3FvMEBiKitVK1vQ"
      },
    line_items = new 
      [
        new
        {
          name = "Box of Cohiba S1s",
          unit_price = 300000,
          quantity = 1
        }
      ],
    shipping_lines = new 
      [
        new
          {
            "amount" = 0
          }
      ],
    checkout = new
      {
        type = "HostedPayment",
        success_url = "testredirect.com",
        failure_url = "testredirect.com",
        multifactor_authentication = false,
        monthly_installments_enabled = true,
        monthly_installments_options = new int[]
          {
            3, 
            6, 
            9, 
            12
          },
        expires_at = 1609891200,
        redirection_time= 4 //Tiempo de Redirección al Success/Failure URL, umbrales de 4 a 120 seg.
      },
     shipping_contact = new
       {
         phone = "+5215555555555",
         receiver = "Marvin Fuller",
         address = new 
           {
             street1 = "Nuevo Leon 4",
             country = "MX",
             postal_code = "06100"
           }
      }
  };

var order = new Order()
  .create(JsonConvert.SerializeObject(validOrderWithCheckout));
package main

import (
	"context"
	"fmt"
	"io"
	"net/http"

	"github.com/conekta/conekta-go"
)

func main() {
	const acceptLanguage = "es"
	cfg := conekta.NewConfiguration()
	client := conekta.NewAPIClient(cfg)
	ctx := context.WithValue(context.TODO(), conekta.ContextAccessToken, "key_DwaOLXoX6YCGGvfNifZ3IPwi")
	rq := conekta.OrderRequest{
		Checkout: &conekta.CheckoutRequest{
			FailureUrl:                 conekta.PtrString("https://www.mysite.com/payment/failure"),
			MonthlyInstallmentsEnabled: conekta.PtrBool(true),
			MonthlyInstallmentsOptions: []int32{3, 6, 9, 12},
			SuccessUrl:                 conekta.PtrString("https://www.mysite.com/payment/confirmation"),
			Type:                       conekta.PtrString("HostedPayment"),
		},
		Currency: "MXN",
		CustomerInfo: conekta.OrderRequestCustomerInfo{
			CustomerInfoJustCustomerId: conekta.NewCustomerInfoJustCustomerId("cus_2nHprwaWFn7QJ21Lj"),
		},
		LineItems: []conekta.Product{
			{
				Name:      "Box of Cohiba S1s",
				UnitPrice: 35000,
				Quantity:  1,
			},
		},
		ShippingContact: &conekta.CustomerShippingContacts{
			Phone:    conekta.PtrString("+5215555555555"),
			Receiver: conekta.PtrString("Marvin Fuller"),
			Address: conekta.CustomerShippingContactsAddress{
				Street1:    conekta.PtrString("Nuevo Leon 4"),
				PostalCode: conekta.PtrString("06100"),
				Country:    conekta.PtrString("MX"),
			},
		},
		ShippingLines: []conekta.ShippingRequest{{Amount: 0}},
	}
	order, response, err := client.OrdersApi.CreateOrder(ctx).
		OrderRequest(rq).
		AcceptLanguage(acceptLanguage).
		Execute()
	if err != nil {
		panic(err)
	}
	if response.StatusCode != http.StatusCreated {
		responseBody, err := io.ReadAll(response.Body)
		if err != nil {
			panic(err)
		}
		panic(fmt.Sprintf("response body: %s", responseBody))
	}
	fmt.Printf("order: %v", order)
}
try {
  Order order = Order.create(
      new JSONObject("{ 'currency': 'mxn'," +
                        " 'customer_info': {" +
                        "   'customer_id': 'cus_2o3FvMEBiKitVK1vQ'" +
                        "  }," +
                        "  'line_items': [{" +
                        "    'name': 'Box of Cohiba S1s'," +
                        "    'unit_price': 300000," +
                        "    'quantity': 1," +
                        "  }]," +
                        "  'checkout': {" +
                        "    'expired_at': " + (System.currentTimeMillis() / 1000L) + 259200 + "," +
                        "    'failure_url': 'testredirect.com'," +
                        "    'force_3ds_flow': false," +
                        "    'monthly_installments_enabled': true," +
                        "    'monthly_installments_options': [3,6,9,12,18]," +
                        "    'success_url': 'testredirect.com'," +
                        "    'type': 'HostedPayment'" +
                        "    'redirection_time': 4," +
                        "  }," +
                        "  'shipping_contact': {" +
                        "    'phone': '5555555555'," +
                        "    'receiver': 'Marvin Fuller'" +
                        "  }" +
                        "}")
    );
} catch (Conekta::Error e) {
   System.out.println(e.details.get(0).message);
}

Esto regresa una respuesta como la siguiente:

{
    "livemode": false,
    "amount": 35000,
    "currency": "MXN",
    "payment_status": "paid",
    "amount_refunded": 0,
    "checkout": {
        "id": "42a4c95e-0db2-4ae8-9bb3-ea681acc8281",
        "object": "checkout",
        "type": "HostedPayment",
        "status": "Issued",
        "url": "https://pay.conektame.io/link/964b5bdfe557467d9e02469e89b48e19",
        "allowed_payment_methods": ["cash", "card", "bank_transfer", "bnpl", "pay_by_bank"],
        "needs_shipping_contact": true,
        "livemode": true
    },
    "customer_info": {
        "email": "[email protected]",
        "name": "Mario Perez",
        "corporate": false,
        "customer_id": "cus_2nHprwaWFn7QJ21Lj",
        "object": "customer_info"
    },
    "shipping_contact": {
        "receiver": "Marvin Fuller",
        "phone": "+5215555555555",
        "address": {
            "street1": "Nuevo Leon 4",
            "country": "mx",
            "residential": true,
            "object": "shipping_address",
            "postal_code": "06100"
        },
        "id": "ship_cont_2nYNo3xT815RRppom",
        "object": "shipping_contact",
        "created_at": 0
    },
    "object": "order",
    "id": "ord_2nYNo3xT815RRppon",
    "metadata": {},
    "created_at": 1587129536,
    "updated_at": 1587129537,
    "line_items": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [{
            "name": "Box of Cohiba S1s",
            "unit_price": 35000,
            "quantity": 1,
            "object": "line_item",
            "id": "line_item_2nYNo3xT815RRppoi",
            "parent_id": "ord_2nYNo3xT815RRppon",
            "metadata": {},
            "antifraud_info": {}
        }]
    },
    "shipping_lines": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [{
            "amount": 0,
            "object": "shipping_line",
            "id": "ship_lin_2nYNo3xT815RRppoj",
            "parent_id": "ord_2nYNo3xT815RRppon"
        }]
    }
}
    echo $result ->getCheckout()->getUrl();
puts order.checkout.allowed_payment_methods.inspect
puts order.checkout.monthly_installments_enabled
puts order.checkout.monthly_installments_options.inspect
puts order.checkout.object
puts order.checkout.url
puts order.checkout.type
console.log(stringify(order.checkout.allowed_payment_methods)); // [cash, card, bank_transfer]
console.log(stringify(order.checkout.monthly_installments_enabled)); // true
console.log(stringify(order.checkout.monthly_installments_options)); // [3, 6, 9, 12]
console.log(stringify(order.checkout.url)); // 'https://pay.conektame.io/link/964b5bdfe557467d9e02469e89b48e19
console.log(strinfiy(order.checkout.type)); // 'HostedPayment'
Console.WriteLine("[{0}]", string.Join(", ", order.checkout.allowed_payment_methods)); // [cash, card, bank_transfer]
Console.WriteLine(order.checkout.monthly_installments_enabled); // true
Console.WriteLine("[{0}]", string.Join(", ", order.checkout.monthly_installments_options)); // [3, 6, 9, 12]
Console.WriteLine(order.checkout._object); // 'checkout'
Console.WriteLine(order.checkout.url); // 'https://pay.conektame.io/link/964b5bdfe557467d9e02469e89b48e19
Console.WriteLine(order.checkout.type); // 'HostedPayment'
	fmt.Println("AllowedPaymentMethod: %v\n", order.Checkout.AllowedPaymentMethods)
	fmt.Println("MonthlyInstallmentsEnabled: %v\n", order.Checkout.MonthlyInstallmentsEnabled)
	fmt.Println("MonthlyInstallmentOptions: %v\n", order.Checkout.MonthlyInstallmentsOptions)
	fmt.Println("Url: %v\n", order.Checkout.Url)
	fmt.Println("Type: %v\n", order.Checkout.Type)
System.out.println(order.checkout.allowed_payment_methods);
System.out.println(order.checkout.monthly_installments_enabled);
System.out.println(order.checkout.monthly_installments_options);
System.out.println(order.checkout.object);
System.out.println(order.checkout.type);

Al redirigir a la url del checkout podrás ver el nuevo método de pago "Pago Directo BBVA".

📘 Ver documentación detallada →

Personalizar métodos de pago (opcional)

Por defecto, todos los métodos de pago disponibles en tu cuenta se habilitan automáticamente. Si necesitas personalizarlos:

Usa excluded_payment_methods para ocultar métodos específicos del flujo de pago.

"excluded_payment_methods": ["cash", "bnpl"]

Valores posibles: card, cash, bank_transfer, bnpl, pay_by_bank, google, apple.


Did this page help you?