Crear Agreement/v2/wallet_connect/agreementsUn Agreement es un link de autorización recibido por el comprador para permitir al vendedor acceder a su billetera de Mercado Pago con el fin de debitar el pago.
POST
Productos que lo utilizan:
Parámetros para la solicitud
client.id
Localización: queryID único que identifica un cliente específiconumber
x-platform-id
Localización: headerCampo destinado a plataformas o módulos que ofrecen Mercado Pago en sus solucionesstring
agreement_data
Localización: bodyContiene información sobre las acciones que el usuario debe realizar y el monto a pagarobject
external_flow_id
Localización: bodyIdentifica el estado del flujo por el lado del vendedorstring
Parámetros de respuesta
agreement_id
Localización: bodyID único que identifica un Agreementstring
agreement_uri
Localización: bodyThis is the uri to redirect the user to the wallet linking in the frontendstring
Solicitud
curl
curl -X POST \
'https://api.mercadopago.com/v2/wallet_connect/agreements?client.id=<CLIENT.ID>' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-platform-id: YOUR_ACCESS_TOKEN' \
-d '{
"return_url": "https://www.mercadopago.com/",
"external_flow_id": "EXTERNAL_FLOW_ID",
"external_user": {
"id": "usertest",
"description": "Test account"
},
"agreement_data": {
"validation_amount": 3.14,
"description": "Test agreement"
}
}'
Respuesta
json
{
"agreement_id": "b1234e5678b91c23a456e78912345b67",
"agreement_uri": "https://beta.mercadopago.com.ar/v1/wallet_agreement/b1234e5678b91c23a456e78912345b67"
}
Errores
400bad_request
400
400Field external_flow_id is required
400Field return_uri must not be grater than 300 characters
400Field external_flow_id must not be grater than 300 characters
400Field external_user must not be blank
400Field id must not be blank