---
title: Managing report schedules
url: amazon-pay-reports/managing-report-schedules.html
---

The `Report Schedule` APIs allow you to query, create or delete report schedules. Report Schedules allow you to request reports to be automatically created for you.  
Use the `Get Report Schedules` API to list all your current report schedules, the `Get Report Schedule By Id` API to get details of an individual Report Schedule. The `Create Report Schedule` and `Cancel Report Schedule` APIs allow you to create or cancel report schedules.

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

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

### 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 report schedule details for 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 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.

```
{
      "reportSchedules": [
            {
                  "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.

***
