AI resources
Generate payer token

This endpoint allows generating a payment 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 200.

POST

https://api.mercadopago.com/v2/wallet_connect/agreements/{agreement_id}/payer_token
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
x-platform-id
string
Identifier for platforms or modules that offer Mercado Pago within their solutions.
Path
agreement_id
string

REQUIRED

Unique identifier of the agreement.
Body
code
string

REQUIRED

Temporary authorization code obtained from the agreement callback. Used to exchange for a payer token.
Response parameters
payer_token
string
Token that represents the buyer's authorization for the seller to process payments from their wallet.
Errors

400Request error.

400

Bad Request.

404Error. Resource not found.

404

Not Found.

500Processing error.

internal_error

Some error occurred on our side while attempting to process the request. Please try again later.

Request
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-4*********994754-12*********c73b4e1ac*********cef36b27c*********840' \
       -H 'x-platform-id: YOUR_PLATFORM_ID' \
    -d '{
  "code": "aeecea3e11f2545d1e7790eb6591ff68df74c57930551ed980239f4538a7e530"
}'
Response
{
  "payer_token": "abcdef1e23f4567d8e9123eb6591ff68df74c57930551ed980239f4538a7e530"
}