---
page_source: https://juspay.io/in/docs/payment-method-integrations/express-checkout-api/amazonpaylater-integration/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 SDK plug-in version (2.0.4 and above)
* 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.




### Step 4 Enable Paylater on UI


* Enable Paylater on Juspay Studio if not done already.
* Enable  **"useTokenizedFlow": ["AMAZONPAY"]**  in studio to support link and pay flow.



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




## **Handling In-eligible Cases** 




### Step 1.1. Appropriate error messages will be shown to in-eligible users


1.  **Complete your registration on Amazon app** 

2.  **Your KYC has expired, complete KYC on Amazon app** 

3.  **Your account is not eligible for this transaction** 

4.  **Check your available credit on the Amazon app** 

5.�� **Amazon Pay Later is unavailable for this transaction** 

6.  **You have insufficient credit for this transaction** For any other responses from Amazon, **“Amazon Pay Later is unavailable for this transaction”** will be displayed.



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




# **Payment Page Request and Response** 




## **Invoking Payment Page** 




#### After enabling the payment method on gateway control, Amazon PayLater will be shown to eligible users in the PayLater Section. 




#### **Sample Session Request:** 




#### Shell Code Snippet:

```shell
curl --location --request POST 'https://sandbox.juspay.in/session' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic 82Q19002******==' \
--data-raw '{
    "order_id": "ref_939",
    "amount": "100.0",
    "customer_id": "cth_pKL9ayw75febC1Dd",
    "customer_email": "test@mail.com",
    "customer_phone": "9986028298",
    "payment_page_client_id": "sugar",
    "action": "paymentPage",
    "return_url": "http://www.juspay.in",
    "description": "Complete your payment",
    "first_name": "Monkey.D",
    "last_name": "Luffy",
    "product_id": "test123",
    "quantity": "1",
    "merchant_id": "merchant_success",
    "currency": "INR",
    "metadata.AMAZONPAY:gateway_reference_id": "amazon_test"
    }'
```



#### **Sample Response:** 




#### json Code Snippet:

```json
{
  "status": "NEW",
  "id": "ordeh_54cca71a932840399502d3b2666c729d",
  "order_id": "ref_253",
  "payment_links": {
    "web": "https://sandbox.juspay.in/orders/ordeh_54cca71a932840399502d3b2666c729d/payment-page",
    "expiry": null
  },
  "sdk_payload": {
    "requestId": "2b81edee38e34f8e82a581fcedf6eef4",
    "service": "in.juspay.hyperpay",
    "payload": {
      "clientId": "geddit",
      "amount": "100.0",
      "metadata.AMAZONPAY:gateway_reference_id": "amazon_test",
      "merchantId": "merchant_success",
      "clientAuthToken": "tkn_defae86c77db4ce880cb2be9ffdb82b2",
      "clientAuthTokenExpiry": "2023-08-21T12:11:59Z",
      "environment": "sandbox",
      "lastName": "Luffy",
      "quantity": "1",
      "action": "paymentPage",
      "customerId": "cth_jJeDKnpQDuL8XWk6",
      "returnUrl": "http://www.juspay.in",
      "currency": "INR",
      "firstName": "Monkey.D",
      "customerPhone": "9986028298",
      "customerEmail": "test@mail.com",
      "orderId": "ref_253",
      "productId": "test123",
      "description": "Complete your payment"
    }
  }
}

```



## **Refund Call** 



**Request CURL:** 


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://sandbox.juspay.in/orders/amazonpay1694704038/refunds' \
--header 'version: 2023-04-1' \
--header 'Authorization: Basic MEQ1N0U5MTJDQzU0OEE4QjZDQUIzOUVCOTdGQzhCOg==' \
--form 'unique_request_id="URI1694704374"' \
--form 'amount="2"'
```



#### **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/<order_id>
 \
--header 'version: 2021-10-25' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic OTc5Mzcx*****czRTlGOg==' 
```



#### **Pre-requisites** 



**1.1 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_ 

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Screenshot%202023-09-29%20at%204.12.19%20PM.png)



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