Extract merchant
curl --request POST \
--url https://app.herondata.io/api/merchants/extract \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"description": "PAYPAL* AMZN Mktp 198748320"
}
'import requests
url = "https://app.herondata.io/api/merchants/extract"
payload = { "description": "PAYPAL* AMZN Mktp 198748320" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'PAYPAL* AMZN Mktp 198748320'})
};
fetch('https://app.herondata.io/api/merchants/extract', 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://app.herondata.io/api/merchants/extract",
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([
'description' => 'PAYPAL* AMZN Mktp 198748320'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://app.herondata.io/api/merchants/extract"
payload := strings.NewReader("{\n \"description\": \"PAYPAL* AMZN Mktp 198748320\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://app.herondata.io/api/merchants/extract")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"PAYPAL* AMZN Mktp 198748320\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.herondata.io/api/merchants/extract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"PAYPAL* AMZN Mktp 198748320\"\n}"
response = http.request(request)
puts response.read_body{
"description_clean": "Amzn Mktp",
"merchant": {
"categories": [
{
"code": "7311",
"description": "Advertising services",
"slug": "advertising_services"
}
],
"confidence": 0.5,
"group_id": "<string>",
"heron_id": "mrc_VGvdKtjptK8d3iiEdjs4T7",
"icon_url": "<string>",
"logo_url": "<string>",
"name": "Amazon",
"url": "https://www.amazon.com/"
},
"payment_processor": {
"heron_id": "mrc_nRYdGU7nYuevb7qem65cEb",
"icon_url": "https://storage.googleapis.com/heron-merchant-assets/icons/mrc_nRYdGU7nYuevb7qem65cEb.svg",
"logo_url": "https://storage.googleapis.com/heron-merchant-assets/logos/mrc_nRYdGU7nYuevb7qem65cEb.svg",
"name": "Paypal",
"url": "https://www.paypal.com"
}
}Merchants
Extract merchant
Extract Merchant from a transaction description
POST
/
api
/
merchants
/
extract
Extract merchant
curl --request POST \
--url https://app.herondata.io/api/merchants/extract \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"description": "PAYPAL* AMZN Mktp 198748320"
}
'import requests
url = "https://app.herondata.io/api/merchants/extract"
payload = { "description": "PAYPAL* AMZN Mktp 198748320" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'PAYPAL* AMZN Mktp 198748320'})
};
fetch('https://app.herondata.io/api/merchants/extract', 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://app.herondata.io/api/merchants/extract",
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([
'description' => 'PAYPAL* AMZN Mktp 198748320'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://app.herondata.io/api/merchants/extract"
payload := strings.NewReader("{\n \"description\": \"PAYPAL* AMZN Mktp 198748320\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://app.herondata.io/api/merchants/extract")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"PAYPAL* AMZN Mktp 198748320\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.herondata.io/api/merchants/extract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"PAYPAL* AMZN Mktp 198748320\"\n}"
response = http.request(request)
puts response.read_body{
"description_clean": "Amzn Mktp",
"merchant": {
"categories": [
{
"code": "7311",
"description": "Advertising services",
"slug": "advertising_services"
}
],
"confidence": 0.5,
"group_id": "<string>",
"heron_id": "mrc_VGvdKtjptK8d3iiEdjs4T7",
"icon_url": "<string>",
"logo_url": "<string>",
"name": "Amazon",
"url": "https://www.amazon.com/"
},
"payment_processor": {
"heron_id": "mrc_nRYdGU7nYuevb7qem65cEb",
"icon_url": "https://storage.googleapis.com/heron-merchant-assets/icons/mrc_nRYdGU7nYuevb7qem65cEb.svg",
"logo_url": "https://storage.googleapis.com/heron-merchant-assets/logos/mrc_nRYdGU7nYuevb7qem65cEb.svg",
"name": "Paypal",
"url": "https://www.paypal.com"
}
}Authorizations
Body
application/json
The bank transaction description as a string
Example:
"PAYPAL* AMZN Mktp 198748320"
Response
200 - application/json
The merchant key is not null when we find a positive match to our database. When we could not match a merchant, merchant is null and description_clean is set to a substring of the original description that our models identified as the relevant entity.
Was this page helpful?
⌘I