---
page_source: https://juspay.io/in/docs/payment-method-integrations/express-checkout-sdk/consumer-finance/amazon-paylater
page_title: Amazon PayLater
---


# **Amazon PayLater (Consumer Finance) Onboarding and API Specifications** 




## **Pre-requisites** 




### Step 1 Configuring a new gateway account for Amazon PayLater on the Juspay Dashboard


Merchant needs to get credentials for Paylater from Amazon and configure it in Juspay dashboard under section “PG CONTROL CENTER” in already existing gateway “AMAZONPAY”




### Step 2 Updating existing gateway account to add Amazon PayLater from the Juspay Dashboard


Merchants can follow the steps below to add the Amazon PayLater payment method for already configured gateway accounts from the Juspay Merchant Dashboard.

* **For new merchants configuring Amazonpay,**  add the keys at the time of gateway configurations. There are 3 extra fields that needs to be added_Amazon Pay Later Access Key, Amazon Pay Later Secret Key and Amazon Pay Later Secret Key_
* Post adding these credentials, make sure that the flag _“should use V2 integration”_  is turned ON
* **For already existing merchants with configured gateway Amazonpay,** Go to edit gateway configuration and enable the flag _Should Use V2 Integration?_ As TRUE. Add these three fields mentioned above and save



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Screenshot%202023-10-02%20at%202.40.57%20PM.png)
*PG Enablement*




### Step 3 Adding Amazon SDK dependency 


Below steps can be skipped if the merchant is already live with Amazon Pay wallet tokenized flow - 

* Merchant needs to add the Amazon Pay SDK dependency (Version will be provided by Juspay support/ Amazon) - Not required if merchant is on new Android SDK plug-in version (2.0.4 and above)Note: SDK Dependencies to be manually added for iOS while merchant is doing a clean build.
* Juspay support to add ‘hyperapay’ as one of the micro-sdks in the merchant's build config file.
* Merchant to double check whether ‘hyperapay’ is added as part of their SDK dependencies.
* Juspay package version to be updated to 2.82 or above on studio.




# **Sample Requests and Response** 




## **Checking if Amazon Paylater is enabled by Merchant** 




#### **Sample getPaymentMethods Response:** 




#### json Code Snippet:

```json
{
  "juspayBankCode": "JP_AMAZONPAY",
  "paymentMethodType": "CONSUMER_FINANCE",
  "walletDirectDebitSupport": true,
  "supportedFeatures": [
    {
      "supportedReferenceIds": ["amazon_test", "amazonpaylater_test"],
      "featureName": "sdk",
      "supportedByDefault": false
    },
    {
      "supportedReferenceIds": ["amazon_test", "amazonpaylater_test"],
      "featureName": "wallet_direct_debit",
      "supportedByDefault": false
    },
    {
      "supportedReferenceIds": ["amazon_test", "amazonpaylater_test"],
      "featureName": "link_and_pay",
      "supportedByDefault": false
    },
    {
      "supportedReferenceIds": ["amazon_test", "amazonpaylater_test"],
      "featureName": "eligibility",
      "supportedByDefault": false
    }
  ],
  "paymentMethod": "AMAZONPAYLATER",
  "nickName": "AMAZONPAYLATER",
  "supportedReferenceIds": ["amazon_test", "amazonpaylater_test"],
  "description": "Amazon Pay Later",
  "supportedByDefault": false
}

```



## **Process SDK Call for Rendering Amazon Paylater** 



**Case 1: When the user is eligible but account linking is required:** 


#### **Sample Eligibility Request:** 




#### json Code Snippet:

```json
{
  "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "eligibility",
    "amount": "1.00",
    "data": {
      "wallets": [
        {
          "mobileNumber": null,
          "mobile": "1111111111",
          "gatewayReferenceId": "amazon_test",
          "email": "test@mail.com",
          "customerId": "cth_pKL9ayw75febC1Dd"
        }
      ],
      "cards": []
    },
    "device_params": null,
    "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
    "showLoader": true
  }
}

```



