Pagos con ApplePay

Esta guía te muestra cómo usar Apple Pay 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 "Apple Pay"


Si estás creando link de pago por API, Apple Pay se habilita automáticamente cuando incluyes "card" en allowed_payment_methods. No es necesario agregar "apple" explícitamente.

Nota importante: Si solo quieres integrar Apple Pay sin aceptar tarjetas regulares, entonces sí debes enviar "apple" específicamente en el array de allowed_payment_methods.

curl --request POST \
  --url https://api.conekta.io/checkouts \
  --header 'accept: application/vnd.conekta-v2.2.0+json' \
  -u key_eYvWV7gSDkNYXsmr: \
  --header 'content-type: application/json' \
  --data '{
    "name": "Payment Link Name",
    "type": "PaymentLink",
    "recurrent": false,
    "expires_at": 1590882634,
    "allowed_payment_methods": ["card"],
    "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"
        }
    }
 }'

Si solo quieres Apple Pay (sin tarjetas regulares):

curl --request POST \
  --url https://api.conekta.io/checkouts \
  --header 'accept: application/vnd.conekta-v2.2.0+json' \
  -u key_eYvWV7gSDkNYXsmr: \
  --header 'content-type: application/json' \
  --data '{
    "name": "Payment Link Name",
    "type": "PaymentLink",
    "recurrent": false,
    "expires_at": 1590882634,
    "allowed_payment_methods": ["apple"],
    "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"
        }
    }
 }'


Checkout redireccionado

Apple Pay se habilita automáticamente cuando incluyes "card" en allowed_payment_methods. No es necesario agregar "apple" explícitamente.

Si solo quieres integrar Apple Pay sin aceptar tarjetas regulares, entonces sí debes enviar "apple" específicamente en el array de allowed_payment_methods.

curl -H "Accept: application/vnd.conekta-v2.2.0+json" \
     -H "Content-type: application/json" \
     -H 'Authorization: Bearer key_XXXXXXX' \
     -X POST -d '{
    "currency": "MXN",
    "customer_info": {
        "name": "Juan Perez",
        "email": "[email protected]",
        "phone": "+5218181818181"
    },
    "line_items": [
        {
            "name": "Box of Cohiba S1s",
            "unit_price": 35000,
            "quantity": 1
        }
    ],
    "shipping_lines": [
        {
            "amount": 0
        }
    ],
    "checkout": {
        "allowed_payment_methods": [
            "card"
        ],
        "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
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken(getenv('CONEKTA_API_KEY'));

$apiInstance = new Conekta\Api\OrdersApi(
    new GuzzleHttp\Client(),
    $config
);

$order_request = new \Conekta\Model\OrderRequest([
    'currency' => 'MXN',
    'customer_info' => [
        'name' => 'Juan Perez',
        'email' => '[email protected]',
        'phone' => '+5218181818181'
    ],
    'line_items' => [
        [
            'name' => 'Box of Cohiba S1s',
            'unit_price' => 35000,
            'quantity' => 1
        ]
    ],
    'shipping_lines' => [
        [
            'amount' => 0
        ]
    ],
    'checkout' => [
        'allowed_payment_methods' => ['card'],
        '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'
        ]
    ]
]);

$accept_language = 'es';

try {
    $result = $apiInstance->createOrder($order_request, $accept_language);
    echo $result->getCheckout()->getUrl();
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->createOrder: ', $e->getMessage(), PHP_EOL;
}
require 'conekta'

Conekta.api_key = ENV['CONEKTA_API_KEY']
Conekta.api_version = '2.2.0'

order_params = {
  currency: 'MXN',
  customer_info: {
    name: 'Juan Perez',
    email: '[email protected]',
    phone: '+5218181818181'
  },
  line_items: [{
    name: 'Box of Cohiba S1s',
    unit_price: 35000,
    quantity: 1
  }],
  shipping_lines: [{
    amount: 0
  }],
  checkout: {
    allowed_payment_methods: ['card'],
    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'
    }
  }
}

