This endpoint allows generating a payer_token, a unique identifier that represents the buyer's authorization for the seller to process payments from their wallet. In case of success, the request will return a response with status 201.
POST
REQUIRED
REQUIRED
REQUIRED
payer_token that represents the buyer's authorization for the seller to process payments from their wallet.400Request error.
CodeMismatch
The provided code does not match the validation code for this agreement. Use the code returned in the return_uri or in the confirmation webhook of the corresponding agreement.
AlreadyCreated
A payer_token for this agreement has already been generated. Use the payer_token obtained previously, as the same code cannot be reused.
WindowExpired
The time window for generating a payer_token has expired. Create a new agreement and obtain a new approval from the buyer.
AgreementNotConfirmedByUser
The agreement has not been confirmed by the buyer yet. Wait for the approval flow to be completed before requesting the payer_token.
UserIdEqualsCollectorId
The buyer and seller cannot be the same Mercado Pago user. Use distinct accounts to perform the agreement.
InvalidCodeFormat
The code format is invalid. It must be a 32-character lowercase alphanumeric string.
403Forbidden.
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.
404Resource not found.
AgreementNotFound
No agreement was found with the provided ID. This same response is returned when the agreement belongs to another application (ClientNotOwner), in order to avoid exposing the existence of other customers' agreements.
ClientNotOwner
The agreement exists but was not created by the current application. The same AgreementNotFound response will be returned to avoid exposing the existence of other customers' agreements.
500Generic error.
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.
curl -X POST \
'https://api.mercadopago.com/v2/wallet_connect/agreements/{agreement_id}/payer_token'\
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer APP_USR-1*********550113-12*********b4773884a*********e8df16347*********786' \
-d '{
"code": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
}'{
"payer_token": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
}