Skip to main content

Documentation

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.

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.

    • id

    • ID of the transfer transaction, from the id field in the data object of the response. UUID.

    • 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.

Code Samples
    • .NET

      • 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

      • 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
        $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

      • 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 -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'
    -d '{
      "id": "d1e8d8a4-b905-11ed-875e-0255f3382f2f",
      "metadata": {
          "merchant_defined": "accepted"
      },
      "status": "accept"
    }
    '
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "38d69aab-b63e-4b7f-afbd-46b0368d30b3"
        },
        "data": {
            "id": "d1e8d8a4-b905-11ed-875e-0255f3382f2f",
            "status": "CLO",
            "amount": 10,
            "currency_code": "EUR",
            "destination_phone_number": null,
            "destination_ewallet_id": "ewallet_8f67fd4defacca9e5401f3829a68228a",
            "destination_transaction_id": "wt_acb4ba1785b7c96ccfd7c44ba8e4a9cd",
            "source_ewallet_id": "ewallet_613fd9c6593f44ffac0f1532c4eb9e18",
            "source_transaction_id": "wt_d3133e9bc96c23b9c139a3281f3b7592",
            "transfer_response_at": 1677767933,
            "created_at": 1677767016,
            "metadata": {
                "merchant_defined": true
            },
            "response_metadata": {
                "merchant_defined": "accepted"
            },
            "expiration": 1678103732
        }
    }
  • Decline

  • 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'
    -d '{
      "id": "3368612a-b908-11ed-875e-0255f3382f2f",
      "metadata": {
          "merchant_defined": "declined"
      },
      "status": "decline"
    }
    '
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "305b32eb-b546-4d15-bd7a-475ec89ab20a"
        },
        "data": {
            "id": "3368612a-b908-11ed-875e-0255f3382f2f",
            "status": "DEC",
            "amount": 10,
            "currency_code": "EUR",
            "destination_phone_number": null,
            "destination_ewallet_id": "ewallet_8f67fd4defacca9e5401f3829a68228a",
            "destination_transaction_id": "",
            "source_ewallet_id": "ewallet_613fd9c6593f44ffac0f1532c4eb9e18",
            "source_transaction_id": "wt_994ef31786ae3e3f7eec348c5433b14a",
            "transfer_response_at": 1677768077,
            "created_at": 1677768039,
            "metadata": {
                "merchant_defined": true
            },
            "response_metadata": {
                "merchant_defined": "declined"
            },
            "expiration": 1678103732
        }
    }
  • Cancel by sender

  • 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'
    -d '{
        "id": "811d3621-b908-11ed-875e-0255f3382f2f",
        "metadata": {
            "merchant_defined": "canceled"
        },
        "status": "cancel"
    }
    '
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "68fdb540-2810-4377-b6ad-0f6bbd82fa71"
        },
        "data": {
            "id": "811d3621-b908-11ed-875e-0255f3382f2f",
            "status": "CAN",
            "amount": 10,
            "currency_code": "EUR",
            "destination_phone_number": null,
            "destination_ewallet_id": "ewallet_8f67fd4defacca9e5401f3829a68228a",
            "destination_transaction_id": "",
            "source_ewallet_id": "ewallet_613fd9c6593f44ffac0f1532c4eb9e18",
            "source_transaction_id": "wt_c986b13f010ebf27867945cb30e68301",
            "transfer_response_at": 1677768191,
            "created_at": 1677768169,
            "metadata": {
                "merchant_defined": true
            },
            "response_metadata": {
                "merchant_defined": "canceled"
            },
            "expiration": 1678103732
        }
    }