---
title: "Set Transfer Response"
source_url: https://docs.rapyd.net/en/set-transfer-response.html
lang: en
---

# Set Transfer Response

Respond to a transfer of funds between wallets.

The transferee uses this method to accept or decline the transfer.

The sender can use this method to cancel the transfer, unless Rapyd Protect is reviewing the transfer.

This method triggers [Transfer Funds Between Wallets Response Webhook](https://docs.rapyd.net/en/transfer-funds-between-wallets-response-webhook.md "Transfer Funds Between Wallets Response Webhook").

> **Note:**
>
> - This method can be used only one time per transfer transaction, and must be used before the expiration date set in the request to create the transfer.
> - This endpoint replaces the deprecated endpoint - `POST /v1/account/transfer/response`
> - Rapyd continues to support the deprecated endpoint. No sunset date has been set.
> - The code samples include successful requests (200) and bad requests (400).
>
>   - For error messages that appear due to bad requests (400), see:
>
>     - [General Errors](https://docs.rapyd.net/en/general-errors.md "General Errors")
>     - [Wallet Transaction Errors](https://docs.rapyd.net/en/wallet-transaction-errors.md "Wallet Transaction Errors")
>   - For information about unauthorized request (401) and other authentication errors, see [Troubleshooting Authentication and Authorization Errors](https://docs.rapyd.net/en/troubleshooting-authentication-and-authorization-errors.md "Troubleshooting Authentication and Authorization Errors").

### Parameters

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - idempotency
  - A unique key that prevents the platform from creating the same object twice.

    See [Idempotency](https://docs.rapyd.net/en/idempotency.md "Idempotency").
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Request Body Parameters

- - id
  - ID of the transfer transaction, from the `id` field in the `data` object of the response. UUID.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - status
  - Determines how to handle the transfer. One of the following values:

    - **accept**
    - **decline**
    - **cancel**

      > **Note:**
      >
      > You cannot cancel a transfer that is being reviewed.

### Response Parameters

- - amount
  - Amount of the transaction, in units of the currency defined in `currency`. Decimal, including the correct number of decimal places for the currency exponent, as defined in ISO 4217:2015.
- - created_at
  - Time the transaction was made, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - currency_code
  - Three-letter ISO 4217 code for the currency used in the `amount` field.
- - destination_ewallet_id
  - ID of the wallet receiving the money. String starting with **ewallet_**.
- - destination_phone_number
  - Phone number of the owner of the wallet receiving the money, in E.164 format.
- - destination_transaction_id
  - ID of the transaction with regard to the destination. String starting with **wt_**.
- - expiration
  - The day the transfer expires, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - id
  - ID of the transaction. UUID.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - response_metadata
  - Metadata created with [Set Transfer Response](https://docs.rapyd.net/en/set-transfer-response.md "Set Transfer Response").
- - source_ewallet_id
  - ID of the wallet sending the money. String starting with **ewallet_**.
- - source_transaction_id
  - ID of the transaction with regard to the source. String starting with **wt_**.
- - status
  - Status of the transaction.

    - **CAN** - Canceled. The transferor canceled the transfer.
    - **CLO** - Closed. The transferee accepted the funds.
    - **DEC** - Declined. The transferee rejected the transfer.
    - **EXP** - Expired. The transferee did not respond before the transfer expired.
    - **HLD** - Hold. Rapyd Protect is putting this transfer on hold and reviewing it.
    - **PEN** - Pending. Waiting for the transferee to accept.
    - **REJ** - Rejected. Rapyd Protect has rejected this transfer.
- - transfer_response_at
  - Time of the [Set Transfer Response](https://docs.rapyd.net/en/set-transfer-response.md "Set Transfer Response") operation, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").

### Code Samples

- - .NET

    - ```csharp
      using System;
      using System.Text.Json;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      var metadata = new
                      {
                          merchant_defined = "accepted"
                      };

                      var requestObj = new
                      {
                          id = "5ecd1c11-6f42-11ea-833c-02e199f7f6f5",
                          metadata,
                          status = "accept",
                      };

                      string request = JsonSerializer.Serialize(requestObj);

                      string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/ewallets/transfer/response", request);

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const body = {
            id: '590d4d32-b07d-11ea-833c-02e199f7f6f5',
            metadata: {
              merchant_defined: "accepted"
            },
            status: 'accept'
          };
          const result = await makeRequest('POST', '/v1/ewallets/transfer/response', body);

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      $body = [
          'id' => 'b8fe12a9-b09d-11ea-833c-02e199f7f6f5',
          'metadata' => [
              'merchant_defined' => 'accepted'
          ],
          'status' => 'accept'
      ];

      try {
          $object = make_request('post', '/v1/ewallets/transfer/response', $body);
          var_dump($object);
      } catch(Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      body = {
          "id": '86dfc58c-b0a4-11ea-833c-02e199f7f6f5',
          "metadata": {
              "merchant_defined": "accepted"
          },
          "status": "accept"
      }

      results = make_request(method='post', path='/v1/ewallets/transfer/response', body=body)
      pprint(results)
      ```

- /v1/ewallets/transfer/response

- Accept
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/ewallets/transfer/response' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "id": "89a72f09-24b7-4eb4-9d49-9864f1d2abaf",
      "status": "accept"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "bcf6aeca-616b-4d6b-9c5b-5791efb31b0a"
      },
      "data": {
          "id": "89a72f09-24b7-4eb4-9d49-9864f1d2abaf",
          "status": "CLO",
          "amount": 50,
          "currency_code": "USD",
          "destination_phone_number": "",
          "destination_ewallet_id": "ewallet_b5320c566cc4aa01fe77440ad08693f7",
          "destination_transaction_id": "wt_164b36175995fdd464326a1f3b9f2ef7",
          "source_ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
          "source_transaction_id": "wt_eca5edf2b42bd86e66d3e1cd4fdb694c",
          "transfer_response_at": 1764834186,
          "created_at": 1764834155,
          "metadata": {},
          "response_metadata": {},
          "expiration": 1766043755
      }
  }
  ```

- Decline
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/ewallets/transfer/response' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "id": "cd76daac-90e8-4b52-bdb8-42126b532fb5",
      "status": "decline"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "68104161-5bd3-4d9f-a56c-c1b0fc4d4605"
      },
      "data": {
          "id": "cd76daac-90e8-4b52-bdb8-42126b532fb5",
          "status": "DEC",
          "amount": 50.21,
          "currency_code": "USD",
          "destination_phone_number": "",
          "destination_ewallet_id": "ewallet_b5320c566cc4aa01fe77440ad08693f7",
          "destination_transaction_id": "",
          "source_ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
          "source_transaction_id": "wt_e3ad25d6cb48c9c284786734c9b69969",
          "transfer_response_at": 1764837694,
          "created_at": 1764837669,
          "metadata": {},
          "response_metadata": {},
          "expiration": 1766047269
      }
  }
  ```

- Cancel by sender
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/ewallets/transfer/response' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "id": "1a61f54d-bd2c-4075-9ec4-33c8599e9f39",
      "status": "cancel"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "d758ed6c-aec6-4b74-b0cd-4c9b0337b781"
      },
      "data": {
          "id": "1a61f54d-bd2c-4075-9ec4-33c8599e9f39",
          "status": "CAN",
          "amount": 50.22,
          "currency_code": "USD",
          "destination_phone_number": "",
          "destination_ewallet_id": "ewallet_b5320c566cc4aa01fe77440ad08693f7",
          "destination_transaction_id": "",
          "source_ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
          "source_transaction_id": "wt_d75d7aebccda8dc7bb9a6230a1fa67e0",
          "transfer_response_at": 1764837748,
          "created_at": 1764837734,
          "metadata": {},
          "response_metadata": {},
          "expiration": 1766047334
      }
  }
  ```

- Bad Request - Transaction Expired
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/ewallets/transfer/response' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "id": "89a72f09-24b7-4eb4-9d49-9864f1d2abaf",
      "status": "accept"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "WALLET_TO_WALLET_TRANSFER_EXPIRED",
          "status": "ERROR",
          "message": "The request tried to respond to a wallet-to-wallet transfer, but the transaction had already expired. The request was rejected. Corrective action: Create a new wallet-to-wallet transfer.",
          "response_code": "WALLET_TO_WALLET_TRANSFER_EXPIRED",
          "operation_id": "e238b867-78db-4268-bd33-2846dfda3001"
      }
  }
  ```

- Bad Request - Transaction Already Closed
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/ewallets/transfer/response' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "id": "204e83ec-e5f4-4a96-8879-46b977ad01c8",
      "status": "accept"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "INVALID_TRANSFER_DETAILS",
          "status": "ERROR",
          "message": "The request tried to transfer funds from a wallet to another wallet, but the input parameters were not valid. The request was rejected. Corrective action: For 'currency', use the ISO 4217 code. For 'source_ewallet' and 'destination_ewallet', use the IDs of valid wallets.",
          "response_code": "ERROR_TRANSFER_RESPONSE_INVALID_DETAILS",
          "operation_id": "ce2ebeb7-d1fd-4f54-903f-680565ed37ed"
      }
  }
  ```
