Ti ringraziamo per la visita. Questa pagina è per il momento disponibile solo in inglese.

Migrate from MWS Reports

If you are consuming HAQM Pay reports via the HAQM Marketplace Web Services (MWS) Reports API, this guide will explain the details on migrating to the new HAQM Pay Reports APIs. HAQM Pay reports will still be available via MWS, independent of MWS Reports API deprecation times. HAQM Pay Reports will not be available via the SP-APIs. If you are migrating to HAQM Pay CV2 or already offering CV2 and leveraging MWS for reports, please consider migrating to the new APIs below.


General differences between MWS Reports and HAQM Pay Reports APIs

Category HAQM Pay Reports MWS Reports
Authentication The HAQM Pay Reports API facilitates the same gateway as the HAQM Pay Checkout Version 2 (CV2). You can use the same credentials to access your reports as you are using for your payment integration. MWS relies on MWS Access Key Id and Secrets. HAQM Pay CV2 does not require those credentials anymore.
SDKs HAQM Pay Reports APIs are integrated into the same HAQM Pay API SDKs as CV2. More details here. MWS Reports provides a standalone SDK, unrelated to any HAQM Pay product.
API The HAQM Pay Reports API follows a RESTful approach and uses JSON to structure requests and responses. MWS Reports API uses XML for requests and responses.
Report document retrieval HAQM Pay Reports returns a link to the document. The API to retrieve the report document for MWS returns the document.

Note: The actual report content and format do not change. You can continue processing the reports as before.


Step1: Authentication

If you are using one of the HAQM Pay CV2 API SDKs, your SDK handle authentication for you, using the same keys and credentials as for your payment integration.

If you are new to CV2 APIs and SDKs, please follow the Download the HAQM Pay SDKs and Get your Public Key ID sections of the official HAQM Pay integration guide.

In case you have to - or are preferring to - manually sign requests, please start by Getting your Public Key ID. Requests need to be singed with your keys for authentication. Please follow the guide to Signing Requests. The HAQM Pay Scratchpad (US, EU, JP) is also a great resource for this.

For partners: Please reach out to your HAQM Pay Partner Manager or Solution Architect to understand which options are available to conveniently migrate merchants you support.


Step 2: Get a list of generated reports

The Get Reports API will return a list of reports including their metadata. The metadata includes the reportDocumentId. This identifier is required to retrieve the actual report document.

MWS Operation: GetReportRequestList and GetReportRequestListByNextToken
HAQM Pay Operation: Get Reports

MWS Parameters HAQM Pay Parameters Notes
ReportTypeList reportTypes Please check the right strings for your report types here
RequestedFromDate createdSince UTC in ISO 8601 format.
RequestedToDate createdUntil UTC in ISO 8601 format.
ReportProcessingStatusList processingStatuses Status of the report, as defined in the ProcessingStatus enum.
NextToken nextToken Only usable without any additional parameter.

Note: Specifying nextToken with any other parameters will cause the request to fail.

All details for this API are available here. If you are using a SDK, please check the matching SDK documentation.


Step 3: Get the Report document

MWS Operation: GetReport
HAQM Pay Operation: Get Report Document

MWS Parameters HAQM Pay Parameters Notes
ReportId reportDocumentId The reportDocumentId received from Get Reports.

The Get Report Document API will return an url with the link to the report in zip format.

All details for this API are available here. If you are using a SDK, please check the matching SDK documentation.


Step 4: Download the report document file

You must download the report using the information returned in Step 3. The url is valid for 30 seconds only. At this time, all files will be uncompressed. The following sample code demonstrates how to download a plain text report document. You can also use the principles demonstrated in the sample code to guide you in building applications in other programming languages.

Use the following as inputs for the sample code:

  • The url and optional compressionAlgorithm values from the previous step are arguments for the url, and compressionAlgorithm parameters of the download method of the DownloadExample class.
package com.example.download;

import java.io.FileOutputStream;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;

public class DownloadExample {

    public static void main(String[] args){
        System.out.println("Downloading file");
        try (
            ReadableByteChannel readableByteChannel = Channels.newChannel(new URL("<url from GetReportDocument>").openStream());
            FileOutputStream fileOutputStream = new FileOutputStream("<target output file>")) 
        {
            fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
            fileOutputStream.close();
            System.out.println("Download complete");
        } catch(Exception e){
            System.err.println(String.format("error downloading: %s", e.getMessage()));
        }
    }

}
wget -O <target output file> "<url from GetReportDocument>"

Hint: Place the url in quotes to avoid issues with wget.