curl --request GET \
--url https://api.fintoc.com/v1/links/exchange \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/links/exchange"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/links/exchange', 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.fintoc.com/v1/links/exchange",
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: <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.fintoc.com/v1/links/exchange"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fintoc.com/v1/links/exchange")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/links/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "link_nMNejK7BT8oGbvO4",
"object": "link",
"accounts": [
{
"id": "acc_nMNejK7BT8oGbvO4",
"object": "account",
"balance": {
"available": 500000,
"current": 500000,
"limit": 500000
},
"currency": "CLP",
"holder_id": "111111111",
"holder_name": "Jon Snow",
"name": "Cuenta Corriente",
"next_refresh": "2023-04-06T13:30:00.000Z",
"number": "9530516286",
"official_name": "Cuenta Corriente Moneda Local",
"refresh_status": "starting",
"refreshed_at": null,
"removed_from_link": false,
"type": "checking_account"
}
],
"active": true,
"created_at": "2022-11-28T15:00:00.000Z",
"holder_id": "111111111",
"holder_type": "individual",
"institution": {
"id": "cl_banco_de_chile",
"country": "cl",
"name": "Banco de Chile"
},
"last_time_refreshed": null,
"link_token": "link_nMNejK7BT8oGbvO4_token_sjnNsMyXKJEXAMPLETOKENrnNL1tA8",
"mode": "live",
"refresh_status": "idle",
"status": "active",
"username": "111111111"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key_mode",
"param": "exchange_token",
"message": "The API key mode does not match the link intent mode.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "expired_exchange_token",
"param": "exchange_token",
"message": "The exchange token has expired. You need to create a new link intent.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Exchange a link
Exchanges the exchange_token obtained through the widget for the resulting link. This is the only response that includes the link’s link_token, needed to fetch the link’s resources; store the link_token securely. The exchange token expires at the link intent’s exchange_token_expires_at.
curl --request GET \
--url https://api.fintoc.com/v1/links/exchange \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/links/exchange"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/links/exchange', 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.fintoc.com/v1/links/exchange",
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: <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.fintoc.com/v1/links/exchange"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fintoc.com/v1/links/exchange")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/links/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "link_nMNejK7BT8oGbvO4",
"object": "link",
"accounts": [
{
"id": "acc_nMNejK7BT8oGbvO4",
"object": "account",
"balance": {
"available": 500000,
"current": 500000,
"limit": 500000
},
"currency": "CLP",
"holder_id": "111111111",
"holder_name": "Jon Snow",
"name": "Cuenta Corriente",
"next_refresh": "2023-04-06T13:30:00.000Z",
"number": "9530516286",
"official_name": "Cuenta Corriente Moneda Local",
"refresh_status": "starting",
"refreshed_at": null,
"removed_from_link": false,
"type": "checking_account"
}
],
"active": true,
"created_at": "2022-11-28T15:00:00.000Z",
"holder_id": "111111111",
"holder_type": "individual",
"institution": {
"id": "cl_banco_de_chile",
"country": "cl",
"name": "Banco de Chile"
},
"last_time_refreshed": null,
"link_token": "link_nMNejK7BT8oGbvO4_token_sjnNsMyXKJEXAMPLETOKENrnNL1tA8",
"mode": "live",
"refresh_status": "idle",
"status": "active",
"username": "111111111"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key_mode",
"param": "exchange_token",
"message": "The API key mode does not match the link intent mode.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "expired_exchange_token",
"param": "exchange_token",
"message": "The exchange token has expired. You need to create a new link intent.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Authorizations
Query Parameters
The exchange_token of a succeeded link intent, obtained through the widget.
"li_a6WUojQ2SjSSeFjH_exc_Q802GD8ZLmMu"
Response
The link, including its accounts. The link_token is only returned in this response.
Unique identifier of the link.
"link_nMNejK7BT8oGbvO4"
Type of the object. Always link.
Bank accounts of the link. Included when retrieving or exchanging a single link; null when listing or updating links.
Show child attributes
Show child attributes
Whether the link is active. Fintoc does not refresh inactive links, and deactivating a link does not revoke the link_token's access to already-collected data. Reactivating a link triggers a full historical refresh if Fintoc has never refreshed the link or if the last refresh happened more than 20 days ago.
true
ISO 8601 timestamp of when the link was created.
"2020-04-22T21:10:19.254Z"
Tax identifier of the account holder, without dots or hyphens (RUT in Chile, RFC in Mexico).
"111111111"
Whether the account holder is an individual or a business.
individual, business "individual"
Show child attributes
Show child attributes
ISO 8601 timestamp of the link's last refresh. null if Fintoc has never refreshed the link.
"2020-11-18T18:43:54.591Z"
Token used to authenticate requests for the link's resources. Only returned when the link is exchanged; null in every other response.
"link_nMNejK7BT8oGbvO4_token_sjnNsMyXKJEXAMPLETOKENrnNL1tA8"
Mode of the object. live objects use real institution data, test objects use fake data for integration testing.
test, live "live"
Refresh status of the link's accounts. idle means no refresh is in progress, refreshing means every account is refreshing, partially_refreshing means only some accounts are refreshing, and interrupted means no account is currently refreshing.
idle, refreshing, interrupted, partially_refreshing, null "idle"
Status of the link. login_required means the institution rejected the stored credentials and you must reconnect the link.
active, inactive, login_required "active"
Username used to log in at the institution, without dots or hyphens.
"111111111"
Identifier of the subscription associated to the link. Only present when the link is returned from a subscription exchange.
"sub_nMNejK7BT8oGbvO4"
Was this page helpful?