---
title: Reports
url: amazon-pay-api-v2/reports.html
---

Reports allow you to retrieve consolidated data about Amazon Pay transactions and settlements. In addition to managing and downloading reports using Seller Central, Amazon Pay offers APIs to manage and retrieve your reports.
For a general overview, please visit the [Getting started with Reports](../amazon-pay-reports/getting-started.html) section of the guide.

<div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Sandbox support only exists for the Sandbox Settlement Report. All other report types are not available in sandbox.</div>

<script>
  function keySpecifics(){
    const keyQuery = "?environmentSpecificKeys=";
    const currentSetting = window.location.search?.split("?environmentSpecificKeys=")[1] ?? 'false';
    const newSetting = currentSetting === 'false' ? 'true' : 'false';
    window.location = window.location.origin + window.location.pathname + keyQuery + newSetting // +  window.location.hash (not included as it feels weird to jump down)
  }
</script>
<div style="display:none" class="environmentSpecificKeys">
  <div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> If your publicKeyId <b>_does not_</b> have an environment prefix (does not begin with 'SANDBOX' or 'LIVE') follow <a href='#' onclick='keySpecifics()' rel='noopener noreferrer'>these instructions</a> instead.</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
  <div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> If your publicKeyId has an environment prefix (for example: SANDBOX-AFVX7ULWSGBZ5535PCUQOY7B) follow <a href='#' onclick='keySpecifics()' rel='noopener noreferrer'>these instructions</a> instead.</div>
</div>


<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#ustab" data-toggle="tab">US</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#eutab" data-toggle="tab">EU / UK</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#jptab" data-toggle="tab">JP</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="ustab" markdown="block">   
<div markdown="block">
* **Get Reports** - GET https://pay-api.amazon.com/:version/reports
* **Get Report By Id** - GET https://pay-api.amazon.com/:version/reports/:reportdId
* **Create Report** - POST https://pay-api.amazon.com/:version/reports
* **Get Report Document** - GET https://pay-api.amazon.com/:version/report-documents/:reportDocumentId
* **Get Report Schedules** - GET https://pay-api.amazon.com/:version/report-schedules
* **Get Report Schedule By Id** - GET https://pay-api.amazon.com/:version/report-schedules
* **Create Report Schedule** - POST https://pay-api.amazon.com/:version/report-schedules
* **Cancel Report Schedule** - DELETE https://pay-api.amazon.com/:version/report-schedules/:reportScheduleId
* **Get Disbursements** - GET https://pay-api.amazon.com/:version/disbursements
</div>
</div>
  <div role="tabpanel" class="tab-pane" id="eutab" markdown="block">
<div markdown="block">
* **Get Reports** - GET https://pay-api.amazon.eu/:version/reports
* **Get Report By Id** - GET https://pay-api.amazon.eu/:version/reports/:reportdId
* **Create Report** - POST https://pay-api.amazon.eu/:version/reports
* **Get Report Document** - GET https://pay-api.amazon.eu/:version/report-documents/:reportDocumentId
* **Get Report Schedules** - GET https://pay-api.amazon.eu/:version/report-schedules
* **Get Report Schedule By Id** - GET https://pay-api.amazon.eu/:version/report-schedules
* **Create Report Schedule** - POST https://pay-api.amazon.eu/:version/report-schedules
* **Cancel Report Schedule** - DELETE https://pay-api.amazon.eu/:version/report-schedules/:reportScheduleId
* **Get Disbursements** - GET https://pay-api.amazon.eu/:version/disbursements
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jptab" markdown="block">
<div markdown="block">
* **Get Reports** - GET https://pay-api.amazon.jp/:version/reports
* **Get Report By Id** - GET https://pay-api.amazon.jp/:version/reports/:reportdId
* **Create Report** - POST https://pay-api.amazon.jp/:version/reports
* **Get Report Document** - GET https://pay-api.amazon.jp/:version/report-documents/:reportDocumentId
* **Get Report Schedules** - GET https://pay-api.amazon.jp/:version/report-schedules
* **Get Report Schedule By Id** - GET https://pay-api.amazon.jp/:version/report-schedules
* **Create Report Schedule** - POST https://pay-api.amazon.jp/:version/report-schedules
* **Cancel Report Schedule** - DELETE https://pay-api.amazon.jp/:version/report-schedules/:reportScheduleId
* **Get Disbursements** - GET https://pay-api.amazon.jp/:version/disbursements
</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#ustabNESK" data-toggle="tab">US</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#eutabNESK" data-toggle="tab">EU / UK</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#jptabNESK" data-toggle="tab">JP</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="ustabNESK" markdown="block">   
<div markdown="block">
* **Get Reports** - GET https://pay-api.amazon.com/:environment/:version/reports
* **Get Report By Id** - GET https://pay-api.amazon.com/:environment/:version/reports/:reportdId
* **Create Report** - POST https://pay-api.amazon.com/:environment/:version/reports
* **Get Report Document** - GET https://pay-api.amazon.com/:environment/:version/report-documents/:reportDocumentId
* **Get Report Schedules** - GET https://pay-api.amazon.com/:environment/:version/report-schedules
* **Get Report Schedule By Id** - GET https://pay-api.amazon.com/:environment/:version/report-schedules
* **Create Report Schedule** - POST https://pay-api.amazon.com/:environment/:version/report-schedules
* **Cancel Report Schedule** - DELETE https://pay-api.amazon.com/:environment/:version/report-schedules/:reportScheduleId
* **Get Disbursements** - GET https://pay-api.amazon.com/:environment/:version/disbursements
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="eutabNESK" markdown="block">
<div markdown="block">
* **Get Reports** - GET https://pay-api.amazon.eu/:environment/:version/reports
* **Get Report By Id** - GET https://pay-api.amazon.eu/:environment/:version/reports/:reportdId
* **Create Report** - POST https://pay-api.amazon.eu/:environment/:version/reports
* **Get Report Document** - GET https://pay-api.amazon.eu/:environment/:version/report-documents/:reportDocumentId
* **Get Report Schedules** - GET https://pay-api.amazon.eu/:environment/:version/report-schedules
* **Get Report Schedule By Id** - GET https://pay-api.amazon.eu/:environment/:version/report-schedules
* **Create Report Schedule** - POST https://pay-api.amazon.eu/:environment/:version/report-schedules
* **Cancel Report Schedule** - DELETE https://pay-api.amazon.eu/:environment/:version/report-schedules/:reportScheduleId
* **Get Disbursements** - GET https://pay-api.amazon.eu/:environment/:version/disbursements
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jptabNESK" markdown="block">
<div markdown="block">
* **Get Reports** - GET https://pay-api.amazon.jp/:environment/:version/reports
* **Get Report By Id** - GET https://pay-api.amazon.jp/:environment/:version/reports/:reportdId
* **Create Report** - POST https://pay-api.amazon.jp/:environment/:version/reports
* **Get Report Document** - GET https://pay-api.amazon.jp/:environment/:version/report-documents/:reportDocumentId
* **Get Report Schedules** - GET https://pay-api.amazon.jp/:environment/:version/report-schedules
* **Get Report Schedule By Id** - GET https://pay-api.amazon.jp/:environment/:version/report-schedules
* **Create Report Schedule** - POST https://pay-api.amazon.jp/:environment/:version/report-schedules
* **Cancel Report Schedule** - DELETE https://pay-api.amazon.jp/:environment/:version/report-schedules/:reportScheduleId
* **Get Disbursements** - GET https://pay-api.amazon.jp/:environment/:version/disbursements
</div>
  </div>
