アクセスいただきありがとうございます。こちらのページは現在英語のみのご用意となっております。順次日本語化を進めてまいりますので、ご理解のほどよろしくお願いいたします。

Checkout Session

A Checkout Session represents a single active session (or engagement) for a buyer on your website. The Checkout Session can be used to facilitate a new, one-time charge, or recovery from a declined payment.

The Checkout Session starts in an Open state and moves to a Canceled state, unless the buyer completes checkout within 24 hours. In the Open state, you can use the Checkout Session to retrieve checkout details such as buyer profile, shipping address, and payment info.

If the buyer completes checkout within 24 hours, the Checkout Session will move to either a Completed state or Canceled state, depending on whether or not the checkout was successful. In the Completed state, you can use the Checkout Session to retrieve references to a Charge Permission. If payment authorization was requested, the response will also include references to a Charge. In the Canceled state, you can use the Checkout Session to retrieve why Checkout failed.

Note that Amazon Pay permanently deletes Checkout Session objects and any associated info after 30 days.

Supported operations:

  • Create Checkout Session - POST https://pay-api.amazon.com/:environment/:version/checkoutSessions/
  • Get Checkout Session - GET https://pay-api.amazon.com/:environment/:version/checkoutSessions/:checkoutSessionId
  • Update Checkout Session - PATCH https://pay-api.amazon.com/:environment/:version/checkoutSessions/:checkoutSessionId
  • Create Checkout Session - POST https://pay-api.amazon.eu/:environment/:version/checkoutSessions/
  • Get Checkout Session - GET https://pay-api.amazon.eu/:environment/:version/checkoutSessions/:checkoutSessionId
  • Update Checkout Session - PATCH https://pay-api.amazon.eu/:environment/:version/checkoutSessions/:checkoutSessionId
  • Create Checkout Session - POST https://pay-api.amazon.jp/:environment/:version/checkoutSessions/
  • Get Checkout Session - GET https://pay-api.amazon.jp/:environment/:version/checkoutSessions/:checkoutSessionId
  • Update Checkout Session - PATCH https://pay-api.amazon.jp/:environment/:version/checkoutSessions/:checkoutSessionId

Checkout Session object

Parameter
Description
checkoutSessionId

Type: string
Checkout Session identifier


webCheckoutDetail

Type: webCheckoutDetail
URLs associated to the Checkout Session used for completing checkout
productType

Type: string
Amazon Pay integration type. You can not set this value via Checkout Session operations, you must set it using button productType parameter
paymentDetail

Type: paymentDetail
Payment details specified by the merchant, such as the amount and method for charging the buyer
merchantMetadata

Type: merchantMetadata
Merchant-provided order info
platformId

Type: string
Merchant identifier of the Solution Provider (SP)- also known as ecommerce provider

Only SPs should use this field
providerMetadata

Type: providerMetadata
Payment service provider (PSP)-provided order information

Only PSPs should use these fields
buyer

Type: buyer
Details about the buyer, such as their unique identifier, name, and email

This info will only be returned for a Checkout Session in the Open state
shippingAddress

Type: address
Shipping address selected by the buyer
paymentPreferences

Type: list<paymentPreferences>
List of payment instruments selected by the buyer
statusDetail

Type: statusDetail
State of the Checkout Session object
constraints

Type: list<constraint>
Constraints that must be addressed to complete Amazon Pay checkout
creationTimestamp

Type: dateTime
Universal Time Coordinated (UTC) date and time when the Checkout Session was created in ISO 8601 format
expirationTimestamp

Type: dateTime
UTC date and time when the Checkout Session will expire in ISO 8601 format
chargePermissionId

Type: string
Charge permission identifier returned after Checkout Session is complete

Used for creating charges for deferred transactions
chargeId

Type: string
Charge identifier returned after Checkout Session is complete

Used for processing refunds
storeId

Type: string
Login with Amazon client ID. Do not use the application ID

Retrieve this value from "Login with Amazon" in Seller Central
deliverySpecifications

Type: deliverySpecifications
Specify shipping restrictions to prevent buyers from selecting unsupported addresses from their Amazon address book
releaseEnvironment

Type: string
The environment the Checkout Session object was created in (either Sandbox or Live)
checkoutButtonText

Type: string
Amazon Pay-provided button text for buyers who have chosen Affirm as payment instrument. For all other use cases, this value will be null

Type: webCheckoutDetail

Parameter
Description
checkoutReviewReturnUrl

Type: string
Checkout review URL provided by the merchant. Amazon Pay will redirect to this URL after the buyer selects their preferred payment instrument and shipping address