#### **Sample Eligibility Response:** 




#### Shell Code Snippet:

```shell
{
  "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "eligibility",
    "wallets": [
      {
        "payment_methods_eligibility": [
          {
            "status": "SUCCESS",
            "payment_method": "AMAZONPAYLATER",
            "payment_method_type": "CONSUMER_FINANCE",
            "is_eligible": true,
            "gateway_error_code": "linking_required",
            "gateway_error_message": "linking_required",
            "description": "Amazon Pay Later",
            "eligibility_strategy": "TRANSACTION",
            "kfs_link": "https://amazonpay.amazon.in/v1/render-kfs?payload=qixWCK28k0GLZcKRVBokHZIGaYeL7tDWJUMooI4jRsn%2FnsgvdULdeoTP%2BdpfPKrifWMrSFQX7Rq18HxnuME03m2NaWpRDZ2c561iZ2oWFokC32hLcu44VxMt3uIVrZk2j00LWjMOCmAFjKLUdDUte2b8sOW1moHbXUiU55MqmUpENgjbMri%2FgdHiZFitwoCpBrBnMjKvV9JHX52OVOLZm%2BqKayBoqAPGIVsu2dN9bPFr35sutSxMUiS64%2FF%2Bto5fk3uI4m0QE5aG55o6LJSuhiyIbWVCfdInLFlcVAPrF9H%2BbmZAKeOiM7jo%2Bsno2Rd6EaTtysOS42sIa9dMlT7wJMkEkA%3D%3D&iv=jxxn%2B%2B011FO0gG2WDz%2BPFA%3D%3D&authToken=QXR6YXxJd0VCSUo5b3ZlSGVJUmpVZWhGc0pQOVhsMEFBUUd6dWVlb19OQTRxNlBXNWRJUjhJTElVb191NGozZHV6T2p0dXFUazlQYWEzUnNoQnpxRUMwVk1xc1RHbUFGaWZFZFQyLUVfN3R1ZTF1SmZFNGU3dnM4dmppVXlCZ0Y3QWhCRzFWSlo2X0llMnhDOWtNNzNVbXhpbEhwdlh0aXZqeW50SUkxNmh4Nng1RjVIRUdYRG5md3lOZnVsM1dOdFRPZGVKQlhRYW5UZXgzRDlKRDk3VGYtWWQ5amc0MDRFTFM2Y1BISUNCeVJfUElpM2lweVlKajVDX2lCRUJOV2htNGhDVEo2M1k0aGczRjc5TURNOF9lQlgyalRoWkJ1WEN1bHFFd3dhUEVwbHU3aFktVG5CVTRGVnJrUG8zSmRSd1dIVHNwbXRiWjJpVUNIN0xBenBYM0xHeUQxbkl2NENXdmpjUUtsOGNKdUxuWXNXZk8tYllaRlQ5aXdJQzUtclZUTXRRbExwdmxMaldmeVpNUEZZSU1JTDBGVnpKOGE5"
          }
        ],
        "orderId": "re1692707000939",
        "customerId": "cth_pKL9ayw75febC1Dd"
      }
    ],
    "consumerFinance": [],
    "apps": [
      {
        "paymentMethodsEligibility": [],
        "orderId": "re1692707000939"
      }
    ]
  },
  "error": false,
  "errorCode": "",
  "errorMessage": ""
}

```


Please note that _**"is_eligible”**_ is received as _**true**_ but gateway error message _“linking_required”_  means that user is eligible for AmazonPaylater but needs to link their wallet.

Merchant has to call link wallet post that to initiate account linking.