</div>
</div>

<!-- prettier-ignore-start -->
* TOC
{:toc}
{::options toc_levels="3" /}

***
<!-- prettier-ignore-end -->

### Object definitions and Enums

#### Get Reports Response

<table border="1">
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Parameter</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">reports<br /><br /> Type: list&lt;<a href="#report-object">Report</a>&gt;</td>
      <td markdown="span">A list of report objects matching the search criteria.</td>
    </tr>
    <tr>
      <td markdown="span">nextToken<br /><br /> Type: string</td>
      <td markdown="span">Returned when the number of results exceeds pageSize. To get the next page of results, call getReports with this token as the only parameter.</td>
    </tr>
  </tbody>
</table>

#### Report object

<table border="1">
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Parameter</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">reportId<br /><br /> Type: string</td>
      <td markdown="span">The report identifier.</td>
    </tr>
    <tr>
      <td markdown="span">reportType<br /><br /> Type: <a href="#enum-reporttypes">ReportTypes</a></td>
      <td markdown="span">The type of the report.</td>
    </tr>
      <tr><td markdown="span">startTime<br /><br /> Type: dateTime</td>
      <td markdown="span">Time **from** which the transactions are included in the report.</td>
    </tr>
    <tr>
      <td markdown="span">endTime<br /><br /> Type: dateTime</td>
      <td markdown="span">Time **to** which the transactions are included in the report.</td>
    </tr>
    <tr>
      <td markdown="span">createdTime<br /><br /> Type: dateTime</td>
      <td markdown="span">Time **at** which the request to create the report was received.</td>
    </tr>
    <tr>
      <td markdown="span">processingStatus<br /><br /> Type: <a href="#enum-processingstatus">ProcessingStatus</a></td>
      <td markdown="span">The processing status of the report.</td>
    </tr>
    <tr>
      <td markdown="span">processingStartTime<br /><br /> Type: dateTime</td>
      <td markdown="span">Time at which the request to create report was processed (started processing).</td>
    </tr>
    <tr>
      <td markdown="span">processingEndTime<br /><br /> Type: dateTime</td>
      <td markdown="span">Time at which the report request was completed and the report was generated.</td>
    </tr>
    <tr>
      <td markdown="span">reportDocumentId<br /><br /> Type: string</td>
      <td markdown="span">The report document identifier.</td>
    </tr>

  </tbody>
</table>

#### Report Document object

<table>
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Parameter</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">reportDocumentId<br /><br /> Type:string</td>
      <td markdown="span">The report document identifier.</td>
    </tr>
    <tr>
      <td markdown="span">url<br /><br /> Type:string</td>
      <td markdown="span">The url to download the report. Valid for 30 seconds.</td>
    </tr>
      <tr><td markdown="span">compressionAlgorithm<br /><br /> Type:string</td>
      <td markdown="span">Algorithm used to compress the report content. At this time always "N/A"</td>
    </tr>
    
  </tbody>
