# MD for: https://www.mercadopago.com.uy/developers/es/docs/subscriptions/additional-content/reports/account-money/api.md \# Generate report via API You can generate your report manually as many times as you want or schedule it according to the desired frequency through our API. ## Set up your reports ### Configurable attributes Know the fields you can configure to adjust your preferences before you start: > WARNING > > Important > > Setting up \`frequency\` feature does not mean that the report will be generated automatically. The settings will apply only when the automatic scheduling is activated. For more details, please go to the \[Schedule your automatic reports\](#bookmark\_schedule\_report\_automatically) section. | Configurable fields | Type | Example | Description | | --- | --- | --- | --- | | \*\`coupon\_detailed\` (optional)\* | Boolean | true | Includes a column to show the detail of the discount coupons. | | \`columns\` | JSON Array | \`\`\`\[ { "key": "DATE" }, { "key": "SOURCE\_ID" } \]\`\`\` | Field with the details of columns to be included in your report. Find all possible values in the \[Glossary section\](https://www.mercadopago.com.uy/developers/en/guides/additional-content/reports/account-money/glossary). | | \`file\_name\_prefix\` | String | "conciliation-settlement-report" | Prefix that composes the report name once generated and ready for download. | | \`frequency\` | JSON | \`\`\`{ "hour": 0, "type": "monthly", "value": 1 }\`\`\` | Indicates the daily, weekly or monthly frequency of scheduled reports. \- \`frequency\` applies type \*monthly\* to the day of the month or \*weekly\* to the day of the week. \- \`hour\` time of day to generate the report. \- \`type\` indicates the type of frequency \*daily\*, \*weekly\* and \*monthly\*. | | \`display\_timezone\` (optional) | String | "GMT-04" | This field determines the date and time displayed in the reports. If you do not set a time zone in this field, the system will consider GMT-04 as default. If you choose a time zone which adopts daylight saving time, you will need to adjust it manually when the time changes. | | \`include\_withdraw\` | Boolean | true | This parameter allows to ignore (false) or include (true) money withdraw in the report. | | \`report\_translation\` (optional) | String | "es" | Allows you to change the default language of the column headers in reports that are generated in Excel format (.xlsx). If you have an integration based on this format and configure this feature, we recommend that you verify if it works correctly. If your integration does not work properly, update it based on the new headers. | | \`header\_language\` (optional) | String | "es" | Allows changing the default report language. If enabled, we recommend verifying that Excel file (.xlsx) integrations work correctly. Available languages: English (en), Spanish (es), and Portuguese (pt). | | \*\`refund\_detailed\` (optional)\* | Boolean | true | Displays the reference code (\`external\_reference\`) of the refund instead of the reference code (\`external\_reference\`) of the payment. | | \`scheduled\` (read\_only) | Boolean | true | Informative field that indicates if there are already scheduled reports in the user account. \`True\` The automatic generation is activated \`False\` The automatic generation is disabled | | \*\`separator\` (optional)\* | String | ";" | Separator that you can use in the .csv file when you don't want the separator to be a comma. | | \*\`sftp\_info\` (optional)\* | JSON | \`\`\`{ "server": "sftp.myserver.com", "password": "mypassword", "remote\_dir": "/myfolder", "port": 22, "username": "myusername" }\`\`\` | Indicates the uploaded data to SFTP when you need it. | | \*\`shipping\_detail\` (optional)\* | Boolean | true | Includes the detail of the shipments. | | \*\`show\_chargeback\_cancel\` (optional)\* | Boolean | true | Includes the detail of cancellations of chargebacks. | | \*\`show\_fee\_prevision\` (optional)\* | Boolean | true | Includes the details of the fees. | You can configure your reports as needed. Below, we highlight the available API calls so you can manage the configuration of your report and, based on these settings, generate the reports. ### Create a new configuration Customize your reports by assigning different creation properties by running the following \_curl\_: * [curl ](#editor%5F1) * [java ](#editor%5F3) * [node ](#editor%5F5) * [php ](#editor%5F2) * [python ](#editor%5F4) curl php java python node ``` curl -X POST \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/config' \ -d '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }' ``` Copiar ``` 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Bearer ENV_ACCESS_TOKEN' ); $data = '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }'; $response = Requests::post('https://api.mercadopago.com/v1/account/settlement_report/config', $headers, $data); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report/config"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("POST"); 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\\": \\"settlement-report-USER_ID\\", \\"show_fee_prevision\\": false, \\"show_chargeback_cancel\\": true, \\"coupon_detailed\\": true, \\"shipping_detail\\": true, \\"refund_detailed\\": true, \\"display_timezone\\": \\"GMT-04\\", \\"header_language\\": \\"en\\", \\"frequency\\": { \\"hour\\": 0, \\"type\\": \\"monthly\\", \\"value\\": 1 }, \\"columns\\": [ { \\"key\\": \\"TRANSACTION_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()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' } data = '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }' response = requests.post('https://api.mercadopago.com/v1/account/settlement_report/config', headers=headers, data=data) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' }; var dataString = '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }'; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/config', method: 'POST', headers: headers, body: dataString }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an HTTP status code \`201 (Created)\` will be issued. The API will respond with a JSON structure, where the properties will represent the configuration you created. #### Response \`\`\`json { "file\_name\_prefix": "settlement-report-USER\_ID", "show\_fee\_prevision": false, "show\_chargeback\_cancel": true, "scheduled": false, "coupon\_detailed": true, "include\_withdraw": true, "shipping\_detail": true, "refund\_detailed": true, "display\_timezone": "GMT-04", "header\_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": \[ { "key": "TRANSACTION\_DATE" }, { "key": "SOURCE\_ID" }, { "key": "EXTERNAL\_REFERENCE" } \] } \`\`\` ### Check settings Check the current configuration of your reports by executing the following \_curl\_: * [curl ](#editor%5F6) * [java ](#editor%5F8) * [node ](#editor%5F10) * [php ](#editor%5F7) * [python ](#editor%5F9) curl php java python node ``` curl -X GET \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/config' \ ``` Copiar ``` 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Bearer ENV_ACCESS_TOKEN' ); $response = Requests::get('https://api.mercadopago.com/v1/account/settlement_report/config', $headers); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report/config"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN"); System.out.println(connection.getResponseCode()); System.out.println(connection.getResponseMessage()); System.out.println(connection.getInputStream()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' } response = requests.get('https://api.mercadopago.com/v1/account/settlement_report/config', headers=headers) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' }; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/config', headers: headers }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an \`HTTP 200 (Ok)\` status code will be issued. The API will respond with a JSON structure whose properties will represent the characteristics of your reports. #### Response \`\`\`json { "file\_name\_prefix": "settlement-report-USER\_ID", "show\_fee\_prevision": false, "show\_chargeback\_cancel": true, "scheduled": false, "coupon\_detailed": true, "include\_withdraw": true, "shipping\_detail": true, "refund\_detailed": true, "display\_timezone": "GMT-04", "header\_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": \[ { "key": "TRANSACTION\_DATE" }, { "key": "SOURCE\_ID" }, { "key": "EXTERNAL\_REFERENCE" } \] } \`\`\` ### Update settings Update the default settings of your reports when necessary by executing the following \_curl\_. > NOTE > > Note > > If, when updating the configuration, you want to change the \`frequency\` attribute and have already activated the automatic creation of your reports, follow these steps: 1\. Cancel the scheduled creation of your reports by following the steps described in the section \*\*Disable automatic generation\*\* in \[Schedule report automatically.\](#bookmark\_schedule\_report\_automatically) 2\. Update the configuration. 3\. Re-enable the automatic creation of your reports by following the steps in the section \*\*Enable automatic generation\*\* in \[Schedule report automatically.\](#bookmark\_schedule\_report\_automatically) * [curl ](#editor%5F11) * [java ](#editor%5F13) * [node ](#editor%5F15) * [php ](#editor%5F12) * [python ](#editor%5F14) curl php java python node ``` curl -X PUT \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/config' \ -d '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }' ``` Copiar ``` 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Bearer ENV_ACCESS_TOKEN' ); $data = '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }'; $response = Requests::put('https://api.mercadopago.com/v1/account/settlement_report/config', $headers, $data); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_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\\": \\"settlement-report-USER_ID\\", \\"show_fee_prevision\\": false, \\"show_chargeback_cancel\\": true, \\"coupon_detailed\\": true, \\"include_withdraw\\": true, \\"shipping_detail\\": true, \\"refund_detailed\\": true, \\"display_timezone\\": \\"GMT-04\\", \\"header_language\\": \\"en\\", \\"frequency\\": { \\"hour\\": 0, \\"type\\": \\"monthly\\", \\"value\\": 1 }, \\"columns\\": [ { \\"key\\": \\"TRANSACTION_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()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN', } data = '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }' response = requests.put('https://api.mercadopago.com/v1/account/settlement_report/config', headers=headers, data=data) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' }; var dataString = '{ "file_name_prefix": "settlement-report-USER_ID", "show_fee_prevision": false, "show_chargeback_cancel": true, "coupon_detailed": true, "include_withdraw": true, "shipping_detail": true, "refund_detailed": true, "display_timezone": "GMT-04", "header_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": [ { "key": "TRANSACTION_DATE" }, { "key": "SOURCE_ID" }, { "key": "EXTERNAL_REFERENCE" } ] }'; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/config', method: 'PUT', headers: headers, body: dataString }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an \`HTTP 200 (Ok)\` status code will be issued. The API will respond with a JSON structure whose properties will represent the configuration you have updated. #### Response \`\`\`json { "file\_name\_prefix": "settlement-report-USER\_ID", "show\_fee\_prevision": false, "show\_chargeback\_cancel": true, "scheduled": false, "coupon\_detailed": true, "include\_withdraw": true, "shipping\_detail": true, "refund\_detailed": true, "display\_timezone": "GMT-04", "header\_language": "en", "frequency": { "hour": 0, "type": "monthly", "value": 1 }, "columns": \[ { "key": "TRANSACTION\_DATE" }, { "key": "SOURCE\_ID" }, { "key": "EXTERNAL\_REFERENCE" } \] } \`\`\` > NOTE > > Note > > Have the \[Glossary of the Account money report\](https://www.mercadopago.com.uy/developers/en/guides/additional-content/reports/account-money/glossary) on hand to review it when needed or want to review a technical term. ## Manually create report You have various resources at your disposal that will allow you to interact with your reports manually. ### Create report Make a POST request to the API to manually generate a new report within a specific date range: * [curl ](#editor%5F16) * [java ](#editor%5F18) * [node ](#editor%5F20) * [php ](#editor%5F17) * [python ](#editor%5F19) curl php java python node ``` curl -X POST \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report' \ -d '{ "begin_date": "2019-05-01T00:00:00Z", "end_date": "2019-06-01T00:00:00Z" }' ``` Copiar ``` 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Bearer ENV_ACCESS_TOKEN' ); $data ='{ "begin_date": "2019-05-01T00:00:00Z", "end_date": "2019-06-01T00:00:00Z" }'; $response = Requests::post("https://api.mercadopago.com/v1/account/settlement_report", $headers, $data); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN"); connection.setDoOutput(true); String body = "{\\"begin_date\\":\\"2019-05-01T00:00:00Z\\",\\"end_date\\": \\"2019-06-01T00:00:00Z\\"}"; 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()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' } data = '{ "begin_date": "2019-05-01T00:00:00Z", "end_date": "2019-06-01T00:00:00Z" }' response = requests.post('https://api.mercadopago.com/v1/account/settlement_report', headers=headers, data=data) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' }; var dataString = '{ "begin_date": "2019-05-01T00:00:00Z", "end_date": "2019-06-01T00:00:00Z" }'; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report', method: 'POST', headers: headers, body: dataString }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an HTTP status code of \`202 (Accepted)\` will be issued. After that, your report will be generated asynchronously. You will receive, as a response, a JSON structure with relevant information regarding your creation request. An HTTP status response of \`203 (Non-Authoritative Information)\` indicates that the request occurred as expected; however, it was not possible to create your report, and you will need to request it again with the dates indicated in the system. ### Query report Consult the API as follows to explore the list of reports you have generated: * [curl ](#editor%5F21) * [java ](#editor%5F23) * [node ](#editor%5F25) * [php ](#editor%5F22) * [python ](#editor%5F24) curl php java python node ``` curl -G \ -H 'accept: application/json' \ -d 'access_token=ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/list' ``` Copiar ``` 'application/json' ); $data = array( 'access_token' => 'ENV_ACCESS_TOKEN' ); $response = Requests::get('https://api.mercadopago.com/v1/account/settlement_report/list', $headers, $data); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report/list"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN"); connection.setRequestMethod("GET"); System.out.println(connection.getResponseCode()); System.out.println(connection.getResponseMessage()); System.out.println(connection.getInputStream()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'Authorization: Bearer ENV_ACCESS_TOKEN' } response = requests.get('https://api.mercadopago.com/v1/account/settlement_report/list', headers=headers) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json'}; var dataString = 'access_token=ENV_ACCESS_TOKEN'; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/list', method: 'GET', headers: headers, body: dataString }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an \`HTTP 200 (Ok)\` status code will be issued. The API will respond with a JSON Array in which you will find the list of all the reports it generated. #### Response \`\`\`json \[ { "id": 12345678, "user\_id": USER-ID, "begin\_date": "2015-05-01T00:00:00Z", "end\_date": "2015-06-01T23:59:59Z", "file\_name": "settlement-report-USER\_ID-2016-01-20-131015.csv", "created\_from": "manual", "date\_created": "2016-01-20T10:07:53.000-04:00" }, { ... } \] \`\`\` ### Download report Using the \`file\_name\` attribute, you can download any of your reports from the following URL: * [curl ](#editor%5F26) * [java ](#editor%5F28) * [node ](#editor%5F30) * [php ](#editor%5F27) * [python ](#editor%5F29) curl php java python node ``` curl -X GET \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/:file_name' ``` Copiar ``` 'application/json' ); $data = array( 'access_token' => 'ENV_ACCESS_TOKEN' ); $response = Requests::post('https://api.mercadopago.com/v1/account/settlement_report/:file_name', $headers, $data); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report/:file_name"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN"); connection.setRequestMethod("GET"); System.out.println(connection.getResponseCode()); System.out.println(connection.getResponseMessage()); System.out.println(connection.getInputStream()); ``` Copiar ``` import requests headers = { 'Authorization: Bearer ENV_ACCESS_TOKEN' } response = requests.get('https://api.mercadopago.com/v1/account/settlement_report/:file_name', headers=headers) ``` Copiar ``` var request = require('request'); var headers = { 'Authorization: Bearer ENV_ACCESS_TOKEN', }; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/:file_name' method: 'GET', headers: headers, }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an HTTP status code \`200 (Ok)\` will be issued. In the API response, you will have the requested report file available for download. #### Response \`\`\`csv EXTERNAL\_REFERENCE;SOURCE\_ID;USER\_ID;PAYMENT\_METHOD\_TYPE;PAYMENT\_METHOD;SITE;TRANSACTION\_TYPE;TRANSACTION\_AMOUNT;TRANSACTION\_CURRENCY;TRANSACTION\_DATE;FEE\_AMOUNT;SETTLEMENT\_NET\_AMOUNT;SETTLEMENT\_CURRENCY;SETTLEMENT\_DATE;REAL\_AMOUNT;COUPON\_AMOUNT;METADATA;MKP\_FEE\_AMOUNT;FINANCING\_FEE\_AMOUNT;SHIPPING\_FEE\_AMOUNT;TAXES\_AMOUNT;INSTALLMENTS;ORDER\_ID;SHIPPING\_ID;SHIPMENT\_MODE;PACK\_ID 2112818453;5067634447;123456789;account\_money;account\_money;MLB;SETTLEMENT;79.00;BRL;2019-08-11T22:20:19.000-04:00;-8.85;70.15;BRL;2019-08-11T22:20:19.000-04:00;70.15;0.00;\[{}\];-8.85;0.00;0.00;0.00;1;2112818453;28067695419;me1;2E+15 2112815686;5067535844;123456789;account\_money;account\_money;MLB;SETTLEMENT;819.00;BRL;2019-08-11T22:15:32.000-04:00;-91.73;727.27;BRL;2019-08-11T22:15:32.000-04:00;727.27;0.00;\[{}\];-91.73;0.00;0.00;0.00;1;2112815686;28067772278;me1;2E+15 2112811587;5067365727;123456789;account\_money;account\_money;MLB;SETTLEMENT;769.00;BRL;2019-08-11T22:11:13.000-04:00;-86.13;682.87;BRL;2019-08-11T22:11:13.000-04:00;682.87;0.00;\[{}\];-86.13;0.00;0.00;0.00;1;2112811587;28067612908;me1;2E+15 2112784039;5067781790;123456789;credit\_card;master;MLB;SETTLEMENT;199.00;BRL;2019-08-11T21:38:18.000-04:00;-22.29;176.71;BRL;2019-08-11T21:38:24.000-04:00;176.71;0.00;\[{}\];-22.29;0.00;0.00;0.00;1;2112784039;;; 2112755183;5067186172;123456789;credit\_card;master;MLB;SETTLEMENT;79.00;BRL;2019-08-11T21:10:20.000-04:00;-8.85;70.15;BRL;2019-08-11T21:10:27.000-04:00;70.15;0.00;\[{}\];-8.85;0.00;0.00;0.00;1;2112755183;;; 2112747018;5067323570;123456789;credit\_card;visa;MLB;SETTLEMENT;3109.00;BRL;2019-08-11T21:00:11.000-04:00;-348.21;2760.79;BRL;2019-08-11T21:00:18.000-04:00;2760.79;0.00;\[{}\];-348.21;0.00;0.00;0.00;12;2112747018;;; 2112742918;5067175589;123456789;account\_money;account\_money;MLB;SETTLEMENT;154.00;BRL;2019-08-11T20:57:05.000-04:00;-17.25;136.75;BRL;2019-08-11T20:57:05.000-04:00;136.75;0.00;\[{}\];-17.25;0.00;0.00;0.00;1;2112742918;28067593333;me1;2E+15 2112736997;5067585992;123456789;digital\_currency;consumer\_credits;MLB;SETTLEMENT;94.00;BRL;2019-08-11T20:51:12.000-04:00;-10.53;83.47;BRL;2019-08-11T20:51:18.000-04:00;83.47;0.00;\[{}\];-10.53;0.00;0.00;0.00;1;2112736997;;; 2112736008;5067314803;123456789;digital\_currency;consumer\_credits;MLB;SETTLEMENT;79.00;BRL;2019-08-11T20:48:08.000-04:00;-8.85;70.15;BRL;2019-08-11T20:48:15.000-04:00;70.15;0.00;\[{}\];-8.85;0.00;0.00;0.00;1;2112736008;;; 2112729919;5067463621;123456789;credit\_card;master;MLB;SETTLEMENT;79.00;BRL;2019-08-11T20:41:46.000-04:00;-8.85;70.15;BRL;2019-08-11T20:41:55.000-04:00;70.15;0.00;\[{}\];-8.85;0.00;0.00;0.00;1;2112729919;;; \`\`\` ## Schedule report automatically Create your reports on a scheduled basis by configuring two instances: activation and deactivation. ### Activate automatic generation Schedule the automatic generation of the report using the frequency assigned during the configuration of your reports. When using this service, the \`scheduled\` property of your configuration will be automatically updated to \`true\`: * [curl ](#editor%5F31) * [java ](#editor%5F33) * [node ](#editor%5F35) * [php ](#editor%5F32) * [python ](#editor%5F34) curl php java python node ``` curl -X POST \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/schedule' ``` Copiar ``` 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Bearer ENV_ACCESS_TOKEN' ); $response = Requests::post('https://api.mercadopago.com/v1/account/settlement_report/schedule', $headers); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report/schedule"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN"); System.out.println(connection.getResponseCode()); System.out.println(connection.getResponseMessage()); System.out.println(connection.getInputStream()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' } response = requests.post('https://api.mercadopago.com/v1/account/settlement_report/schedule', headers=headers) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' }; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/schedule', method: 'POST', headers: headers }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an HTTP status code \`200 (OK)\` will be issued. The API will respond with a JSON structure in which you will find information associated with the scheduled report. #### Response \`\`\`json { "id": 2541818, "user\_id": "USER-ID", "begin\_date": "2019-07-01T06:00:00Z", "end\_date": "2019-08-01T05:59:59Z", "created\_from": "schedule", "status": "pending", "report\_type": "settlement", "generation\_date": "2019-08-01T06:00:00.000Z", "last\_modified": "2019-07-24T13:45:33.479-04:00", "retries": 0 } \`\`\` ### Disable automatic generation You can disable the automatic generation of your reports at any time when needed. When using this service, the \`scheduled\` property in your configuration will be automatically updated to \`false\`. * [curl ](#editor%5F36) * [java ](#editor%5F38) * [node ](#editor%5F40) * [php ](#editor%5F37) * [python ](#editor%5F39) curl php java python node ``` curl -X DELETE \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ 'https://api.mercadopago.com/v1/account/settlement_report/schedule' ``` Copiar ``` 'application/json', 'content-type' => 'application/json', 'Authorization' => 'Bearer ENV_ACCESS_TOKEN' ); $response = Requests::delete('https://api.mercadopago.com/v1/account/settlement_report/schedule', $headers); ``` Copiar ``` URL url = new URL("https://api.mercadopago.com/v1/account/settlement_report/schedule"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("DELETE"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Authorization", "Bearer ENV_ACCESS_TOKEN"); System.out.println(connection.getResponseCode()); System.out.println(connection.getResponseMessage()); System.out.println(connection.getInputStream()); ``` Copiar ``` import requests headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' } response = requests.delete('https://api.mercadopago.com/v1/account/settlement_report/schedule', headers=headers) ``` Copiar ``` var request = require('request'); var headers = { 'accept': 'application/json', 'content-type': 'application/json', 'Authorization': 'Bearer ENV_ACCESS_TOKEN' }; var options = { url: 'https://api.mercadopago.com/v1/account/settlement_report/schedule', method: 'DELETE', headers: headers }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } } request(options, callback); ``` Copiar In the absence of errors, an HTTP status code \`200 (OK)\` will be issued. The API will respond with a JSON structure in which you will find information associated with the report you deactivated. #### Response \`\`\`json { "id": 2787882, "begin\_date": "2019-08-15T06:00:00Z", "created\_from": "schedule", "end\_date": "2019-08-16T05:59:59Z", "generation\_date": "2019-08-16T02:00:00.000-04:00", "last\_modified": "2019-08-15T15:41:53.681-04:00", "report\_type": "settlement", "retries": 0, "status": "deleted", "user\_id": USER\_ID } \`\`\`