**Case 2: When the user is eligible and account is linked:** 


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://sandbox.juspay.in/customers/cth_avWQeBoXuFCvyTt3/eligibility' \
--header 'Authorization: Basic APIKEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'amount=10' \
--data-urlencode 'gateway_reference_id=amazonpaylater_test' \
--data-urlencode 'gateway_id=38’
Response:
{
    "payment_methods_eligibility": [
        {
            "status": "SUCCESS",
            "payment_method": "AMAZONPAYLATER",
            "payment_method_type": "CONSUMER_FINANCE",
            "is_eligible": true,
            "balance": 100,
            "kfs_link": "https://amazonpay.amazon.in/v1/????,
            "description": "Amazon Pay Later",
            "eligibility_strategy": "TRANSACTION"
        }
    ]
}

```


**Case 3: For ineligible user:** 

If the particular customer is ineligible for Amazonpaylater, eligibility call will return the response as false.


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://sandbox.juspay.in/customers/cth_avWQeBoXuFCvyTt3/eligibility' \
--header 'Authorization: Basic APIKEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'amount=10' \
--data-urlencode 'gateway_reference_id=amazonpaylater_test' \
--data-urlencode 'gateway_id=38’
Response:
{
    "payment_methods_eligibility": [
        {
            "status": "SUCCESS",
            "payment_method": "AMAZONPAYLATER",
            "payment_method_type": "CONSUMER_FINANCE",
            "is_eligible": false,
            "balance": 0,
           "gateway_error_code": "Your KYC has expired, please update on the Amazon app.",
            "gateway_error_message": "Your KYC has expired, please update on the Amazon app.",
            "description": "Amazon Pay Later",
            "eligibility_strategy": "TRANSACTION"
        }
    ]
}

```



## **Amazon Paylater linking** 




#### **Sample Linking Request:** 




#### Shell Code Snippet:

```shell
{
    "walletName": "AMAZONPAY",
    "sdkWalletIdentifier": "AZ4WQCLDT2DF0",
    "requestId": "ba7a5e37-4fdf-4de6-80bb-c428149deaea",
    "mobileNumber": "7224996066",
    "gatewayReferenceId": "amazonpaylater_test",
    "clientAuthToken": "tkn_ba1314a42fa747e98bc4cbaffe9a4552",
    "action": "createWallet"
}
```



#### **Sample Linking Response:** 




#### Shell Code Snippet:

```shell
{
    "service": "in.juspay.hyperapi",
    "requestId": "a9dab6ef-05ad-4f36-9305-11dafdb9af4e",
    "payload": {
        "action": "createWallet",
        "wallet": "AMAZONPAY",
        "token": "tkn_614d9850874d4620bf41e24f733d3f1c",
        "subDetails": [
            {
                "paymentMethodType": "CONSUMER_FINANCE",
                "paymentMethod": "AMAZONPAYLATER",
                "lastRefreshed": "2023-09-18T13:08:18.814Z",
                "currentBalance": 100
            },
            {
                "paymentMethodType": "WALLET",
                "paymentMethod": "AMAZONPAY",
                "lastRefreshed": "2023-09-18T13:08:18Z",
                "currentBalance": 500
            }
        ],
        "metadata": {},
        "linked": true,
        "lastRefreshed": "2023-09-18T13:08:18.000Z",
        "id": "wlm_oaSmLFatgvNcxiGb",
        "gatewayReferenceId": "amazonpaylater_test",
        "currentBalance": 500
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}
```



## **Making a transaction** 




#### **Sample Transaction Request:** 




#### Shell Code Snippet:

```shell
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "consumerFinanceTxn",
        "orderId": "hyperorder45314",
        "walletMobileNumber": "1111111111",
        "preAuthEnabled": true,
        "paymentMethod": "AMAZONPAYLATER",
        "directWalletToken": "tkn_nvtQf8DP1A2oGoZu",
        "endUrls": [
            "https:\\/\\/shop\\.merchant\\.com\\/payments\\/handleResponse.*"
        ],
        "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
        "showLoader": true
    }
}
```



#### **Sample Transaction Response:** 