</table>

#### _Enum_: ProcessingStatus

<table border="1">
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Value</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
  <tr>
      <td markdown="span">IN_PROGRESS<br /><br /> Type: string</td>
      <td markdown="span">The report is being processed.</td>
    </tr>
    <tr>
      <td markdown="span">COMPLETED<br /><br /> Type: string</td>
      <td markdown="span">The report has completed processing.</td>
    </tr>
    <tr>
      <td markdown="span">FAILED<br /><br /> Type: string</td>
      <td markdown="span">The report was aborted due to a fatal error.</td>
    </tr>
    <tr>
      <td markdown="span">CANCELLED<br /><br /> Type: string</td>
      <td markdown="span">The report was cancelled. There are two ways a report can be cancelled: an explicit cancellation request before the report starts processing, or an automatic cancellation if there is no data to return.</td>
    </tr>
  </tbody>
</table>

#### _Enum_: ReportTypes

<table border="1">
  <colgroup>
    <col width="40%" />
    <col width="30%" />
    <col width="30%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Value</th>
      <th>Description</th>
      <th>Scheduling / Creation</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SETTLEMENT_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Amazon Pay Settlement Report.</td>
      <td markdown="span">Automatically created with each settlement. No scheduling or manual creation possible.</td>
    </tr>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Amazon Pay Settlement Report based on sandbox transactions.</td>
      <td markdown="span">No scheduling possible. Needs to be [manually created](../amazon-pay-reports/requesting-sandbox-settlement-reports.html).</td>
    </tr>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Transaction report listing all orders of a period.</td>
      <td markdown="span">Manual creation and scheduling possible. Not automatically scheduled.</td>
    </tr>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_BILLING_AGREEMENT_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Transaction report listing all recurring contracts of a period.</td>
      <td markdown="span">Manual creation and scheduling possible. Not automatically scheduled.</td>
    </tr>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_AUTHORIZATION_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Transaction report listing all payment authorizations of a period.</td>
      <td markdown="span">Manual creation and scheduling possible. Not automatically scheduled.</td>
    </tr>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_CAPTURE_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Transaction report listing all charges of a period.</td>
      <td markdown="span">__Note__: This report type is currently not available via API.</td>
    </tr>
    <tr>
      <td markdown="span">\_GET_FLAT_FILE_OFFAMAZONPAYMENTS_REFUND_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Transaction report listing all refunds of a period.</td>
      <td markdown="span">Manual creation and scheduling possible. Not automatically scheduled.</td>
    </tr>
        <tr>
      <td markdown="span">\_GET_CSV_CUSTOM_OFFAMAZONPAYMENTS_MULTI_CURRENCY_PAYMENTS_DATA\_<br /><br /> Type: string</td>
      <td markdown="span">Transaction report listing transaction amounts, presentment amounts, currency codes and applied currency conversion rates for your all orders of a period.</td>
      <td markdown="span">Manual creation and scheduling possible. Not automatically scheduled.</td>
    </tr>
  </tbody>
</table>

#### Get Report Schedules Response Object

<table border="1">
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Parameter</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">reportSchedules<br /><br /> Type: list&lt;<a href="#report-schedule-object">ReportSchedule</a>&gt;</td>
      <td markdown="span">A list of report schedule objects matching the search criteria.</td>
    </tr>
  </tbody>
</table>

#### Report Schedule Object

<table border="1">
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Parameter</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">reportScheduleId<br /><br /> Type: string</td>
      <td markdown="span">The report schedule identifier.</td>
    </tr>
    <tr>
      <td markdown="span">reportType<br /><br /> Type: <a href="#enum-reporttypes">ReportTypes</a></td>
      <td markdown="span">The type of the scheduled report.</td>
    </tr>
      <tr><td markdown="span">scheduleFrequency<br /><br /> Type: <a href="#enum-schedulefrequency">ScheduleFrequency</a></td>
      <td markdown="span">Frequency defining the interval between report creations.</td>
    </tr>
    <tr>
      <td markdown="span">nextReportCreationTime<br /><br /> Type: dateTime</td>
      <td markdown="span">Time when the next report will be created.</td>
    </tr>
  </tbody>
</table>

#### _Enum_: ScheduleFrequency

