Amazon Pay and Login with Amazon integration guide

Step 1: Create the feed content

Construct an XML file containing a series of API requests, with each request node containing the details of the individual API call that you want to execute.

Don't mix multiple API calls in a single batch. For example, if you want to submit Capture and Refund calls, create two separate feeds — one that includes all of your Capture requests and another feed that contains your Refund requests.

If you have a series of operations to perform, submit the feeds in the correct order. For example, don't submit Refund requests before submitting Capture requests as you might receive processing errors (you can't refund fees that you haven't yet captured). In some cases, you need to wait for the response to your feed and look at the data before you submit another feed.

Request elements

The XML feed file must contain the following elements, among others:

Product "Amazon Pay"
Connection Contains information that is common to all requests in a batch. Don't modify anything in this section.
Version The Off-Amazon Pay API version.
Requests Element that contains all requests in a batch. The total number of requests must not exceed 60000.
Request Each individual request in a batch containing all parameters for a single operation; the request information must be wrapped in a CDATA block.
SellerRequestId A request ID that you specify and that is returned to you in the processing report. Use the SellerRequestId to match requests in the feed to responses in the report.
SellerId or MerchantId Your seller identifier. You must be registered for the Amazon Pay Service in the submitted marketplace.

For more information about the request parameters that are required for all Amazon MWS operations, see Required Request Parameters in the Amazon MWS Developer Guide.

Sample feed files

Note that the same parameters from the API calls are required in the XML nodes with the same names. For more information see the Introduction section of the Amazon Pay API reference guide.

