### Get Invoice Details - Go Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/invoice_chile Example of how to retrieve invoice details using Go with the net/http package. ```Go package main import ( "encoding/base64" "fmt" "io/ioutil" "net/http" "strings" ) func main() { // Replace with your actual credentials and invoice ID username := "" password := "" invoiceID := "{id}" credentials := fmt.Sprintf("%s:%s", username, password) encodedCredentials := base64.StdEncoding.EncodeToString([]byte(credentials)) url := fmt.Sprintf("https://sandbox.belvo.com/api/cl/invoices/%s/?omit=string&fields=string", invoiceID) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Printf("Error creating request: %v\n", err) return } req.Header.Add("Authorization", "Basic "+encodedCredentials) resp, err := client.Do(req) if err != nil { fmt.Printf("Error sending request: %v\n", err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Printf("Error reading response body: %v\n", err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Get Invoice Details - Go Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/listinvoiceschile Example of how to retrieve invoice details using Go with the net/http package. ```Go package main import ( "encoding/base64" "fmt" "io/ioutil" "net/http" "strings" ) func main() { // Replace with your actual credentials and invoice ID username := "" password := "" invoiceID := "{id}" credentials := fmt.Sprintf("%s:%s", username, password) encodedCredentials := base64.StdEncoding.EncodeToString([]byte(credentials)) url := fmt.Sprintf("https://sandbox.belvo.com/api/cl/invoices/%s/?omit=string&fields=string", invoiceID) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Printf("Error creating request: %v\n", err) return } req.Header.Add("Authorization", "Basic "+encodedCredentials) resp, err := client.Do(req) if err != nil { fmt.Printf("Error sending request: %v\n", err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Printf("Error reading response body: %v\n", err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Belvo API Link Details - Go Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using Go's net/http package. It demonstrates making a GET request with basic authentication. ```go package main import ( "encoding/base64" "fmt" "io/ioutil" "net/http" "os" ) func main() { username := "" password := "" linkID := "{id}" url := fmt.Sprintf("https://sandbox.belvo.com/api/links/%s/", linkID) auth := username + ":" + password encodedAuth := base64.StdEncoding.EncodeToString([]byte(auth)) req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Fprintf(os.Stderr, "Error creating request: %v\n", err) return } req.Header.Set("Authorization", "Basic "+encodedAuth) client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Fprintf(os.Stderr, "Error sending request: %v\n", err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Fprintf(os.Stderr, "Error reading response body: %v\n", err) return } fmt.Printf("Status Code: %d\n", res.StatusCode) fmt.Println(string(body)) } ``` -------------------------------- ### Belvo API Link Details - C# Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using C# with HttpClient. It demonstrates making a GET request with basic authentication. ```csharp using System; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; public class BelvoLinkDetails { public static async Task GetLinkDetails(string username, string password, string linkId) { using (var client = new HttpClient()) { var url = $"https://sandbox.belvo.com/api/links/{linkId}/"; var authToken = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authToken); try { HttpResponseMessage response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); // Throw if HTTP status is not 2xx string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine($"Request error: {e.Message}"); } } } public static async Task Main(string[] args) { string username = ""; string password = ""; string linkId = "{id}"; await GetLinkDetails(username, password, linkId); } } ``` -------------------------------- ### Belvo API Link Details - Ruby Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using Ruby's Net::HTTP library. It demonstrates making a GET request with basic authentication. ```ruby require 'net/http' require 'uri' require 'base64' username = '' password = '' link_id = '{id}' url = URI.parse("https://sandbox.belvo.com/api/links/#{link_id}/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) auth = "#{username}:#{password}" encoded_auth = Base64.strict_encode64(auth) request["Authorization"] = "Basic #{encoded_auth}" response = http.request(request) puts "Status Code: #{response.code}" puts response.body ``` -------------------------------- ### Curl Example - Get Employment Details Source: https://developers.belvo.com/apis/belvoopenapispec/employments-brazil/listemploymentsbrazil Example of how to fetch employment details using cURL, including authentication and optional query parameters. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/br/employments/{id}/?omit=string&fields=string' ``` -------------------------------- ### Example Request using cURL Source: https://developers.belvo.com/apis/belvoopenapispec/owners/patchowners An example of how to make a GET request to the Belvo API to retrieve owner details using cURL, including authentication and query parameters. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/owners/{id}/?omit=string&fields=string' ``` -------------------------------- ### Belvo API Employment Records GET Request Example Source: https://developers.belvo.com/apis/belvoopenapispec/employment-records-mexico/listemploymentrecords This code snippet provides a practical example of making a GET request to the Belvo API's employment records endpoint. It showcases how to construct the URL with various query parameters for filtering and pagination, demonstrating a real-world use case for the documented filters. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/employment-records/?link=8848bd0c-9c7e-4f53-a732-ec896b11d4c4&page_size=100&page=1&omit=string&fields=string&id=24ccab1d-3a86-4136-a6eb-e04bf52b356f&id__in=6b3dea0f-be29-49d1-aabe-1a6d588642e6&link__in=5722d0ba-69d7-42dc-8ff5-33767b83c5d6&internal_identification=BLPM951331IONVGR54&internal_identification__in=BLPM951331IONVGR54&collected_at=2022-05-01&collected_at__gt=2022-05-05&collected_at__gte=2022-05-04&collected_at__lt=2022-04-01&collected_at__lte=2022-03-30&collected_at__range=2022-05-04&created_at=2022-05-05&created_at__gt=2022-05-05&created_at__gte=2022-05-04&created_at__lt=2022-04-01&created_at__lte=2022-03-30&created_at__range=2022-03-03' ``` -------------------------------- ### Belvo API Link Details - R Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using R's httr package. It demonstrates making a GET request with basic authentication. ```r library(httr) username <- "" password <- "" link_id <- "{id}" url <- paste0("https://sandbox.belvo.com/api/links/", link_id, "/") response <- VERB("GET", url, authenticate(username, password, type = "basic")) print(status_code(response)) print(content(response, "parsed")) ``` -------------------------------- ### Belvo API Link Details - JavaScript Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using JavaScript's fetch API. It shows how to make a GET request with basic authentication. ```javascript fetch('https://sandbox.belvo.com/api/links/{id}/', { method: 'GET', headers: { 'Authorization': 'Basic ' + btoa(':') } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Belvo API Employment Records GET Request Example Source: https://developers.belvo.com/apis/belvoopenapispec/employment-records-mexico/retrieveemploymentrecorddetails This code snippet provides a practical example of making a GET request to the Belvo API's employment records endpoint. It showcases how to construct the URL with various query parameters for filtering and pagination, demonstrating a real-world use case for the documented filters. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/employment-records/?link=8848bd0c-9c7e-4f53-a732-ec896b11d4c4&page_size=100&page=1&omit=string&fields=string&id=24ccab1d-3a86-4136-a6eb-e04bf52b356f&id__in=6b3dea0f-be29-49d1-aabe-1a6d588642e6&link__in=5722d0ba-69d7-42dc-8ff5-33767b83c5d6&internal_identification=BLPM951331IONVGR54&internal_identification__in=BLPM951331IONVGR54&collected_at=2022-05-01&collected_at__gt=2022-05-05&collected_at__gte=2022-05-04&collected_at__lt=2022-04-01&collected_at__lte=2022-03-30&collected_at__range=2022-05-04&created_at=2022-05-05&created_at__gt=2022-05-05&created_at__gte=2022-05-04&created_at__lt=2022-04-01&created_at__lte=2022-03-30&created_at__range=2022-03-03' ``` -------------------------------- ### Belvo API Link Details - Java Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using Java with the Apache HttpClient library. It demonstrates making a GET request with basic authentication. ```java import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import java.nio.charset.StandardCharsets; import java.util.Base64; public class BelvoLinkDetails { public static void main(String[] args) throws Exception { String username = ""; String password = ""; String linkId = "{id}"; String url = "https://sandbox.belvo.com/api/links/" + linkId + "/"; CloseableHttpClient client = HttpClients.createDefault(); HttpGet request = new HttpGet(url); String auth = username + ":" + password; byte[] encodedAuth = Base64.getEncoder().encode(auth.getBytes(StandardCharsets.ISO_8859_1)); String authHeader = "Basic " + new String(encodedAuth); request.setHeader("Authorization", authHeader); org.apache.http.HttpResponse response = client.execute(request); String responseBody = EntityUtils.toString(response.getEntity()); System.out.println("Status Code: " + response.getStatusLine().getStatusCode()); System.out.println("Response Body: " + responseBody); client.close(); } } ``` -------------------------------- ### Get Risk Insight Details - Go Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/detailriskinsights This Go code snippet illustrates how to retrieve risk insight details using the standard 'net/http' package. It shows how to set up authentication and make the GET request. ```go // Go example would go here, demonstrating http.NewRequest usage ``` -------------------------------- ### Get Risk Insight Details - Go Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/patchriskinsights This Go code snippet illustrates how to retrieve risk insight details using the standard 'net/http' package. It shows how to set up authentication and make the GET request. ```go // Go example would go here, demonstrating http.NewRequest usage ``` -------------------------------- ### Belvo API Link Details - Python Example Source: https://developers.belvo.com/apis/belvoopenapispec/links/detaillink Example of how to retrieve link details using Python's 'requests' library. It shows how to make a GET request with basic authentication. ```python import requests username = '' password = '' link_id = '{id}' response = requests.get( f'https://sandbox.belvo.com/api/links/{link_id}/', auth=(username, password) ) print(response.json()) print(f'Status Code: {response.status_code}') ``` -------------------------------- ### cURL Request Example Source: https://developers.belvo.com/apis/belvoopenapispec/bank-accounts-%28brazil%29 Example of how to make a GET request to the Belvo API to list bank accounts using cURL, demonstrating the use of various query parameters and headers. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/payments/br/bank-accounts/?page=1&page_size=100&id__in=6b3dea0f-be29-49d1-aabe-1a6d588642e6&created_at=2022-05-05&created_at__gt=2022-05-05&created_at__gte=2022-05-04&created_at__lt=2022-04-01&created_at__lte=2022-03-30&created_at__range=2022-03-03&number=1231564526&number__in=1231564526&customer=24e5b3a5-19aa-40fe-91e5-4db7f22ecc2d&external_id=295ebb46-65b8-47de-85cd-34ffbc327c09&external_id__in=446bdd9f-5b3e-4c05-9159-7a5c87cfc810&institution=planet_mx_retail&holder__type=INDIVIDUAL&holder__type__in=INDIVIDUAL' \ -H 'X-Belvo-API-Resource-Version: Payments-BR.V2' ``` -------------------------------- ### Curl Example for Get Link Details Source: https://developers.belvo.com/apis/belvoopenapispec/links/modifylinkdataretrieval An example of how to use curl to make a GET request to retrieve the details of a specific link. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/links/{id}/' ``` -------------------------------- ### Curl Example for Get Link Details Source: https://developers.belvo.com/apis/belvoopenapispec/links Example of how to retrieve link details using curl. It specifies the GET method, authentication, and the sandbox endpoint. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/links/{id}/' ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/detailpaymentauthorizationbrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/listpaymentauthorizationchargesbrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Curl Example for Get Link Details Source: https://developers.belvo.com/apis/belvoopenapispec/links/refreshhistoricaldataforlink Example of how to retrieve link details using curl. It specifies the GET method, authentication, and the sandbox endpoint. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/links/{id}/' ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29 A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Curl Example for Get Link Details Source: https://developers.belvo.com/apis/belvoopenapispec/links/registerlink Example of how to retrieve link details using curl. It specifies the GET method, authentication, and the sandbox endpoint. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/links/{id}/' ``` -------------------------------- ### Belvo API GET /api/cl/invoices/ Example Request Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/destroyinvoicechile This cURL example demonstrates how to make a GET request to the Belvo API's /api/cl/invoices/ endpoint, utilizing various filtering parameters for comprehensive data retrieval. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/cl/invoices/?link=8848bd0c-9c7e-4f53-a732-ec896b11d4c4&page_size=100&page=1&omit=string&fields=string&link__in=5722d0ba-69d7-42dc-8ff5-33767b83c5d6&id=24ccab1d-3a86-4136-a6eb-e04bf52b356f&id__in=6b3dea0f-be29-49d1-aabe-1a6d588642e6&created_at=2022-05-05&created_at__gt=2022-05-05&created_at__gte=2022-05-04&created_at__lt=2022-04-01&created_at__lte=2022-03-30&created_at__range=2022-03-03' ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/detailpaymentauthorizationchargebrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Belvo API GET /api/cl/invoices/ Example Request Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/detailinvoicechile This cURL example demonstrates how to make a GET request to the Belvo API's /api/cl/invoices/ endpoint, utilizing various filtering parameters for comprehensive data retrieval. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/api/cl/invoices/?link=8848bd0c-9c7e-4f53-a732-ec896b11d4c4&page_size=100&page=1&omit=string&fields=string&link__in=5722d0ba-69d7-42dc-8ff5-33767b83c5d6&id=24ccab1d-3a86-4136-a6eb-e04bf52b356f&id__in=6b3dea0f-be29-49d1-aabe-1a6d588642e6&created_at=2022-05-05&created_at__gt=2022-05-05&created_at__gte=2022-05-04&created_at__lt=2022-04-01&created_at__lte=2022-03-30&created_at__range=2022-03-03' ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/createpaymentauthorizationbrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Invoice Details - PHP Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/invoice_chile Example of how to retrieve invoice details using PHP with cURL. ```PHP '; $password = ''; $invoiceId = '{id}'; $url = "https://sandbox.belvo.com/api/cl/invoices/{$invoiceId}/?omit=string&fields=string"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}"); $headers = array(); $headers[] = "Content-Type: application/json"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { echo $response; } curl_close($ch); ?> ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/createpaymentauthorizationchargebrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### cURL Example for Listing Customers Source: https://developers.belvo.com/apis/belvoopenapispec/customers-%28brazil%29 Demonstrates how to use cURL to make a GET request to the Belvo API to list customers, including various query parameters and headers. ```curl curl -i -X GET \ -u : \ 'https://sandbox.belvo.com/payments/br/customers/?page=1&page_size=100&id__in=6b3dea0f-be29-49d1-aabe-1a6d588642e6&created_at=2022-05-05&created_at__gt=2022-05-05&created_at__gte=2022-05-04&created_at__lt=2022-04-01&created_at__lte=2022-03-30&created_at__range=2022-03-03&customer__type=INDIVIDUAL&external_id=295ebb46-65b8-47de-85cd-34ffbc327c09&external_id__in=446bdd9f-5b3e-4c05-9159-7a5c87cfc810&search=trai' \ -H 'X-Belvo-API-Resource-Version: Payments-BR.V2' ``` -------------------------------- ### Get Invoice Details - C# Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/invoice_chile Example of how to retrieve invoice details using C# with HttpClient. ```C# using System; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; public class BelvoInvoiceClient { public static async Task GetInvoiceDetailsAsync(string username, string password, string invoiceId) { using (var client = new HttpClient()) { var authToken = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authToken); var response = await client.GetAsync($"https://sandbox.belvo.com/api/cl/invoices/{invoiceId}/?omit=string&fields=string"); if (response.IsSuccessStatusCode) { var json = await response.Content.ReadAsStringAsync(); Console.WriteLine(json); } else { Console.WriteLine($"Error: {response.StatusCode}"); } } } public static void Main(string[] args) { // Replace with your actual credentials and invoice ID string username = ""; string password = ""; string invoiceId = "{id}"; GetInvoiceDetailsAsync(username, password, invoiceId).Wait(); } } ``` -------------------------------- ### Create Customer Request Example (cURL) Source: https://developers.belvo.com/apis/belvoopenapispec/customers-%28brazil%29 Example of how to create a customer using cURL, demonstrating the POST request to the Belvo API with necessary headers and JSON payload. ```curl curl -i -X POST \ -u : \ https://sandbox.belvo.com/payments/br/customers/ \ -H 'Content-Type: application/json' \ -H 'X-Belvo-API-Resource-Version: Payments-BR.V2' \ -d '{ \ "identifier": "12345678901122", \ "name": "Frangos Enlatados", \ "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73" \ }' ``` -------------------------------- ### Get Invoice Details - C# Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/listinvoiceschile Example of how to retrieve invoice details using C# with HttpClient. ```C# using System; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; public class BelvoInvoiceClient { public static async Task GetInvoiceDetailsAsync(string username, string password, string invoiceId) { using (var client = new HttpClient()) { var authToken = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authToken); var response = await client.GetAsync($"https://sandbox.belvo.com/api/cl/invoices/{invoiceId}/?omit=string&fields=string"); if (response.IsSuccessStatusCode) { var json = await response.Content.ReadAsStringAsync(); Console.WriteLine(json); } else { Console.WriteLine($"Error: {response.StatusCode}"); } } } public static void Main(string[] args) { // Replace with your actual credentials and invoice ID string username = ""; string password = ""; string invoiceId = "{id}"; GetInvoiceDetailsAsync(username, password, invoiceId).Wait(); } } ``` -------------------------------- ### Get Risk Insight Details - C# Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/patchriskinsights This C# code snippet shows how to retrieve risk insight details using HttpClient. It includes setting up authentication and making a GET request to the Belvo API. ```csharp // C# example would go here, showing HttpClient usage ``` -------------------------------- ### Get Risk Insight Details - C# Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/detailriskinsights This C# code snippet shows how to retrieve risk insight details using HttpClient. It includes setting up authentication and making a GET request to the Belvo API. ```csharp // C# example would go here, showing HttpClient usage ``` -------------------------------- ### Get Invoice Details - PHP Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/listinvoiceschile Example of how to retrieve invoice details using PHP with cURL. ```PHP '; $password = ''; $invoiceId = '{id}'; $url = "https://sandbox.belvo.com/api/cl/invoices/{$invoiceId}/?omit=string&fields=string"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}"); $headers = array(); $headers[] = "Content-Type: application/json"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { echo $response; } curl_close($ch); ?> ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/cancelpaymentauthorizationbrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Risk Insight Details - Python Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/detailriskinsights This Python code snippet shows how to retrieve risk insight details using the 'requests' library. It demonstrates setting up authentication and making a GET request to the Belvo API. ```python # Python example would go here, showing requests.get usage ``` -------------------------------- ### Get Risk Insight Details - Python Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/patchriskinsights This Python code snippet shows how to retrieve risk insight details using the 'requests' library. It demonstrates setting up authentication and making a GET request to the Belvo API. ```python # Python example would go here, showing requests.get usage ``` -------------------------------- ### Example Request using Python Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/detailpaymentauthorizationbrazil A Python example using the `requests` library to create a charge for a payment authorization, showing how to structure the request with headers and JSON payload. ```Python import requests import json BELVO_API_KEY = 'YOUR_BELVO_API_KEY' # Replace with your actual API key payment_authorization_id = 'a3b92311-1888-449f-acaa-49ae28d68fcd' url = f"https://sandbox.belvo.com/payments/br/payment-authorizations/{payment_authorization_id}/charges/" headers = { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2' } charge_data = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } } response = requests.post(url, headers=headers, data=json.dumps(charge_data), auth=(BELVO_API_KEY.split(':')[0], BELVO_API_KEY.split(':')[1])) if response.status_code == 201: print("Charge created successfully:", response.json()) else: print(f"Error creating charge: {response.status_code}", response.text) ``` -------------------------------- ### Get Invoice Details - Python Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/invoice_chile Example of how to retrieve invoice details using Python with the 'requests' library. ```Python import requests from requests.auth import HTTPBasicAuth # Replace with your actual credentials and invoice ID username = '' password = '' invoice_id = '{id}' url = f'https://sandbox.belvo.com/api/cl/invoices/{invoice_id}/?omit=string&fields=string' response = requests.get(url, auth=HTTPBasicAuth(username, password)) if response.status_code == 200: print(response.json()) else: print(f'Error: {response.status_code}') ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/cancelpaymentauthorizationchargebrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Invoice Details - R Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/invoice_chile Example of how to retrieve invoice details using R with the httr library. ```R library(httr) library(jsonlite) # Replace with your actual credentials and invoice ID username <- '' password <- '' invoice_id <- '{id}' url <- paste0("https://sandbox.belvo.com/api/cl/invoices/", invoice_id, "/?omit=string&fields=string") response <- GET(url, authenticate(username, password, type = "basic")) if (status_code(response) == 200) { content(response, "parsed") } else { stop(paste("Error:", status_code(response))) } ``` -------------------------------- ### Get Risk Insight Details - R Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/detailriskinsights This R code snippet demonstrates how to retrieve risk insight details using the 'httr' package. It includes setting up authentication and making a GET request to the Belvo API. ```r # R example would go here, showing httr::GET usage ``` -------------------------------- ### Get Invoice Details - JavaScript Example Source: https://developers.belvo.com/apis/belvoopenapispec/invoices-chile/invoice_chile Example of how to retrieve invoice details using JavaScript with the Fetch API. ```JavaScript // Replace with your actual credentials and invoice ID const username = ''; const password = ''; const invoiceId = '{id}'; fetch(`https://sandbox.belvo.com/api/cl/invoices/${invoiceId}/?omit=string&fields=string`, { method: 'GET', headers: { 'Authorization': 'Basic ' + btoa(`${username}:${password}`) } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Example Request using JavaScript Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29/retrypaymentauthorizationchargebrazil A JavaScript example using the `fetch` API to create a charge for a payment authorization, demonstrating how to set headers and the request body. ```JavaScript const belvoApiKey = 'YOUR_BELVO_API_KEY'; // Replace with your actual API key const paymentAuthorizationId = 'a3b92311-1888-449f-acaa-49ae28d68fcd'; const chargeData = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } }; fetch(`https://sandbox.belvo.com/payments/br/payment-authorizations/${paymentAuthorizationId}/charges/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2', 'Authorization': `Basic ${Buffer.from(belvoApiKey).toString('base64')}` // For Basic Auth }, body: JSON.stringify(chargeData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Risk Insight Details - R Example Source: https://developers.belvo.com/apis/belvoopenapispec/risk-insights/patchriskinsights This R code snippet demonstrates how to retrieve risk insight details using the 'httr' package. It includes setting up authentication and making a GET request to the Belvo API. ```r # R example would go here, showing httr::GET usage ``` -------------------------------- ### Example Request using Python Source: https://developers.belvo.com/apis/belvoopenapispec/payment-authorizations-%28brazil%29 A Python example using the `requests` library to create a charge for a payment authorization, showing how to structure the request with headers and JSON payload. ```Python import requests import json BELVO_API_KEY = 'YOUR_BELVO_API_KEY' # Replace with your actual API key payment_authorization_id = 'a3b92311-1888-449f-acaa-49ae28d68fcd' url = f"https://sandbox.belvo.com/payments/br/payment-authorizations/{payment_authorization_id}/charges/" headers = { 'Content-Type': 'application/json', 'X-Belvo-API-Resource-Version': 'Payments-BR.V2' } charge_data = { "amount": 100.01, "date": "2025-05-15", "statement_description": "Monthly Gym - Premium Plan", "external_id": "4b8a81a0-e33c-45a6-8567-479efb105f73", "metadata": { "internal_reference_id": "GGq73487w2" } } response = requests.post(url, headers=headers, data=json.dumps(charge_data), auth=(BELVO_API_KEY.split(':')[0], BELVO_API_KEY.split(':')[1])) if response.status_code == 201: print("Charge created successfully:", response.json()) else: print(f"Error creating charge: {response.status_code}", response.text) ```