感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Finalize Checkout Session

For MSDK EoC flow, the request of finalizeCS API will be: CSId + merchant’s button params. The response will be normal finalizeCS + paymentDetails, billingAddress, and buyerDetails.

Request

curl "https://pay-api.amazon.com/:version/checkoutSessions/:checkoutSessionId/finalize" \
-X POST
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"
-H "x-amz-pay-date:20201012T235046Z"
-d @request_body

Request body

{
    "shippingAddress": {
        "name": "Susy S",
        "addressLine1": "11 Ditka Ave",
        "addressLine2": "Suite 2500",
        "city": "Chicago",
        "county": null,
        "district": null,
        "stateOrRegion": "IL",
        "postalCode": "60602",
        "countryCode": "US",
        "phoneNumber": "800-000-0000"
    },
    {
    "chargeAmount": {
        "amount": "14",
        "currencyCode": "USD"
    },
    "paymentIntent": "AuthorizeWithCapture",
    "canHandlePendingAuthorization": "false"
}

Request parameters

Name
Location
Description
checkoutSessionId
(required)

Type: string
Path parameter
Checkout Session identifier
paymentIntent
(required)

Type: string
Body
Payment flow for charging the buyer
chargeAmount
(required)

Type: price
Body
Amount to be processed using paymentIntent during checkout. Must match Checkout Session object paymentDetails.chargeAmount
totalOrderAmount

Type: price
Body
Total order amount. Must match Checkout Session object paymentDetails.totalOrderAmount if a value was provided
canHandlePendingAuthorization

Type: boolean
Body
Boolean that indicates whether merchant can handle pending response

See asynchronous processing for more info
shippingAddress
(required*)

Type: address
Body
Shipping address provided by Amazon for validation

*required for `PayAndShip` use cases
billingAddress
(required*)

Type: address
Body
Billing address provided by Amazon for validation

*required for `PayOnly` use cases
supplementaryData

Type: string
Body
Supplementary data about your order

Response

Returns HTTP 200 status response code if paymentIntent was successful. Returns HTTP 202 status response code if authorization is still pending.

{
    "checkoutSessionId": "bd504926-f659-4ad7-a1a9-9a747aaf5275",
    "webCheckoutDetails": null,
    "chargePermissionType": "OneTime",   
    "recurringMetadata": null,
    "productType": null,
    "paymentDetails": null,
    "merchantMetadata": null,
    "supplementaryData":null, // Amazon Pay system data 
    "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"
    },
    "paymentDescriptor": "Amazon Pay Visa (1111)",
    "buyer": {
        "buyerId": "buyerId",
        "name": "name-1",
        "email": "name@amazon.com",
        "phoneNumber": "800-000-0000"
    },
    "paymentPreferences": [
        null
    ],
    "statusDetails": {
        "state": "Completed",
        "reasonCode": null,
        "reasonDescription": null,
        "lastUpdatedTimestamp": "20191015T204327Z"
    },
    "shippingAddress": null,
    "platformId":null,
    "chargePermissionId": "S01-5105180-3221187",
    "chargeId": "S01-5105180-3221187-C056351",
    "constraints": [
        null
    ],
    "creationTimestamp": "20191015T204313Z",
    "expirationTimestamp": null,
    "storeId": null,
    "deliverySpecifications": null,
    "providerMetadata": null,
    "checkoutButtonText": null,
    "releaseEnvironment": null
}