Create a link intent
curl --request POST \
--url https://api.fintoc.com/v1/link_intents \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"country": "cl",
"holder_type": "business",
"product": "movements"
}
'import requests
url = "https://api.fintoc.com/v1/link_intents"
payload = {
"country": "cl",
"holder_type": "business",
"product": "movements"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({country: 'cl', holder_type: 'business', product: 'movements'})
};
fetch('https://api.fintoc.com/v1/link_intents', 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/link_intents",
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([
'country' => 'cl',
'holder_type' => 'business',
'product' => 'movements'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.fintoc.com/v1/link_intents"
payload := strings.NewReader("{\n \"country\": \"cl\",\n \"holder_type\": \"business\",\n \"product\": \"movements\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.fintoc.com/v1/link_intents")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"cl\",\n \"holder_type\": \"business\",\n \"product\": \"movements\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/link_intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"cl\",\n \"holder_type\": \"business\",\n \"product\": \"movements\"\n}"
response = http.request(request)
puts response.read_body{
"id": "li_a6WUojQ2SjSSeFjH",
"object": "link_intent",
"country": "cl",
"created_at": "2022-12-01T01:50:12Z",
"exchange_token": null,
"exchange_token_expires_at": null,
"holder_type": "business",
"mode": "live",
"product": "movements",
"status": "created",
"widget_token": "li_a6WUojQ2SjSSeFjH_sec_Q802GD8ZLmMuK0Atl4ucJuLp"
}{
"error": {
"type": "invalid_request_error",
"code": "not_supported_product",
"param": "product",
"message": "Not supported product: payments. Currently, supported products are: movements.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}Linkintents
Create a link intent
Creates a link intent, the first step to connect an account through the Fintoc widget. The response includes the widget_token needed to initialize the widget; Fintoc returns the token only in this response. The link intent inherits the live or test mode of the API key used.
POST
/
v1
/
link_intents
Create a link intent
curl --request POST \
--url https://api.fintoc.com/v1/link_intents \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"country": "cl",
"holder_type": "business",
"product": "movements"
}
'import requests
url = "https://api.fintoc.com/v1/link_intents"
payload = {
"country": "cl",
"holder_type": "business",
"product": "movements"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({country: 'cl', holder_type: 'business', product: 'movements'})
};
fetch('https://api.fintoc.com/v1/link_intents', 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/link_intents",
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([
'country' => 'cl',
'holder_type' => 'business',
'product' => 'movements'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.fintoc.com/v1/link_intents"
payload := strings.NewReader("{\n \"country\": \"cl\",\n \"holder_type\": \"business\",\n \"product\": \"movements\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.fintoc.com/v1/link_intents")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"cl\",\n \"holder_type\": \"business\",\n \"product\": \"movements\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/link_intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"cl\",\n \"holder_type\": \"business\",\n \"product\": \"movements\"\n}"
response = http.request(request)
puts response.read_body{
"id": "li_a6WUojQ2SjSSeFjH",
"object": "link_intent",
"country": "cl",
"created_at": "2022-12-01T01:50:12Z",
"exchange_token": null,
"exchange_token_expires_at": null,
"holder_type": "business",
"mode": "live",
"product": "movements",
"status": "created",
"widget_token": "li_a6WUojQ2SjSSeFjH_sec_Q802GD8ZLmMuK0Atl4ucJuLp"
}{
"error": {
"type": "invalid_request_error",
"code": "not_supported_product",
"param": "product",
"message": "Not supported product: payments. Currently, supported products are: movements.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}Cuerpo
application/json
Respuesta
Link intent created. The widget_token is only returned in this response.
¿Esta página le ayudó?