GeneraciĆ³n por retiro
Puedes crear un reporte de Dinero retirado de forma automĆ”tica cada vez que hagas un retiro de dinero de tu cuenta de Mercado Pago a una cuenta bancaria. Programa esta opciĆ³n desde tu panel de Mercado Pago o vĆa API.
Generar desde el panel de Mercado Pago
Desde la secciĆ³n Reportes de Mercado Pago, programa la generaciĆ³n de reportes por retiro siguiendo estos pasos:
- Desde tu cuenta de Mercado Pago, ve a tus Reportes y de ahĆ a Reportes de Dinero retirado.
- Haz click en Programar reportes y confirma Programar.
- Ā”Y listo! Cada vez que retires dinero, tendrĆ”s tu reporte disponible.
Genera tus reportes cada vez que quieras consultar un retiro de dinero
- Desde tu cuenta de Mercado Pago, ve a tus Reportes.
- Entra en la secciĆ³n Dinero retirado y haz click en Crear reporte.
- Ubica tus retiros por perĆodo de tiempo y selecciona el retiro quieras consultar.
Ā”Y listo! Vas a ver tu reporte en preparaciĆ³n.
Generar por API
Actualiza el atributo execute_after_withdrawal
con el valor true
.
Ā”Y listo! Ahora tendrĆ”s un reporte por cada retiro de dinero que hagas.
curl -X PUT \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-H 'Authorization: Bearer ENV_ACCESS_TOKEN' \
'https://api.mercadopago.com/v1/account/bank_report/config' \
-d '{
"file_name_prefix": "bank-report-USER_ID",
"include_withdrawal_at_end": false,
"execute_after_withdrawal": true,
"scheduled": true,
"display_timezone": "GMT-04",
"frequency": {
"hour": 0,
"type": "monthly",
"value": 1
},
"columns": [
{
"key": "DATE"
},
{
"key": "SOURCE_ID"
},
{
"key": "EXTERNAL_REFERENCE"
}
]
}'
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'content-type' => 'application/json',
'Authorization' => 'Bearer ENV_ACCESS_TOKEN'
);
$data = '{
"file_name_prefix": "bank-report-USER_ID",
"include_withdrawal_at_end": false,
"execute_after_withdrawal": true,
"scheduled": true,
"display_timezone": "GMT-04",
"frequency": {
"hour": 0,
"type": "monthly",
"value": 1
},
"columns": [
{
"key": "DATE"
},
{
"key": "SOURCE_ID"
},
{
"key": "EXTERNAL_REFERENCE"
}
]
}';
$response = Requests::put('https://api.mercadopago.com/v1/account/bank_report/config', $headers, $data);
URL url = new URL("https://api.mercadopago.com/v1/account/bank_report/config");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setRequestMethod("PUT");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN");
connection.setDoOutput(true);
String body = "{
\\"file_name_prefix\\": \\"bank-report-USER_ID\\",
\\"include_withdrawal_at_end\\": false,
\\"execute_after_withdrawal\\": true,
\\"schedule\\": true,
\\"display_timezone\\": \\"GMT-04\\",
\\"frequency\\": {
\\"hour\\": 0,
\\"type\\": \\"monthly\\",
\\"value\\": 1
},
\\"columns\\": [
{ \\"key\\": \\"DATE\\" },
{ \\"key\\": \\"SOURCE_ID\\" },
{ \\"key\\": \\"EXTERNAL_REFERENCE\\" },
]
}";
try(OutputStream os = connection.getOutputStream()) {
byte[] input = body.getBytes("utf-8");
os.write(input, 0, input.length);
}
System.out.println(connection.getResponseCode());
System.out.println(connection.getResponseMessage());
System.out.println(connection.getInputStream());
import requests
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'Authorization': 'Bearer ENV_ACCESS_TOKEN'
}
data = '{
"file_name_prefix": "bank-report-USER_ID",
"include_withdrawal_at_end": false,
"execute_after_withdrawal": true,
"scheduled": true,
"display_timezone": "GMT-04",
"frequency": {
"hour": 0,
"type": "monthly",
"value": 1
},
"columns": [
{
"key": "DATE"
},
{
"key": "SOURCE_ID"
},
{
"key": "EXTERNAL_REFERENCE"
}
]
}'
response = requests.put('https://api.mercadopago.com/v1/account/bank_report/config', headers=headers, data=data)
var request = require('request');
var headers = {
'accept': 'application/json',
'content-type': 'application/json',
'Authorization': 'Bearer ENV_ACCESS_TOKEN'
};
var dataString = '{
"file_name_prefix": "bank-report-USER_ID",
"include_withdrawal_at_end": false,
"execute_after_withdrawal": true,
"scheduled": true,
"display_timezone": "GMT-04",
"frequency": {
"hour": 0,
"type": "monthly",
"value": 1
},
"columns": [
{
"key": "DATE"
},
{
"key": "SOURCE_ID"
},
{
"key": "EXTERNAL_REFERENCE"
}
]
}';
var options = {
url: 'https://api.mercadopago.com/v1/account/bank_report/config',
method: 'PUT',
headers: headers,
body: dataString
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
request(options, callback);
RecibirƔs como respuesta un HTTP STATUS 200 (Ok)
json
{
"file_name_prefix": "bank-report-USER_ID",
"include_withdrawal_at_end": false,
"scheduled": true,
"execute_after_withdrawal": true,
"display_timezone": "GMT-04",
"frequency": {
"hour": 3,
"type": "daily",
"value": {}
},
"columns": [
{
"key": "DATE"
},
{
"key": "SOURCE_ID"
},
{
"key": "EXTERNAL_REFERENCE"
}
]
}