curl --request POST \
--url https://east.sandbox.spade.com/transactions/universal/enrich \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"userId": "user_id_123456789",
"description": "AMAZON CORP SYF PAYMNT",
"amount": "283.78",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"organizationId": "organization_id_123",
"accountId": "account_id_123456789",
"transactionId": "transaction_id_123456789",
"direction": "CREDIT",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
'import requests
url = "https://east.sandbox.spade.com/transactions/universal/enrich"
payload = {
"userId": "user_id_123456789",
"description": "AMAZON CORP SYF PAYMNT",
"amount": "283.78",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"organizationId": "organization_id_123",
"accountId": "account_id_123456789",
"transactionId": "transaction_id_123456789",
"direction": "CREDIT",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
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({
userId: 'user_id_123456789',
description: 'AMAZON CORP SYF PAYMNT',
amount: '283.78',
currencyCode: 'USD',
occurredAt: '2022-06-15 18:27:51Z',
organizationId: 'organization_id_123',
accountId: 'account_id_123456789',
transactionId: 'transaction_id_123456789',
direction: 'CREDIT',
billingProfile: 'standard',
customAttributes: {custom_attribute_1: 'value_1', custom_attribute_2: 'value_2'}
})
};
fetch('https://east.sandbox.spade.com/transactions/universal/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://east.sandbox.spade.com/transactions/universal/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([
'userId' => 'user_id_123456789',
'description' => 'AMAZON CORP SYF PAYMNT',
'amount' => '283.78',
'currencyCode' => 'USD',
'occurredAt' => '2022-06-15 18:27:51Z',
'organizationId' => 'organization_id_123',
'accountId' => 'account_id_123456789',
'transactionId' => 'transaction_id_123456789',
'direction' => 'CREDIT',
'billingProfile' => 'standard',
'customAttributes' => [
'custom_attribute_1' => 'value_1',
'custom_attribute_2' => 'value_2'
]
]),
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://east.sandbox.spade.com/transactions/universal/enrich"
payload := strings.NewReader("{\n \"userId\": \"user_id_123456789\",\n \"description\": \"AMAZON CORP SYF PAYMNT\",\n \"amount\": \"283.78\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"organizationId\": \"organization_id_123\",\n \"accountId\": \"account_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"direction\": \"CREDIT\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\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://east.sandbox.spade.com/transactions/universal/enrich")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"user_id_123456789\",\n \"description\": \"AMAZON CORP SYF PAYMNT\",\n \"amount\": \"283.78\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"organizationId\": \"organization_id_123\",\n \"accountId\": \"account_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"direction\": \"CREDIT\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://east.sandbox.spade.com/transactions/universal/enrich")
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 \"userId\": \"user_id_123456789\",\n \"description\": \"AMAZON CORP SYF PAYMNT\",\n \"amount\": \"283.78\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"organizationId\": \"organization_id_123\",\n \"accountId\": \"account_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"direction\": \"CREDIT\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"enrichmentId": "7e40312d-91a4-4744-a987-1fac6e574bde",
"transactionInfo": {
"type": "debt",
"subType": "payment",
"display": {
"name": "Amazon",
"categoryName": "Online Marketplace",
"graphic": "https://static.v2.spadeapi.com/logos/de33f8973bc934c5b368a5b27155db02/light.png",
"graphicSource": "counterparty"
},
"thirdParties": [
{
"id": "038b7223-91b4-30bd-a2e8-851093c2f22d",
"name": "Synchrony",
"type": "payment_processor",
"logo": "https://static.v2.spadeapi.com/logos/038b722391b430bda2e8851093c2f22d/light.png",
"website": "https://synchrony.com/"
}
],
"spendingInfo": null,
"transferInfo": {
"direction": "outgoing",
"transferMethod": "ach",
"transferType": "external",
"isAdjustmentOrRefund": false
},
"atmInfo": null,
"isAccountVerification": false,
"isPeerToPeer": false,
"isDigitalWallet": false,
"transactionId": "transaction_id_123456789",
"recurrenceInfo": null,
"riskInsights": {
"irregularWebPresenceDetected": false,
"negativeOnlineSentiment": false,
"highRiskEntity": false,
"riskyIndustry": false,
"cardAcceptanceHistory": "extensive"
}
},
"counterparty": [
{
"id": "704bbd58-fb12-4bdb-9aae-2786704ea92a",
"name": "Amazon",
"legalName": "Amazon Inc.",
"industry": [
{
"id": "011-000-000-000",
"name": "Retail",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png"
}
],
"matchScore": 93.5,
"location": [
{
"id": null,
"address": null,
"addressLine1": null,
"addressLine2": null,
"city": null,
"region": null,
"country": null,
"postalCode": null,
"latitude": null,
"longitude": null,
"phoneNumber": null,
"matchScore": null
}
],
"logo": "https://static.v2.spadeapi.com/logos/de33f8973bc934c5b368a5b27155db02/light.png",
"phoneNumber": "+18664862360",
"website": "https://www.amazon.com",
"possibleCounterpartyAlternate": null
}
],
"mobileAppInfo": null,
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
},
"actions": [
{
"id": "trigger-12345",
"type": "merchant_trigger",
"action": {
"type": "REWARD",
"rewardPercent": 5
},
"scope": "account",
"source": "counterparty"
}
]
}Enrich a universal transaction
Enrich any type of transaction such as an aggregator transaction, card transaction, ACH withdrawal, ACH deposit, or wire transfer.
curl --request POST \
--url https://east.sandbox.spade.com/transactions/universal/enrich \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"userId": "user_id_123456789",
"description": "AMAZON CORP SYF PAYMNT",
"amount": "283.78",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"organizationId": "organization_id_123",
"accountId": "account_id_123456789",
"transactionId": "transaction_id_123456789",
"direction": "CREDIT",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
'import requests
url = "https://east.sandbox.spade.com/transactions/universal/enrich"
payload = {
"userId": "user_id_123456789",
"description": "AMAZON CORP SYF PAYMNT",
"amount": "283.78",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"organizationId": "organization_id_123",
"accountId": "account_id_123456789",
"transactionId": "transaction_id_123456789",
"direction": "CREDIT",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
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({
userId: 'user_id_123456789',
description: 'AMAZON CORP SYF PAYMNT',
amount: '283.78',
currencyCode: 'USD',
occurredAt: '2022-06-15 18:27:51Z',
organizationId: 'organization_id_123',
accountId: 'account_id_123456789',
transactionId: 'transaction_id_123456789',
direction: 'CREDIT',
billingProfile: 'standard',
customAttributes: {custom_attribute_1: 'value_1', custom_attribute_2: 'value_2'}
})
};
fetch('https://east.sandbox.spade.com/transactions/universal/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://east.sandbox.spade.com/transactions/universal/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([
'userId' => 'user_id_123456789',
'description' => 'AMAZON CORP SYF PAYMNT',
'amount' => '283.78',
'currencyCode' => 'USD',
'occurredAt' => '2022-06-15 18:27:51Z',
'organizationId' => 'organization_id_123',
'accountId' => 'account_id_123456789',
'transactionId' => 'transaction_id_123456789',
'direction' => 'CREDIT',
'billingProfile' => 'standard',
'customAttributes' => [
'custom_attribute_1' => 'value_1',
'custom_attribute_2' => 'value_2'
]
]),
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://east.sandbox.spade.com/transactions/universal/enrich"
payload := strings.NewReader("{\n \"userId\": \"user_id_123456789\",\n \"description\": \"AMAZON CORP SYF PAYMNT\",\n \"amount\": \"283.78\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"organizationId\": \"organization_id_123\",\n \"accountId\": \"account_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"direction\": \"CREDIT\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\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://east.sandbox.spade.com/transactions/universal/enrich")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"user_id_123456789\",\n \"description\": \"AMAZON CORP SYF PAYMNT\",\n \"amount\": \"283.78\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"organizationId\": \"organization_id_123\",\n \"accountId\": \"account_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"direction\": \"CREDIT\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://east.sandbox.spade.com/transactions/universal/enrich")
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 \"userId\": \"user_id_123456789\",\n \"description\": \"AMAZON CORP SYF PAYMNT\",\n \"amount\": \"283.78\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"organizationId\": \"organization_id_123\",\n \"accountId\": \"account_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"direction\": \"CREDIT\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"enrichmentId": "7e40312d-91a4-4744-a987-1fac6e574bde",
"transactionInfo": {
"type": "debt",
"subType": "payment",
"display": {
"name": "Amazon",
"categoryName": "Online Marketplace",
"graphic": "https://static.v2.spadeapi.com/logos/de33f8973bc934c5b368a5b27155db02/light.png",
"graphicSource": "counterparty"
},
"thirdParties": [
{
"id": "038b7223-91b4-30bd-a2e8-851093c2f22d",
"name": "Synchrony",
"type": "payment_processor",
"logo": "https://static.v2.spadeapi.com/logos/038b722391b430bda2e8851093c2f22d/light.png",
"website": "https://synchrony.com/"
}
],
"spendingInfo": null,
"transferInfo": {
"direction": "outgoing",
"transferMethod": "ach",
"transferType": "external",
"isAdjustmentOrRefund": false
},
"atmInfo": null,
"isAccountVerification": false,
"isPeerToPeer": false,
"isDigitalWallet": false,
"transactionId": "transaction_id_123456789",
"recurrenceInfo": null,
"riskInsights": {
"irregularWebPresenceDetected": false,
"negativeOnlineSentiment": false,
"highRiskEntity": false,
"riskyIndustry": false,
"cardAcceptanceHistory": "extensive"
}
},
"counterparty": [
{
"id": "704bbd58-fb12-4bdb-9aae-2786704ea92a",
"name": "Amazon",
"legalName": "Amazon Inc.",
"industry": [
{
"id": "011-000-000-000",
"name": "Retail",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png"
}
],
"matchScore": 93.5,
"location": [
{
"id": null,
"address": null,
"addressLine1": null,
"addressLine2": null,
"city": null,
"region": null,
"country": null,
"postalCode": null,
"latitude": null,
"longitude": null,
"phoneNumber": null,
"matchScore": null
}
],
"logo": "https://static.v2.spadeapi.com/logos/de33f8973bc934c5b368a5b27155db02/light.png",
"phoneNumber": "+18664862360",
"website": "https://www.amazon.com",
"possibleCounterpartyAlternate": null
}
],
"mobileAppInfo": null,
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
},
"actions": [
{
"id": "trigger-12345",
"type": "merchant_trigger",
"action": {
"type": "REWARD",
"rewardPercent": 5
},
"scope": "account",
"source": "counterparty"
}
]
}Body
The full transaction description. Typically, this will be a string containing the name of the merchant or institution involved in the transaction plus information related to the type of transaction such as "ACCT VERIFY", "WEB PMT", "ETRANSFER", etc...
1024"AMAZON CORP SYF PAYMNT"
An ID representing the organization associated with this transaction. Use this field if you are enriching transactions on behalf of other organizations. Used for billing purposes and for scoping products such as action triggers and category personalizations at the organization-level. For more information, see Supporting multiple data sources and clients
256"organization_id_123"
An optional billing profile for this transaction. When set to "resell", the organizationId field is required. For more information, see Supporting multiple data sources and clients
standard, resell "standard"
A dictionary containing custom attributes that you would like to be returned in the response.
Please ensure this object does not contain any PII.
Restrictions include: customAttributes must be an object, up 30 custom attributes are allowed, each key must be a string <= 40 characters in length, and each value must be a string <= 250 characters in length.
Show child attributes
Show child attributes
{
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
Response
Successful operation
An array of triggered actions, or null if no triggers matched.
This field is only present if your integration has the actions feature enabled.
When a transaction matches one or more registered triggers, this array contains the action details including your custom action data.
Show child attributes
Show child attributes
[
{
"id": "trigger-12345",
"type": "merchant_trigger",
"action": { "type": "REWARD", "rewardPercent": 5 },
"scope": "account",
"source": "counterparty"
}
]

