Terminate Virtual Account
curl --request POST \
--url https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate', 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.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-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.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyVirtual Accounts
Terminate Virtual Account
Close a virtual account permanently
POST
/
v1
/
accounts
/
{account_id}
/
virtual-account-groups
/
{group_id}
/
virtual-accounts
/
{virtual_account_id}
/
terminate
Terminate Virtual Account
curl --request POST \
--url https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate', 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.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-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.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hopnow.io/v1/accounts/{account_id}/virtual-account-groups/{group_id}/virtual-accounts/{virtual_account_id}/terminate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodySets the virtual account’s status to
terminated and closes its bank details. Termination is permanent: a terminated virtual account cannot be reopened, and its account number is not issued again. The request takes no body.
Only an active virtual account can be terminated, and all three balances (available, pending_payin and held_for_payout) must be zero. Move the funds out first with a payout or a transfer, and wait for pending deposits and payouts to finish. A pending or frozen virtual account can only be closed by Hop.
The call is idempotent: terminating an already-terminated virtual account returns 200 with the virtual account unchanged.
Tell your payers to stop using the bank details before you terminate. A deposit sent to a terminated virtual account is not credited.
A virtual_account.updated webhook is sent when the status changes.
Requires an API key with write access on the virtual_accounts scope.
Path Parameters
The virtual account group’s external ID (starts with
vag_)Response
Returns the full virtual account object, the same shape as Get Virtual Account, withstatus set to terminated.
Errors
| Status | code | When |
|---|---|---|
404 | RESOURCE_NOT_FOUND | No such virtual account in this group on this account |
422 | VIRTUAL_ACCOUNT_HAS_BALANCE | A balance is not zero. details carry available, pending_payin and held_for_payout. |
422 | VIRTUAL_ACCOUNT_STATUS_TRANSITION_INVALID | The virtual account is pending or frozen. details carry current_status. |