order = Conekta::Order.create(order_params)
puts order.checkout.url
import conekta
import os

conekta.api_key = os.environ.get('CONEKTA_API_KEY')
conekta.api_version = '2.2.0'

order = conekta.Order.create({
    "currency": "MXN",
    "customer_info": {
        "name": "Juan Perez",
        "email": "[email protected]",
        "phone": "+5218181818181"
    },
    "line_items": [{
        "name": "Box of Cohiba S1s",
        "unit_price": 35000,
        "quantity": 1
    }],
    "shipping_lines": [{
        "amount": 0
    }],
    "checkout": {
        "allowed_payment_methods": ["card"],
        "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"
        }
    }
})

print(order.checkout.url)
const Conekta = require('conekta');

const conekta = new Conekta(process.env.CONEKTA_API_KEY);
conekta.api_version = '2.2.0';

conekta.Order.create({
    currency: 'MXN',
    customer_info: {
        name: 'Juan Perez',
        email: '[email protected]',
        phone: '+5218181818181'
    },
    line_items: [{
        name: 'Box of Cohiba S1s',
        unit_price: 35000,
        quantity: 1
    }],
    shipping_lines: [{
        amount: 0
    }],
    checkout: {
        allowed_payment_methods: ['card'],
        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'
        }
    }
}, function(err, order) {
    if (err) {
        console.log(err);
        return;
    }
    console.log(order.checkout.url);
});
using Conekta;
using System;

Conekta.Conekta.ApiKey = Environment.GetEnvironmentVariable("CONEKTA_API_KEY");
Conekta.Conekta.ApiVersion = "2.2.0";

var orderParams = new JObject
{
    ["currency"] = "MXN",
    ["customer_info"] = new JObject
    {
        ["name"] = "Juan Perez",
        ["email"] = "[email protected]",
        ["phone"] = "+5218181818181"
    },
    ["line_items"] = new JArray
    {
        new JObject
        {
            ["name"] = "Box of Cohiba S1s",
            ["unit_price"] = 35000,
            ["quantity"] = 1
        }
    },
    ["shipping_lines"] = new JArray
    {
        new JObject
        {
            ["amount"] = 0
        }
    },
    ["checkout"] = new JObject
    {
        ["allowed_payment_methods"] = new JArray { "card" },
        ["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"] = new JArray { 3, 6, 9, 12 },
        ["redirection_time"] = 4
    },
    ["shipping_contact"] = new JObject
    {
        ["phone"] = "+5215555555555",
        ["receiver"] = "Marvin Fuller",
        ["address"] = new JObject
        {
            ["street1"] = "Nuevo Leon 4",
            ["country"] = "MX",
            ["postal_code"] = "06100"
        }
    }
};

var order = Order.Create(orderParams);
Console.WriteLine(order.checkout.url);
package main

