# MD for: https://www.mercadopago.com.uy/developers/es/docs/checkout-pro-orders/additional-content/reports/activities-reports/api.md \# Generate report via API The Other Operations reports API lets you define the file content and delivery channel, generate reports manually or schedule their automatic generation, and download them when they are available. Use your :toolTipComponent\[production Access Token\]{content="Private key of the application created in Mercado Pago and used in the \_backend\_. You can access it through \*Your integrations > Integration data > Production > Production credentials\*."} to send requests. The flow consists of the following steps: 1\. Configure the file columns and delivery notifiers. 2\. Generate the report manually, check its status, and download it when available. 3\. Schedule automatic generation if you need to receive the report periodically. 4\. Review the Webhook notification content and validate its signature. Remember that the report type you want to configure, generate, or schedule is defined through the \`reportId\` path parameter. The available values are: | \`reportId\` | Report type | Description | | --- | --- | --- | | \`activities\_collection\` | Collection report | Includes collections received through checkout, QR, Point, marketplace, and other channels. | | \`activities\_after\_collection\` | Post-collection report | Includes refunds, chargebacks, claims, and adjustments made after collection. | | \`activities\_withdraw\` | Withdrawal report | Includes fund withdrawals and transfers from the account. | ## 1\. Set up your reports The configuration determines which columns the file contains, how its data is displayed, and the channels used to notify you about or deliver the report. You must create a configuration for each report type, identified by \`reportId\`, before generating or scheduling files. :::AccordionComponent{title="Create a new configuration"} To create it, send a request to :TagComponent{tag="POST" text="/v1/reporting/operations/{reportId}/config" href="/developers/en/reference/reports/create-activity-report-configuration/post" color="green"} with the \`structure\` and \`notifiers\` objects. - In \`structure\`, assign a name to the configuration through \`name\` and define the file columns in \`columns\`. Each \`columns\` item must contain the \`key\` of a field supported by the report type. See the available values in \[Report fields\](https://www.mercadopago.com.uy/developers/en/docs/reports/activities-reports/report-fields). - In \`structure.file\_format\`, you can define the separators, date format, name, and prefix of the file. - In \`structure.display\_timezone\`, you can set the timezone used to display dates in the file. This value does not change the range later sent in \`filters.creation\_date.range\`. - In \`notifiers\`, include at least one channel to indicate that the report is available or deliver the generated file. Each \`notifiers\` item contains a \`type\`, which identifies the delivery channel, and a \`data\` object with the connection data required for that channel. | \`notifiers\[\].type\` value | Delivery channel | Fields to send in \`notifiers\[\].data\` | | --- | --- | --- | | \`webhook\` | Sends a notification to your URL. | \`url\`, \`key\` | | \`ftp\` | Delivers the file to an FTP or SFTP server using a password. | \`server\`, \`port\`, \`username\`, \`password\`, \`remote\_dir\` | | \`ftp\_pkey\` | Delivers the file to an SFTP server using an SSH private key. | \`server\`, \`port\`, \`username\`, \`private\_key\`, \`remote\_dir\` | | \`internal\_sftp\` | Delivers the file through Mercado Pago's internal SFTP channel. | Send \`data\` as an empty object; its attributes are managed internally. | In case of success, the response contains \`structure.id\`, which identifies the configuration, and \`notifiers\[\].id\`, which identifies each created notifier. Save these values: you will need them to update the configuration or schedule automatic generation. ::: :::AccordionComponent{title="Retrieve configurations"} To retrieve the active configuration for a report type, send a request to :TagComponent{tag="GET" text="/v1/reporting/operations/{reportId}/config" href="/developers/en/reference/reports/get-activity-report-configuration/get" color="accent"}. The response returns the structure, its associated notifiers, and their respective identifiers. ::: :::AccordionComponent{title="Update configurations"} To modify an existing configuration, use the \`structure.id\` value as \`structureId\` in :TagComponent{tag="PUT" text="/v1/reporting/operations/{reportId}/config/{structureId}" href="/developers/en/reference/reports/update-activity-report-configuration/put" color="orange"}. With this request, you can update the report name and columns, output-file settings, the timezone used to display dates, and delivery notifiers. ::: ## 2\. Generate report manually Generate a report for a specific period and download it when available. :::AccordionComponent{title="Create report"} To generate the report, send a request to :TagComponent{tag="POST" text="/v1/reporting/operations/{reportId}/statements" href="/developers/en/reference/reports/create-activity-report/post" color="green"}. With this request, you can define the report period, apply the filters supported by the selected type, and choose the file format. The period cannot exceed one year. curl curl ``` curl -X POST \ 'https://api.mercadopago.com/v1/reporting/operations/activities_collection/statements' \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"filters":{"creation_date":{"range":{"gte":"2026-03-01T00:00:00-03:00","lte":"2026-03-31T23:59:59-03:00"}}}}' ``` In case of success, the response returns \`record\_id\`. Use this value as \`uid\` to check the report status and download the file. ::: :::AccordionComponent{title="Retrieve report"} To check a report's status, use the \`record\_id\` obtained when creating it as \`uid\` in :TagComponent{tag="GET" text="/v1/reporting/operations/{reportId}/statements/{uid}" href="/developers/en/reference/reports/get-activity-report-status/get" color="accent"}. | Status | Description | | --- | --- | | \`pending\` | The report is being generated. | | \`available\` | The file is available for download. | | \`failed\` | The generation could not be completed. | | \`empty\` | No operations were found for the submitted range and filters. | You can also list generated reports through :TagComponent{tag="GET" text="/v1/reporting/operations/{reportId}/statements" href="/developers/en/reference/reports/consult-activity-reports-list/get" color="accent"} and filter the results by status, creation date, and origin. ::: :::AccordionComponent{title="Download report"} When the report has the \`available\` status, download it through :TagComponent{tag="GET" text="/v1/reporting/operations/{reportId}/statements/{uid}/download" href="/developers/en/reference/reports/download-activity-report/get" color="accent"}. Use the same \`uid\` from the status request and choose between CSV and XLSX. Larger files may be delivered compressed as \`.zip\`. ::: ## 3\. Schedule report automatically Create a schedule to generate the report automatically on a daily, weekly, or monthly basis. :::AccordionComponent{title="Enable automatic generation"} To enable automatic generation, send a request to :TagComponent{tag="POST" text="/v1/reporting/operations/{reportId}/schedule" href="/developers/en/reference/reports/enable-automatic-generation/post" color="green"}. With this request, you can define the generation frequency and time, specify the report configuration, and select its delivery notifiers. In case of success, the response returns \`id\`, which identifies the created schedule. Save this value to later disable it as \`scheduleId\`. ::: :::AccordionComponent{title="Disable automatic generation"} Use the schedule identifier as \`scheduleId\` in :TagComponent{tag="DELETE" text="/v1/reporting/operations/{reportId}/schedule/{scheduleId}" href="/developers/en/reference/reports/disable-automatic-generation/delete" color="red"}. Disabling it stops new reports from being generated, but previously created files remain available. ::: ## 4\. Notifications When the report is available, Mercado Pago sends a \`POST\` request to the URL defined in \`notifiers\[\].data.url\` for the \`webhook\` notifier. The body identifies the report and the available files. json json ``` { "report_id": "activities_collection", "statement_id": "6d17e034-6eb3-48fc-a6fa-461e886fa406", "status": "available", "files": [ { "type": "text/csv", "name": "activities_collection.csv", "size": 20480, "has_zip_version": false } ] } ``` Verify the notification signature with the secret sent in \`notifiers\[\].data.key\` and discard the event if it does not match.