Update a settlement rule
curl --request POST \
--url https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "{{$guid}}",
"chain": "BASE",
"includeHIFIFee": false,
"rules": [
{
"type": "PERCENTAGE",
"calculationModel": "FIXED",
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b",
"value": 0.001,
"tiers": [
{
"min": "1000",
"max": "2000",
"value": 0.0005
}
]
}
]
}
'import requests
url = "https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update"
payload = {
"requestId": "{{$guid}}",
"chain": "BASE",
"includeHIFIFee": False,
"rules": [
{
"type": "PERCENTAGE",
"calculationModel": "FIXED",
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b",
"value": 0.001,
"tiers": [
{
"min": "1000",
"max": "2000",
"value": 0.0005
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '{{$guid}}',
chain: 'BASE',
includeHIFIFee: false,
rules: [
{
type: 'PERCENTAGE',
calculationModel: 'FIXED',
walletAddress: '0x15FB50680fEB2f726413416665c25f9B397b047b',
value: 0.001,
tiers: [{min: '1000', max: '2000', value: 0.0005}]
}
]
})
};
fetch('https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update', 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://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requestId' => '{{$guid}}',
'chain' => 'BASE',
'includeHIFIFee' => false,
'rules' => [
[
'type' => 'PERCENTAGE',
'calculationModel' => 'FIXED',
'walletAddress' => '0x15FB50680fEB2f726413416665c25f9B397b047b',
'value' => 0.001,
'tiers' => [
[
'min' => '1000',
'max' => '2000',
'value' => 0.0005
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update"
payload := strings.NewReader("{\n \"requestId\": \"{{$guid}}\",\n \"chain\": \"BASE\",\n \"includeHIFIFee\": false,\n \"rules\": [\n {\n \"type\": \"PERCENTAGE\",\n \"calculationModel\": \"FIXED\",\n \"walletAddress\": \"0x15FB50680fEB2f726413416665c25f9B397b047b\",\n \"value\": 0.001,\n \"tiers\": [\n {\n \"min\": \"1000\",\n \"max\": \"2000\",\n \"value\": 0.0005\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"{{$guid}}\",\n \"chain\": \"BASE\",\n \"includeHIFIFee\": false,\n \"rules\": [\n {\n \"type\": \"PERCENTAGE\",\n \"calculationModel\": \"FIXED\",\n \"walletAddress\": \"0x15FB50680fEB2f726413416665c25f9B397b047b\",\n \"value\": 0.001,\n \"tiers\": [\n {\n \"min\": \"1000\",\n \"max\": \"2000\",\n \"value\": 0.0005\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requestId\": \"{{$guid}}\",\n \"chain\": \"BASE\",\n \"includeHIFIFee\": false,\n \"rules\": [\n {\n \"type\": \"PERCENTAGE\",\n \"calculationModel\": \"FIXED\",\n \"walletAddress\": \"0x15FB50680fEB2f726413416665c25f9B397b047b\",\n \"value\": 0.001,\n \"tiers\": [\n {\n \"min\": \"1000\",\n \"max\": \"2000\",\n \"value\": 0.0005\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "15c786fb-de7a-520c-a4b3-f312d4a122d2",
"chain": "BASE",
"includeHIFIFee": false,
"rules": [
{
"type": "PERCENTAGE",
"calculationModel": "FIXED",
"value": 0.001,
"tiers": null,
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b"
},
{
"type": "FIXED",
"calculationModel": "FIXED",
"value": 0.5,
"tiers": null,
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b"
},
{
"type": "PERCENTAGE",
"calculationModel": "TIERED",
"value": null,
"tiers": [
{
"max": "1000",
"min": "",
"value": 0.0007
},
{
"max": "2000",
"min": "1000",
"value": 0.0005
},
{
"max": "",
"min": "2000",
"value": 0.0002
}
],
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b"
}
]
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}Settlement Rules
Update a settlement rule
Update an existing settlement rule. This will replace all existing rules with the new configuration.
POST
/
v2
/
virtual-accounts
/
settlement-rules
/
{ruleId}
/
update
Update a settlement rule
curl --request POST \
--url https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "{{$guid}}",
"chain": "BASE",
"includeHIFIFee": false,
"rules": [
{
"type": "PERCENTAGE",
"calculationModel": "FIXED",
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b",
"value": 0.001,
"tiers": [
{
"min": "1000",
"max": "2000",
"value": 0.0005
}
]
}
]
}
'import requests
url = "https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update"
payload = {
"requestId": "{{$guid}}",
"chain": "BASE",
"includeHIFIFee": False,
"rules": [
{
"type": "PERCENTAGE",
"calculationModel": "FIXED",
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b",
"value": 0.001,
"tiers": [
{
"min": "1000",
"max": "2000",
"value": 0.0005
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '{{$guid}}',
chain: 'BASE',
includeHIFIFee: false,
rules: [
{
type: 'PERCENTAGE',
calculationModel: 'FIXED',
walletAddress: '0x15FB50680fEB2f726413416665c25f9B397b047b',
value: 0.001,
tiers: [{min: '1000', max: '2000', value: 0.0005}]
}
]
})
};
fetch('https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update', 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://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requestId' => '{{$guid}}',
'chain' => 'BASE',
'includeHIFIFee' => false,
'rules' => [
[
'type' => 'PERCENTAGE',
'calculationModel' => 'FIXED',
'walletAddress' => '0x15FB50680fEB2f726413416665c25f9B397b047b',
'value' => 0.001,
'tiers' => [
[
'min' => '1000',
'max' => '2000',
'value' => 0.0005
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update"
payload := strings.NewReader("{\n \"requestId\": \"{{$guid}}\",\n \"chain\": \"BASE\",\n \"includeHIFIFee\": false,\n \"rules\": [\n {\n \"type\": \"PERCENTAGE\",\n \"calculationModel\": \"FIXED\",\n \"walletAddress\": \"0x15FB50680fEB2f726413416665c25f9B397b047b\",\n \"value\": 0.001,\n \"tiers\": [\n {\n \"min\": \"1000\",\n \"max\": \"2000\",\n \"value\": 0.0005\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"{{$guid}}\",\n \"chain\": \"BASE\",\n \"includeHIFIFee\": false,\n \"rules\": [\n {\n \"type\": \"PERCENTAGE\",\n \"calculationModel\": \"FIXED\",\n \"walletAddress\": \"0x15FB50680fEB2f726413416665c25f9B397b047b\",\n \"value\": 0.001,\n \"tiers\": [\n {\n \"min\": \"1000\",\n \"max\": \"2000\",\n \"value\": 0.0005\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifibridge.com/v2/virtual-accounts/settlement-rules/{ruleId}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requestId\": \"{{$guid}}\",\n \"chain\": \"BASE\",\n \"includeHIFIFee\": false,\n \"rules\": [\n {\n \"type\": \"PERCENTAGE\",\n \"calculationModel\": \"FIXED\",\n \"walletAddress\": \"0x15FB50680fEB2f726413416665c25f9B397b047b\",\n \"value\": 0.001,\n \"tiers\": [\n {\n \"min\": \"1000\",\n \"max\": \"2000\",\n \"value\": 0.0005\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "15c786fb-de7a-520c-a4b3-f312d4a122d2",
"chain": "BASE",
"includeHIFIFee": false,
"rules": [
{
"type": "PERCENTAGE",
"calculationModel": "FIXED",
"value": 0.001,
"tiers": null,
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b"
},
{
"type": "FIXED",
"calculationModel": "FIXED",
"value": 0.5,
"tiers": null,
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b"
},
{
"type": "PERCENTAGE",
"calculationModel": "TIERED",
"value": null,
"tiers": [
{
"max": "1000",
"min": "",
"value": 0.0007
},
{
"max": "2000",
"min": "1000",
"value": 0.0005
},
{
"max": "",
"min": "2000",
"value": 0.0002
}
],
"walletAddress": "0x15FB50680fEB2f726413416665c25f9B397b047b"
}
]
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the settlement rule
Body
application/json
Unique identifier for the request (recommend using uuid v4)
Example:
"{{$guid}}"
Blockchain network for the settlement rule
Available options:
BASE, POLYGON, ETHEREUM, SOLANA, TRON Example:
"BASE"
Whether to include HiFi's fee in addition to custom rules
Example:
false
Array of settlement rules
Minimum array length:
1Show child attributes
Show child attributes
Response
Success
Unique identifier for the settlement rule
Example:
"15c786fb-de7a-520c-a4b3-f312d4a122d2"
Blockchain network for the settlement rule
Available options:
BASE, POLYGON, ETHEREUM, SOLANA, TRON Example:
"BASE"
Whether to include HiFi's fee in addition to custom rules, please contact HiFi support if you want to include HiFi's fee
Example:
false
Array of settlement rules
Show child attributes
Show child attributes
⌘I