import (
	"context"
	"fmt"
	"log"
	"os"

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

func main() {
	cfg := conekta.NewConfiguration()
	cfg.AddDefaultHeader("Accept-Language", "es")
	
	client := conekta.NewAPIClient(cfg)
	ctx := context.WithValue(
		context.Background(),
		conekta.ContextAccessToken,
		os.Getenv("CONEKTA_API_KEY"),
	)

	orderRequest := conekta.OrderRequest{
		Currency: "MXN",
		CustomerInfo: conekta.OrderRequestCustomerInfo{
			CustomerInfo: &conekta.CustomerInfo{
				Name:  conekta.PtrString("Juan Perez"),
				Email: conekta.PtrString("[email protected]"),
				Phone: conekta.PtrString("+5218181818181"),
			},
		},
		LineItems: []conekta.Product{
			{
				Name:      "Box of Cohiba S1s",
				UnitPrice: 35000,
				Quantity:  1,
			},
		},
		ShippingLines: []conekta.ShippingRequest{
			{Amount: 0},
		},
		Checkout: &conekta.CheckoutRequest{
			AllowedPaymentMethods:      []string{"card"},
			Type:                       conekta.PtrString("HostedPayment"),
			SuccessUrl:                 conekta.PtrString("https://www.mysite.com/payment/confirmation"),
			FailureUrl:                 conekta.PtrString("https://www.mysite.com/payment/failure"),
			MonthlyInstallmentsEnabled: conekta.PtrBool(true),
			MonthlyInstallmentsOptions: []int32{3, 6, 9, 12},
			RedirectionTime:            conekta.PtrInt32(4),
		},
		ShippingContact: &conekta.CustomerShippingContacts{
			Phone:    conekta.PtrString("+5215555555555"),
			Receiver: conekta.PtrString("Marvin Fuller"),
			Address: conekta.CustomerShippingContactsAddress{
				Street1:    conekta.PtrString("Nuevo Leon 4"),
				Country:    conekta.PtrString("MX"),
				PostalCode: conekta.PtrString("06100"),
			},
		},
	}

	order, _, err := client.OrdersApi.CreateOrder(ctx).
		OrderRequest(orderRequest).
		Execute()
	
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Checkout URL: %s\n", *order.Checkout.Url)
}
import io.conekta.Conekta;
import io.conekta.Order;
import org.json.JSONObject;
import org.json.JSONArray;

Conekta.setApiKey(System.getenv("CONEKTA_API_KEY"));
Conekta.setApiVersion("2.2.0");

try {
    JSONObject orderParams = new JSONObject();
    orderParams.put("currency", "MXN");
    
    JSONObject customerInfo = new JSONObject();
    customerInfo.put("name", "Juan Perez");
    customerInfo.put("email", "[email protected]");
    customerInfo.put("phone", "+5218181818181");
    orderParams.put("customer_info", customerInfo);
    
    JSONArray lineItems = new JSONArray();
    JSONObject lineItem = new JSONObject();
    lineItem.put("name", "Box of Cohiba S1s");
    lineItem.put("unit_price", 35000);
    lineItem.put("quantity", 1);
    lineItems.put(lineItem);
    orderParams.put("line_items", lineItems);
    
    JSONArray shippingLines = new JSONArray();
    JSONObject shippingLine = new JSONObject();
    shippingLine.put("amount", 0);
    shippingLines.put(shippingLine);
    orderParams.put("shipping_lines", shippingLines);
    
    JSONObject checkout = new JSONObject();
    checkout.put("allowed_payment_methods", new JSONArray().put("card"));
    checkout.put("type", "HostedPayment");
    checkout.put("success_url", "https://www.mysite.com/payment/confirmation");
    checkout.put("failure_url", "https://www.mysite.com/payment/failure");
    checkout.put("monthly_installments_enabled", true);
    checkout.put("monthly_installments_options", new JSONArray().put(3).put(6).put(9).put(12));
    checkout.put("redirection_time", 4);
    orderParams.put("checkout", checkout);
    
    JSONObject shippingContact = new JSONObject();
    shippingContact.put("phone", "+5215555555555");
    shippingContact.put("receiver", "Marvin Fuller");
    JSONObject address = new JSONObject();
    address.put("street1", "Nuevo Leon 4");
    address.put("country", "MX");
    address.put("postal_code", "06100");
    shippingContact.put("address", address);
    orderParams.put("shipping_contact", shippingContact);
    
    Order order = Order.create(orderParams);
    System.out.println(order.checkout.url);
    
} catch (Exception e) {
    System.out.println(e.getMessage());
}

Esto regresa una respuesta como la siguiente:

{
    "livemode": false,
    "amount": 35000,
    "currency": "MXN",
    "amount_refunded": 0,
    "customer_info": {
        "email": "[email protected]",
        "phone": "+5218181818181",
        "name": "Juan Perez",
        "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_2yZr3Kg9BEXsDSUHW",
        "object": "shipping_contact",
        "created_at": 1756131674
    },
    "channel": {
        "segment": "Checkout",
        "checkout_request_id": "8ebff614-697a-41ea-a82a-66c666169047",
        "checkout_request_type": "HostedPayment",
        "id": "channel_2yZr3Kg9BEXsDSUHY"
    },
    "checkout": {
        "id": "8ebff614-697a-41ea-a82a-66c666169047",
        "name": "ord-2yZr3Kg9BEXsDSUHX",
        "livemode": false,
        "emails_sent": 0,
        "success_url": "https://www.mysite.com/payment/confirmation",
        "failure_url": "https://www.mysite.com/payment/failure",
        "paid_payments_count": 0,
        "sms_sent": 0,
        "status": "Issued",
        "type": "HostedPayment",
        "recurrent": false,
        "starts_at": 1756101600,
        "expires_at": 1756360799,
        "allowed_payment_methods": [
            "card"
        ],
        "exclude_card_networks": [],
        "needs_shipping_contact": false,
        "monthly_installments_options": [
            3,
            6,
            9,
            12
        ],
        "monthly_installments_enabled": true,
        "redirection_time": 4,
        "force_3ds_flow": false,
        "metadata": {},
        "can_not_expire": false,
        "object": "checkout",
        "is_redirect_on_failure": true,
        "slug": "8ebff614697a41eaa82a66c666169047",
        "url": "https://pay.stg.conekta.io/checkout/8ebff614697a41eaa82a66c666169047"
    },
    "object": "order",
    "id": "ord_2yZr3Kg9BEXsDSUHX",
    "metadata": {},
    "is_refundable": false,
    "created_at": 1756131674,
    "updated_at": 1756131674,
    "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_2yZr3Kg9BEXsDSUHT",
                "parent_id": "ord_2yZr3Kg9BEXsDSUHX",
                "metadata": {},
                "antifraud_info": {}
            }
        ]
    },
    "shipping_lines": {
        "object": "list",
        "has_more": false,
        "total": 1,
        "data": [
            {
                "amount": 0,
                "object": "shipping_line",
                "id": "ship_lin_2yZr3Kg9BEXsDSUHU",
                "parent_id": "ord_2yZr3Kg9BEXsDSUHX"
            }
        ]
    }
}
    echo $result ->getCheckout()->getUrl();
