Enrich transactions
curl --request POST \
--url https://api.swippee.com/v1/enrich \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"description": "<string>",
"debit": 123,
"credit": 123
}
]
}
'import requests
url = "https://api.swippee.com/v1/enrich"
payload = { "transactions": [
{
"description": "<string>",
"debit": 123,
"credit": 123
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({transactions: [{description: '<string>', debit: 123, credit: 123}]})
};
fetch('https://api.swippee.com/v1/enrich', 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.swippee.com/v1/enrich",
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([
'transactions' => [
[
'description' => '<string>',
'debit' => 123,
'credit' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.swippee.com/v1/enrich"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"description\": \"<string>\",\n \"debit\": 123,\n \"credit\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.swippee.com/v1/enrich")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"description\": \"<string>\",\n \"debit\": 123,\n \"credit\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swippee.com/v1/enrich")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactions\": [\n {\n \"description\": \"<string>\",\n \"debit\": 123,\n \"credit\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"date": "2023-12-25",
"description": "<string>",
"debit": 123,
"credit": 123,
"balance": 123,
"category": "merchant_payment",
"merchant": "Example Store",
"merchantTerminal": "<string>",
"mcc": "5411",
"merchantCategory": "groceries"
}
]
}{
"error_type": "AUTHENTICATION_ERROR",
"error_code": "INVALID_API_KEY",
"error_message": "Unknown API key.",
"display_message": null,
"request_id": "req_8f3c9b2e4a1d4f7c9e0b1a2c3d4e5f60",
"documentation_url": "https://docs.swippee.com/concepts/errors#invalid_api_key",
"suggested_action": "Check your API key in the Authorization header."
}Enrichment
Enrich transactions
Send raw transactions; get merchant, MCC, and spend category tags back. A transform endpoint — no report required.
POST
/
v1
/
enrich
Enrich transactions
curl --request POST \
--url https://api.swippee.com/v1/enrich \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"description": "<string>",
"debit": 123,
"credit": 123
}
]
}
'import requests
url = "https://api.swippee.com/v1/enrich"
payload = { "transactions": [
{
"description": "<string>",
"debit": 123,
"credit": 123
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({transactions: [{description: '<string>', debit: 123, credit: 123}]})
};
fetch('https://api.swippee.com/v1/enrich', 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.swippee.com/v1/enrich",
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([
'transactions' => [
[
'description' => '<string>',
'debit' => 123,
'credit' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.swippee.com/v1/enrich"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"description\": \"<string>\",\n \"debit\": 123,\n \"credit\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.swippee.com/v1/enrich")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"description\": \"<string>\",\n \"debit\": 123,\n \"credit\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swippee.com/v1/enrich")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactions\": [\n {\n \"description\": \"<string>\",\n \"debit\": 123,\n \"credit\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"date": "2023-12-25",
"description": "<string>",
"debit": 123,
"credit": 123,
"balance": 123,
"category": "merchant_payment",
"merchant": "Example Store",
"merchantTerminal": "<string>",
"mcc": "5411",
"merchantCategory": "groceries"
}
]
}{
"error_type": "AUTHENTICATION_ERROR",
"error_code": "INVALID_API_KEY",
"error_message": "Unknown API key.",
"display_message": null,
"request_id": "req_8f3c9b2e4a1d4f7c9e0b1a2c3d4e5f60",
"documentation_url": "https://docs.swippee.com/concepts/errors#invalid_api_key",
"suggested_action": "Check your API key in the Authorization header."
}⌘I