Cancel Order Reference request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
      <SellerRequestId>5</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CancelOrderReferenceRequest>
          <SellerId>A0677412396XWXWRWHDJQ</SellerId>
          <AmazonOrderReferenceId>
            S01-4037919-8550790
          </AmazonOrderReferenceId>
          </CancelOrderReferenceRequest>
        ]]>
      </RequestData>
    </Request>
    <Request>
      <SellerRequestId>6</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CancelOrderReferenceRequest>
            <SellerId>A0677412396XWXWRWHDJQ</SellerId>
            <AmazonOrderReferenceId>
              S01-4012349-8550790
            </AmazonOrderReferenceId>
          </CancelOrderReferenceRequest>
        ]]>
      </RequestData>
    </Request>
    <Request>
      <SellerRequestId>7</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CancelOrderReferenceRequest>
          <SellerId>A0677412396XWXWRWHDJQ</SellerId>
          <AmazonOrderReferenceId>
            S01-4012349-8876590
          </AmazonOrderReferenceId>
          </CancelOrderReferenceRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Close Order Reference request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
      <SellerRequestId>11</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CloseOrderReferenceRequest>
          <SellerId>A0677412396XWXWRWHDJQ</SellerId>
          <AmazonOrderReferenceId>
            S01-8304098-EXAMPLE
          </AmazonOrderReferenceId>
          </CloseOrderReferenceRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Close Authorization request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
      <SellerRequestId>14</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CloseAuthorizationRequest>
            <SellerId>A0677412396XWXEXAMPLE</SellerId>
            <AmazonAuthorizationId>
              S01-2718849-1908555-EXAMPLE
            </AmazonAuthorizationId>
          </CloseAuthorizationRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Capture request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
      <SellerRequestId>8</SellerRequestId>
      <RequestData>
      <![CDATA[
        <CaptureRequest>
          <SellerId>A0677412396XWXEXAMPLE</SellerId>
          <AmazonAuthorizationId>
            S01-1238558-3179098-EXAMPLE
          </AmazonAuthorizationId>
          <CaptureReferenceId>cap06</CaptureReferenceId>
          <CaptureAmount>
            <CurrencyCode>EUR</CurrencyCode>
            <Amount>10.00</Amount>
          </CaptureAmount>
        </CaptureRequest>
      ]]>
      </RequestData>
    </Request>
    <Request>
      <SellerRequestId>9</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CaptureRequest>
            <SellerId>A0677412396XWXEXAMPLE</SellerId>
            <AmazonAuthorizationId>
              S01-8438558-3173458-EXAMPLE
            </AmazonAuthorizationId> 
            <CaptureReferenceId>cap06</CaptureReferenceId>
            <CaptureAmount>
              <CurrencyCode>EUR</CurrencyCode>
              <Amount>11.00</Amount>
            </CaptureAmount>
          </CaptureRequest>
        ]]>
      </RequestData>
    </Request>
    <Request>
      <SellerRequestId>10</SellerRequestId>
      <RequestData>
        <![CDATA[
          <CaptureRequest>
            <SellerId>A0677412396XWXWRWHDJQ</SellerId>
            <AmazonAuthorizationId>
              S01-8438558-3179098-A024424
            </AmazonAuthorizationId>
            <CaptureReferenceId>cap06</CaptureReferenceId>
            <CaptureAmount>
              <CurrencyCode>EUR</CurrencyCode>
              <Amount>154.00</Amount>
            </CaptureAmount>
          </CaptureRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Get Capture Details request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
      <SellerRequestId>12</SellerRequestId>
      <RequestData>
        <![CDATA[
          <GetCaptureDetailsRequest>
          <SellerId>A0677412396XWXEXAMPLE</SellerId>
          <AmazonCaptureId>
            S01-2718849-1908555-EXAMPLE
          </AmazonCaptureId>
          </GetCaptureDetailsRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Refund request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
    <SellerRequestId>0</SellerRequestId>
      <RequestData>
        <![CDATA[
        <RefundRequest>
        <SellerId>A0677412396XWXEXAMPLE</SellerId>
        <AmazonCaptureId>S01-1383325-7506464-EXAMPLE</
        </AmazonCaptureId>
        <RefundReferenceId>ref02</RefundReferenceId>
        <RefundAmount>
        <CurrencyCode>EUR</CurrencyCode>
        <Amount>20.00</Amount>
        </RefundAmount>
        </RefundRequest>
        ]]>
      </RequestData>
    </Request>
    <Request>
      <SellerRequestId>1</SellerRequestId>
      <RequestData>
        <![CDATA[
          <RefundRequest>
            <SellerId>A0677412396XWXEXAMPLE</SellerId>
            <AmazonCaptureId>S01-4037919-EXAMPLE</AmazonCaptureId>
            <RefundReferenceId>ref02</RefundReferenceId>
            <RefundAmount>
              <CurrencyCode>EUR</CurrencyCode>
              <Amount>20.00</Amount>
            </RefundAmount>
          </RefundRequest>
        ]]>
      </RequestData>
    </Request>
    <Request>
      <SellerRequestId>2</SellerRequestId>
      <RequestData>
        <![CDATA[
        <RefundRequest>
          <SellerId>A0677412396XWXEXAMPLE</SellerId>
          <AmazonCaptureId>S01-8304098-EXAMPLE</AmazonCaptureId>
          <RefundReferenceId>ref02</RefundReferenceId>
          <RefundAmount>
            <CurrencyCode>EUR</CurrencyCode>
            <Amount>20.00</Amount>
          </RefundAmount>
        </RefundRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Get Refund Details request


<?xml version="1.0" encoding="utf-8"?>
<Batch>
  <Product>Amazon Payments</Product>
  <Connection>
    <Version>2013-01-01</Version>
  </Connection>
  <Requests>
    <Request>
      <SellerRequestId>13</SellerRequestId>
      <RequestData>
        <![CDATA[
          <GetRefundDetailsRequest>
            <SellerId>A0677412396XWXEXAMPLE</SellerId>
            <AmazonRefundId>
              S01-1383325-7506464-EXAMPLE
            </AmazonRefundId>
          </GetRefundDetailsRequest>
        ]]>
      </RequestData>
    </Request>
  </Requests>
</Batch>

Copyright © 2009-2017 Amazon.com, Inc. or its affiliates. Amazon and Amazon.com are registered trademarks of Amazon.com, Inc. or its affiliates. All other trademarks are the property of their respective owners.