---
title: "Withdrawing Cash"
source_url: https://docs.rapyd.net/en/withdrawing-cash.html
lang: en
---

# Withdrawing Cash

Receive cash at a physical location.

Rapyd makes it easy for you to enable customers to withdraw cash using a [POS](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_pos "Point of Sale"). The POS API provide methods for handling cash at Rapyd POS locations, such as ATMs and retail stores.

In this use case, the POS withdraws 10 GBP (Pound Sterling) from the customer’s [eWallet](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_ewallet "eWallet"), and then gives her 10 GBP (Pound Sterling) in cash.

For example, the customer would like to withdraw 10 GBP from their eWallet and receive it as cash from a POS. The POS withdraws 10 GBP from the customer’s eWallet and give her 10 GBP in cash.

## Withdrawal Workflow

Let’s look at the highlights of your workflow.

### Step 1: Customer Gets Code

![customer-gets-code.png](image/img-45e7f741111eaf2ad00c73e151026c0b.jpg)

1. The customer runs the mobile application that you provide to your customers for managing their eWallets, and requests an [OTP](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_otp "One-time password") in order to withdraw 10 GBP (Pound Sterling) in cash at a specific POS.
2. The mobile application provides an authorization code to the customer.

### Step 2: Opening a Session

![open-a-session.png](image/img-aad711f946c1cb55f00cac2b29a7c8e4.jpg)

1. You request to open a session.
2. Rapyd opens session and displays the field values necessary for withdrawal.

### Step 3: Withdrawing

![withdrawing.jpg](image/img-c47bca14586a55299533d243cb84aac4.jpg)

1. You create a withdrawal request with the field values that you received in the ‘opening a session’ stage.
2. Rapyd executes the withdrawal.
3. POS give 10 GBP (Pound Sterling) in cash to the customer.

### Step 4: Closing a Session

![close-a-session.jpg](image/img-5c40ebc455ad6c0a4dadf71cabe2af23.jpg)

1. You request to close the session with the field values that you received in the ‘opening a session’ stage.
2. Rapyd closes the session.

## Implementing the Workflow

Let's take a quick look at how you'll use Rapyd's API to implement the workflow.

To withdraw from customer's eWallet:

1. Ask Rapyd to open a session.
2. Ask Rapyd to withdraw 10 GBP (Pound Sterling) from the customer’s eWallet.

To end a session:

- Ask Rapyd to close a session.

## How Withdrawing Cash Works

### Finding the OTP Code

> **Note:**
>
> To generate a one-time password (OTP) code, the customer uses the Rapyd SDK mobile application that you provide to your customers for managing their eWallets.

1. The customer runs the mobile application that you provide to your customers for managing their eWallets (the merchant app).
2. The customer requests an OTP code, and the app displays `876680` as the OTP code.
3. The customer provides the OTP code at the POS.

   Make sure to store the OTP code for future use.

   ![643e80887a49c.png](image/img-10efdebeade79076745707d659a0893c.png)

### Opening Session

> **Note:**
>
> After the OTP is displayed, it is valid for absolute 30 seconds, meaning that if the OTP is generated at 11:42:25 then this code will be valid for an additional 5 seconds until 11:42:30. If you do not open a session within absolute 30 seconds then the customer must retrieve a new OTP code.

