Transactions via Checkout Pro
After receiving your ID related to the PLATFORM_ID of your platform, you can add it to the header of the payment request /checkout/preferences when creating a payment preference with Mercado Pago.
Example:
using MercadoPago.Config;
MercadoPagoConfig.PlatformId = "YOUR_PLATFORM_ID";
// create the payment preference
import com.mercadopago.MercadoPagoConfig;
MercadoPagoConfig.setPlatformId("your-platform-id");
// create the payment preference
import MercadoPago, { Payment } from '@src/index';
const client = new MercadoPago({
accessToken: 'YOUR_ACCESS_TOKEN',
options: {
plataformId: 'your-platform-id'
}
});
// create the payment preference
use MercadoPago\MercadoPagoConfig;
MercadoPagoConfig::setPlatformId("YOUR_PLATFORM_ID");
// create the payment preference
import mercadopago
from mercadopago.config import RequestOptions
request_options = RequestOptions(platform_id="your_platform_id")
# create the payment preference
require 'mercadopago'
request_options = Mercadopago::RequestOptions.new(
platform_id: 'your_platform_id_value'
)
# create the payment preference
cfg, err := config.New(
accessToken,
config.WithPlatformID("your_platform_id_here"),
)
// create the payment preference
curl --location --request POST 'https://api.mercadolibre.com/checkout/preferences' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'x-platform-id: {{PLATFORM_ID proporcionado por el equipo de Partners}}' \
// create the payment preference