puts order.checkout.allowed_payment_methods.inspect # ["card"]
puts order.checkout.monthly_installments_enabled # true
puts order.checkout.monthly_installments_options.inspect # [3, 6, 9, 12]
puts order.checkout.object # "checkout"
puts order.checkout.url # "https://pay.conekta.io/checkout/..."
puts order.checkout.type # "HostedPayment"
console.log(JSON.stringify(order.checkout.allowed_payment_methods)); // ["card"]
console.log(order.checkout.monthly_installments_enabled); // true
console.log(JSON.stringify(order.checkout.monthly_installments_options)); // [3, 6, 9, 12]
console.log(order.checkout.url); // 'https://pay.conekta.io/checkout/...'
console.log(order.checkout.type); // 'HostedPayment'
Console.WriteLine("[{0}]", string.Join(", ", order.checkout.allowed_payment_methods)); // [card]
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.conekta.io/checkout/...'
Console.WriteLine(order.checkout.type); // 'HostedPayment'
fmt.Printf("AllowedPaymentMethods: %v\n", order.Checkout.AllowedPaymentMethods) // [card]
fmt.Printf("MonthlyInstallmentsEnabled: %v\n", order.Checkout.MonthlyInstallmentsEnabled) // true
fmt.Printf("MonthlyInstallmentOptions: %v\n", order.Checkout.MonthlyInstallmentsOptions) // [3 6 9 12]
fmt.Printf("Url: %v\n", order.Checkout.Url) // https://pay.conekta.io/checkout/...
fmt.Printf("Type: %v\n", order.Checkout.Type) // HostedPayment
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 botón de pago "Apple".