Skip to main content

Documentation

Simulating a Payout Returned Status

Use this method in the sandbox to simulate the action of a third party that is required for returning the payout.

Relevant when the status of the payout is Completed.

Prerequisites:

This method triggers the Payout Returned Webhook. This webhook contains the same information as the response.

    • payout

    • ID of the payout. String starting with payout_.

    • .NET

      • using System;
        using System.Text.Json;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        var payout = "payout_cd35fbe8dc6fd7c2e67d44ad53a4367d";               
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("POST", $"/v1/payouts/return/{payout}", 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 = {};
            const result = await makeRequest(
              'POST',
              '/v1/payouts/return/payout_cd35fbe8dc6fd7c2e67d44ad53a4367d/',
              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);
        
        try {
            $object = make_request('post', '/v1/payouts/return/payout_cd35fbe8dc6fd7c2e67d44ad53a4367d');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        payout = 'payout_cd35fbe8dc6fd7c2e67d44ad53a4367d'  
        results = make_request(method='post',
                               path=f'/v1/payouts/return/{payout}')
        pprint(results)
  • /v1/payouts/return/:payout/

  • Return Payout

  • curl -X post
    https://sandboxapi.rapyd.net/v1/payouts/return/payout_f85eca81e10e2a0bd6bf0ac5ed35a926/
    -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'
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "465b4fc9-7845-44ba-a0ec-7204a0ab88c8"
        },
        "data": {
            "id": "payout_a5dfe5d57303d7bafb4644a43ba7493d",
            "payout_type": "bank",
            "payout_method_type": "gp_sepa_bank",
            "amount": 61,
            "payout_currency": "EUR",
            "sender_amount": 53.06,
            "sender_currency": "GBP",
            "status": "Returned",
            "sender_country": "US",
            "sender": {
                "id": "sender_bd2668b021895154506e4b581c0c2a0e",
                "country": "US",
                "entity_type": "company",
                "address": "1 St Katharines Way St Katharines Wapping London E1W 1UN",
                "name": "Cashdash UK Ltd",
                "date_of_incorporation": "08/10/1990",
                "postcode": "934539",
                "city": "AE Limbd",
                "phone_number": "447470554081",
                "company_name": "Cashdash UK Ltd",
                "currency": "GBP",
                "identification_type": "company_registered_number",
                "identification_value": "10207686",
                "beneficiary_relationship": "customer",
                "source_of_income": "business_income"
            },
            "beneficiary_country": "GP",
            "beneficiary": {
                "id": "beneficiary_de1f84ad75f48315e7fc7627779a96d2",
                "last_name": "Meme",
                "first_name": "Mehmet",
                "country": "GP",
                "entity_type": "individual",
                "address": "a2123",
                "name": "Mehmet Meme",
                "date_of_birth": "13/10/1990",
                "postcode": "12333",
                "city": "test",
                "phone_number": "12303839",
                "currency": "EUR",
                "identification_type": "identification_id",
                "identification_value": "***********",
                "bank_name": "CREDIT AGRICOLE S A",
                "bic_swift": "AGRIFRPPXXX",
                "iban": "FR7630006000011234567890189",
                "default_payout_method_type": "gp_sepa_bank"
            },
            "fx_rate": 1.1496977598,
            "instructions": [
                {
                    "name": "instructions",
                    "steps": [
                        {
                            "step1": "The funds will be transferred to the provided account details of the beneficiary"
                        }
                    ]
                }
            ],
            "instructions_value": {},
            "ewallets": [
                {
                    "ewallet_id": "ewallet_f69bdf976830363ec0146418f31ea4c1",
                    "amount": 53.06,
                    "percent": 100
                }
            ],
            "metadata": {},
            "description": "mydecsr",
            "created_at": 1728474259,
            "payout_fees": null,
            "expiration": null,
            "merchant_reference_id": null,
            "paid_at": null,
            "identifier_type": null,
            "identifier_value": null,
            "error": null,
            "paid_amount": 0,
            "statement_descriptor": null,
            "gc_error_code": null,
            "batch_file": null
        }
    }