Note: In the Live environment, URLs must use HTTPS protocol. In Sandbox environment, you don't need a SSL certificate and can use the HTTP protocol

Max length: 1024 characters
checkoutResultReturnUrl

Type: string

Checkout result URL provided by the merchant. Amazon Pay will redirect to this URL after completing the transaction

Note: In the Live environment, URLs must use HTTPS protocol. In Sandbox environment, you don't need a SSL certificate and can use the HTTP protocol

Max length: 1024 characters
amazonPayRedirectUrl

Type: string
URL provided by Amazon Pay. Merchant will redirect to this page after setting transaction details to complete checkout

Max length: 256 characters

Type: deliverySpecifications

Parameter
Description
specialRestrictions

Type: list<string>
Rule-based restrictions

Note: Amazon will only validate this value in Sandbox. This parameter is ignored in the Live environment if an unsupported value is used

Supported values:
  • 'RestrictPOBoxes' - Marks PO box addresses in US, CA, GB, FR, DE, ES, PT, IT, AU as restricted
  • 'RestrictPackstations' - Marks packstation addresses in DE as restricted
addressRestrictions

Type: addressRestrictions

Country-based restrictions


Type: addressRestrictions

Parameter
Description
type

Type: string
Specifies whether addresses that match restrictions configuration should or should not be restricted

Note: Amazon will only validate this value in Sandbox. This parameter is ignored in the Live environment if an unsupported value is used

Supported values:
'Allowed' - Mark addresses that don't match restrictions configuration as restricted
'NotAllowed' - Mark addresses that match restrictions configuration as restricted

restrictions

Type: hash<countryCode:restriction>

Hash of country-level restrictions that determine which addresses should or should not be restricted based on addressRestrictions.type parameter.

CountryCode is a string that represents the country code of the address in ISO 3166 format. Amazon will only validate CountryCode in Sandbox. CountryCode is ignored in the Live environment if an unsupported value is used


Type: restriction

Parameter
Description
statesOrRegions

Type: list<string>
List of country-specific states that should or should not be restricted based on addressRestrictions.type parameter

Note:
  • US addresses - Use 2-character state codes (for example: WA, CA, IL)
  • All other countries - This element is free text. Include all applicable variants: 2-character code, fully spelled out, and abbreviated
zipCodes

Type: list<string>

List of country-specific zip codes that should or should not be restricted based on addressRestrictions.type parameter

Type: paymentDetail

Parameter
Description
paymentIntent

Type: string
Payment flow for charging the buyer

Possible values: Confirm or Authorize
canHandlePendingAuthorization

Type: boolean

Boolean that indicates whether merchant can handle pending response

See asynchronous processing for more info
chargeAmount

Type: price
Transaction amount
presentmentCurrency

Type: string
The currency that the buyer will be charged in ISO 4217 format. Example: USD

See multi-currency integration for more info

Type: price

Parameter
Description
amount

Type: string
Transaction amount
currencyCode

Type: string
Transaction currency code in ISO 4217 format

Example: USD
<tbody>
    <tr id='ERL9CAkCDAX'>
        <td id='s:ERL9CAkCDAX;ERL9CA2PpgG' style='vertical-align: top; font-weight: bold; width: 30%;' class='bold'>Parameter
            <br /></td>
        <td id='s:ERL9CAkCDAX;ERL9CA2NQzd' style='vertical-align: top; font-weight: bold; width: 70%;' class='bold'>Description
            <br /></td>
    </tr>
    <tr id='ERL9CAp4Zym'>
        <td id='s:ERL9CAp4Zym;ERL9CA2PpgG' style='vertical-align: top;'>amount<br><br>Type: string
            <br /></td>
        <td id='s:ERL9CAp4Zym;ERL9CA2NQzd' style='vertical-align: top;'>Transaction amount
            <br /></td>
    </tr>
    <tr id='ERL9CAvtIrl'>
        <td id='s:ERL9CAvtIrl;ERL9CA2PpgG' style='vertical-align: top;'>currencyCode<br><br>Type: string
            <br /></td>
        <td id='s:ERL9CAvtIrl;ERL9CA2NQzd' style='vertical-align: top;'>Transaction currency code in ISO 4217 format. Example: USD
            <br /></td>
    </tr>
</tbody>

</table>

Type: providerMetadata

Parameter
Description
providerReferenceId

Type: string
Payment service provider (PSP)-provided order identifier

Only PSPs should use these fields

Type: merchantMetadata

Parameter
Description
merchantReferenceId

