---
title: Set payment info
url: amazon-pay-checkout/v1-set-payment-info.html
---

**[Step 4 of 8]** To complete checkout, set payment details, and redirect to `amazonPayRedirectUrl`. 

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

***

### 1. Set payment info.

[Update Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) to set payment info and transaction metadata. Note that you can only set payment info while the Checkout Session object is in an [Open state](../amazon-pay-api-v2/v1-checkout-session.html).

Use the `checkoutResultReturnUrl` parameter to specify the URL the buyer is redirected to after checkout is completed on the Amazon Pay-hosted page.

#### Request

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

#### Request body

```
{
    "webCheckoutDetail": {
        "checkoutResultReturnUrl": "https://a.com/merchant-confirm-page"
    },
    "paymentDetail": {
        "paymentIntent": "Authorize",
        "canHandlePendingAuthorization": false,
        "chargeAmount": {
            "amount": "1",
            "currencyCode": "USD"
        }
     },
    "merchantMetadata": {
        "merchantReferenceId": "Merchant reference ID",
        "merchantStoreName": "Merchant store name",
        "noteToBuyer": "Note to buyer",
        "customInformation": "Custom information"
    },
    "platformId": "SPId"
}
```



#### Request parameters

<table width="100%" border="1">
    <tbody>
        <tr id='GQe9CAs5MDB'>
            <td id='s:GQe9CAs5MDB;GQe9CAELlwN' style='vertical-align: top; font-weight: bold; width: 30%;' class='bold'>Name
                <br /></td>
            <td id='s:GQe9CAs5MDB;GQe9CA9gAmy' style='vertical-align: top; font-weight: bold; width: 20%;' class='bold'>Location
                <br /></td>
            <td id='s:GQe9CAs5MDB;GQe9CA7NBhr' style='vertical-align: top; font-weight: bold; width: 50%;' class='bold'>Description
                <br /></td>
        </tr>
        <tr id='GQe9CAkY1Cm'>
            <td id='s:GQe9CAkY1Cm;GQe9CAELlwN' style='vertical-align: top;'>checkoutSessionId<br>(required)<br><br>Type: string
                <br /></td>
            <td id='s:GQe9CAkY1Cm;GQe9CA9gAmy' style='vertical-align: top;'>Path parameter
                <br /></td>
            <td id='s:GQe9CAkY1Cm;GQe9CA7NBhr' style='vertical-align: top;'>Checkout Session identifier
                <br /></td>
        </tr>
        <tr id='GQe9CARndUY'>
            <td id='s:GQe9CARndUY;GQe9CAELlwN' style='vertical-align: top;'>webCheckoutDetail<br><br>Type: <a href="../amazon-pay-api-v2/v1-checkout-session.md">webCheckoutDetail</a>
                <br /></td>
            <td id='s:GQe9CARndUY;GQe9CA9gAmy' style='vertical-align: top;'>Body
                <br /></td>
            <td id='s:GQe9CARndUY;GQe9CA7NBhr' style='vertical-align: top;'>Checkout result URL provided by the merchant. Amazon Pay will redirect to this URL after completing the transaction<br><br>Modifiable: Multiple times before the buyer is redirected to the <code>amazonPayReturnUrl</code>
                <br /></td>
        </tr>
        <tr id='GQe9CA0SnRb'>
            <td id='s:GQe9CA0SnRb;GQe9CAELlwN' style='vertical-align: top;'>paymentDetail<br><br>Type: <a href="../amazon-pay-api-v2/v1-checkout-session.md">paymentDetail</a>
                <br /></td>
            <td id='s:GQe9CA0SnRb;GQe9CA9gAmy' style='vertical-align: top;'>Body
                <br /></td>
            <td id='s:GQe9CA0SnRb;GQe9CA7NBhr' style='vertical-align: top;'>Payment details specified by the merchant, such as the amount and method for charging the buyer<br><br>Modifiable: Multiple times before the buyer is redirected to the <code>amazonPayReturnUrl</code>
                <br /></td>
        </tr>
        <tr id='GQe9CAB0a4g'>
            <td id='s:GQe9CAB0a4g;GQe9CAELlwN' style='vertical-align: top;'>merchantMetadata<br><br>Type: <a href="../amazon-pay-api-v2/v1-checkout-session.md">merchantMetadata</a>
                <br /></td>
            <td id='s:GQe9CAB0a4g;GQe9CA9gAmy' style='vertical-align: top;'>Body
                <br /></td>
            <td id='s:GQe9CAB0a4g;GQe9CA7NBhr' style='vertical-align: top;'>External order details provided by the merchant<br><br>Modifiable: Multiple times before the buyer is redirected to the <code>amazonPayReturnUrl</code>
                <br /></td>
        </tr>
        <tr id='GQe9CAoGOxm'>
            <td id='s:GQe9CAoGOxm;GQe9CAELlwN' style='vertical-align: top;'>platformId<br><br>Type: string
                <br /></td>
            <td id='s:GQe9CAoGOxm;GQe9CA9gAmy' style='vertical-align: top;'>Body
                <br /></td>
            <td id='s:GQe9CAoGOxm;GQe9CA7NBhr' style='vertical-align: top;'>Merchant identifier of the Solution Provider (SP). <br><br>Only SPs should use this field.<br><br>Modifiable: Multiple times before the buyer is redirected to the <code>amazonPayReturnUrl</code>
                <br /></td>
        </tr>
        <tr id='GQe9CAp9eWh'>
            <td id='s:GQe9CAp9eWh;GQe9CAELlwN' style='vertical-align: top;'>providerMetadata<br><br>Type: <a href="../amazon-pay-api-v2/v1-checkout-session.md">providerMetadata</a>
                <br /></td>
            <td id='s:GQe9CAp9eWh;GQe9CA9gAmy' style='vertical-align: top;'>Body
                <br /></td>
            <td id='s:GQe9CAp9eWh;GQe9CA7NBhr' style='vertical-align: top;'>Transaction identifier created by the Payment Service Provider (PSP).<br><br>Only PSPs should use these fields.<br><br>Modifiable: Multiple times before the buyer is redirected to the <code>amazonPayReturnUrl</code>.
                <br /></td>
        </tr>
    </tbody>
