Deactivate a Treasury beneficiary
curl --request POST \
--url https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"clientId": "<string>",
"externalReference": "<string>",
"destination": {
"type": "payid",
"payId": "<string>",
"payIdType": "email",
"accountName": "<string>"
},
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "individual",
"firstName": "<string>",
"lastName": "<string>",
"dateOfBirth": "<string>",
"address": "<string>",
"partyContext": {},
"deactivatedAt": "2023-11-07T05:31:56Z"
}Treasury resource management
Deactivate a Treasury beneficiary
Deactivates a beneficiary for new payouts without deleting its identity or payout history.
POST
/
v1
/
treasury
/
beneficiaries
/
{id}
/
deactivate
Deactivate a Treasury beneficiary
curl --request POST \
--url https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.rails.wayex.com/v1/treasury/beneficiaries/{id}/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"clientId": "<string>",
"externalReference": "<string>",
"destination": {
"type": "payid",
"payId": "<string>",
"payIdType": "email",
"accountName": "<string>"
},
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "individual",
"firstName": "<string>",
"lastName": "<string>",
"dateOfBirth": "<string>",
"address": "<string>",
"partyContext": {},
"deactivatedAt": "2023-11-07T05:31:56Z"
}What this endpoint does
Deactivates a beneficiary for new payouts without deleting its identity or payout history.When to use it
Use it when a recipient should no longer be selectable, such as after destination details change.Before you call
Use a secret API key withtreasury:write and pass an active beneficiary ID owned by this tenant account.
Money and balance effect
This changes a resource or configuration but does not directly reserve, debit, credit, or settle wallet money.States and completion
Deactivation blocks new payout use. Existing accepted or historical payouts keep their original beneficiary snapshot and continue through their real lifecycle.Safe retries
Send a uniqueIdempotency-Key for the logical action. If the response is lost, retry the same payload with the same key; never create a new key merely because the first response timed out.
Read Beneficiaries and payouts for the complete workflow.Authorizations
BearerApiKey
Send the same Wayex API key as Authorization: Bearer <key>.
Headers
A unique key for this logical action. Reuse the same key and identical payload when retrying after an unknown response.
Required string length:
8 - 255Path Parameters
Response
200 - application/json
- Option 1
- Option 2
Minimum string length:
1Minimum string length:
1Your own reference for this beneficiary, echoed back for correlation. Wayex generates one when you do not supply it at creation.
Minimum string length:
1- Option 1
- Option 2
Show child attributes
Show child attributes
Available options:
active, inactive Available options:
individual Minimum string length:
1Minimum string length:
1Minimum string length:
1Optional free-form key/value metadata about the beneficiary party (e.g. your internal tags or travel-rule party context). Stored and returned; Wayex does not interpret the keys.
Show child attributes
Show child attributes

