---
title: Set payment info
url: amazon-pay-paymentmethodonfile-express/set-payment-info.html
---

**[Step 4 of 11]** In this step, you will set the order total and specify how the buyer should be charged. At the end of this step, you will be able to redirect the buyer to a unique `amazonRedirectUrl` for transaction processing.

<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. Set payment info

Call <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#update-checkout-session" target="_blank" rel="noopener noreferrer">Update Checkout Session</a> to set payment info (such as the order amount) and transaction metadata. Use the `checkoutResultReturnUrl` parameter to specify the URL the buyer is redirected to after checkout is completed on the Amazon Pay-hosted page.

<div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> You must add the checkoutReviewReturnUrl domain you plan on using if it's different from the domain where you rendered the Amazon Pay button, to the Seller Central. See <a href='get-set-up-for-integration.html#2-add-domains-to-seller-central' target='_blank' rel='noopener noreferrer'>Add domains to Seller Central</a> for more information.</div>

Set `chargeAmount` to the value that should be processed using the `paymentIntent` during checkout. If you need to split the order to capture additional payment after checkout is complete, use the optional `totalOrderAmount` parameter to set the full order amount.

#### Request


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

#### Request body

```
{
    "webCheckoutDetails": {
        "checkoutResultReturnUrl": "https://a.com/merchant-confirm-page"
    },
    "paymentDetails": {
        "paymentIntent": "AuthorizeWithCapture",
        "canHandlePendingAuthorization":false,
        "softDescriptor": "Descriptor",
        "chargeAmount": {
            "amount": "1",
            "currencyCode": "USD"
        }
     },
    "merchantMetadata": {
        "merchantReferenceId": "Merchant reference ID",
        "merchantStoreName": "Merchant store name",
        "noteToBuyer": "Note to buyer",
        "customInformation": "Custom information"
    }
}
```



#### 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;'>webCheckoutDetails<br><br>Type: <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#type-webcheckoutdetails" target="_blank" rel="noopener noreferrer">webCheckoutDetails</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;'>paymentDetails<br><br>Type: <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#type-paymentdetails" target="_blank" rel="noopener noreferrer">paymentDetails</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-paymentmethodonfile/checkout-session.md#type-merchantmetadata" target="_blank" rel="noopener noreferrer">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-paymentmethodonfile/checkout-session.md#type-providermetadata" target="_blank" rel="noopener noreferrer">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",
    "webCheckoutDetails": {
        "checkoutReviewReturnUrl":"https://a.com/merchant-review-page",
        "checkoutResultReturnUrl":"https://a.com/merchant-confirm-page",
        "checkoutCancelUrl": null,
        "amazonPayRedirectUrl":"https://pay.amazon.com/redirect/checkoutId-1"
    },
    "chargePermissionType": PaymentMethodOnFile, 
    "paymentMethodOnFileMetadata": {
        "setupOnly": false
    },
    "productType":"PayAndShip",
    "paymentDetails": {
        "paymentIntent":"AuthorizeWithCapture",
        "canHandlePendingAuthorization":false,
        "chargeAmount": {
            "amount":"1",
            "currencyCode":"USD"
        },
        "totalOrderAmount": null,
        "softDescriptor": "Descriptor",
        "presentmentCurrency": "USD",
        "allowOvercharge": null,
        "extendExpiration": null
    },
    "merchantMetadata": {
        "merchantReferenceId": "Merchant reference ID",
        "merchantStoreName": "Merchant store name",
        "noteToBuyer": "Note to buyer",
        "customInformation": "Custom information"
    },
    "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": "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": null,
    "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

<a href="../amazon-pay-paymentmethodonfile/checkout-session.md#update-checkout-session" target="_blank" rel="noopener noreferrer">Update Checkout Session</a> response will include a <a href="../amazon-pay-paymentmethodonfile/checkout-session.md#type-constraint" target="_blank" rel="noopener noreferrer">Constraint object</a> until all mandatory parameters have been provided. The mandatory parameters are:

* `checkoutResultReturnUrl`
* `chargeAmount` - Only if paymentIntent is set as Confirm and RecurringMetadata is set, chargeAmount is optional. In all other scenarios, chargeAmount is needed and the value should not be 0.
* `paymentIntent`

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







