cURL
curl --request GET \
--url https://development.knotapi.com/accounts/get \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://development.knotapi.com/accounts/get"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://development.knotapi.com/accounts/get', 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://development.knotapi.com/accounts/get",
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: Basic <encoded-value>"
],
]);
$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://development.knotapi.com/accounts/get"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://development.knotapi.com/accounts/get")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://development.knotapi.com/accounts/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"merchant": {
"id": 19,
"name": "DoorDash",
"logo": "https://knot.imgix.net/merchants/KBQ5j6cN010PPpwbO7RpKGyDrCpsZ91FRhwnZp5u.png"
},
"connection": {
"status": "connected",
"scopes": [
{
"type": "update_card"
}
]
},
"lifecycle": {
"status": null
},
"last_user_action": {
"attempted_at": null,
"status": null
}
},
{
"merchant": {
"id": 40,
"name": "Instacart",
"logo": "https://knot.imgix.net/merchants/KBQ5j6cN010PPpwbO7RpKGyDrCpsZ91FRhwnZp5u.png"
},
"connection": {
"status": "connected",
"scopes": [
{
"type": "update_card"
}
]
},
"lifecycle": {
"status": null
},
"last_user_action": {
"attempted_at": null,
"status": null
}
},
{
"merchant": {
"id": 12,
"name": "Target",
"logo": "https://knot.imgix.net/merchants/KBQ5j6cN010PPpwbO7RpKGyDrCpsZ91FRhwnZp5u.png"
},
"connection": {
"status": "disconnected",
"scopes": []
},
"lifecycle": {
"status": null
},
"last_user_action": {
"attempted_at": null,
"status": null
}
}
]
Merchant Accounts
Get Merchant Accounts
Get a user’s merchant accounts linked to Knot.
GET
/
accounts
/
get
cURL
curl --request GET \
--url https://development.knotapi.com/accounts/get \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://development.knotapi.com/accounts/get"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://development.knotapi.com/accounts/get', 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://development.knotapi.com/accounts/get",
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: Basic <encoded-value>"
],
]);
$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://development.knotapi.com/accounts/get"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://development.knotapi.com/accounts/get")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://development.knotapi.com/accounts/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body[
{
"merchant": {
"id": 19,
"name": "DoorDash",
"logo": "https://knot.imgix.net/merchants/KBQ5j6cN010PPpwbO7RpKGyDrCpsZ91FRhwnZp5u.png"
},
"connection": {
"status": "connected",
"scopes": [
{
"type": "update_card"
}
]
},
"lifecycle": {
"status": null
},
"last_user_action": {
"attempted_at": null,
"status": null
}
},
{
"merchant": {
"id": 40,
"name": "Instacart",
"logo": "https://knot.imgix.net/merchants/KBQ5j6cN010PPpwbO7RpKGyDrCpsZ91FRhwnZp5u.png"
},
"connection": {
"status": "connected",
"scopes": [
{
"type": "update_card"
}
]
},
"lifecycle": {
"status": null
},
"last_user_action": {
"attempted_at": null,
"status": null
}
},
{
"merchant": {
"id": 12,
"name": "Target",
"logo": "https://knot.imgix.net/merchants/KBQ5j6cN010PPpwbO7RpKGyDrCpsZ91FRhwnZp5u.png"
},
"connection": {
"status": "disconnected",
"scopes": []
},
"lifecycle": {
"status": null
},
"last_user_action": {
"attempted_at": null,
"status": null
}
}
]
This endpoint allows you to retrieve an array of merchant accounts for a given user (specified in the request with
external_user_id) that are currently linked to Knot. If a user unlinked a merchant account with Unlink Merchant Account, it will not be returned.
You can choose to retrieve all merchant accounts for a user or a single merchant account by passing a specific merchant_id in the request.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password. Use your client_id as the username and your secret as the password value.
Query Parameters
Your unique identifier for the user.
Unique identifier for a merchant. Used to return a single merchant account object.
Example:
19
Product type for which you want to get the status of the most recent login attempt in lifecycle.status.
Available options:
card_switcher, transaction_link, vault Example:
"card_switcher"
Response
Successful request. If you pass a merchant_id in the request, the response will be a single object, instead of an array.
Was this page helpful?
⌘I