# Reports
source: https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md

The End of Day (EOD) Reconciliation process is a crucial component of financial integrity, ensuring that all transactional data spanning payments, refunds, mandates, and settlements are accurately logged, reconciled, and balanced at the close of each business day. This document provides comprehensive guidance on executing EOD reconciliation using the Reports API.

The Reports API provides extensive data on all daily transactions, facilitating the accurate reconciliation of accounts, early fraud detection, and precise reporting for enhanced customer transparency. Integrators and Merchants receive detailed reconciliation data following each day's issuance of batch onward payments, helping to maintain operational accuracy and financial transparency.

## Overview {#overview}

This diagram shows an overview of the flow to generate and retrieve a report.
Diagram reports

## How It Works {#how-it-works}

Using the Reports API is an asynchronous process. This is because compiling large datasets can take some time.

1. **Authenticate with the API.** To use the API, you need to be authenticated with the service. You must use the **ob_reporting** scope in the request body when authenticating. Refer to [API Authentication](https://developer.mastercard.com/ob-accept-payments/documentation/api-basics/index.md) for detailed instructions.

2. **Create a new report.** Call the following endpoint to create a report.


   API Reference: `POST /reports`

   When you call this endpoint, the generation of the requested report begins in the background. A `reportId` is returned which you will use later
   to check the report status and retrieve the report.
   * `mimeType` is a mandatory field which determines the report format. Currently, the only `mimeType` supported is `application/json` and reports are returned in JSON format.

   * Use the `reportType` field to specify the type of report to create. There are four report types:

     * `Payments` includes payment details.
     * `Mandates` includes mandate details (may not be enabled on your account configuration).
     * `Refunds` includes refund details (may not be enabled on your account configuration).
     * `Settlement` generates a report that includes settlement payment details (only available if you are using Mastercard's Open Finance Settlement Service).   

   * You can filter a report so that only items matching the specified conditions are included:

     * You can filter by item status using the `statuses` field to pass an array of the statuses you are interested in - refer to [Report Item Statuses](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#report-item-statuses) for details.
     * You can filter with fields like `createdDateFrom` and `country`. The fields supported depend on the report type that you are generating. Refer to [Report Filters](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#report-filters) for the fields available for each report type.   

3. **Get a report status.** Call the following endpoint to fetch the status of the report generation by the `reportId`.


   API Reference: `GET /reports/{report_id}`

   Refer to [Report Generation Statuses](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#report-generation-statuses) for a description of the statuses that a report generation can be in. Once Reports are available in a READY status, they are available for seven days from the `createdDate`.
4. **Get the report items.** Call the following endpoint to fetch the items of a report by the `reportId`. The Report needs to be in a READY status before you can fetch the Report items.


   API Reference: `GET /reports/{report_id}/items`

   The report items are returned in the format defined in the `mimeType` in step 2. The items returned in the report vary based on the report type that has been generated and the filtering used by the Integrator when creating the report. Refer to the [API reference](https://developer.mastercard.com/ob-accept-payments/documentation/api-reference/index.md) for a full description of the items that can be returned for a report. Below we describe the key points to consider for each report type.
   * **Payments** -- the endpoint returns a collection of Payment objects that match the filters you defined. Inside each payment object, the details for a specific payment are returned.
   * **Mandates** -- the endpoint returns a collection of Mandate objects that match the filters you defined. Inside each Mandate object, the details for a specific mandate are returned.
   * **Refunds** -- the endpoint returns a collection of Refund objects that match the filters you defined. Inside each Refund object, the details for a specific refund are returned.
   * **Settlement** -- the endpoint returns:
     * A collection of Payment objects that match the filters you defined.
     * A collection of Refund objects that match the filters you defined.
     * A collection of External Transaction objects that match the filters you defined. ExternalTransactions are defined as transactions that happen outside of Mastercard Open Finance Pay on the Mastercard operated Settlement Account. An example of an external transaction would be a top-up payment made to the Mastercard operated Settlement Account.

## Report Filters {#report-filters}

When you call [Create report](https://developer.mastercard.com/ob-accept-payments/documentation/api-reference/index.md#createReport), you can filter the content of the report that is generated. The fields that can be used to filter a report depend on the report type.
Note: The date range between `createdDateFrom` and `createdDateTo` must not exceed 90 days.

* [Payments Report Filters](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#payments-report-filters)
* [Mandates Report Filters](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#mandates-report-filters)
* [Refunds Report Filters](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#refunds-report-filters)
* [Settlement Report Filters](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#settlement-report-filters)

### Payments Report Filters {#payments-report-filters}

|       **Field**       |                                                                                                                   **Description**                                                                                                                    |
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `createdDateFrom`     | Items in the generated report are from the date specified here or later.                                                                                                                                                                             |
| `createdDateTo`       | Items in the generated report are from the date specified here or earlier.                                                                                                                                                                           |
| `requestedDateFrom`   | The generated report includes items where the `requestedDate` is on or after the date specified here. The date is the date that was requested by the Integrator when creating a payment.                                                             |
| `lastUpdatedDateFrom` | The generated report includes items where the status was updated on or after the date specified here.                                                                                                                                                |
| `lastUpdatedDateTo`   | The generated report includes items where the status was updated on or before the date specified here.                                                                                                                                               |
| `country`             | Items in the generated report are from the country that is specified here.                                                                                                                                                                           |
| `statuses`            | Items in the generated report have statuses that match the statuses passed in here. You can pass in a list of several statuses that you want to be returned in the report. The statuses that are applicable to each report type are specified below. |

### Mandates Report Filters {#mandates-report-filters}

|     **Field**     |                                                                                                                   **Description**                                                                                                                    |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `createdDateFrom` | Items in the generated report are from the date specified here or later.                                                                                                                                                                             |
| `createdDateTo`   | Items in the generated report are from the date specified here or earlier.                                                                                                                                                                           |
| `country`         | Items in the generated report are from the country that is specified here.                                                                                                                                                                           |
| `statuses`        | Items in the generated report have statuses that match the statuses passed in here. You can pass in a list of several statuses that you want to be returned in the report. The statuses that are applicable to each report type are specified below. |

### Refunds Report Filters {#refunds-report-filters}

|     **Field**     |                                                                                                                   **Description**                                                                                                                    |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `createdDateFrom` | Items in the generated report are from the date specified here or later.                                                                                                                                                                             |
| `createdDateTo`   | Items in the generated report are from the date specified here or earlier.                                                                                                                                                                           |
| `country`         | Items in the generated report are from the country that is specified here.                                                                                                                                                                           |
| `statuses`        | Items in the generated report have statuses that match the statuses passed in here. You can pass in a list of several statuses that you want to be returned in the report. The statuses that are applicable to each report type are specified below. |

### Settlement Report Filters {#settlement-report-filters}

|          **Field**           |                              **Description**                               |
|------------------------------|----------------------------------------------------------------------------|
| `createdDateFrom`            | Items in the generated report are from the date specified here or later.   |
| `createdDateTo`              | Items in the generated report are from the date specified here or earlier. |
| `country`                    | Items in the generated report are from the country that is specified here. |
| `forwardSettlementReference` | Items in the generated report are related to this specific settlement.     |

## Report Item Statuses {#report-item-statuses}

When you call [Create report](https://developer.mastercard.com/ob-accept-payments/documentation/api-reference/index.md#createReport), you can filter by item status by passing a `statuses` array.

For example:

```json

"statuses": [
   "PAYMENT_EXECUTED_DEBITED",
   "PAYMENT_EXECUTED_CREDITED",
   "INITIATED"
]
```

The valid statuses for each report depend on the report type:

* [Payments Report Statuses](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#payments-report-statuses)
* [Refunds Report Statuses](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#refunds-report-statuses)
* [Mandates Report Statuses](https://developer.mastercard.com/ob-accept-payments/documentation/payments/reports/index.md#mandates-report-statuses)

### Payments Report Statuses {#payments-report-statuses}

|           **Status**            |                                                                                                         **Description**                                                                                                         |
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PREPARING`                     | The payment request details have been captured and the payment is ready to be authorized by the Payer.                                                                                                                          |
| `AUTHORIZING`                   | The Payer is going through the payment authorization journey.                                                                                                                                                                   |
| `PROVIDER_PROCESSING`           | The ASPSP received the payment request. We are awaiting confirmation that the payment has been initiated.                                                                                                                       |
| `PENDING`                       | The ASPSP placed the payment in a pending state. Further action from the Payer may be required.                                                                                                                                 |
| `INITIATED`                     | The ASPSP validated and accepted the payment request. The payment has been scheduled for the provided payment date, or as soon as possible.                                                                                     |
| `PAYMENT_EXECUTED_DEBITED`      | The payment has been settled and debited from the Payer's account.                                                                                                                                                              |
| `PAYMENT_EXECUTED_CREDITED`     | The payment has been settled and we received confirmation that it was credited to the Payee's account.                                                                                                                          |
| `CANCELLED`                     | The Payer either cancelled the payment at the authorization stage, did not proceed before the payment expired, or cancelled a scheduled future payment before it reached its execution date. The payment has not been executed. |
| `FAILED`                        | The payment failed. More information about the cause of the failure may be available in the details.code and details.reason fields of the status object.                                                                        |
| `UNKNOWN`                       | It is no longer possible to refresh the payment status at the ASPSP. For confirmation of payment execution, perform reconciliation against transactions in the destination account.                                             |
| `AUTHORIZATION_FLOW_INCOMPLETE` | The payment authorization URL expired, or the Payer left the payment authorization page. The payment authorization has not been completed.                                                                                      |

### Refunds Report Statuses {#refunds-report-statuses}

|         **Status**          |                                                                                       **Description**                                                                                       |
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PREPARING`                 | The refund request details have been captured and it is ready to be processed.                                                                                                              |
| `PENDING`                   | The refund is being processed by our settlement account provider.                                                                                                                           |
| `PAYMENT_EXECUTED_DEBITED`  | The payment has been settled and debited from the settlement account.                                                                                                                       |
| `PAYMENT_RAILS_AVAILABLE`   | The refund cannot be executed, but the source account is available. The source account details are provided as a set of payment rails so that the client can execute the refund themselves. |
| `PAYMENT_RAILS_UNAVAILABLE` | The refund cannot be executed and the source account cannot be obtained.                                                                                                                    |
| `CAPTURING_SOURCE_ACCOUNT`  | The source account used to make a payment was unavailable and a source account collection was started. The status will change once the source account collection succeeds or times out.     |
| `FAILED`                    | The refund failed. More information about the cause of the failure may be available in the details property within the code or reason.                                                      |

### Mandates Report Statuses {#mandates-report-statuses}

|           **Status**            |                                                                **Description**                                                                 |
|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `PREPARING`                     | The mandate was just created.                                                                                                                  |
| `AUTHORIZING`                   | The mandate has been created but is awaiting authorization.                                                                                    |
| `AUTHORIZED`                    | The mandate is authorized and ready to be used.                                                                                                |
| `CANCELLED`                     | The mandate was cancelled by the user before authorization finished.                                                                           |
| `INACTIVE`                      | The mandate is inactive, but not revoked. The mandate can reach this state if for example the end user is under KYC investigation.             |
| `FAILED`                        | The mandate is in a failed state.                                                                                                              |
| `REVOKED`                       | The mandate has been revoked by bank.                                                                                                          |
| `AUTHORIZATION_FLOW_INCOMPLETE` | The mandate authorization was not completed in time. After a certain time, we consider that the user abandoned the flow to create the mandate. |
| `EXPIRED`                       | Past the 'Valid To' date.                                                                                                                      |

## Report Generation Statuses {#report-generation-statuses}

The following table describes the possible statuses that a report generation can be in.

|  **Status**  |                                                                                                                                          **Description**                                                                                                                                           |
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PROCESSING` | The report is still being processed and is not yet ready. You should not call the [Get report items](https://developer.mastercard.com/ob-accept-payments/documentation/api-reference/index.md#getReportItems) endpoint while the report is in a PROCESSING state.                                  |
| `READY`      | The report generation is now complete and the report is ready to be consumed by your system. While a Report is in a READY state, you can proceed to call the [Get report items](https://developer.mastercard.com/ob-accept-payments/documentation/api-reference/index.md#getReportItems) endpoint. |
| `FAILED`     | Mastercard Open Finance Pay was unable to generate the report you requested. You should create a new report or reach out to our support team for more information.                                                                                                                                 |

