Skip to content

Create Link Token

Request URL

POST /public/customer/plaid/create_link_token

Description

This endpoint will allow the customer session corresponding to the provided 'x-connectfi-jwtoken' header to create a Plaid link token in order to enable linking the customer bank account via Plaid. The resulting link token is used to open Plaid Link for the customer. The customer will then verify their bank login credentials through Plaid Link. After successful verification, Plaid Link will return a temporary public token that can be used with the /public/customer/plaid/exhange-public-token endpoint. This action can also be facilitated through the payment page HTML that is provided when the customer payment link email is sent or, depending on client configurations, the payment link webhook.

Snippet Examples

javascript

const axios = require('axios');
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/public/customer/plaid/create_link_token',
  headers: {
    'Content-Type': "application/json",
    'x-connectfi-jwtoken': "A long random string token received from /public/customer/payment/link request"
  },
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "CONNECTFI_BASE_URL/public/customer/plaid/create_link_token"  --header "Content-Type: application/json" --header "x-connectfi-jwtoken: A long random string token received from /public/customer/payment/link request" 

Successful Response Examples

200 SUCCESSFUL RESPONSE

HEADERS

Header Value
Content-Type application/json
x-connectfi-jwtoken A long random string token received from /public/customer/payment/link request

REQUEST BODY

none

RESPONSE BODY

{
    "code": "0",
    "data": {
        "expiration": "2024-07-31T16:39:43Z",
        "link_token": "link-sandbox-888f0c44-a8d8-47a1-98ca-7ac4f56d12c0",
        "request_id": "s0rQHCLZ7RkJeLa"
    },
    "requestId": "f60927a04f3911ef92543a54d404e711"
}