Create agreement - Agreements - Mercado Pago Developers
Create Agreement

POST

/v2/wallet_connect/agreements
An agreement is an authorization link that the buyer receives to allow the seller to access their Mercado Pago wallet to debit the payment.
Request's parameters
client.id
number
Localization: queryUnique ID that identifies a specific Client
x-platform-id
string
Localization: headerField intended for platforms or modules that offer Mercado Pago in their solutions
agreement_data
object
Localization: bodyContains information about actions the user must do and the amount to be paid
external_flow_id
string
Localization: bodyIdentifies the Seller side flow current state
Response parameters
agreement_id
string
Localization: bodyUnique ID that identifies an Agreement
agreement_uri
string
Localization: bodyThis is the uri to redirect the user to the wallet linking in the frontend
Request
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"
  }
}'
Answer
json
{
  "agreement_id": "b1234e5678b91c23a456e78912345b67",
  "agreement_uri": "https://beta.mercadopago.com.ar/v1/wallet_agreement/b1234e5678b91c23a456e78912345b67"
}
Errors
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