Type: string
External merchant order identifier. The merchant order identifier is shared in buyer communication and in the buyer transaction history on the Amazon Pay website

Max length: 256 characters
merchantStoreName

Type: string
Merchant store name. Setting this parameter will override the default value configured in Seller Central (the account management tool for merchants). The store name is shared in buyer communication and in the buyer transaction history on the Amazon Pay website

Max length: 50 characters
noteToBuyer

Type: string
Description of the order that is shared in buyer communication

You should not store sensitive data about the buyer or the transaction in this field

Max length: 255 characters
customInformation

Type: string
Custom info for the order. This data is not shared in any buyer communication

You should not store sensitive data about the buyer or the transaction in this field

Max length: 4096 characters

Type: buyer

Parameter
Description
buyerId

Type: string
Unique Amazon Pay buyer identifier
name

Type: string
Buyer name
email

Type: string
Buyer email address

Type: paymentPreferences

Parameter
Description
paymentDescriptor

Type: string
Amazon Pay-provided description for buyer-selected payment instrument
billingAddress

Type: address
Billing address for buyer-selected payment instrument. Billing address is only available in EU or for PayOnly product type

Type: address

Parameter
Description
name

Type: string
Address name

Max length: 50 characters
addressLine1

Type: string
The first line of the address

Max length: 180 characters
addressLine2

Type: string
The second line of the address

Max length: 60 characters
addressLine3

Type: string
The third line of the address

Max length: 60 characters
city

Type: string
City of the address

Max length: 50 characters
county

Type: string
County of the address

Max length: 50 characters
district

Type: string
District of the address

Max length: 50 characters
stateOrRegion

Type: string
The state or region:
  • US and CA addresses - Response will always be a 2-character code
  • All other countries - This element is free text and can be either a 2-character code, fully spelled out, or abbreviated
Max length: 50 characters
postalCode

Type: string
Postal code of the address

Max length: 20 characters
countryCode

Type: string
Country code of the address in ISO 3166 format

Max length: 3 characters
phoneNumber

Type: string
Phone number

Max length: 20 characters

Type: statusDetail

Parameter
Description
state

Type: string
Current object state
reasonCode

Type: string
Reason code for current state
reasonDescription

Type: string
An optional description of the Checkout Session state
lastUpdatedTimestamp

Type: dateTime
UTC date and time when the state was last updated in ISO 8601 format

Type: constraint

Parameter
Description
constraintId

Type: string
Code for any Checkout Session constraint
description

Type: string

Description of the Checkout Session constraint
Constraint Code
Description
CheckoutResultReturnUrlNotSet
checkoutResultReturnURL has not been set on the Checkout Session
ChargeAmountNotSet
chargeAmount has not been set on the Checkout Session
PaymentIntentNotSet
paymentIntent has not been set on the Checkout Session
BuyerNotAssociated
Buyer-preferred payment instrument or shipping address has not been set on the Checkout Session


States and reason codes

State
Description
Reason code
Open
The initial Checkout Session state. Checkout Session state will return missing value constraints, until mandatory fields are provided by the merchant using Update Checkout Session. After all constraints have been removed, the merchant will redirect the buyer to the AmazonPayRedirectUrl to complete checkout. The Checkout Session state will then move to either Completed or Canceled state

Note that the Checkout Session will move to Canceled state if the buyer doesn't complete checkout within 24 hours

Allowed operation(s):
GET Checkout Session
UPDATE Checkout Session
-
Completed
Checkout was successfully completed. The buyer was redirected to the AmazonPayRedirectUrl and payment intent was successfully completed. The Checkout Session can no longer be used to perform another payment, or retry a charge

Note: if you set canHandlePendingAuthorization to true, the Checkout Session state will be in a Completed state, even though the Authorization might later fail. See asynchronous processing for more info

Allowed operation(s):
GET Checkout Session (will return Charge Permission ID, Charge ID, and other Checkout Session details).
-
Canceled
Checkout was not successfully completed due to either buyer abandoment or payment decline. The payment intent was not successfully completed

Allowed operation(s):
GET CheckoutSession (will only return state and reasonCode)
BuyerCanceled - The buyer canceled the checkout by clicking the Return to previous page button

Expired - The Checkout Session expired 24 hour after creation because there was no redirect to the amazonPayRedirectUrl or buyer did not complete payment

AmazonCanceled
- Amazon has canceled the transaction due to service unavailability. This is not a payment associated cancelation

Declined - Generic payment decline reason code that includes fraud declines, failure to complete multi-factor authentication (MFA) challenge, and issues with the payment instrument

Operations

Create Checkout Session

