### Go Example: List Wallet Offers Source: https://docs.hifi.com/api-reference/canton-offers/list-all-offers-for-a-wallet This Go snippet demonstrates how to make a GET request to the /wallets/{walletId}/offers endpoint to retrieve a list of offers. It includes setting the Authorization header and reading the response body. ```Go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/{walletId}/offers" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Example Response for Parameter Options Source: https://docs.hifi.com/api-reference/reporting/get-parameter-options This is an example of a successful response when fetching parameter options, showing a list of user IDs. ```json { "status": "success", "data": [ "f6a78498-0994-5bea-b5ab-7d40a231217a", "c92f87e6-eaac-59a3-898f-d8c847553f5f", "fb0b02ed-6bcc-5724-8269-dcaeb6474be2", "b56ac719-efc3-5e40-b99f-2daf85d519dc", "2bbbda5d-0464-5748-801a-dae6ae3dbad9" ], "metadata": { "count": 5, "page": 1, "limit": 5, "total": 1000, "totalPages": 200, "hasMore": true } } ``` -------------------------------- ### List UBOs using Ruby Net::HTTP Source: https://docs.hifi.com/api-reference/kyc/list-all-ubos This Ruby example demonstrates fetching UBO data using the Net::HTTP library. It establishes an SSL connection and sets the Authorization header for the GET request. ```ruby require 'uri' require 'net/http' url = URI("https://production.hifibridge.com/v2/users/{userId}/kyc/ubos") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Execute Saved Metric with Go Source: https://docs.hifi.com/api-reference/reporting/execute-saved-metric This Go example demonstrates making a GET request to retrieve saved metric results. It includes setting the Authorization header and reading the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/reporting/metrics/{id}/results" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Wallet Balance Object Example Source: https://docs.hifi.com/api-reference/wallet/retrieve-wallet-balance This example shows the structure of a wallet balance object, including the raw balance, a human-readable display balance, and detailed token information. ```json { "balance": "0", "displayBalance": "0", "tokenInfo": { "tokenAddress": "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582", "standard": "ERC20", "name": "USDC", "symbol": "USDC", "decimals": 6 } } ``` -------------------------------- ### User Object (Business) Example Source: https://docs.hifi.com/api-reference/user/create-a-user This example illustrates the structure of a User Object for a business account, detailing the business information and its associated wallet addresses for Ethereum and Polygon. ```json { "id": "264484e0-979a-5fa3-9335-947f55e5999a", "createdAt": "2025-09-24T19:03:41.107Z", "type": "business", "email": "admin@randombizz.com", "name": "Random Bizz", "wallets": { "INDIVIDUAL": { "ETHEREUM": { "id": "24b4917d-604e-4d81-ace8-9ba0261b6f4e", "address": "0x2f78AEFA879819D7a5C9a87fE8BF5e7B961f5500" }, "POLYGON": { "id": "24b4917d-604e-4d81-ace8-9ba0261b6f4e", "address": "0x2f78AEFA879819D7a5C9a87fE8BF5e7B961f5500" } } } } ``` -------------------------------- ### Get an Inbound Deposit (Go) Source: https://docs.hifi.com/api-reference/wallet/get-an-inbound-deposit This Go program demonstrates how to make an HTTP GET request to retrieve deposit details. It reads and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/wallets/deposits/{depositId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Successful User List Response Example Source: https://docs.hifi.com/api-reference/user/list-all-users This is an example of a successful response when listing users. It includes the total count, a list of users with their details, and a cursor for pagination. ```json { "count": 2, "users": [ { "id": "4d93ab4f-3983-4ac0-8c97-54bbc0f287fa", "createdAt": "2025-09-24T19:12:20.541Z", "type": "individual", "email": "john.doe@hifibridge.com", "name": "John Doe", "wallets": { "INDIVIDUAL": { "ETHEREUM": { "id": "24b4917d-604e-4d81-ace8-9ba0261b6f4e", "address": "0x43B343Bb48E23F58406271131B71448fF95787AD" }, "POLYGON": { "id": "24b4917d-604e-4d81-ace8-9ba0261b6f4e", "address": "0x43B343Bb48E23F58406271131B71448fF95787AD" } } } }, { "id": "264484e0-979a-5fa3-9335-947f55e5999a", "createdAt": "2025-09-24T19:03:41.107Z", "type": "business", "email": "admin@randombizz.com", "name": "Random Bizz", "wallets": { "INDIVIDUAL": { "ETHEREUM": { "id": "24b4917d-604e-4d81-ace8-9ba0261b6f4e", "address": "0x2f78AEFA879819D7a5C9a87fE8BF5e7B961f5500" }, "POLYGON": { "id": "24b4917d-604e-4d81-ace8-9ba0261b6f4e", "address": "0x2f78AEFA879819D7a5C9a87fE8BF5e7B961f5500" } } } } ], "nextCursor": "2025-09-24T19:03:41.107Z" } ``` -------------------------------- ### Get External Wallet (Go) Source: https://docs.hifi.com/api-reference/wallet/get-an-external-wallet This Go program demonstrates how to make an HTTP GET request to fetch external wallet details. It handles the response body and prints it to the console. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/wallets/external/{externalWalletId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Swap API Response Example Source: https://docs.hifi.com/docs/transactions/swaps This is an example of the response received after creating a swap. It includes details about the swap's status, source, destination, and quote information. ```json { "transferType": "WALLET.SWAP", "transferDetails": { "id": "swp_abc123", "requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86", "status": "OPEN_QUOTE", "createdAt": "2025-08-20T03:55:29.437108+00:00", "updatedAt": "2025-08-20T03:55:31.837+00:00", "source": { "currency": "usdc", "amount": 100, "chain": "POLYGON", "userId": "usr_abc123" }, "destination": { "currency": "usdt", "userId": "usr_abc123", "amount": 100, "chain": "POLYGON", "walletAddress": "0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204" }, "quoteInformation": { "sendGross": { "amount": "100", "currency": "usdc" }, "sendNet": { "amount": "100", "currency": "usdc" }, "receiveGross": { "amount": "100", "currency": "usdt" }, "receiveNet": { "amount": "100", "currency": "usdt" }, "rate": "1", "expiresAt": "2025-08-20T03:55:59.539+00:00" }, "error": null, "errorDetails": null } } ``` -------------------------------- ### Get Inbound Deposits Response Example Source: https://docs.hifi.com/docs/wallets This JSON object represents the response from the Get Inbound Deposits endpoint, detailing a completed deposit. ```json { "count": 1, "records": [ { "userId": "usr_abc123", "id": "dep_xyz789", "createdAt": "2025-06-25T15:47:16.983978+00:00", "updatedAt": "2025-06-25T15:47:16.983978+00:00", "wallet": { "id": "wlt_def456", "address": "0x0B95D270400BE4319EAFbfDD82F6C38B59ab54Ef", "chain": "POLYGON", "walletType": "INDIVIDUAL" }, "transaction": { "transactionHash": "0xe5284c4cb35ae9b5eb0ae23b840032f320b87b63f8967ee9b67ee09dfe6a194a", "chain": "POLYGON", "currency": "usdc", "status": "COMPLETED", "sourceAddress": "0x8B3D4E9C42F7A1B5D2E6F8A9C3B7D5E1F4A2C8B6", "destinationAddress": "0x0B95D270400BE4319EAFbfDD82F6C38B59ab54Ef", "contractAddress": "0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582", "amount": "19", "unitAmount": "19000000" } } ], "nextCursor": "2025-06-25T15:47:16.983978+00:00" } ``` -------------------------------- ### Ruby Example: List Wallet Offers Source: https://docs.hifi.com/api-reference/canton-offers/list-all-offers-for-a-wallet This Ruby snippet demonstrates how to fetch wallet offers using Net::HTTP. It establishes an SSL connection, sets the Authorization header, and prints the response body. ```Ruby require 'uri' require 'net/http' url = URI("https://production.hifibridge.com/v2/wallets/{walletId}/offers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Wallet Balance Response Example Source: https://docs.hifi.com/docs/wallets Example JSON response structure for the Get Wallet Balance endpoint, detailing the balance, display balance, and token information. ```json { "balance": "10000", "displayBalance": "0.01", "tokenInfo": { "chain": "POLYGON_MAINNET", "contractAddress": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", "assetType": "ERC20", "quantity": "10000", "symbol": "USDC", "decimals": 6 } } ``` -------------------------------- ### List Offers using Go HTTP Client Source: https://docs.hifi.com/api-reference/canton-offers/list-all-offers-for-a-wallet This Go program demonstrates how to fetch wallet offers using the standard `net/http` package. It constructs a GET request and prints the response body. Ensure to replace placeholders. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/{walletId}/offers" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Get Transfer Approval (Python) Source: https://docs.hifi.com/api-reference/transfer-approvals/get-a-transfer-approval This Python script uses the `requests` library to fetch transfer approval details. Ensure you have the library installed (`pip install requests`). ```python import requests url = "https://production.hifibridge.com/v2/transfer-approvals/{approvalId}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Get Metric Details using Python Source: https://docs.hifi.com/api-reference/reporting/get-metric-details This Python script uses the requests library to get metric details. Ensure you have the library installed and replace and {id} accordingly. ```python import requests url = "https://production.hifibridge.com/v2/reporting/metrics/{id}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### List All Accounts using Go HTTP Client Source: https://docs.hifi.com/api-reference/account/list-all-accounts This Go program demonstrates how to fetch account data using the standard Go HTTP client. It constructs the request, sets the authorization header, and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/accounts" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List Settlement Rules (Go) Source: https://docs.hifi.com/api-reference/settlement-rules/list-all-settlement-rules Demonstrates how to fetch settlement rules using Go's net/http package. Ensure you replace `` with your actual authorization token. ```Go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/virtual-accounts/settlement-rules" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Retrieve KYC Information (Java/Unirest) Source: https://docs.hifi.com/api-reference/kyc/retrieve-kyc-information Java example using the Unirest library to make a GET request for KYC information. This snippet shows how to set headers and get the response as a string. Replace placeholders. ```java HttpResponse response = Unirest.get("https://production.hifibridge.com/v2/users/{userId}/kyc") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### Get Transfer Approval Details in Ruby Source: https://docs.hifi.com/api-reference/transfer-approvals/get-a-transfer-approval This Ruby code example shows how to retrieve transfer approval information. Replace `` with your Bearer token for authentication. ```Ruby require 'uri' require 'net/http' url = URI("https://production.hifibridge.com/v2/transfer-approvals/{approvalId}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Get Transfer Approval (JavaScript) Source: https://docs.hifi.com/api-reference/transfer-approvals/get-a-transfer-approval This JavaScript example demonstrates how to use the `fetch` API to retrieve transfer approval information. It includes basic error handling. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://production.hifibridge.com/v2/transfer-approvals/{approvalId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Add Wallets using Go Source: https://docs.hifi.com/api-reference/wallet/add-wallets-to-a-user This Go program demonstrates how to send a POST request to add wallets for a user. It includes setting the necessary headers and request body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/wallets/add" payload := strings.NewReader("{\n \"chains\": []\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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)) } ``` -------------------------------- ### Simulate Deposit with Go Source: https://docs.hifi.com/api-reference/virtual-account/simulate-a-deposit-to-a-virtual-account This Go program demonstrates how to simulate a deposit to a virtual account using the net/http package. It constructs the request with necessary headers and payload. ```go package main import ( "fmt" "strings" "net/http" io "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/virtual-accounts/{accountId}/simulate-deposit" payload := strings.NewReader("{\n \"amount\": \"\",\n \"requestId\": \"\",\n \"source\": {\n \"routingNumber\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"bankName\": \"\"\n },\n \"userId\": \"\",\n \"reference\": \"\",\n \"description\": \"\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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)) } ``` -------------------------------- ### Ping API with JavaScript (fetch) Source: https://docs.hifi.com/api-reference/common/ping This JavaScript example uses the `fetch` API to make a GET request to the ping endpoint. It handles JSON responses and errors. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://production.hifibridge.com/ping', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### List Batches (Go) Source: https://docs.hifi.com/api-reference/orchestration-address/list-batches-for-an-orchestration-address This Go program demonstrates how to fetch batches for an orchestration address using the net/http package. Remember to replace placeholders. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/orchestration-addresses/{orchestrationAddressId}/batches?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Get Parameter Options with Python Source: https://docs.hifi.com/api-reference/reporting/get-parameter-options Fetch parameter options using the requests library in Python. Ensure you have the 'requests' library installed and replace with your API token. ```python import requests url = "https://production.hifibridge.com/v2/reporting/params/{name}/options" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Retrieve KYC Requirements Source: https://docs.hifi.com/docs/guides/submit-kyc Call the Retrieve KYC Requirements endpoint to determine the necessary information for a specific target rail. This example uses curl to make the GET request. ```curl curl --request GET \ --url 'https://sandbox.hifibridge.com/v2/users/32051b2f-0798-55a7-9c42-b08da4192c97/kyc/requirements?rails=USD' \ --header 'accept: application/json' \ --header 'authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Accept Swap using Go Source: https://docs.hifi.com/api-reference/token-swap/accept-a-swap This Go program demonstrates how to accept a swap. It makes a POST request to the HiFi API endpoint. Remember to substitute `` and `{swapId}`. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/swaps/{swapId}/accept" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List batches for an orchestration address (Go) Source: https://docs.hifi.com/api-reference/orchestration-address/list-batches-for-an-orchestration-address This Go program demonstrates how to fetch batches using the net/http package. It constructs the request, adds the Authorization header, and prints the response body. Ensure placeholders are replaced. ```go package main import ( "fmt" "io" "net/http" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/orchestration-addresses/{orchestrationAddressId}/batches?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Get External Wallet (JavaScript) Source: https://docs.hifi.com/api-reference/wallet/get-an-external-wallet This JavaScript example demonstrates fetching external wallet data using the `fetch` API. It includes basic error handling for network requests. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://production.hifibridge.com/v2/users/{userId}/wallets/external/{externalWalletId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Retrieve a Batch using JavaScript (Fetch API) Source: https://docs.hifi.com/api-reference/orchestration-address/retrieve-a-batch This JavaScript example uses the Fetch API to make a GET request for a batch. It includes error handling for the network request. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://production.hifibridge.com/v2/users/{userId}/orchestration-addresses/{orchestrationAddressId}/batches/{batchId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Create Swap with Go Source: https://docs.hifi.com/api-reference/token-swap/create-a-swap This Go program demonstrates creating a token swap using the net/http package. Ensure your API token is included in the Authorization header. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/swaps" payload := strings.NewReader("{\n \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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)) } ``` -------------------------------- ### Create Token Swap with Ruby (Net::HTTP) Source: https://docs.hifi.com/api-reference/token-swap/create-a-swap This Ruby example demonstrates how to create a token swap using the Net::HTTP library. It sets up the POST request with necessary headers and the JSON body. ```ruby require 'uri' require 'net/http' url = URI("https://production.hifibridge.com/v2/wallets/swaps") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Get an Inbound Deposit (Python) Source: https://docs.hifi.com/api-reference/wallet/get-an-inbound-deposit This Python script uses the `requests` library to fetch deposit information. Ensure you have the library installed and replace placeholders with your specific IDs and token. ```python import requests url = "https://production.hifibridge.com/v2/users/{userId}/wallets/deposits/{depositId}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### List All Users with Go HTTP Client Source: https://docs.hifi.com/api-reference/user/list-all-users This Go program demonstrates how to fetch all users using the standard `net/http` package. Replace `` with your actual API bearer token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Get Template Details using PHP Source: https://docs.hifi.com/api-reference/reporting/get-template-details This PHP script utilizes cURL to retrieve template details. Ensure that the cURL extension is enabled in your PHP installation and substitute `{name}` and ``. ```php "https://production.hifibridge.com/v2/reporting/templates/{name}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:". $err; } else { echo $response; } ``` -------------------------------- ### Fetch Reporting Templates (Go) Source: https://docs.hifi.com/api-reference/reporting This Go program demonstrates how to fetch reporting templates using the standard net/http package. Remember to substitute "" with your valid API token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/reporting/templates" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Get Template Details using Python Source: https://docs.hifi.com/api-reference/reporting/get-template-details This Python script uses the `requests` library to fetch template details. Ensure you have the library installed and replace `{name}` and `` with appropriate values. ```python import requests url = "https://production.hifibridge.com/v2/reporting/templates/{name}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### List All KYC Documents using Go Source: https://docs.hifi.com/api-reference/kyc/list-all-documents This Go program demonstrates how to fetch KYC documents using the `net/http` package. It reads and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/kyc/documents" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Fetch Metric Templates (Go) Source: https://docs.hifi.com/api-reference/reporting This Go program demonstrates how to fetch metric templates using the standard `net/http` package. Ensure you replace `` with your API key. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/reporting/templates" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Retrieve a UBO using JavaScript (Fetch API) Source: https://docs.hifi.com/api-reference/kyc/retrieve-a-ubo This JavaScript example utilizes the Fetch API to make a GET request for UBO information. It handles JSON parsing and logs the response or any errors. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://production.hifibridge.com/v2/users/{userId}/kyc/ubos/{uboId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### List All Virtual Accounts using Go Source: https://docs.hifi.com/api-reference/virtual-account/list-all-virtual-accounts This Go program demonstrates fetching virtual accounts. It makes an HTTP GET request and requires your API token and the user ID. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/virtual-accounts" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Execute Saved Metric with Ruby Source: https://docs.hifi.com/api-reference/reporting/execute-saved-metric This Ruby example uses the built-in Net::HTTP library to make a GET request for saved metric results. It demonstrates setting up the SSL connection and the Authorization header. ```ruby require 'uri' require 'net/http' url = URI("https://production.hifibridge.com/v2/reporting/metrics/{id}/results") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Retrieve KYC Requirements in Ruby Source: https://docs.hifi.com/api-reference/kyc/retrieve-kyc-requirements Provides a Ruby example for retrieving KYC requirements using Net::HTTP. This code sets up an SSL connection and sends a GET request with the necessary authorization header. ```Ruby require 'uri' require 'net/http' url = URI("https://production.hifibridge.com/v2/users/{userId}/kyc/requirements") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### List Deposits using Go HTTP Client Source: https://docs.hifi.com/api-reference/orchestration-address/list-deposits-for-an-orchestration-address This Go program demonstrates how to fetch deposits using the standard `net/http` package. It constructs a GET request and reads the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/orchestration-addresses/{orchestrationAddressId}/deposits?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Accept a Swap using Go Source: https://docs.hifi.com/api-reference/token-swap/accept-a-swap This Go program demonstrates accepting a swap. Ensure you replace with your API token and {swapId} with the swap ID. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/swaps/{swapId}/accept" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List Settlement Rules with Go Source: https://docs.hifi.com/api-reference/settlement-rules/list-all-settlement-rules This Go program demonstrates how to fetch settlement rules using the net/http package. Ensure you replace with your API token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/virtual-accounts/settlement-rules" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Retrieve KYC Information (Go) Source: https://docs.hifi.com/api-reference/kyc/retrieve-kyc-information Go program to fetch KYC data using the net/http package. This example demonstrates setting headers and reading the response body. Ensure you replace {userId} and . ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/kyc" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Offramp Object Example Source: https://docs.hifi.com/api-reference/offramp/retrieve-an-offramp An example of a completed offramp transaction in USD. ```APIDOC ## Offramp Object (USD - COMPLETED) ### Description Represents a completed offramp transaction with USD currency. ### Response #### Success Response (200) - **transferType** (string) - Type of transfer, expected to be 'OFFRAMP'. - **transferDetails** (object) - Details of the offramp transfer. - **id** (string) - Unique identifier for the offramp. - **requestId** (string) - Identifier for the request that initiated the offramp. - **createdAt** (string) - Timestamp when the offramp was created. - **updatedAt** (string) - Timestamp when the offramp was last updated. - **status** (string) - Current status of the offramp (e.g., COMPLETED). ### Response Example ```json { "transferType": "OFFRAMP", "transferDetails": { "id": "173c1e89-7bbd-4352-9e5d-73807681510d", "requestId": "201ca31d-700f-4c76-ac4b-961623acbb79", "createdAt": "2025-02-03T16:12:04.331652+00:00", "updatedAt": "2025-02-03T16:12:08.732+00:00", "status": "COMPLETED" } } ``` ``` -------------------------------- ### Unauthorized Error Example Source: https://docs.hifi.com/api-reference/onramp/retrieve-an-onramp-rate This example shows the structure of an error response when authentication fails. ```json { "code": 401, "error": "Unauthorized", "errorDetails": "Detailed error message" } ``` -------------------------------- ### List All Batch Crypto Transfers with Go Source: https://docs.hifi.com/api-reference/crypto-transfer/list-all-batch-crypto-transfers This Go program demonstrates how to fetch batch crypto transfers using the `net/http` package. It constructs the request, adds the Authorization header, and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/transfers/batches" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Successful Response Example Source: https://docs.hifi.com/api-reference/user/retrieve-a-terms-of-service-link This is an example of a successful JSON response when retrieving a terms of service link. ```json { "id": "e6e0de1d-7d0b-4935-ba1a-71906064067e", "createdAt": "2025-04-17T18:27:51.169Z", "expiredAt": "2025-04-22T18:27:51.091Z", "signed": true, "sessionToken": "e3a92e74-19e0-4137-ab75-ae537832f342" } ``` -------------------------------- ### List All KYC Statuses with Go Source: https://docs.hifi.com/api-reference/kyc/list-all-kyc-statuses This Go program demonstrates how to fetch KYC statuses using the standard `net/http` package. It sets the authorization header and reads the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/kyc/status" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List all users with Java Unirest Source: https://docs.hifi.com/api-reference/user/list-all-users An example of how to fetch all users using the Unirest library in Java. Remember to substitute `` with your valid API token. ```java HttpResponse response = Unirest.get("https://production.hifibridge.com/v2/users") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### Request ID Example Source: https://docs.hifi.com/api-reference/token-swap/create-a-swap Example of a unique identifier for a swap request, recommended to use UUID v4. ```json "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86" ``` -------------------------------- ### Internal Server Error Example Source: https://docs.hifi.com/api-reference/onramp/retrieve-an-onramp-rate This example illustrates the structure of an error response for internal server issues. ```json { "code": 500, "error": "InternalServerError", "errorDetails": "Detailed error message" } ``` -------------------------------- ### Accept Canton Offer with Go HTTP Client Source: https://docs.hifi.com/api-reference/canton-offers/accept-a-canton-offer This Go program demonstrates accepting a Canton offer using the standard `net/http` package. It constructs a POST request with the required 'Authorization' header and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/wallets/{walletId}/offers/{offerId}/accept" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Onramp Rate Example Source: https://docs.hifi.com/api-reference/onramp/retrieve-an-onramp-rate This example demonstrates the structure of a successful response for retrieving an onramp conversion rate. ```json { "fromCurrency": "usd", "toCurrency": "usdc", "conversionRate": "1", "conversionRates": [ { "transferType": "default", "conversionRate": "1" } ] } ``` -------------------------------- ### Successful Response Example Source: https://docs.hifi.com/api-reference/orchestration-address/list-batches-for-an-orchestration-address This is an example of a successful JSON response when listing batches. It includes count, records, and nextCursor. ```json { "count": 123, "records": [ { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "orchestrationAddressId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "totalAmount": "150.000000", "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z", "depositIds": [ "3c90c3cc-0d44-4b50-8888-8dd25736052a" ], "offrampTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" } ], "nextCursor": "2023-11-07T05:31:56Z" } ``` -------------------------------- ### List Orchestration Addresses (Go) Source: https://docs.hifi.com/api-reference/orchestration-address/list-orchestration-addresses This Go program demonstrates fetching orchestration addresses. It constructs an HTTP GET request, sets the `Authorization` header, and prints the response body. Ensure `{userId}` and `` are correctly substituted. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://production.hifibridge.com/v2/users/{userId}/orchestration-addresses?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ```