Canceling a Payout

Stop a payout to a worker or business before it is confirmed. | Enterprise

Rapyd makes it easy to cancel a payout after it was created. The payout can be canceled unless its status is confirmed or completed.

A customer's business needs to pay 110 Bulgarian Lev (BGN) to a worker's bank account, but the company wallet has only US dollars. The business owner creates a payout with automatic currency exchange. However, the they requested a payout of 110 BGN by mistake, so the business needs to cancel the payout. On your website, the business asks you to cancel the payout request. Your website back end asks Rapyd to process the request. Rapyd cancels the payout and notifies you that the payout was successfully canceled.

Canceling a Payout Workflow

  1. The website back end asks Rapyd to cancel the payout with the specific payout reference number.
  2. Rapyd processes the request to cancel the payout, and returns confirmation.
  3. The website back end receives the confirmation of the cancellation and notifies the customer.

How it Works

Requesting a Payout Cancellation

In this example, you want to cancel a payout that John Doe created. You ask Rapyd to cancel the payout.

Cancel Payout Request

Use the ID of the payout in the request to cancel the payout.

// Request URL: DELETE https://sandboxapi.rapyd.net/v1/payouts/payout_d85447ab91a76ac24f4b779dec8281f4

// Message body absent
using System;

namespace RapydApiRequestSample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {

                string payout = "payout_d85447ab91a76ac24f4b779dec8281f4";

                string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/payouts/{payout}");

                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error completing request: " + e.Message);
            }
        }
    }
}
const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

async function main() {
  try {
    const result = await makeRequest(
      'DELETE',
      '/v1/payouts/payout_d85447ab91a76ac24f4b779dec8281f4'
    );
    console.log(result);
  } catch (error) {
    console.error('Error completing request', error);
  }
}
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/<path-to-your-utility-file>/utilities.php";
include($path);

try {
    $object = make_request('delete', "/v1/payouts/payout_d85447ab91a76ac24f4b779dec8281f4");
    var_dump($object);
} catch (Exception $e) {
    echo "Error: $e";
}
?>
from pprint import pprint

from utilities import make_request

payout = 'payout_d85447ab91a76ac24f4b779dec8281f4'
results = make_request(method='delete',
                       path=f'/v1/payouts/{payout}')
pprint(results)

Cancel Payout Response

Let's take a look at the response. Payout Object describes the fields in the response.

{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "637221bb-f165-49e1-9253-0c8f2a105305"
    },
    "data": {
        "id": "payout_d85447ab91a76ac24f4b779dec8281f4",
        "payout_type": "bank",
        "payout_method_type": "bg_general_bank",
        "amount": 1100,
        "payout_currency": "BGN",
        "sender_amount": 628.40,
        "sender_currency": "USD",
        "status": "Canceled",
        "sender_country": "BG",

          // ...
          
        "fx_rate": 0.571276,

          // ...
          
        "ewallets": [
            {
                "ewallet_id": "ewallet_4f8009d08b7b41e5d3b356494101d83b",
                "amount": 1100,
                "percent": null
            }
        ],

          // ...
          
        "merchant_reference_id": "GHY-0YU-HUJ-POI"

          // ...
          
    }
}

The status field in the data section of this response shows that the payout was canceled successfully.

📘

Looking for more in-depth technical information?

Want to see the Rapyd API methods and objects that you'll use?
Visit the Rapyd API Reference Documentation for more technical details.

Updated 2 months ago


Canceling a Payout


Stop a payout to a worker or business before it is confirmed. | Enterprise

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.