Create a new Amazon Pay Checkout Session to customize and manage the buyer experience, from when the buyer clicks the Amazon Pay button to when they complete checkout.

Request

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

Request body

{
    "webCheckoutDetail": {
        "checkoutReviewReturnUrl": "https://a.com/merchant-review-page"
    },
    "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": {}
            }
        }
    }
}  

Request parameters

Name
Location
Description
x-amz-pay-idempotency-key
(required)

Type: string
Header
Idempotency key to safely retry requests
webCheckoutDetail
(required)

Type: webCheckoutDetail
Body
Checkout result URL provided by the merchant. Amazon Pay will redirect to this URL after completing the transaction

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl
storeId
(required)

Type: string
Body
Login with Amazon client ID. Do not use the application ID

Retrieve this value from "Login with Amazon" in Seller Central
deliverySpecifications

Type: deliverySpecifications
Body
Specify shipping restrictions and limit which addresses your buyer can select from their Amazon address book
paymentDetail

Type: paymentDetail
Body
Payment details specified by the merchant such as the amount and method for charging the buyer

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl
merchantMetadata

Type: merchantMetadata
Body
External order details provided by the merchant

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl
platformId

Type: string
Body
Merchant identifier of the Solution Provider (SP).

Only SPs should use this field.

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl.
providerMetadata

Type: providerMetadata
Body
Payment service provider (PSP)-provided order details

Only PSPs should use these fields

Response

Returns HTTP 201 (Created) status if the operation was successful. Subsequent retry attempts using the same Idempotency Key may return a HTTP 200 (OK) status if a new resource is not created.

{
    "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": null,
    "paymentPreferences": [
        null
    ],
    "statusDetail": {
        "state": "Open",
        "reasonCode": null,
        "reasonDescription": null,
        "lastUpdatedTimestamp": "20191015T204327Z"
    },
    "shippingAddress": null,  // Null for PayOnly product type
    "platformId": null,
    "chargePermissionId": null,
    "chargeId": null,
    "constraints": [
        {
           "constraintId": "BuyerNotAssociated",
            "description": "There is no buyer associated with the Checkout Session. Return the checkout session id to the Amazon Pay Button to allow buyer to login."
        },
        {
           "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"
}

Error codes

Generic errors can be found here.

Get Checkout Session

Get Checkout Session details includes buyer info, payment instrument details, and shipping address. Shipping address will only be returned if Checkout Session has PayAndShip product type. Use this operation to determine if checkout was successful after the buyer returns from the AmazonPayRedirectUrl to the specified checkoutResultReturnUrl.

Request

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

Request parameters

Name
Location
Description
CheckoutSessionId
(required)

Type: string
Path Parameter
Checkout session identifier

Response

Returns HTTP 200 (OK) status if the operation was successful.

{
    "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"
}

Error codes

HTTP status code
Reason code
Description

404 NOT_FOUND

ResourceNotFound
Checkout Session details are permanently deleted after 30 days. Any request on the Checkout Session will return this error code

Generic errors can be found here.

Update Checkout Session

Update the Checkout Session with transaction details. You can keep updating the Checkout Session, as long as it’s in an Open state. Once all mandatory parameters have been set, the Checkout Session object will respond with an unique amazonPayRedirectUrl that you will use to redirect the buyer to complete checkout.

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

Name
Location
Description
checkoutSessionId
(required)

Type: string
Path parameter
Checkout Session identifier
webCheckoutDetail

Type: webCheckoutDetail
Body
Checkout result URL provided by the merchant. Amazon Pay will redirect to this URL after completing the transaction

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl
paymentDetail

Type: paymentDetail
Body
Payment details specified by the merchant such as the amount and method for charging the buyer

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl
merchantMetadata

Type: merchantMetadata
Body
External order details provided by the merchant

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl
platformId

Type: string
Body
Merchant identifier of the Solution Provider (SP).

Only SPs should use this field.

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl.
providerMetadata

Type: providerMetadata
Body
Transaction identifier created by the Payment Service Provider (PSP)

Only PSPs should use these fields

Modifiable: Multiple times before the buyer is redirected to the amazonPayReturnUrl

Response

Returns HTTP 200 (OK) status if the operation was successful.

{
    "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"
}

Error codes

HTTP status code
Reason code
Description

404 NOT_FOUND

ResourceNotFound
Checkout Session details are permanently deleted after 30 days. Any request on the Checkout Session will return this error code

422 UNPROCESSABLE_ENTITY
InvalidCheckoutSessionStatus
You tried to call an operation on a Checkout Session that is in a state where that operation is not allowed

Generic errors can be found here.