Crear agreement - Agreements - Mercado Pago Developers
Crear Agreement

POST

/v2/wallet_connect/agreements
Un 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.
Parámetros para la solicitud
client.id
number
Localización: queryID único que identifica un cliente específico
x-platform-id
string
Localización: headerCampo destinado a plataformas o módulos que ofrecen Mercado Pago en sus soluciones
agreement_data
object
Localización: bodyContiene información sobre las acciones que el usuario debe realizar y el monto a pagar
external_flow_id
string
Localización: bodyIdentifica el estado del flujo por el lado del vendedor
Parámetros de respuesta
agreement_id
string
Localización: bodyID único que identifica un Agreement
agreement_uri
string
Localización: bodyThis is the uri to redirect the user to the wallet linking in the frontend
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
400Field return_uri is required
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