</table>

#### Response

```
{
    "checkoutSessionId": "ada3f397-7d4b-4a55-abac-786685c02d8b",
    "webCheckoutDetail": {
        "checkoutReviewReturnUrl": "https://a.com/merchant-review-page",
        "checkoutResultReturnUrl": "https://a.com/merchant-confirm-page",
        "amazonPayRedirectUrl": "https://pay.amazon.com/redirect/checkoutId-1"
    },
    "productType": "PayAndShip",
    "paymentDetail": {
        "paymentIntent": "Authorize",
        "canHandlePendingAuthorization":false,
        "chargeAmount": {
            "amount": "1",
            "currencyCode": "USD"
        },
        "softDescriptor": null,
        "presentmentCurrency": "USD"
    },
    "merchantMetadata": {
        "merchantReferenceId": "Merchant reference ID",
        "merchantStoreName": "Merchant store name",
        "noteToBuyer": "Note to buyer",
        "customInformation": "Custom information"
    },
    "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": "20191015T195703Z"
    },
    "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": "AEMGQX8TKDO54",
    "chargePermissionId": null,
    "chargeId": null,
    "constraints": [],
    "creationTimestamp": "20191015T195655Z",
    "expirationTimestamp": "20191016T195655Z",
    "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. Redirect to AmazonPayRedirectUrl

[Update Checkout Session](../amazon-pay-api-v2/v1-checkout-session.html) response will include a [Constraint object](../amazon-pay-api-v2/v1-checkout-session.html), until all mandatory parameters are provided. The mandatory parameters are:

* `checkoutResultReturnUrl`
* `chargeAmount`
* `paymentIntent`

Once there are no constraints, the response will return a unique `amazonPayRedirectUrl`. Redirect the buyer to that URL to complete checkout.







