---
title: Display shipping and payment info
url: amazon-pay-paymentmethodonfile-express/display-shipping-payment-info.html
---

**[Step 3 of 11]** The buyer is redirected to `checkoutReviewReturnUrl` after they select their preferred shipping address and payment instrument. The Amazon Pay checkout session ID will be included as a query parameter. 

In this step, you will use the checkout session ID to get checkout info (such as shipping address and payment instrument) and to enable checkout preference updates. At the end of this step, you will be able to present the buyer with an order summary and give them the option of updating their preferred shipping and payment instrument before they complete checkout.

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


* TOC
{:toc}
{::options toc_levels="3" /}

***

### 1. Get shipping and payment info

<a href="../amazon-pay-paymentmethodonfile/checkout-session.md#get-checkout-session" target="_blank" rel="noopener noreferrer">Get Checkout Session</a> to retrieve checkout info, such as buyer email, shipping address, and payment information. Use the response to display checkout information, offer shipping options if applicable, and calculate additional costs. 

Note that you can only retrieve checkout info using <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#get-checkout-session" target="_blank" rel="noopener noreferrer">Get Checkout Session</a> while the Checkout Session object is in an <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#states-and-reason-codes" target="_blank" rel="noopener noreferrer">Open state</a>. Additionally, shipping address will only be returned if the Checkout Session has PayAndShip product type. After a successful checkout, you can use <a href="../amazon-pay-paymentmethodonfile/charge-permission.md#get-charge-permission" target="_blank" rel="noopener noreferrer">Get Charge Permission</a> to retrieve checkout info. 

