Reports
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 section of the guide.
Note: Sandbox support only exists for the Sandbox Settlement Report. All other report types are not available in sandbox.
Note: If your publicKeyId
does not have an environment prefix (does not begin with 'SANDBOX' or 'LIVE') follow
these instructions instead.
Note: If your publicKeyId has an environment prefix (for example: SANDBOX-AFVX7ULWSGBZ5535PCUQOY7B) follow
these instructions instead.
- 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
- 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
- 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
- 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
- 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
- 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
Object definitions and Enums
Get Reports Response
reports
Type: list<Report> |
A list of report objects matching the search criteria. |
nextToken
Type: string |
Returned when the number of results exceeds pageSize. To get the next page of results, call getReports with this token as the only parameter. |
Report object
reportId
Type: string |
The report identifier. |
reportType
Type: ReportTypes |
The type of the report. |
startTime
Type: dateTime |
Time from which the transactions are included in the report. |
endTime
Type: dateTime |
Time to which the transactions are included in the report. |
createdTime
Type: dateTime |
Time at which the request to create the report was received. |
processingStatus
Type: ProcessingStatus |
The processing status of the report. |
processingStartTime
Type: dateTime |
Time at which the request to create report was processed (started processing). |
processingEndTime
Type: dateTime |
Time at which the report request was completed and the report was generated. |
reportDocumentId
Type: string |
The report document identifier. |
Report Document object
reportDocumentId
Type:string |
The report document identifier. |
url
Type:string |
The url to download the report. Valid for 30 seconds. |
compressionAlgorithm
Type:string |
Algorithm used to compress the report content. At this time always "N/A" |
Enum: ProcessingStatus
IN_PROGRESS
Type: string |
The report is being processed. |
COMPLETED
Type: string |
The report has completed processing. |
FAILED
Type: string |
The report was aborted due to a fatal error. |
CANCELLED
Type: string |
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. |
Enum: ReportTypes
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SETTLEMENT_DATA_
Type: string |
Amazon Pay Settlement Report. |
Automatically created with each settlement. No scheduling or manual creation possible. |
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_
Type: string |
Amazon Pay Settlement Report based on sandbox transactions. |
No scheduling possible. Needs to be manually created. |
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_
Type: string |
Transaction report listing all orders of a period. |
Manual creation and scheduling possible. Not automatically scheduled. |
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_BILLING_AGREEMENT_DATA_
Type: string |
Transaction report listing all recurring contracts of a period. |
Manual creation and scheduling possible. Not automatically scheduled. |
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_AUTHORIZATION_DATA_
Type: string |
Transaction report listing all payment authorizations of a period. |
Manual creation and scheduling possible. Not automatically scheduled. |
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_CAPTURE_DATA_
Type: string |
Transaction report listing all charges of a period. |
Note: This report type is currently not available via API. |
_GET_FLAT_FILE_OFFAMAZONPAYMENTS_REFUND_DATA_
Type: string |
Transaction report listing all refunds of a period. |
Manual creation and scheduling possible. Not automatically scheduled. |
_GET_CSV_CUSTOM_OFFAMAZONPAYMENTS_MULTI_CURRENCY_PAYMENTS_DATA_
Type: string |
Transaction report listing transaction amounts, presentment amounts, currency codes and applied currency conversion rates for your all orders of a period. |
Manual creation and scheduling possible. Not automatically scheduled. |
Get Report Schedules Response Object
reportSchedules
Type: list<ReportSchedule> |
A list of report schedule objects matching the search criteria. |
Report Schedule Object
reportScheduleId
Type: string |
The report schedule identifier. |
reportType
Type: ReportTypes |
The type of the scheduled report. |
scheduleFrequency
Type: ScheduleFrequency |
Frequency defining the interval between report creations. |
nextReportCreationTime
Type: dateTime |
Time when the next report will be created. |
Enum: ScheduleFrequency
PT5M
Type: string |
Every 5 minutes. |
PT15M
Type: string |
Every 15 minutes. |
PT30M
Type: string |
Every 30 minutes. |
PT1H
Type: string |
Every hour. |
PT2H
Type: string |
Every 2 hours. |
PT4H
Type: string |
Every 4 hours. |
PT8H
Type: string |
Every 8 hours. |
PT12H
Type: string |
Every 12 hours. |
PT84H
Type: string |
Every 84 hours. |
P1D
Type: string |
Every day. |
P2D
Type: string |
Every 2 days. |
P3D
Type: string |
Every 3 days. |
P7D
Type: string |
Every 7 days. |
P14D
Type: string |
Every 14 days. |
P15D
Type: string |
Every 15 days. |
P18D
Type: string |
Every 18 days. |
P30D
Type: string |
Every 30 days. |
Operations
Get Reports
Returns report details for the reports that match the filters that you specify.
Request
curl "https://pay-api.amazon.com/live/:version/reports"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
curl "https://pay-api.amazon.com/live/:version/reports"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
Request parameters
reportTypes (optional)
Type: string (comma-separated list of ReportTypes) |
Query Parameter |
List of types of reports requested. |
processingStatuses (optional)
Type: string (comma-separated list of ProcessingStatus) |
Query Parameter |
A list of processing statuses used to filter reports. |
createdSince (optional)
Type: string (date-time ISO 8601) |
Query Parameter |
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.
Default: 90 days |
createdUntil (optional)
Type: string (date-time ISO 8601) |
Query Parameter |
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.
Default: now |
pageSize (optional)
Type: number |
Query Parameter |
The number of reports per page to return. Minimum: 1 Maximum: 100
Default: 10 |
nextToken (optional)
Type: string |
Query Parameter |
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. |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 200 status response code 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
curl "https://pay-api.amazon.com/live/:version/reports/:reportId"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
curl "https://pay-api.amazon.com/live/:version/reports/:reportId"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
Request parameters
reportId (required)
Type: string |
Path Parameter |
Report identifier |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 200 status response code 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
curl "https://pay-api.amazon.com/live/:version/reports"
-X POST
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
-d @request_body
curl "https://pay-api.amazon.com/live/:version/reports"
-X POST
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
-d @request_body
Request body
{
"reportType": "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_",
"startTime": "2022-08-04T00-00-00Z",
"endTime": "2022-08-04T23-59-59Z"
}
Request parameters
reportType (required)
Type: ReportType |
Body |
Type of report to be created. |
startTime (required)
Type: string (date-time ISO 8601) |
Body |
Time from which the transactions are included in the report. |
endTime (required)
Type: string (date-time ISO 8601) |
Body |
Time until which the transactions are included in the report. |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 201 status response code 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.
Note: Reports may contain sensitive information. We recommend treating the url with the same precautions as you treat sensitive data itself.
Request
curl "https://pay-api.amazon.com/live/:version/report-documents/:reportDocumentId"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
curl "https://pay-api.amazon.com/live/:version/report-documents/:reportDocumentId"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
Request parameters
reportDocumentId (required)
Type: string |
Path Parameter |
Report Document identifier |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 200 status response code 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
curl "https://pay-api.amazon.com/live/:version/report-schedules"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
curl "https://pay-api.amazon.com/live/:version/report-schedules"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
Request parameters
reportTypes (optional)
Type: string (comma-separated list of ReportType) |
Query Parameter |
List of report types |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 200 status response code 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
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
Request parameters
reportScheduleId (required)
Type: string |
Path Parameter |
Id of the report schedule |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 200 status response code 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
curl "https://pay-api.amazon.com/live/:version/report-schedules"
-X POST
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
-d @request_body
curl "https://pay-api.amazon.com/live/:version/report-schedules"
-X POST
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
-d @request_body
Request parameters
deleteExistingSchedule (optional)
Type: boolean |
Query Parameter |
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.
Default: false |
reportType (required)
Type: ReportType |
Body |
Type of the report for the schedule |
scheduleFrequency (required)
Type: ScheduleFrequency |
Body |
Frequency in which the report shall be created. |
nextReportCreationTime (required)
Type: string (date-time ISO 8601) |
Body |
ISO 8601 time defining the next report creation time |
Request body
{
"reportType": "_GET_FLAT_FILE_OFFAMAZONPAYMENTS_ORDER_REFERENCE_DATA_",
"scheduleFrequency": "P1D",
"nextReportCreationTime": "2022-08-06T23-59-59Z"
}
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 201 status response code if the operation was successful.
{
"reportScheduleId": "68973459224",
}
Cancel Report Schedule
Cancels the report schedule with the given reportScheduleId.
Request
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId" \
-X DELETE
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
curl "https://pay-api.amazon.com/live/:version/report-schedules/:reportScheduleId" \
-X DELETE
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
Request parameters
reportScheduleId (required)
Type: string |
Path Parameter |
Report schedule identifier |
Sample Code
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
<?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";
}
?>
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);
}
}
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();
}
}
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);
});
Response
Returns HTTP 200 status response code 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
curl "https://pay-api.amazon.com/live/:version/disbursements"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
curl "https://pay-api.amazon.com/:environment/:version/disbursements"
-X GET
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-H "x-amz-pay-idempotency-key:AVLo5tI10BHgEk2jEXAMPLEKEY"
Query Parameters
{
"startTime": "2022-08-04T00-00-00Z",
"endTime": "2022-08-04T23-59-59Z",
"pageSize": "30",
"nextToken": ""
}
Response
Returns HTTP 200 status response code 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 here.
| 400 BAD_REQUEST |
Request has missing or invalid parameters and cannot be parsed. |
| 403 FORBIDDEN |
Indicates access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature. |
| 404 NOT_FOUND |
The specified resource does not exist. |
| 429 TOO_MANY_REQUESTS |
The frequency of requests was greater than allowed. |
| 500 INTERNAL_SERVER_ERROR |
An unexpected condition occurred that prevented the server from fulfilling the request. |