#### Shell Code Snippet:

```shell
{
    "service": "in.juspay.hyperapi",
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "payload": {
        "action": "consumerFinanceTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}
```



## **Refund Call** 



**Request CURL:** 


#### Shell Code Snippet:

```shell
curl --location 'https://sandbox.juspay.in/orders/test_1690556864/refunds' \
--header 'version: 2020-01-09' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic RTk4OEM4MTFGM0Q0RkVGODgyMjc5RDkwQjg1QUI3Og==' \
--data-urlencode 'unique_request_id=paypal_refund_1692948073' \
--data-urlencode 'amount=1'
```



#### **Sample Response:** 




#### json Code Snippet:

```json
{
    "order_id": "amazonpay1694704038",
    "udf3": "",
    "status": "CHARGED",
    "amount": 2,
    "auth_type": "",
    "refunded": true,
    "udf8": "",
    "udf5": "",
    "payment_method": "AMAZONPAYLATER",
    "gateway_id": 38,
    "refunds": [
        {
            "status": "PENDING",
            "amount": 2,
            "sent_to_gateway": true,
            "unique_request_id": "URI1694704086",
            "error_code": "Pending",
            "arn": "S04-0352630-5486414-R097904",
            "created": "2023-09-14T15:08:06Z",
            "initiated_by": "API",
            "refund_source": "AMAZONPAY",
            "error_message": "Pending",
            "expected_refund_credit_time": "2023-09-25T16:00:00Z",
            "id": "URI1694704086",
            "refund_type": "STANDARD",
            "ref": "S04-0352630-5486414-R097904"
        }
    ],
    "udf2": "",
    "payment_method_type": "CONSUMER_FINANCE",
    "txn_uuid": "mozwrE7MEb5WHaD6zES",
    "udf4": "",
    "customer_id": "cth_avWQeBoXuFCvyTt3",
    "udf10": "",
    "bank_pg": null,
    "payment_links": {
        "iframe": "https://sandbox.juspay.in/orders/ordeh_6b3ff52f9ff641cbb0d6d29da60b3318/payment-page",
        "web": "https://sandbox.juspay.in/orders/ordeh_6b3ff52f9ff641cbb0d6d29da60b3318/payment-page",
        "mobile": "https://sandbox.juspay.in/orders/ordeh_6b3ff52f9ff641cbb0d6d29da60b3318/payment-page"
    },
    "effective_amount": 2,
    "udf1": "",
    "payment_gateway_response": {
        "auth_id_code": "NA",
        "created": "2023-09-14T15:07:40Z",
        "rrn": "NA",
        "epg_txn_id": "S04-0352630-5486414",
        "txn_id": "azhar_test-amazonpay1694704038-1",
        "resp_message": "CaptureApproved",
        "resp_code": "CaptureApproved"
    },
    "product_id": "ProductId_54",
    "txn_detail": {
        "order_id": "amazonpay1694704038",
        "status": "CHARGED",
        "net_amount": 2,
        "error_code": "",
        "gateway_id": 38,
        "surcharge_amount": null,
        "txn_uuid": "mozwrE7MEb5WHaD6zES",
        "gateway": "AMAZONPAY",
        "created": "2023-09-14T15:07:38Z",
        "tax_amount": null,
        "txn_amount": 2,
        "error_message": "",
        "currency": "INR",
        "redirect": true,
        "express_checkout": false,
        "txn_id": "azhar_test-amazonpay1694704038-1",
        "txn_flow_type": "DIRECT_DEBIT"
    },
    "amount_refunded": 2,
    "customer_email": "apl-balance-supported+0-1694691186433wadp@amazon.com",
    "currency": "INR",
    "customer_phone": "7013486526",
    "metadata": {
        "payment_links": {
            "iframe": "https://sandbox.juspay.in/orders/ordeh_6b3ff52f9ff641cbb0d6d29da60b3318/payment-page",
            "web": "https://sandbox.juspay.in/orders/ordeh_6b3ff52f9ff641cbb0d6d29da60b3318/payment-page",
            "mobile": "https://sandbox.juspay.in/orders/ordeh_6b3ff52f9ff641cbb0d6d29da60b3318/payment-page"
        },
        "AMAZONPAY:gateway_reference_id": "amazonpaylater_test",
        "payment_page_client_id": "change"
    },
    "bank_error_message": "",
    "id": "ordeh_6b3ff52f9ff641cbb0d6d29da60b3318",
    "txn_id": "azhar_test-amazonpay1694704038-1",
    "merchant_id": "azhar_test",
    "maximum_eligible_refund_amount": 0,
    "udf7": "",
    "date_created": "2023-09-14T15:07:18Z",
    "bank_error_code": "",
    "offers": [],
    "udf9": "",
    "gateway_reference_id": "amazonpaylater_test",
    "return_url": "https://sandbox.juspay.in/r/9hifhh",
    "status_id": 21,
    "rewards_breakup": null,
    "udf6": ""
}
```