<table border="1">
  <colgroup>
    <col width="40%" />
    <col width="60%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>Value</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">PT5M<br /><br /> Type: string</td>
      <td markdown="span">Every 5 minutes.</td>
    </tr>
    <tr>
      <td markdown="span">PT15M<br /><br /> Type: string</td>
      <td markdown="span">Every 15 minutes.</td>
    </tr><tr>
      <td markdown="span">PT30M<br /><br /> Type: string</td>
      <td markdown="span">Every 30 minutes.</td>
    </tr>
    <tr>
      <td markdown="span">PT1H<br /><br /> Type: string</td>
      <td markdown="span">Every hour.</td>
    </tr>
    <tr>
      <td markdown="span">PT2H<br /><br /> Type: string</td>
      <td markdown="span">Every 2 hours.</td>
    </tr>
    <tr>
      <td markdown="span">PT4H<br /><br /> Type: string</td>
      <td markdown="span">Every 4 hours.</td>
    </tr>
    <tr>
      <td markdown="span">PT8H<br /><br /> Type: string</td>
      <td markdown="span">Every 8 hours.</td>
    </tr>
    <tr>
      <td markdown="span">PT12H<br /><br /> Type: string</td>
      <td markdown="span">Every 12 hours.</td>
    </tr>
    <tr>
      <td markdown="span">PT84H<br /><br /> Type: string</td>
      <td markdown="span">Every 84 hours.</td>
    </tr>
    <tr>
      <td markdown="span">P1D<br /><br /> Type: string</td>
      <td markdown="span">Every day.</td>
    </tr>
    <tr>
      <td markdown="span">P2D<br /><br /> Type: string</td>
      <td markdown="span">Every 2 days.</td>
    </tr>
    <tr>
      <td markdown="span">P3D<br /><br /> Type: string</td>
      <td markdown="span">Every 3 days.</td>
    </tr>
     <tr>
      <td markdown="span">P7D<br /><br /> Type: string</td>
      <td markdown="span">Every 7 days.</td>
    </tr>
     <tr>
      <td markdown="span">P14D<br /><br /> Type: string</td>
      <td markdown="span">Every 14 days.</td>
    </tr>
     <tr>
      <td markdown="span">P15D<br /><br /> Type: string</td>
      <td markdown="span">Every 15 days.</td>
    </tr>
     <tr>
      <td markdown="span">P18D<br /><br /> Type: string</td>
      <td markdown="span">Every 18 days.</td>
    </tr>
     <tr>
      <td markdown="span">P30D<br /><br /> Type: string</td>
      <td markdown="span">Every 30 days.</td>
    </tr>
  </tbody>
</table>

***

## Operations

### Get Reports

