---
title: "eWallets"
source_url: https://docs.rapyd.net/en/ewallets.html
lang: en
---

# eWallets

eWallet is a secure and easy payment method which is expected to surpass credit card usage in the next five years.

### eWallet Use Case

Enable your customers to use their preferred eWallet to pay for purchases on your website or app. An eWallet is a payment category utilizing unique local payment methods a part of the Rapyd Global Payments Network.

Common [eWallet](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_ewallet "eWallet") Payments include:

- [GrabPay](https://docs.rapyd.net/en/grabpay.md "GrabPay") (Southeast Asia)
- PayTM (India)
- Samsung Pay ewallet (Korea)
- FamiPay (Japan)

> **Note:**
>
> If you are using Rapyd Hosted Checkout, simply select eWallet as one of your accepted payment methods. A full list of eWallet Payment Methods is found in Client Portal as described in [Viewing Payment Methods](https://docs.rapyd.net/en/viewing-payment-methods.md "Viewing Payment Methods")

### eWallet Checkout

1. Select your eWallet.
2. Click **Place Your Order** .

   ![6480838f102e6.png](image/img-dc6eb3d5176323a9bea0516dbc6a87e5.png)
3. Complete the payment.

   ![64808391893b3.png](image/img-334c8a7f676631a406fcc6c85554fc1c.png)
4. Redirect to the **payment success** page.

   ![64808394261ee.png](image/img-79f8fb9b3d45511a2ff7e87cb440dee2.png)

### eWallet Payment Workflow

Finding the specific ewallet payment methods you'll accept and the corresponding required fields that customers fill out is described under How it Works.

### Step 1: Customer Purchase

![customer-purchase.jpg](image/img-fefcacb7b624b60ce52e037be53f19b9.jpg)

1. A customer using your website or app selects an item that costs 19.99 SGD (Singapore Dollars) and adds it to the shopping cart. The customer presses the checkout button and arrives on the payment page and selects the option to pay with an ewallet.
2. You request Rapyd for the ewallet details and present to customer.
3. The customer fills in the ewallet details and confirms the payment by pressing **Pay**.

### Step 2: Processing Payment

![process-payment.jpg](image/img-06ef40b66468fb8c3681538fa478ca97.jpg)

1. The website back end requests Rapyd to process the customer's payment, specifying the amount, currency, payment method, and your payment success URL and error URL.
2. Rapyd processes the transaction and responds with a unique URL for the customer to complete the payment. The URL is valid only for this payment.
3. Your website directs the customer to the [redirect URL](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_redirect "Redirect URL") of the ewallet website.

### Step 3: Completing the Payment

![complete-payment.jpg](image/img-85fc33b9b6c70e46196d451f5c3f6e03.jpg)

1. On the ewallet website, the customer follows the instructions to complete the payment by entering ewallet details.
2. The ewallet website redirects the customer to the URL you specified for a successful payment or for an unsuccessful payment. The ewallet website notifies Rapyd.
3. Rapyd sends a webhook to your back end, indicating that the payment was completed.

### How eWallets Work

### Find Available eWallets

> **Note:**
>
> SG (Singapore) and SGD (Singapore Dollar) is used for country and currency in the sample codes below.

To identify eWallets that are available in SG and SGD, use [List Payment Methods by Country](https://docs.rapyd.net/en/list-payment-methods-by-country.md "List Payment Methods by Country") with the following parameters:

Description of Query Parameters

| Query Parameter | Description |
| --- | --- |
| country | Enter **SG** as the country code. |
| currency | Enter **SGD** as the currency code. |

### List Payment Methods by Country Request

Request a list of all payment methods available in SG that support SGD.

- - Request

    - ```
      // Request URL: GET https://sandboxapi.rapyd.net/v1/payment_methods/country?country=SG&currency=SGD

      // Message body absent
         
      ```

### List Payment Methods by Country Response

[List Payment Methods by Country](https://docs.rapyd.net/en/list-payment-methods-by-country.md "List Payment Methods by Country") describes the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "53776342-3d2d-4f20-b54b-8b402f6ef88c"
          },
          "data": 
          [
              {
                  "type": "sg_grabpay_ewallet",
                  "name": "Grabpay eWallet Payments Singapore",
                  "category": "ewallet",
                  "image": "",
                  "country": "sg",
                  "payment_flow_type": "redirect_url",
                  "currencies": [
                      "SGD"
                  ],
                  "status": 1,
                  "is_cancelable": false,
                  "payment_options": [],
                  "is_expirable": false,
                  "is_online": false,
                  "minimum_expiration_seconds": null,
                  "maximum_expiration_seconds": null
              }
          ]
      }
         
      ```

The `data` section of this response shows that **sg_grabpay_ewallet** is an acceptable eWallet payment method.

> **Note:**
>
> A full response lists many payment methods.

### Find the Required Fields for the Payment Method

Identify the fields that your customer needs to complete for the payment method. To do that, use [Get Payment Method Required Fields](https://docs.rapyd.net/en/get-payment-method-required-fields.md "Get Payment Method Required Fields") with the following parameter:

Description of Path Parameters

| Path Parameter | Description |
| --- | --- |
| type | Enter **sg_grabpay_ewallet** as the payment method type. |

### Get Payment Method Required Fields Request

Request a set of required fields for  **sg_grabpay_ewallet**.

- - Request

    - ```
      // Request URL: GET https://sandboxapi.rapyd.net/v1/payment_methods/sg_grabpay_ewallet/required_fields

      // Message body absent
         
      ```

### Get Payment Method Required Fields Response

[Payment Method Required Fields](https://docs.rapyd.net/en/get-payment-method-required-fields.md "Get Payment Method Required Fields") describes the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "4d0d21b9-8cc0-4e93-81c3-27a184fdd8c2"
          },
          "data": {
              "type": "sg_grabpay_ewallet",
              "fields": [],
              "payment_method_options": [],
              "payment_options": [],
              "minimum_expiration_seconds": null,
              "maximum_expiration_seconds": null
          }
      }
         
      ```

The response shows that for  **sg_grabpay_ewallet**, the customer does not ne

### Process the Payment

When your customer checks out on your website, use [Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment") with the following parameters to get Rapyd to process your customer's bank payment:

Description of Body Parameters

| Body Parameter | Description |
| --- | --- |
| amount | Enter **19.99** as the payment amount. |
| currency | Enter **SGD** as the currency code. |
| payment_method | Enter an object with the following fields:  - `type` - **sg_grabpay_ewallet** - `fields` - An empty object. |
| complete_payment_url | Replace the  **https://success_example.net** example with your real website URL where you want to redirect the customer to when the payment succeeds. |
| error_payment_url | Replace the  **https://error_example.net** example with your real website URL where you want to redirect the customer to when the payment fails. |

### Create Payment Request

Request Rapyd to process the customer's eWallet payment (19.99 SGD in this case) and to collect the payment for you.

- - Request

    - ```
      / Request URL: POST https://sandboxapi.rapyd.net/v1/payments

      // Message body: 
      {
          "amount": 19.99,
          "currency": "SGD",
          "payment_method": {
              "type": "sg_grabpay_ewallet",
              "fields": {}
          },
          "complete_payment_url":"http://www.example.com/complete",
          "error_payment_url":"http://www.example.com/error"
      }

         
      ```

### Create Payment Response

See [Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment") for a description of the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "f3b3a4f5-1713-460b-a770-ec8f4c2ccbb2"
          },
          "data": {
              "id": "payment_56410597a0196e1eec00954b3440461b",
              "amount": 0,
              "original_amount": 19.99,
              "is_partial": false,
              "currency_code": "SGD",
              "country_code": "sg",
              "status": "ACT",
              "description": "",
              "merchant_reference_id": "",
              "customer_token": "cus_1daa2cf4216845afdd277bb6d8f9dadf",
              "payment_method": "other_6afd4e09b6a2d22b7460a5dc3810112a",
              
      //      ...          
                
              "redirect_url": "https://sandboxdashboard.rapyd.net/complete-bank-payment?token=payment_56410597a0196e1eec00954b3440461b&complete_payment_url=https://success_example.net&error_payment_url=https://error_example.net",
              "complete_payment_url": "https://success_example.net",
              "error_payment_url": "https://error_example.net",
              
      //      ...          
                
              "created_at": 1591620906,
              
      //      ...          
                
              "ewallet_id": "ewallet_1a867a32b47158b30a8c17d42f12f3f1",
              "ewallets": [
                  {
                      "ewallet_id": "ewallet_1a867a32b47158b30a8c17d42f12f3f1",
                      "amount": 19.99,
                      "percent": 100,
                      "refunded_amount": 0
                  }
              ],
              "payment_method_options": {},
              "payment_method_type": "sg_grabpay_ewallet",
              "payment_method_type_category": "ewallet",
                
      //     ...  
                
          }
      }
         
      ```

The response shows:

- The payment `id` is **payment_56410597a0196e1eec00954b3440461b**. When you run this example in your own sandbox, you will get a different ID, which you will need for later steps.
- The `amount` is  **19.99**.
- The `currency_code` is **SGD** (Singapore dollars).
- The `status` (under `data`) is **ACT** (active). This means that the payment process is active but not complete.
- These URLs are included:

  - `redirect_url` - You redirect your customer to this one-time eWallet website URL to complete the payment.
  - `complete_payment_url` and  `error_payment_url` - Rapyd provides these URLs to the eWallet website to redirect the customer back to your website depending on whether the purchase succeeded.

Your website redirects the customer to the eWallet website. After the customer successfully pays:

1. The eWallet website redirects the customer to the URL you provided for a successful payment.
2. The eWallet website informs Rapyd that the payment was completed successfully.
3. Rapyd sends you a webhook with details of the completed transaction.

> **Note:**
>
> The sandbox does not directly simulate the action of the customer completing the transaction with the local eWallet. You can simulate this action with the procedure described in [Complete Payment](https://docs.rapyd.net/en/complete-payment-363014.md "Complete Payment"). For this, you will need the payment ID that you generated in your sandbox.
>
> Configure your system to receive webhooks with the procedure described in [Defining a Webhook Endpoint](https://docs.rapyd.net/en/defining-a-webhook-endpoint.md "Defining a Webhook Endpoint").

Let's take a look at [Webhook - Payment Completed](https://docs.rapyd.net/en/payment-completed-webhook.md "Payment Completed Webhook") .

- - Webhook

    - ```
      {
          "id": "wh_718940ccd8fd308b43da58fdd05thj78",
          "type": "PAYMENT_COMPLETED”,

      ",
          "data": {
              "id": "payment_56410597a0196e1eec00954b3440461b",
              "fee": 0,
              "paid": true,
              "order": null,
              "amount": 19.99,
              "status": "CLO",

      //      ...      

              "captured": true,

      //      ...      

              "created_at": "1591620916",

      //      ...      

              "redirect_url": "https://sandboxdashboard.rapyd.net/complete-bank-payment?token=payment_56410597a0196e1eec00954b3440461b&complete_payment_url=https://success_example.net&error_payment_url=https://error_example.net",

      //      ...      

              "currency_code": "SGD",

      //      ...      

              "customer_token": "cus_1daa2cf4216845afdd277bb6d8f9dadf",
              "payment_method": "other_6afd4e09b6a2d22b7460a5dc3810112a",

      //      ...      

              "original_amount": 19.99,

      //      ...      
         
              "error_payment_url": "https://https://error_example.net",
              "payment_method_type": "",
              "complete_payment_url": "https://success_example.net",

      //      ...      

              "payment_method_type_category": "ewallet"
          },

      //      ...      

          "created_at": 1591620906
      }
         
      ```

The `data` section of the webhook contains the same type of information as the response to the Create Payment request, except that the `status` now is  **CLO** (closed). This shows that the transaction is complete.
