AmazonPay Tokenized Flow
All prerequisites and authorization required for Amazonpay shall be completed by merchant.
Account creation with Amazon Pay
Configure the credentials provided by Amazonpay on Juspay Dashboard
Merchant’s App name and SHA256 key has to be whitelisted at Amazonpay end.
The API key generated for the new secure profile created at Amazonpay has to be whitelisted at their end. Refer for more information.
Contact your Juspay integration SPoC to get Amazonpay SDK added as a feature for your client ID at Juspay end.
Configure Juspay’s set of callback URLs at Amazonpay’s end for the Seller ID.
sdkWalletIndentifier is necessary and needs to be configured by merchant before testing. Merchant can do this by creating and configuring their Seller ID on Amazon dashboard. Without sdkWalletIdentifier - testing will be blocked.
Configure Juspay webhooks - this is critical to get real time transaction status from Amazonpay. Hence its important to ensure that the webhook configurations are in place. Failing to configure might lead to delayed success in case the redirection response is dropped.
Steps :
● Log in to your Amazon Sellercentral account.
● Click on the “Settings” tab on the right-hand side and select “Integration settings”.
● Then click on the “Edit” button to add “Merchant URL” and update. The URL to be updated is of the below format:
Sandbox–https://sandbox.juspay.in/v2/pay/webhooks/<merchantId>/amazonpay
Production– https://api.juspay.in/v2/pay/webhooks/<merchantId>/amazonpay
Note: Kindly note to replace the merchantId with the actual merchant id/ username provided by Juspay.
Minimum SDK Version - Android version shall be equal to or greater than 2.1.14 for new SSO experience and 2.1.2 for older flow.
Minimum SDK Version - iOS version shall be equal to or greater than 2.0.92.
Android
Ensure that required dependencies are added for the Amazonpay SDK.
iOS
SDK dependencies for Amzonpay can be added by the following pod:
Ensure the following things are done:
Add the following properties in your app's Info.plist file:
Add your AmazonPay API key with the key name APIKey in the plist file.
Add the following code in the AppDelegate's application:openurl:options function if the project is not using SceneDelegate:
For the project that is using SceneDelegate, add the following code in SceneDelegate’s scene:openURLContexts: function:
Step 1 - Customer context creation:
Create or Get
Customer on the Juspay Server. It is recommended to make this API call before opening the payment page.
Step 2 - Order creation:
CreateOrder on Juspay Servers. Kindly ensure that
Step 3 - Refresh wallet balances:
Use the refreshWalletBalances call to get the list of wallets available for the user. Refer to the code snippets on the right for details. The response shall provide information on:
Whether Amazonpay wallet is already linked for the customer.
The direct debit token obtained in the response shall be used in the walletTxn call.
If the wallet is linked, please display the Amazonpay wallet balance on the Payment page and proceed to Step 5. If wallet is not linked for the user, process to Step 4
Step 4 - Create Wallet:
Use create wallet call to enable the user to create and link Amazonpay wallet. After the link is successful, the user will be returned back to the payment page with wallet balance displayed.
Step 5 - Initiate wallet transaction:
Use walletTxn operation to initiate Amazonpay direct debit transaction. Please note to send the below three parameters for the walletTxn operation.
paymentMethod :: AMAZONPAY
sdkPresent :: ANDROID_AMAZONPAY_TOKENIZED (for Android) AND IOS_AMAZONPAY_TOKENIZED (For iOS)
directDebitToken :: Required for all transactions
First time and repeat users will be redirected to the Amazonpay page opened on a Chrome Custom Tab to login and complete the payment. The Chrome Custom Tab is a security requirement from Amazonpay and it is a Native feature.
Link transaction : The user will be redirected to Amazonpay login page on Chrome custom tab/ CCT. The user shall login into Amazon Pay account and successfully link Amazon Pay wallet and land on the payment page.
Pay (with sufficient balance): The Amazonpay wallet balance will be displayed to the user on the payment page. If the funds are sufficient to complete the transaction, the amount will be automatically debited.
Pay (with insufficient balance): If the funds are insufficient to complete the transaction, the user will be redirected to Amazonpay page, where he can pay the balance amount using a payment instrument of choice.
This is an optional feature. On your user’s payment profile page you may include this feature for your user to delink any linked wallet. Refer code snippet on the right for payload details.

