Create a bridge token
curl --request POST \
--url https://prod.truv.com/v1/users/{user_id}/tokens/ \
--header 'Content-Type: application/json' \
--header 'X-Access-Client-Id: <api-key>' \
--header 'X-Access-Secret: <api-key>' \
--data '
{
"product_type": "income",
"tracking_info": "any data for tracking current user",
"allowed_products": [
"income"
],
"company_mapping_id": "99dd17074ac94aa9ace2621d657c7610",
"provider_id": "adp",
"access_token": "99dd17074ac94aa9ace2621d657c7610",
"template_id": "99dd17074ac94aa9ace2621d657c7610",
"use_case": "mortgage_lending",
"request_extended_history": true,
"locale": "es",
"data_sources": [
"payroll"
]
}
'import requests
url = "https://prod.truv.com/v1/users/{user_id}/tokens/"
payload = {
"product_type": "income",
"tracking_info": "any data for tracking current user",
"allowed_products": ["income"],
"company_mapping_id": "99dd17074ac94aa9ace2621d657c7610",
"provider_id": "adp",
"access_token": "99dd17074ac94aa9ace2621d657c7610",
"template_id": "99dd17074ac94aa9ace2621d657c7610",
"use_case": "mortgage_lending",
"request_extended_history": True,
"locale": "es",
"data_sources": ["payroll"]
}
headers = {
"X-Access-Client-Id": "<api-key>",
"X-Access-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Client-Id': '<api-key>',
'X-Access-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product_type: 'income',
tracking_info: 'any data for tracking current user',
allowed_products: ['income'],
company_mapping_id: '99dd17074ac94aa9ace2621d657c7610',
provider_id: 'adp',
access_token: '99dd17074ac94aa9ace2621d657c7610',
template_id: '99dd17074ac94aa9ace2621d657c7610',
use_case: 'mortgage_lending',
request_extended_history: true,
locale: 'es',
data_sources: ['payroll']
})
};
fetch('https://prod.truv.com/v1/users/{user_id}/tokens/', 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://prod.truv.com/v1/users/{user_id}/tokens/",
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([
'product_type' => 'income',
'tracking_info' => 'any data for tracking current user',
'allowed_products' => [
'income'
],
'company_mapping_id' => '99dd17074ac94aa9ace2621d657c7610',
'provider_id' => 'adp',
'access_token' => '99dd17074ac94aa9ace2621d657c7610',
'template_id' => '99dd17074ac94aa9ace2621d657c7610',
'use_case' => 'mortgage_lending',
'request_extended_history' => true,
'locale' => 'es',
'data_sources' => [
'payroll'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Client-Id: <api-key>",
"X-Access-Secret: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod.truv.com/v1/users/{user_id}/tokens/"
payload := strings.NewReader("{\n \"product_type\": \"income\",\n \"tracking_info\": \"any data for tracking current user\",\n \"allowed_products\": [\n \"income\"\n ],\n \"company_mapping_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"provider_id\": \"adp\",\n \"access_token\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"template_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"use_case\": \"mortgage_lending\",\n \"request_extended_history\": true,\n \"locale\": \"es\",\n \"data_sources\": [\n \"payroll\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Client-Id", "<api-key>")
req.Header.Add("X-Access-Secret", "<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://prod.truv.com/v1/users/{user_id}/tokens/")
.header("X-Access-Client-Id", "<api-key>")
.header("X-Access-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product_type\": \"income\",\n \"tracking_info\": \"any data for tracking current user\",\n \"allowed_products\": [\n \"income\"\n ],\n \"company_mapping_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"provider_id\": \"adp\",\n \"access_token\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"template_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"use_case\": \"mortgage_lending\",\n \"request_extended_history\": true,\n \"locale\": \"es\",\n \"data_sources\": [\n \"payroll\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.truv.com/v1/users/{user_id}/tokens/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Client-Id"] = '<api-key>'
request["X-Access-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_type\": \"income\",\n \"tracking_info\": \"any data for tracking current user\",\n \"allowed_products\": [\n \"income\"\n ],\n \"company_mapping_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"provider_id\": \"adp\",\n \"access_token\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"template_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"use_case\": \"mortgage_lending\",\n \"request_extended_history\": true,\n \"locale\": \"es\",\n \"data_sources\": [\n \"payroll\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"bridge_token": "2f67984a110747d190c39e1022c81837",
"tracking_info": "any data for tracking current user",
"client_name": "Truv Demo",
"product_type": "income",
"allowed_products": [
"income",
"deposit_switch"
],
"company_mapping_id": "99dd17074ac94aa9ace2621d657c7610",
"access_token": "99dd17074ac94aa9ace2621d657c7610",
"user_id": "99dd17074ac94aa9ace2621d657c7610",
"template_id": "99dd17074ac94aa9ace2621d657c7610",
"data_sources": [
"payroll"
]
}{
"error": {
"code": "incorrect_parameters",
"message": "Incorrect request parameters",
"extra": {
"invalid-params": [
{
"field": "access_token",
"message": "This field is required."
}
]
}
}
}{
"error": {
"code": "authentication_failed",
"message": "No such token"
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication credentials were not provided."
}
}{
"detail": "Not Found."
}Bridge Token
Create a bridge token
The endpoint creates a bridge token for a user. This is typically the endpoint called before initializing the Bridge since the response from this call is passed to the TruvBridge.init function.
POST
/
v1
/
users
/
{user_id}
/
tokens
/
Create a bridge token
curl --request POST \
--url https://prod.truv.com/v1/users/{user_id}/tokens/ \
--header 'Content-Type: application/json' \
--header 'X-Access-Client-Id: <api-key>' \
--header 'X-Access-Secret: <api-key>' \
--data '
{
"product_type": "income",
"tracking_info": "any data for tracking current user",
"allowed_products": [
"income"
],
"company_mapping_id": "99dd17074ac94aa9ace2621d657c7610",
"provider_id": "adp",
"access_token": "99dd17074ac94aa9ace2621d657c7610",
"template_id": "99dd17074ac94aa9ace2621d657c7610",
"use_case": "mortgage_lending",
"request_extended_history": true,
"locale": "es",
"data_sources": [
"payroll"
]
}
'import requests
url = "https://prod.truv.com/v1/users/{user_id}/tokens/"
payload = {
"product_type": "income",
"tracking_info": "any data for tracking current user",
"allowed_products": ["income"],
"company_mapping_id": "99dd17074ac94aa9ace2621d657c7610",
"provider_id": "adp",
"access_token": "99dd17074ac94aa9ace2621d657c7610",
"template_id": "99dd17074ac94aa9ace2621d657c7610",
"use_case": "mortgage_lending",
"request_extended_history": True,
"locale": "es",
"data_sources": ["payroll"]
}
headers = {
"X-Access-Client-Id": "<api-key>",
"X-Access-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Client-Id': '<api-key>',
'X-Access-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product_type: 'income',
tracking_info: 'any data for tracking current user',
allowed_products: ['income'],
company_mapping_id: '99dd17074ac94aa9ace2621d657c7610',
provider_id: 'adp',
access_token: '99dd17074ac94aa9ace2621d657c7610',
template_id: '99dd17074ac94aa9ace2621d657c7610',
use_case: 'mortgage_lending',
request_extended_history: true,
locale: 'es',
data_sources: ['payroll']
})
};
fetch('https://prod.truv.com/v1/users/{user_id}/tokens/', 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://prod.truv.com/v1/users/{user_id}/tokens/",
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([
'product_type' => 'income',
'tracking_info' => 'any data for tracking current user',
'allowed_products' => [
'income'
],
'company_mapping_id' => '99dd17074ac94aa9ace2621d657c7610',
'provider_id' => 'adp',
'access_token' => '99dd17074ac94aa9ace2621d657c7610',
'template_id' => '99dd17074ac94aa9ace2621d657c7610',
'use_case' => 'mortgage_lending',
'request_extended_history' => true,
'locale' => 'es',
'data_sources' => [
'payroll'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Client-Id: <api-key>",
"X-Access-Secret: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod.truv.com/v1/users/{user_id}/tokens/"
payload := strings.NewReader("{\n \"product_type\": \"income\",\n \"tracking_info\": \"any data for tracking current user\",\n \"allowed_products\": [\n \"income\"\n ],\n \"company_mapping_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"provider_id\": \"adp\",\n \"access_token\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"template_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"use_case\": \"mortgage_lending\",\n \"request_extended_history\": true,\n \"locale\": \"es\",\n \"data_sources\": [\n \"payroll\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Client-Id", "<api-key>")
req.Header.Add("X-Access-Secret", "<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://prod.truv.com/v1/users/{user_id}/tokens/")
.header("X-Access-Client-Id", "<api-key>")
.header("X-Access-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product_type\": \"income\",\n \"tracking_info\": \"any data for tracking current user\",\n \"allowed_products\": [\n \"income\"\n ],\n \"company_mapping_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"provider_id\": \"adp\",\n \"access_token\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"template_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"use_case\": \"mortgage_lending\",\n \"request_extended_history\": true,\n \"locale\": \"es\",\n \"data_sources\": [\n \"payroll\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod.truv.com/v1/users/{user_id}/tokens/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Client-Id"] = '<api-key>'
request["X-Access-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_type\": \"income\",\n \"tracking_info\": \"any data for tracking current user\",\n \"allowed_products\": [\n \"income\"\n ],\n \"company_mapping_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"provider_id\": \"adp\",\n \"access_token\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"template_id\": \"99dd17074ac94aa9ace2621d657c7610\",\n \"use_case\": \"mortgage_lending\",\n \"request_extended_history\": true,\n \"locale\": \"es\",\n \"data_sources\": [\n \"payroll\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"bridge_token": "2f67984a110747d190c39e1022c81837",
"tracking_info": "any data for tracking current user",
"client_name": "Truv Demo",
"product_type": "income",
"allowed_products": [
"income",
"deposit_switch"
],
"company_mapping_id": "99dd17074ac94aa9ace2621d657c7610",
"access_token": "99dd17074ac94aa9ace2621d657c7610",
"user_id": "99dd17074ac94aa9ace2621d657c7610",
"template_id": "99dd17074ac94aa9ace2621d657c7610",
"data_sources": [
"payroll"
]
}{
"error": {
"code": "incorrect_parameters",
"message": "Incorrect request parameters",
"extra": {
"invalid-params": [
{
"field": "access_token",
"message": "This field is required."
}
]
}
}
}{
"error": {
"code": "authentication_failed",
"message": "No such token"
}
}{
"error": {
"code": "not_authenticated",
"message": "Authentication credentials were not provided."
}
}{
"detail": "Not Found."
}Authorizations
Body
application/json
Bridge token properties
Indicates the type of product to use:
employment- Employment verification,income- Income and Employment verification,deposit_switch- Direct deposit switch,pll- Paycheck linked lending,insurance- Insurance verification,transactions- Financial account aggregation,assets- Assets verification,
Available options:
income, employment, deposit_switch, pll, insurance, transactions, assets Example:
"income"
Response
Data for the bridge token
Indicates the type of product to use:
employment- Employment verification,income- Income and Employment verification,deposit_switch- Direct deposit switch,pll- Paycheck linked lending,insurance- Insurance verification,transactions- Financial account aggregation,assets- Assets verification,
Available options:
income, employment, deposit_switch, pll, insurance, transactions, assets, credit, education Example:
"income"
Was this page helpful?