You’ll use the [Open Session](https://docs.rapyd.net/en/open-session.md "Open Session") method to open a session for a withdrawal with the following parameters:

### Description of Header Parameters

| Header Parameter | Description |
| --- | --- |
| access_key | Enter  **8C6223151345345D** as the access key. |
| phone_number | Enter **+14155559992** as the customer's phone number. |
| Content-Type | Enter  **application/json** as the type of content. |

### Description of Path Parameters

| Path Parameter | Description |
| --- | --- |
| pos_id | Enter  **z128ffb-11a5-11l9-93p5-1231a8maf28** as the ID of the point-of-sale location. The `pos_id` value is unique for each point of sale location, and it is provided to you directly from Rapyd. |
| otp_code | Enter **876680** as the `otp_code`. |

### Opening Session Request

You ask Rapyd to open a session.

- - Request

    - ```
      // Request URL: POST https://sandboxpos.rapyd.net/v1/pos/login/z128ffb-11a5-11l9-93p5-1231a8maf28/876680

      access_key: 8C6223151345345D
      phone_number: +14155559992
      Content-Type: application/json

      // No message body
                        
      ```

### Opening Session Response

Let's take a look at the [Open Session](https://docs.rapyd.net/en/open-session.md "Open Session") response.

- - Response

    - ```
      {
         "status": {
             "error_code": "",
             "status": "SUCCESS",
             "message": "",
             "response_code": "",
             "operation_id": "d1063f84-977b-48f5-a3a3-a3e4d94be47f"
         },
         "data": {
             "token_id": "d9b7398f-5c2f-438c-8ac6-68e79f28c02e",
             "operation_id": "95e2c071-9513-48d6-a717-a480814f7df8",
             "accounts": [
                 {
                     "account_id": "64e4a964-53b5-11e9-8495-02f0df928b",
                     "account_currency": "GBP",
                     "account_alias": "GBP",
                     "account_balance": 189,
                     "account_currency_symbol": "£"
                 }
             ]
         }
      }
                        
      ```

The `data` section of the response shows that:

- The customer's eWallet includes one account for the **GBP** currency. Its `account_id` is **64e4a964-53b5-11e9-8495-02f0df928b**.
- The `token_id` is **d9b7398f-5c2f-438c-8ac6-68e79f28c02e**.
- The `operation_id` is **95e2c071-9513-48d6-a717-a480814f7df8**.

Make sure to store these field values for future use.

### Withdrawing

You’ll use the [Withdraw](https://docs.rapyd.net/en/withdraw.md "Withdraw") method to withdraw 10 GBP from the customer's eWallet. Make a withdrawal with the following parameters:

### Description of Header Parameters

| Header Parameter | Description |
| --- | --- |
| Content-Type | Enter  **application/json** as the type of content. |
| access_key | Enter  **8C6223151345345D** as the access key. |
| token_id | Enter  **d9b7398f-5c2f-438c-8ac6-68e79f28c02e** as the  `token_id`, which was displayed in the open session response. |
| operation_id | Enter  **95e2c071-9513-48d6-a717-a480814f7df8** as the  `operation_id`, which was displayed in the open session response. |
| phone_number | Enter **+14155559992** as the customer's phone number |

### Description of Path Parameters

| Path Parameter | Description |
| --- | --- |
| account | Enter  **64e4a964-53b5-11e9-8495-02f0df928b** as the ID of the  `account`. This is the 'account_id' of the customer's **GBP** account that was displayed in the open session response. |
| sum | Enter **10** as the `sum` in **GBP** . |

### Withdrawing Request

You ask Rapyd to withdraw funds from an eWallet account.

- - Request

    - ```
      // Request URL: POST https://sandboxpos.rapyd.net/v1/pos/withdraw/64e4a964-53b5-11e9-8495-02f0df928b/10

      Content-Type: application/json
      access_key: 8C6223151345345D 
      token_id: d9b7398f-5c2f-438c-8ac6-68e79f28c02e 
      operation_id: 95e2c071-9513-48d6-a717-a480814f7df8 
      phone_number: +14155559992

      // No message body
                        
      ```

### Withdraw Response

Let's take a look at the [Withdraw](https://docs.rapyd.net/en/withdraw.md "Withdraw") response.

- - Response

    - ```
      {
         "status": {
             "error_code": "",
             "status": "SUCCESS",
             "message": "",
             "response_code": "",
             "operation_id": "0c211a3c-a4c4-4708-bbe9-7628ddd07437"
         },
         "data": {
             "transaction_id": "4e61e815-b68f-11e9-9ffc-12c4c8fed768"
         }
      }
      ```

The `data` section of this response shows that the `transaction_id` is  **4e61e815-b68f-11e9-9ffc-12c4c8fed768**.

At this stage the POS provides **10 GBP** in cash to the customer.

### Closing Session

You’ll use the [Close Session](https://docs.rapyd.net/en/close-session.md "Close Session") method to close a session for a withdrawal. Close a session with the following parameters:

### Description of Header Parameters

| Header Parameter | Description |
| --- | --- |
| Content-Type | Enter  **application/json** as the type of content. |
| access_key | Enter  **8C6223151345345D** as the access key. |
| token_id | Enter  **d9b7398f-5c2f-438c-8ac6-68e79f28c02e** as the  `token_id`, which was displayed in the open session response. |
| operation_id | Enter  **95e2c071-9513-48d6-a717-a480814f7df8** as the  `operation_id`, which was displayed in the open session response. |
| phone_number | Enter +14155559992 as the customer's phone number. |

### Closing Session Request

You ask Rapyd to close the session.

- - Request

    - ```
      // Request URL: POST https://sandboxpos.rapyd.net/v1/pos/logout

      Content-Type: application/json
      access_key: 8C6223151345345D 
      token_id: d9b7398f-5c2f-438c-8ac6-68e79f28c02e 
      operation_id: 95e2c071-9513-48d6-a717-a480814f7df8 
      phone_number: +14155559992

      // No message body

                        
      ```

### Closing Session Response

Let's take a look at the [Close Session](https://docs.rapyd.net/en/close-session.md "Close Session") response.

- - Response

    - ```
      {
         "status": {
             "error_code": "",
             "status": "SUCCESS",
             "message": "",
             "response_code": "",
             "operation_id": "09666c40-77fa-49c7-be73-82ade0217c8e"
         }
      }
                        
      ```

The data section of this response shows that the session closed successfully.