### **Order Status Call** 



**Request CURL:** 


#### Shell Code Snippet:

```shell
curl --location --request GET 'https://api.juspay.in/orders/MOTOINR1695191749
 \
--header 'version: 2021-10-25' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic OTc5Mzcx*****czRTlGOg==' 

Replace MOTOINR1695191749 with your order_id.
And OTc5Mzcx*****czRTlGOg== with your API_KEY
```



#### **Sample Resposne:** 




#### json Code Snippet:

```json
{
    "customer_email": "nagendra.p@juspay.in",
    "customer_phone": "7892369201",
    "customer_id": "cth_oKFk2gKvJUuwQ8Dq",
    "status_id": 10,
    "status": "NEW",
    "id": "ordeh_07343849498b49bca29a5d7725049a34",
    "merchant_id": "azhar_test",
    "amount": 1,
    "currency": "INR",
    "order_id": "MOTOINR1695191740",
    "date_created": "2023-09-20T06:35:40Z",
    "return_url": "https://sandbox.juspay.in/r/6JmlYW",
    "product_id": "product_150",
    "payment_links": {
        "iframe": "https://sandbox.juspay.in/orders/ordeh_07343849498b49bca29a5d7725049a34/payment-page",
        "web": "https://sandbox.juspay.in/orders/ordeh_07343849498b49bca29a5d7725049a34/payment-page",
        "mobile": "https://sandbox.juspay.in/orders/ordeh_07343849498b49bca29a5d7725049a34/payment-page"
    },
    "udf1": "",
    "udf2": "",
    "udf3": "",
    "udf4": "",
    "udf5": "",
    "udf6": "",
    "udf7": "",
    "udf8": "",
    "udf9": "",
    "udf10": "",
    "refunded": false,
    "amount_refunded": 0,
    "effective_amount": 1,
    "metadata": {
        "YES_BIZ:gateway_reference_id": "juspay_test",
        "payment_links": {
            "iframe": "https://sandbox.juspay.in/orders/ordeh_07343849498b49bca29a5d7725049a34/payment-page",
            "web": "https://sandbox.juspay.in/orders/ordeh_07343849498b49bca29a5d7725049a34/payment-page",
            "mobile": "https://sandbox.juspay.in/orders/ordeh_07343849498b49bca29a5d7725049a34/payment-page"
        },
        "payment_page_client_id": "change"
    },
    "offers": []
}
```


For more details on order create/order status and refund APIs, kindly visit this link[https://developer.juspay.in/reference/create-order-1](https://developer.juspay.in/reference/create-order-1)


# **Annexure** 



_**Webhooks:**_ To know more about webhooks and their sample responses, please visit this link[https://docs.juspay.in/resources/docs/common-resources/webhooks](https://docs.juspay.in/resources/docs/common-resources/webhooks)