**Important:** 
* For protection against buyer disputes, you should display the shipping address that you receive from Amazon Pay as read-only text. [Enable shipping and payment updates](./display-shipping-payment-info.html#2-enable-shipping-and-payment-updates) so that buyers can select a different shipping address from their Amazon address book. More information about Amazon Pay Payment Protection Plan here: <a href="https://pay.amazon.com/help/201749690" target="_blank" rel="noopener noreferrer">US</a>, <a href="https://pay.amazon.co.uk/help/201749690" target="_blank" rel="noopener noreferrer">UK</a>, <a href="https://pay.amazon.eu/help/201749690" target="_blank" rel="noopener noreferrer">EU</a>, <a href="https://pay.amazon.co.jp/help/201749690" target="_blank" rel="noopener noreferrer">JP</a>.
* Use the `paymentDescriptor` value returned in <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#get-checkout-session" target="_blank" rel="noopener noreferrer">Get Checkout Session</a> response to represent the buyer-selected payment instrument. Amazon Pay may dynamically return a different value to optimize checkout conversion.
* Verify the address returned in the <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#get-checkout-session" target="_blank" rel="noopener noreferrer">Get Checkout Session</a> is supported by your business requirements even if you use the `deliverySpecifications` parameter to limit which addresses your buyer can select from their Amazon address book. If the address returned is not supported, please ask the buyer to select a different one.
* Do not display checkout info such as shipping address or buyer email to anyone besides the buyer who initiated checkout. Implement validation (for example: browser session verification) in case someone besides the buyer gains access to the Checkout Session ID.

<img src="https://m.media-amazon.com/images/G/01/EPSDocumentation/AmazonPay/Integration/example-v2-checkoutV2.png" style="width: 100%;" />

#### Request


<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/:version/checkoutSessions/:checkoutSessionId"<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/:environment/:version/checkoutSessions/:checkoutSessionId"<br />
-X GET<br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>
</div>

#### Request parameters

<table width="100%" border="1">
    <tbody>
        <tr id='ERL9CAVsuDr'>
            <td id='s:ERL9CAVsuDr;ERL9CAdoMUq' style='vertical-align: top; font-weight: bold; width: 30%;' class='bold'>Name
                <br /></td>
            <td id='s:ERL9CAVsuDr;ERL9CAoJhYx' style='vertical-align: top; font-weight: bold; width: 20%;' class='bold'>Location
                <br /></td>
            <td id='s:ERL9CAVsuDr;ERL9CA4xLvY' style='vertical-align: top; font-weight: bold; width: 50%;' class='bold'>Description
                <br /></td>
        </tr>
        <tr id='ERL9CAmASXg'>
            <td id='s:ERL9CAmASXg;ERL9CAdoMUq' style='vertical-align: top;'>CheckoutSessionId<br><b>(required)</b><br><br>Type: string
                <br /></td>
            <td id='s:ERL9CAmASXg;ERL9CAoJhYx' style='vertical-align: top;'>Path Parameter
                <br /></td>
            <td id='s:ERL9CAmASXg;ERL9CA4xLvY' style='vertical-align: top;'>Checkout session identifier
                <br /></td>
        </tr>
    </tbody>
</table>

#### Response

```
{
    "checkoutSessionId":"bd504926-f659-4ad7-a1a9-9a747aaf5275",
    "webCheckoutDetails": {
        "checkoutReviewReturnUrl":"https://a.com/merchant-review-page",
        "checkoutResultReturnUrl":null,
        "checkoutCancelUrl": null,
        "amazonPayRedirectUrl":null
    },
    "chargePermissionType": PaymentMethodOnFile, 
    "paymentMethodOnFileMetadata": {
        "setupOnly": false
    },
    "productType":"PayAndShip",
    "paymentDetails": {
        "paymentIntent":null,
        "canHandlePendingAuthorization":false,
        "chargeAmount": null,
        "totalOrderAmount": null,
        "softDescriptor": null,
        "presentmentCurrency": null,
        "allowOvercharge": null,
        "extendExpiration": null
    },
    "merchantMetadata": {
        "merchantReferenceId":null,
        "merchantStoreName":null,
        "noteToBuyer":null,
        "customInformation":null
    },
    "supplementaryData":null, // Amazon Pay system data 
    "buyer": {
        "buyerId": "buyerId",
        "name": "name-1",
        "email": "name@amazon.com",
        "phoneNumber": "800-000-0000",
        "primeMembershipTypes": null
    },
    "billingAddress":{ 
        "name": "Work",
        "addressLine1": "440 Terry Ave",
        "addressLine2": "",
        "addressLine3": "",
        "city": "Seattle",
        "county": "King",    
        "district": "Seattle",
        "stateOrRegion": "WA",
        "postalCode": "98121",
        "countryCode": "US",
        "phoneNumber": "800-000-0000"
    },
    "paymentPreferences": [
        {
            "paymentDescriptor": "Visa ****1111 (Amazon Pay)"
        }
    ],
    "statusDetails": {
        "state":"Open",
        "reasonCode":null,
        "reasonDescription":null,
        "lastUpdatedTimestamp":"20191015T204327Z"
    },
    "shippingAddress": {  // Null for PayOnly product type
        "name":"Susie Smith",
        "addressLine1":"10 Ditka Ave",
        "addressLine2":"Suite 2500",
        "addressLine3":null,
        "city":"Chicago",
        "county":null,
        "district":null,
        "stateOrRegion":"IL",
        "postalCode":"60602",
        "countryCode":"US",
        "phoneNumber":"800-000-0000"
    },
    "platformId":null,
    "chargePermissionId":null,
    "chargeId":null,
    "constraints": [
        {
            "constraintId":"ChargeAmountNotSet",
            "description":"chargeAmount is not set."
        },
        {
            "constraintId":"CheckoutResultReturnUrlNotSet",
            "description":"checkoutResultReturnUrl is not set."
        },
        {
            "constraintId":"PaymentIntentNotSet",
            "description":"paymentIntent is not set."
        }
    ],
    "creationTimestamp":"20191015T204313Z",
    "expirationTimestamp":"20191016T204313Z",
    "storeId":"amzn1.application-oa2-client.8b5e45312b5248b69eeaStoreId",
    "deliverySpecifications": {
        "specialRestrictions": ["RestrictPOBoxes"],
        "addressRestrictions": {
            "type":"Allowed",
            "restrictions": {
                "US": {
                    "statesOrRegions": ["WA"],
                    "zipCodes": ["95050", "93405"]
                },
                "GB": {
                    "zipCodes": ["72046", "72047"]
                },
                "IN": {
                    "statesOrRegions": ["AP"]
                },
                "JP": {}
          }
        }
    },
    "providerMetadata": {
        "providerReferenceId":null
    },
    "releaseEnvironment":"Sandbox"
}
```

***

### 2. Enable shipping and payment updates

Use <a href="../amazon-pay-checkout/amazon-pay-script.md" target="_blank" rel="noopener noreferrer">amazon.Pay.bindChangeAction()</a> to bind click events to HTML elements, so that when the element is clicked, the buyer can select a different shipping address or payment method. Be sure to <a href="../amazon-pay-api-v2/checkout-session.md#get-checkout-session" target="_blank" rel="noopener noreferrer">Get Checkout Session</a> after the buyer returns to your site to retrieve updated checkout info.

<img src="https://m.media-amazon.com/images/G/01/EPSDocumentation/AmazonPay/Integration/example-v2-checkout-changeV2.png" style="width: 100%;" />

**Step 1.** Add the Amazon Pay script to your HTML file. Be sure you select the correct region.

<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#ustab" data-toggle="tab">US</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#eutab" data-toggle="tab">EU / UK</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#jptab" data-toggle="tab">JP</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="ustab">   
<div markdown="block">
```html
<script src="https://static-na.payments-amazon.com/checkout.js"></script>
```
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="eutab">
<div markdown="block">
```html
<script src="https://static-eu.payments-amazon.com/checkout.js"></script>
```
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jptab">
<div markdown="block">
```html
<script src="https://static-fe.payments-amazon.com/checkout.js"></script>
```
</div>
  </div>
</div>

**Step 2.** Use <a href="../amazon-pay-checkout/amazon-pay-script.md" target="_blank" rel="noopener noreferrer">amazon.Pay.bindChangeAction()</a> to bind click events to HTML elements on your page. You can specify whether the buyer is editing shipping address or payment method by using the `changeAction` parameter.

Changing address (only relevant if Checkout Session product type is PayAndShip):
```html
<script type="text/javascript" charset="utf-8">
  amazon.Pay.bindChangeAction('#changeButton1', {
    amazonCheckoutSessionId: 'xxxx',
    changeAction: 'changeAddress'
  });
</script>
```

Changing payment instrument:
```html
<script type="text/javascript" charset="utf-8">
  amazon.Pay.bindChangeAction('#changeButton2', {
    amazonCheckoutSessionId: 'xxxx',
    changeAction: 'changePayment'
  });
</script>
```

#### Function parameters

<div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> Both changeAction values will trigger the same buyer experience. Regardless of which value you specify, the buyer will be given the option of updating both their shipping address and payment method. Eventually, the changeAction value will trigger the expected behavior.</div>

<table width="100%" border="1">
    <tbody>
        <tr id='fIK9CAJlXo1'>
            <td id='s:fIK9CAJlXo1;fIK9CAUhRBo' style='vertical-align: top; font-weight:bold;  width: 30%' class='bold'>Parameter
                <br /></td>
            <td id='s:fIK9CAJlXo1;fIK9CAVdSRz' style='vertical-align: top; font-weight:bold;  width: 70%' class='bold'>Description
                <br /></td>
        </tr>
        <tr id='fIK9CAJFUd0'>
            <td id='s:fIK9CAJFUd0;fIK9CAUhRBo' style='vertical-align: top;'>amazonCheckoutSessionId<br><b>(required)</b><br><br>Type: string
                <br /></td>
            <td id='s:fIK9CAJFUd0;fIK9CAVdSRz' style='vertical-align: top;'>Amazon Pay Checkout Session identifier
                <br /></td>
        </tr>
        <tr id='fIK9CAcpkOP'>
            <td id='s:fIK9CAcpkOP;fIK9CAUhRBo' style='text-align: left;vertical-align: middle;'>changeAction<br><b>(required)</b><br><br>Type: string
                <br /></td>
            <td id='s:fIK9CAcpkOP;fIK9CAVdSRz' style='vertical-align: top;'>Update requested by the buyer<br><br>Supported values: 'changeAddress', 'changePayment'
                <br /></td>
        </tr>
    </tbody>
</table>


### 3. Update estimated order amount

This step is only required if you’ve set the `estimatedOrderAmount` parameter and if buyers can change the order total after starting checkout (for example, if they can remove items from the cart on the  checkoutReviewReturnUrl page.

Use updateButtonInfo() to update the `estimatedOrderAmount` any time the estimated order amount changes. 


```html
<script type="text/javascript" charset="utf-8">
  amazonPayButton.updateButtonInfo({"amount":"120.99","currencyCode":"USD"});
</script>
```


