---
title: Display shipping and payment info
url: amazon-pay-checkout/v1-display-shipping-payment-info.html
---

**[Step 3 of 8]** After the buyer selects their preferred shipping address and payment instrument, they are redirected to the `checkoutReviewReturnUrl` , which is specified on the Checkout Session. The Amazon Pay checkout session ID will be included as a query parameter. Use the checkout session ID to get checkout info (such as shipping address and payment instrument) and to enable updates after the buyer returns to your site.

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

***

### 1. Get shipping and payment info

[Get Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) 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 [Get Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) while the Checkout Session object is in an [Open state](../amazon-pay-api-v2/v1-checkout-session.html). Additionally, shipping address will only be returned if the Checkout Session has PayAndShip product type. After a successful checkout, you can use [Get Charge Permission](../amazon-pay-api-v2/v1-charge-permission.html) 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 [Get Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) 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 [Get Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) 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.

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

#### Request

```
curl "https://pay-api.amazon.com/:environment/:version/checkoutSessions/:checkoutSessionId"
-X GET
-H "x-amz-pay-authorization: Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
```

#### Request parameters

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

#### Response

```
{
    "checkoutSessionId": "bd504926-f659-4ad7-a1a9-9a747aaf5275",
    "webCheckoutDetail": {
        "checkoutReviewReturnUrl": "https://a.com/merchant-review-page",
        "checkoutResultReturnUrl": null,
        "amazonPayRedirectUrl": null
    },
    "productType": "PayAndShip",
    "paymentDetail": {
        "paymentIntent": null,
        "canHandlePendingAuthorization": false,
        "chargeAmount": null,
        "softDescriptor": null,
        "presentmentCurrency": "USD"
    },
    "merchantMetadata": {
        "merchantReferenceId": null,
        "merchantStoreName": null,
        "noteToBuyer": null,
        "customInformation": null
    },
    "supplementaryData":null, // Amazon Pay system data
    "buyer": {
        "buyerId": "amzn1.account.AH34VHFHHYL4YMBuyerId",
        "name": "name-1",
        "email": "name@amazon.com"
    },
    "paymentPreferences": [
        {
            "paymentDescriptor": "Visa ****1111 (Amazon Pay)",
            "billingAddress":{ // Only available in EU or for PayOnly product type
                "name": "Work",
                "addressLine1": "440 Terry Ave",
                "addressLine2": "",
                "addressLine3": "",
                "city": "Seattle",
                "county": "King",    
                "district": "Seattle",
                "stateOrRegion": "WA",
                "postalCode": "98121",
                "countryCode": "US"
            }
        }
    ],
    "statusDetail": {
        "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
    },
    "checkoutButtonText": null,
    "releaseEnvironment": "Sandbox"
}
```

***

### 2. Enable shipping and payment updates

Use [amazon.Pay.bindChangeAction()](../amazon-pay-checkout/v1-amazon-pay-script.html) 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 [Get Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) 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 [amazon.Pay.bindChangeAction()](../amazon-pay-checkout/v1-amazon-pay-script.html) 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>