Returns report details for the reports that match the filters that you specify.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/reports"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/reports"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">reportTypes<br />(optional)<br /><br />Type: string (comma-separated list of <a href="../amazon-pay-api-v2/reports.md#enum-reporttypes">ReportTypes</a>)</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">List of types of reports requested.</td>
        </tr>
        <tr>
            <td markdown="span">processingStatuses<br />(optional)<br /><br />Type: string (comma-separated list of <a href="../amazon-pay-api-v2/reports.md#enum-processingstatus">ProcessingStatus</a>)</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">A list of processing statuses used to filter reports.</td>
        </tr>
        <tr>
            <td markdown="span">createdSince<br />(optional)<br /><br />Type: string (date-time ISO 8601)</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. Reports are retained for a maximum of 90 days.<br /><br />Default: *90 days*</td>
        </tr>
        <tr>
            <td markdown="span">createdUntil<br />(optional)<br /><br />Type: string (date-time ISO 8601)</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. Reports are retained for a maximum of 90 days.<br /><br />Default: *now*</td>
        </tr>
        <tr>
            <td markdown="span">pageSize<br />(optional)<br /><br />Type: number</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">The number of reports per page to return.<br />Minimum: *1*<br />Maximum: *100*<br /><br />Default: *10*</td>
        </tr>
        <tr>
            <td markdown="span">nextToken<br />(optional)<br /><br />Type: string</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">A string token returned in the response to your previous request. `nextToken` is returned when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the getReports operation and include this token as the only parameter. Specifying `nextToken` with any other parameters will cause the request to fail.</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReports" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReports" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReports" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReports" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReports">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem',
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReports();

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReports">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportsAPI()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        GetReportsRequest reportRequest = new GetReportsRequest();

        // send the request
        GetReportsResponse report = client.GetReports(reportRequest, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReports">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        response = webstoreClient.getReports();
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReports">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const testPayClient = new Client.WebStoreClient(config);

const response = testPayClient.getReports();

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReports-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReports-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReports-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReports-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReports-NESK">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem',
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReports();

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReports-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportsAPI()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        GetReportsRequest reportRequest = new GetReportsRequest();

        // send the request
        GetReportsResponse report = client.GetReports(reportRequest, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReports-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        response = webstoreClient.getReports();
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReports-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const testPayClient = new Client.WebStoreClient(config);

const response = testPayClient.getReports();

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

```
{
     "reports": [{
        "reportId": "A08439021T39K6DTX4JS8",
        "reportType": "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SETTLEMENT_DATA_",
        "startTime":"20221118T150630Z",
        "endTime":"20221202T150350Z",
        "createdTime":"20221207T170826Z",
        "processingStatus": "COMPLETED",
        "processingStartTime":"20221207T170826Z",
        "processingEndTime":"20221207T170826Z",
        "reportDocumentId": "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32"
     }]
}
```


***

### Get Report By Id

Returns report details for the given `reportId`.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/reports/:reportId"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/reports/:reportId"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">reportId<br />**(required)**<br /><br />Type: string</td>
            <td markdown="span">Path Parameter</td>
            <td markdown="span">Report identifier</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportById" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportById" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportById" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportById" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportById">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportId = "A08439021T39K6DTX4JS8";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportById($reportId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportById">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportById()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportId = "A08439021T39K6DTX4JS8";

        // send the request
        Report report = client.GetReportById(reportId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportById">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
       
        AmazonPayResponse response = null;
        String reportId = "A08439021T39K6DTX4JS8";

        response = webstoreClient.getReportById(reportId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportById">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportId = 'A08439021T39K6DTX4JS8';
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportById(reportId);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportById-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportById-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportById-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportById-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportById-NESK">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportId = "A08439021T39K6DTX4JS8";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportById($reportId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportById-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportById()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportId = "A08439021T39K6DTX4JS8";

        // send the request
        Report report = client.GetReportById(reportId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportById-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
       
        AmazonPayResponse response = null;
        String reportId = "A08439021T39K6DTX4JS8";

        response = webstoreClient.getReportById(reportId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportById-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportId = 'A08439021T39K6DTX4JS8';
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportById(reportId);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>

</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

```
{
      "reportId": "A08439021T39K6DTX4JS8",
      "reportType": "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SETTLEMENT_DATA_",
      "startTime":"20221118T150630Z",
      "endTime":"20221202T150350Z",
      "createdTime":"20221207T170826Z",
      "processingStatus": "COMPLETED",
      "processingStartTime":"20221207T170826Z",
      "processingEndTime":"20221207T170826Z",
      "reportDocumentId": "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32"
}
```


***

### Create Report

Submits a request to generate a report based on the `reportType` and date range specified.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/reports"<br />
-X POST <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
-d @request_body<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/reports"<br />
-X POST <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
-d @request_body<br />
</code>

</div>

#### Request body

```
{
    "reportType": "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_",
    "startTime": "2022-08-04T00-00-00Z",
    "endTime": "2022-08-04T23-59-59Z"
}
```

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
         <tr>
            <td markdown="span">reportType<br />(required)<br /><br />Type: <a href="../amazon-pay-api-v2/reports.md#enum-reporttypes">ReportType</a></td>
            <td markdown="span">Body</td>
            <td markdown="span">Type of report to be created.</td>
        </tr>
        <tr>
            <td markdown="span">startTime<br />(required)<br /><br />Type: string (date-time ISO 8601)</td>
            <td markdown="span">Body</td>
            <td markdown="span">Time **from** which the transactions are included in the report.</td>
        </tr>
        <tr>
            <td markdown="span">endTime<br />(required)<br /><br />Type: string (date-time ISO 8601)</td>
            <td markdown="span">Body</td>
            <td markdown="span">Time **until** which the transactions are included in the report.</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-createReport" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-createReport" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-createReport" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-createReport" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-createReport">   
<div markdown="block">
```
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    $headers = array('x-amz-pay-Idempotency-Key' => uniqid());

    try {
        $requestPayload = array(
            'reportType' => '_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_',
            'startTime' => '20220804T000000Z',
            'endTime' => '20220804T235959Z'
        );

        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->createReport($requestPayload);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-createReport">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Reports;
using Amazon.Pay.API.WebStore.Types;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void CreateReport()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        CreateReportRequest requestPayload = new CreateReportRequest(
            reportType: ReportTypes._GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_,
            startTime: "20220804T000000Z", // Can also use DateTime.Now or any DateTime object value
            endTime: "20220804T235959Z" // Can also use DateTime.Now or any DateTime object value
        );

        // send the request
        CreateReportResponse report = client.CreateReport(requestPayload, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-createReport">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

import org.json.JSONObject;

// for generating an idempotency key
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        JSONObject requestPayload = new JSONObject();
        requestPayload.put("reportType", "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_");
        requestPayload.put("startTime", "20220804T000000Z");
        requestPayload.put("endTime", "20220804T235959Z");
        
        Map<String, String> header = new HashMap<String, String>();
        header.put("x-amz-pay-idempotency-key", UUID.randomUUID().toString().replace("-", ""));

        response = webstoreClient.createReport(requestPayload, header);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-createReport">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const requestPayload = {
    reportType: "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_",
    startTime: "20220804T000000Z",
    endTime: "20220804T235959Z"
}

const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.createReport(requestPayload);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-createReport-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-createReport-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-createReport-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-createReport-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-createReport-NESK">   
<div markdown="block">
```
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    $headers = array('x-amz-pay-Idempotency-Key' => uniqid());

    try {
        $requestPayload = array(
            'reportType' => '_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_',
            'startTime' => '20220804T000000Z',
            'endTime' => '20220804T235959Z'
        );

        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->createReport($requestPayload);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-createReport-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Reports;
using Amazon.Pay.API.WebStore.Types;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void CreateReport()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        CreateReportRequest requestPayload = new CreateReportRequest(
            reportType: ReportTypes._GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_,
            startTime: "20220804T000000Z", // Can also use DateTime.Now or any DateTime object value
            endTime: "20220804T235959Z" // Can also use DateTime.Now or any DateTime object value
        );

        // send the request
        CreateReportResponse report = client.CreateReport(requestPayload, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-createReport-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

import org.json.JSONObject;

// for generating an idempotency key
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        JSONObject requestPayload = new JSONObject();
        requestPayload.put("reportType", "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_");
        requestPayload.put("startTime", "20220804T000000Z");
        requestPayload.put("endTime", "20220804T235959Z");
        
        Map<String, String> header = new HashMap<String, String>();
        header.put("x-amz-pay-idempotency-key", UUID.randomUUID().toString().replace("-", ""));

        response = webstoreClient.createReport(requestPayload, header);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-createReport-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const requestPayload = {
    reportType: "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_",
    startTime: "20220804T000000Z",
    endTime: "20220804T235959Z"
}

const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.createReport(requestPayload);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-201-created" target="_blank" rel="noopener noreferrer">HTTP 201 status response code</a> if the operation was successful.

```
{
     "reportId": "A08439021T39K6DTX4JS8",
}
```


***

### Get Report Document

Returns the pre-signed S3 URL for the report. The report can be downloaded using this URL.

<div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Reports may contain sensitive information. We recommend treating the ``url`` with the same precautions as you treat sensitive data itself.</div>

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-documents/:reportDocumentId"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-documents/:reportDocumentId"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">reportDocumentId<br />**(required)**<br /><br />Type: string</td>
            <td markdown="span">Path Parameter</td>
            <td markdown="span">Report Document identifier</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportDocument" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportDocument" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportDocument" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportDocument" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportDocument">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportDocumentId = "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportDocument($reportDocumentId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportDocument">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportDocument()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportDocumentId = "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32";

        // send the request
        GetReportDocumentResponse report = client.GetReportDocument(reportDocumentId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportDocument">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;
        String reportDocumentId = "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32";

        response = webstoreClient.getReportDocument(reportDocumentId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportDocument">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportDocumentId = 'amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32';
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportDocument(reportDocumentId);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportDocument-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportDocument-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportDocument-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportDocument-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportDocument-NESK">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportDocumentId = "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportDocument($reportDocumentId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportDocument-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportDocument()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportDocumentId = "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32";

        // send the request
        GetReportDocumentResponse report = client.GetReportDocument(reportDocumentId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportDocument-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;
        String reportDocumentId = "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32";

        response = webstoreClient.getReportDocument(reportDocumentId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportDocument-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportDocumentId = 'amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32';
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportDocument(reportDocumentId);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

```
{
      "reportDocumentId" : "amzn1.tortuga.3.45ee712dc-3512-6cbd-ad71-ab3cb4cffef7.T3FKJJI01Y1E32",
      "url" : ""https://tortuga-[...].amazonaws.com/<reportDocumentId>?X-Amz-Algorithm=...&X-Amz-Signature=...",
      "compressionAlgorithm" : "N/A"
}
```


***

### Get Report Schedules

Returns report schedule details that match the filters criteria specified.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">reportTypes<br />(optional)<br /><br />Type: string (comma-separated list of <a href="../amazon-pay-api-v2/reports.md#enum-reporttypes">ReportType</a>)</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">List of report types</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportSchedules" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportSchedules" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportSchedules" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportSchedules" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportSchedules">   
<div markdown="block">
```
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportSchedules();

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportSchedules">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportSchedules()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        GetReportSchedulesRequest reportTypes = new GetReportSchedulesRequest();

        // send the request
        GetReportScheduleResponse report = client.GetReportSchedules(reportTypes, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportSchedules">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        response = webstoreClient.getReportSchedules();
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportSchedules">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportSchedules();

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportSchedules-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportSchedules-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportSchedules-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportSchedules-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportSchedules-NESK">   
<div markdown="block">
```
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportSchedules();

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportSchedules-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportSchedules()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        GetReportSchedulesRequest reportTypes = new GetReportSchedulesRequest();

        // send the request
        GetReportScheduleResponse report = client.GetReportSchedules(reportTypes, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportSchedules-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        response = webstoreClient.getReportSchedules();
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportSchedules-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportSchedules();

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

```
{
      "reportSchedules": [
            {
                  "reportScheduleId" : "68973459224",
                  "reportType" : "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_",
                  "scheduleFrequency" : "P1D",
                  "nextReportCreationTime": "20221118T150630Z"
            }
      ]
}
```


***

### Get Report Schedule By ID

Returns the report schedule details that match the given ID.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">reportScheduleId<br />(required)<br /><br />Type: string</td>
            <td markdown="span">Path Parameter</td>
            <td markdown="span">Id of the report schedule</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportScheduleById" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportScheduleById" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportScheduleById" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportScheduleById" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportScheduleById">   
<div markdown="block">
```
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportScheduleId = "68973459224";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportScheduleById($reportScheduleId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportScheduleById">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportScheduleById()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportScheduleId = "68973459224";

        // send the request
        ReportSchedule report = client.GetReportScheduleById(reportScheduleId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportScheduleById">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;
        String reportScheduleId = "68973459224";
        
        response = webstoreClient.getReportScheduleById(reportScheduleId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportScheduleById">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportScheduleId = '68973459224';
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportScheduleById(reportScheduleId);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getReportScheduleById-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getReportScheduleById-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getReportScheduleById-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getReportScheduleById-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getReportScheduleById-NESK">   
<div markdown="block">
```
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportScheduleId = "68973459224";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getReportScheduleById($reportScheduleId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getReportScheduleById-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetReportScheduleById()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportScheduleId = "68973459224";

        // send the request
        ReportSchedule report = client.GetReportScheduleById(reportScheduleId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getReportScheduleById-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;
        String reportScheduleId = "68973459224";
        
        response = webstoreClient.getReportScheduleById(reportScheduleId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getReportScheduleById-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportScheduleId = '68973459224';
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getReportScheduleById(reportScheduleId);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

```

{
      "reportScheduleId" : "68973459224",
      "reportType" : "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_",
      "scheduleFrequency" : "P1D",
      "nextReportCreationTime": "20221118T150630Z"
}

```


***

### Create Report Schedule

Creates a report schedule for the given `reportType`. Only one schedule per report type allowed.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules"<br />
-X POST <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
-d @request_body<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules"<br />
-X POST <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
-d @request_body<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">deleteExistingSchedule<br />(optional)<br /><br />Type: boolean</td>
            <td markdown="span">Query Parameter</td>
            <td markdown="span">If `true` deletes an existing report schedule for the given report type. The API returns an array, if a schedule for the given report type already exists and set to `false`.
            <br /><br />Default: `false`</td>
        </tr>
        <tr>
            <td markdown="span">reportType<br />(required)<br /><br />Type: <a href="../amazon-pay-api-v2/reports.md#enum-reporttypes">ReportType</a></td>
            <td markdown="span">Body</td>
            <td markdown="span">Type of the report for the schedule</td>
        </tr>
        <tr>
            <td markdown="span">scheduleFrequency<br />(required)<br /><br />Type: <a href="../amazon-pay-api-v2/reports.md#enum-schedulefrequency">ScheduleFrequency</a></td>
            <td markdown="span">Body</td>
            <td markdown="span">Frequency in which the report shall be created.</td>
        </tr>
        <tr>
            <td markdown="span">nextReportCreationTime<br />(required)<br /><br />Type: string (date-time ISO 8601)</td>
            <td markdown="span">Body</td>
            <td markdown="span">ISO 8601 time defining the next report creation time</td>
        </tr>
    </tbody>
</table>


#### Request body

```
{
    "reportType": "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_",
    "scheduleFrequency": "P1D",
    "nextReportCreationTime": "2022-08-06T23-59-59Z"
}
```


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-createReportSchedule" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-createReportSchedule" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-createReportSchedule" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-createReportSchedule" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-createReportSchedule">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    $headers = array('x-amz-pay-Idempotency-Key' => uniqid());

    try {
        
        $requestPayload = array(
            'reportType' => '_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_',
            'scheduleFrequency' => 'P1D',
            'nextReportCreationTime' => '20220806T235959Z'
        );
        
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->createReportSchedule($requestPayload);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-createReportSchedule">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Reports;
using Amazon.Pay.API.WebStore.Types;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void CreateReportSchedule()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        CreateReportScheduleRequest requestPayload = new CreateReportScheduleRequest(
            reportType: ReportTypes._GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_,
            scheduleFrequency: ScheduleFrequency.P1D,
            nextReportCreationTime: "20220806T235959Z", // Can also use DateTime.Now or any DateTime object value
        );

        // send the request
        CreateReportScheduleResponse report = client.CreateReportSchedule(requestPayload, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-createReportSchedule">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

import org.json.JSONObject;

// for generating an idempotency key
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        JSONObject requestPayload = new JSONObject();
        requestPayload.put("reportType", "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_");
        requestPayload.put("scheduleFrequency", "P14D");
        requestPayload.put("nextReportCreationTime", "20220806T235959Z");
        
        Map<String, String> header = new HashMap<String, String>();
        header.put("x-amz-pay-idempotency-key", UUID.randomUUID().toString().replace("-", ""));

        response = webstoreClient.createReportSchedule(requestPayload, header);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-createReportSchedule">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const requestPayload = {
    reportType: "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_",
    scheduleFrequency: "P1D",
    nextReportCreationTime: "20220806T235959Z"
}
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.createReportSchedule(requestPayload);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-createReportSchedule-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-createReportSchedule-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-createReportSchedule-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-createReportSchedule-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-createReportSchedule-NESK">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    $headers = array('x-amz-pay-Idempotency-Key' => uniqid());

    try {
        
        $requestPayload = array(
            'reportType' => '_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_',
            'scheduleFrequency' => 'P1D',
            'nextReportCreationTime' => '20220806T235959Z'
        );
        
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->createReportSchedule($requestPayload);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-createReportSchedule-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Reports;
using Amazon.Pay.API.WebStore.Types;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void CreateReportSchedule()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        CreateReportScheduleRequest requestPayload = new CreateReportScheduleRequest(
            reportType: ReportTypes._GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_,
            scheduleFrequency: ScheduleFrequency.P1D,
            nextReportCreationTime: "20220806T235959Z", // Can also use DateTime.Now or any DateTime object value
        );

        // send the request
        CreateReportScheduleResponse report = client.CreateReportSchedule(requestPayload, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-createReportSchedule-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

import org.json.JSONObject;

// for generating an idempotency key
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        JSONObject requestPayload = new JSONObject();
        requestPayload.put("reportType", "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_");
        requestPayload.put("scheduleFrequency", "P14D");
        requestPayload.put("nextReportCreationTime", "20220806T235959Z");
        
        Map<String, String> header = new HashMap<String, String>();
        header.put("x-amz-pay-idempotency-key", UUID.randomUUID().toString().replace("-", ""));

        response = webstoreClient.createReportSchedule(requestPayload, header);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-createReportSchedule-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const requestPayload = {
    reportType: "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_",
    scheduleFrequency: "P1D",
    nextReportCreationTime: "20220806T235959Z"
}
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.createReportSchedule(requestPayload);

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-201-created" target="_blank" rel="noopener noreferrer">HTTP 201 status response code</a> if the operation was successful.

```
{
     "reportScheduleId": "68973459224",
}
```


***

### Cancel Report Schedule

Cancels the report schedule with the given `reportScheduleId`.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId" \<br />
-X DELETE<br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId" \<br />
-X DELETE<br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>

</div>

#### Request parameters

<table border="1">
    <colgroup>
        <col width="30%" />
        <col width="20%" />
        <col width="50%" />
    </colgroup>
    <thead>
        <tr class="header">
            <th>Name</th>
            <th>Location</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td markdown="span">reportScheduleId<br />**(required)**<br /><br />Type: string</td>
            <td markdown="span">Path Parameter</td>
            <td markdown="span">Report schedule identifier</td>
        </tr>
    </tbody>
</table>


#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-cancelReportSchedule" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-cancelReportSchedule" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-cancelReportSchedule" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-cancelReportSchedule" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-cancelReportSchedule">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportScheduleId = "68973459224";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->cancelReportSchedule($reportScheduleId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-cancelReportSchedule">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void CancelReportSchedule()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportScheduleId = "68973459224";

        // send the request
        CancelReportScheduleResponse report = client.CancelReportSchedule(reportScheduleId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-cancelReportSchedule">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

import org.json.JSONObject;

// for generating an idempotency key
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        String reportScheduleId = "68973459224";

        response = webstoreClient.cancelReportSchedule(reportScheduleId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-cancelReportSchedule">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportScheduleId = "68973459224";
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.cancelReportSchedule(reportScheduleId);
    
response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-cancelReportSchedule-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-cancelReportSchedule-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-cancelReportSchedule-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-cancelReportSchedule-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-cancelReportSchedule-NESK">   
<div markdown="block">
```    
<?php
    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => false,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );

    try {
        $reportScheduleId = "68973459224";
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->cancelReportSchedule($reportScheduleId);

        if ($result['status'] === 200) {
            // success
            $response = $result['response'];
            echo $response;
        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'] . "\n";
        }
    } catch (\Exception $e) {
            // handle the exception
            echo $e . "\n";
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-cancelReportSchedule-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.Reports;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Live,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void CancelReportSchedule()
    {
        // init Headers
        var myHeaderKey = "x-amz-pay-idempotency-key";
        var myHeaderValue = Guid.NewGuid().ToString();
        var headers = new Dictionary<string, string> { { myHeaderKey, myHeaderValue } };

        // init Request Payload
        string reportScheduleId = "68973459224";

        // send the request
        CancelReportScheduleResponse report = client.CancelReportSchedule(reportScheduleId, headers);

        // check if API call was successful
        if (!report.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        Console.WriteLine(report.RawResponse);
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-cancelReportSchedule-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

import org.json.JSONObject;

// for generating an idempotency key
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY")
            .setEnvironment(Environment.LIVE)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = null;

        String reportScheduleId = "68973459224";

        response = webstoreClient.cancelReportSchedule(reportScheduleId);
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-cancelReportSchedule-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: false,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    

const reportScheduleId = "68973459224";
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.cancelReportSchedule(reportScheduleId);
    
response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

***

### Get Disbursements

Submits a request to receive disbursement details based on a date range of the settlement date specified in the request.

#### Request

<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/live/:version/disbursements"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
</code>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/:environment/:version/disbursements"<br />
-X GET <br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"<br />
</code>
</div>

#### Query Parameters

```
{
    "startTime": "2022-08-04T00-00-00Z",
    "endTime": "2022-08-04T23-59-59Z",
    "pageSize": "30",
    "nextToken": ""
}
```

#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 status response code</a> if the operation was successful.

```
{
     "disbursements": [{
        "sellerId": "A084390EXAMPLE",
        "settlementId": "68973459224",
        "amazonDisbursementReferenceId":"The Identifier used on your bank statement",
        "amount":"1000.50",
        "currencyCode":"USD",
        "transactionTime":"2022-12-07T17:08:26.717Z"
     }]
}
```


***

### Error codes

Generic errors can be found <a href="../amazon-pay-api-v2/error-handling.md" target="_blank" rel="noopener noreferrer">here</a>.

<table border="1">
  <colgroup>
    <col width="30%" />
    <col width="70%" />
  </colgroup>
  <thead>
    <tr class="header">
      <th>HTTP status code</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td markdown="span">400 BAD_REQUEST</td>
      <td markdown="span">Request has missing or invalid parameters and cannot be parsed.</td>
    </tr>
    <tr>
      <td markdown="span">403 FORBIDDEN </td>
      <td markdown="span">Indicates access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.</td>
    </tr>
    <tr>
      <td markdown="span">404 NOT_FOUND</td>
      <td markdown="span">The specified resource does not exist.</td>
    </tr>
    <tr>
      <td markdown="span">429 TOO_MANY_REQUESTS</td>
      <td markdown="span">The frequency of requests was greater than allowed.</td>
    </tr>
    <tr>
      <td markdown="span">500 INTERNAL_SERVER_ERROR</td>
      <td markdown="span">An unexpected condition occurred that prevented the server from fulfilling the request.</td>
    </tr>
  </tbody>
</table>
