# Create agreement This endpoint allows creating an agreement between buyer and seller, generating an authorization link to be sent to the buyer so the seller can access their Mercado Pago wallet and process payments. In case of success, the request will return a response with status 201. **POST** `/v2/wallet_connect/agreements` ## Request parameters ### Query - `client.id` (string, optional) Unique identifier of the client application. - `return_uri` (string, optional) URI to which the buyer will be redirected after completing the agreement flow. It must match a URI previously registered for the application and accepts up to 2048 characters. - `external_flow_id` (string, optional) Seller's internal identifier for the current flow state, used to correlate the agreement result with the purchase session in your system. Accepts up to 64 characters. - `external_user` (object, optional) Data used by the seller to identify the buyer within their own system. - `external_user.id` (string, optional) Seller's unique identifier for the buyer. - `external_user.description` (string, optional) Label for the buyer in the seller's system, such as the buyer's name. - `agreement_data` (object, optional) Additional data about the agreement, including optional amount and description. - `agreement_data.validation_amount` (number, optional) Reference amount for the agreement. If the buyer's account balance is insufficient to cover this amount, a card will be required as a secondary payment method. - `agreement_data.description` (string, optional) Description of the actions the buyer is about to perform. ## Response parameters - `agreement_id` (string, optional) Unique identifier of the agreement. - `agreement_uri` (string, optional) URI to redirect the buyer to complete the [wallet linking flow](/developers/en/docs/wallet-connect/configure-agreements) in the frontend. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | RedirectUriMismatch | The redirect URI does not match the one registered for this application. Check the value sent in `return_uri` and confirm that it is registered in your application settings. | | 400 | ReturnUriNull | The `return_uri` field is required and was not provided. Make the request again including it. | | 400 | ExternalFlowIdTooLong | The `external_flow_id` value exceeds the maximum allowed length of 64 characters. Reduce the size of the identifier sent. | | 400 | ReturnUriTooLong | The `return_uri` value exceeds the maximum allowed length of 2048 characters. Reduce the size of the URI sent. | | 400 | ExternalUserNull | The `external_user` field is required and was not provided. Make the request again including the buyer's identifier in your system. | | 400 | AgreementDataDescriptionInvalid | The `agreement_data.description` value is invalid. Check the content sent and respect the 256-character limit. | | 403 | forbidden | You don't have permission to access the requested resource. Check whether the Access Token used has the permissions and scopes required for this operation. | | 500 | internal_error | An internal server error occurred. Please try again later. If the problem persists, contact support and provide the `x-request-id` and details about the operation performed. | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v2/wallet_connect/agreements?client.id=' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "return_uri": "https://www.mercadopago.com/", "external_flow_id": "EXTERNAL_FLOW_ID", "external_user": { "id": "usertest", "description": "Test account" }, "agreement_data": { "validation_amount": "24.50", "description": "Test agreement" } }' ``` ## Response example ```json { "agreement_id": "22abcd1235ed497f945f755fcaba3c6c", "agreement_uri": "https://www.mercadopago.com.pe/wallet-connect/vinculation/onboarding?22abcd1235ed497f945f755fcaba3c6c" } ```