curl --request POST \
--url https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"transactions": [
{
"userId": "user_id_123456789",
"transactionId": "transaction_id_123456789",
"amount": "25.23",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"categoryCode": "5812",
"location": {
"address": "1234 W 5th Ave Suite 100",
"city": "New York",
"region": "NY",
"country": "USA",
"postalCode": "10001",
"latitude": 45,
"longitude": 120
},
"de43": "de43_123456789",
"merchantName": "Amazon",
"organizationId": "organization_id_123",
"programId": "program_id_123",
"cardId": "card_id_123456789",
"cardFirstSix": "123456",
"cardLastFour": "7890",
"acquirerId": "000000000123456",
"categoryType": "MCC",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
],
"callbackUrl": "https://example.com/callback"
}
'import requests
url = "https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse"
payload = {
"transactions": [
{
"userId": "user_id_123456789",
"transactionId": "transaction_id_123456789",
"amount": "25.23",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"categoryCode": "5812",
"location": {
"address": "1234 W 5th Ave Suite 100",
"city": "New York",
"region": "NY",
"country": "USA",
"postalCode": "10001",
"latitude": 45,
"longitude": 120
},
"de43": "de43_123456789",
"merchantName": "Amazon",
"organizationId": "organization_id_123",
"programId": "program_id_123",
"cardId": "card_id_123456789",
"cardFirstSix": "123456",
"cardLastFour": "7890",
"acquirerId": "000000000123456",
"categoryType": "MCC",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
],
"callbackUrl": "https://example.com/callback"
}
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({
transactions: [
{
userId: 'user_id_123456789',
transactionId: 'transaction_id_123456789',
amount: '25.23',
currencyCode: 'USD',
occurredAt: '2022-06-15 18:27:51Z',
categoryCode: '5812',
location: {
address: '1234 W 5th Ave Suite 100',
city: 'New York',
region: 'NY',
country: 'USA',
postalCode: '10001',
latitude: 45,
longitude: 120
},
de43: 'de43_123456789',
merchantName: 'Amazon',
organizationId: 'organization_id_123',
programId: 'program_id_123',
cardId: 'card_id_123456789',
cardFirstSix: '123456',
cardLastFour: '7890',
acquirerId: '000000000123456',
categoryType: 'MCC',
billingProfile: 'standard',
customAttributes: {custom_attribute_1: 'value_1', custom_attribute_2: 'value_2'}
}
],
callbackUrl: 'https://example.com/callback'
})
};
fetch('https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse', 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/batches/transactions/cards/enrich/parse",
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' => [
[
'userId' => 'user_id_123456789',
'transactionId' => 'transaction_id_123456789',
'amount' => '25.23',
'currencyCode' => 'USD',
'occurredAt' => '2022-06-15 18:27:51Z',
'categoryCode' => '5812',
'location' => [
'address' => '1234 W 5th Ave Suite 100',
'city' => 'New York',
'region' => 'NY',
'country' => 'USA',
'postalCode' => '10001',
'latitude' => 45,
'longitude' => 120
],
'de43' => 'de43_123456789',
'merchantName' => 'Amazon',
'organizationId' => 'organization_id_123',
'programId' => 'program_id_123',
'cardId' => 'card_id_123456789',
'cardFirstSix' => '123456',
'cardLastFour' => '7890',
'acquirerId' => '000000000123456',
'categoryType' => 'MCC',
'billingProfile' => 'standard',
'customAttributes' => [
'custom_attribute_1' => 'value_1',
'custom_attribute_2' => 'value_2'
]
]
],
'callbackUrl' => 'https://example.com/callback'
]),
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/batches/transactions/cards/enrich/parse"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"userId\": \"user_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": \"25.23\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"categoryCode\": \"5812\",\n \"location\": {\n \"address\": \"1234 W 5th Ave Suite 100\",\n \"city\": \"New York\",\n \"region\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"10001\",\n \"latitude\": 45,\n \"longitude\": 120\n },\n \"de43\": \"de43_123456789\",\n \"merchantName\": \"Amazon\",\n \"organizationId\": \"organization_id_123\",\n \"programId\": \"program_id_123\",\n \"cardId\": \"card_id_123456789\",\n \"cardFirstSix\": \"123456\",\n \"cardLastFour\": \"7890\",\n \"acquirerId\": \"000000000123456\",\n \"categoryType\": \"MCC\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n }\n ],\n \"callbackUrl\": \"https://example.com/callback\"\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/batches/transactions/cards/enrich/parse")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"userId\": \"user_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": \"25.23\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"categoryCode\": \"5812\",\n \"location\": {\n \"address\": \"1234 W 5th Ave Suite 100\",\n \"city\": \"New York\",\n \"region\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"10001\",\n \"latitude\": 45,\n \"longitude\": 120\n },\n \"de43\": \"de43_123456789\",\n \"merchantName\": \"Amazon\",\n \"organizationId\": \"organization_id_123\",\n \"programId\": \"program_id_123\",\n \"cardId\": \"card_id_123456789\",\n \"cardFirstSix\": \"123456\",\n \"cardLastFour\": \"7890\",\n \"acquirerId\": \"000000000123456\",\n \"categoryType\": \"MCC\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n }\n ],\n \"callbackUrl\": \"https://example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse")
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 \"transactions\": [\n {\n \"userId\": \"user_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": \"25.23\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"categoryCode\": \"5812\",\n \"location\": {\n \"address\": \"1234 W 5th Ave Suite 100\",\n \"city\": \"New York\",\n \"region\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"10001\",\n \"latitude\": 45,\n \"longitude\": 120\n },\n \"de43\": \"de43_123456789\",\n \"merchantName\": \"Amazon\",\n \"organizationId\": \"organization_id_123\",\n \"programId\": \"program_id_123\",\n \"cardId\": \"card_id_123456789\",\n \"cardFirstSix\": \"123456\",\n \"cardLastFour\": \"7890\",\n \"acquirerId\": \"000000000123456\",\n \"categoryType\": \"MCC\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n }\n ],\n \"callbackUrl\": \"https://example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"batchSize": 1,
"submittedAt": "2024-11-21T20:07:20.213660Z"
}{
"invalidField": [
"This field is required."
]
}{
"details": "Incorrect authentication credentials."
}{
"details": "Internal server error."
}Enrich a batch of card transactions with DE43 data
Submit a batch of card transactions for enrichment where de43 data in the request body takes precedence over the other fields in the request body.
Just like the /transactions/cards/enrich/parse endpoint, the transactions can omit city and merchantName fields if the de43 field is present.
This endpoint returns a batchId which can be used in the /batches/{batchId} and /batches/{batchId}/results endpoints to check the status of the batch job and retrieve the results.
You can pass ?synchronous=true to enrich smaller sets of transactions synchronously. See the Microbatch enrichment guide for details.
Note that we impose a rate limit on the number of batch requests made in a rolling 12 hour window. Please reach out to sales@spade.com with any questions.
curl --request POST \
--url https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"transactions": [
{
"userId": "user_id_123456789",
"transactionId": "transaction_id_123456789",
"amount": "25.23",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"categoryCode": "5812",
"location": {
"address": "1234 W 5th Ave Suite 100",
"city": "New York",
"region": "NY",
"country": "USA",
"postalCode": "10001",
"latitude": 45,
"longitude": 120
},
"de43": "de43_123456789",
"merchantName": "Amazon",
"organizationId": "organization_id_123",
"programId": "program_id_123",
"cardId": "card_id_123456789",
"cardFirstSix": "123456",
"cardLastFour": "7890",
"acquirerId": "000000000123456",
"categoryType": "MCC",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
],
"callbackUrl": "https://example.com/callback"
}
'import requests
url = "https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse"
payload = {
"transactions": [
{
"userId": "user_id_123456789",
"transactionId": "transaction_id_123456789",
"amount": "25.23",
"currencyCode": "USD",
"occurredAt": "2022-06-15 18:27:51Z",
"categoryCode": "5812",
"location": {
"address": "1234 W 5th Ave Suite 100",
"city": "New York",
"region": "NY",
"country": "USA",
"postalCode": "10001",
"latitude": 45,
"longitude": 120
},
"de43": "de43_123456789",
"merchantName": "Amazon",
"organizationId": "organization_id_123",
"programId": "program_id_123",
"cardId": "card_id_123456789",
"cardFirstSix": "123456",
"cardLastFour": "7890",
"acquirerId": "000000000123456",
"categoryType": "MCC",
"billingProfile": "standard",
"customAttributes": {
"custom_attribute_1": "value_1",
"custom_attribute_2": "value_2"
}
}
],
"callbackUrl": "https://example.com/callback"
}
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({
transactions: [
{
userId: 'user_id_123456789',
transactionId: 'transaction_id_123456789',
amount: '25.23',
currencyCode: 'USD',
occurredAt: '2022-06-15 18:27:51Z',
categoryCode: '5812',
location: {
address: '1234 W 5th Ave Suite 100',
city: 'New York',
region: 'NY',
country: 'USA',
postalCode: '10001',
latitude: 45,
longitude: 120
},
de43: 'de43_123456789',
merchantName: 'Amazon',
organizationId: 'organization_id_123',
programId: 'program_id_123',
cardId: 'card_id_123456789',
cardFirstSix: '123456',
cardLastFour: '7890',
acquirerId: '000000000123456',
categoryType: 'MCC',
billingProfile: 'standard',
customAttributes: {custom_attribute_1: 'value_1', custom_attribute_2: 'value_2'}
}
],
callbackUrl: 'https://example.com/callback'
})
};
fetch('https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse', 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/batches/transactions/cards/enrich/parse",
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' => [
[
'userId' => 'user_id_123456789',
'transactionId' => 'transaction_id_123456789',
'amount' => '25.23',
'currencyCode' => 'USD',
'occurredAt' => '2022-06-15 18:27:51Z',
'categoryCode' => '5812',
'location' => [
'address' => '1234 W 5th Ave Suite 100',
'city' => 'New York',
'region' => 'NY',
'country' => 'USA',
'postalCode' => '10001',
'latitude' => 45,
'longitude' => 120
],
'de43' => 'de43_123456789',
'merchantName' => 'Amazon',
'organizationId' => 'organization_id_123',
'programId' => 'program_id_123',
'cardId' => 'card_id_123456789',
'cardFirstSix' => '123456',
'cardLastFour' => '7890',
'acquirerId' => '000000000123456',
'categoryType' => 'MCC',
'billingProfile' => 'standard',
'customAttributes' => [
'custom_attribute_1' => 'value_1',
'custom_attribute_2' => 'value_2'
]
]
],
'callbackUrl' => 'https://example.com/callback'
]),
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/batches/transactions/cards/enrich/parse"
payload := strings.NewReader("{\n \"transactions\": [\n {\n \"userId\": \"user_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": \"25.23\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"categoryCode\": \"5812\",\n \"location\": {\n \"address\": \"1234 W 5th Ave Suite 100\",\n \"city\": \"New York\",\n \"region\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"10001\",\n \"latitude\": 45,\n \"longitude\": 120\n },\n \"de43\": \"de43_123456789\",\n \"merchantName\": \"Amazon\",\n \"organizationId\": \"organization_id_123\",\n \"programId\": \"program_id_123\",\n \"cardId\": \"card_id_123456789\",\n \"cardFirstSix\": \"123456\",\n \"cardLastFour\": \"7890\",\n \"acquirerId\": \"000000000123456\",\n \"categoryType\": \"MCC\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n }\n ],\n \"callbackUrl\": \"https://example.com/callback\"\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/batches/transactions/cards/enrich/parse")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transactions\": [\n {\n \"userId\": \"user_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": \"25.23\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"categoryCode\": \"5812\",\n \"location\": {\n \"address\": \"1234 W 5th Ave Suite 100\",\n \"city\": \"New York\",\n \"region\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"10001\",\n \"latitude\": 45,\n \"longitude\": 120\n },\n \"de43\": \"de43_123456789\",\n \"merchantName\": \"Amazon\",\n \"organizationId\": \"organization_id_123\",\n \"programId\": \"program_id_123\",\n \"cardId\": \"card_id_123456789\",\n \"cardFirstSix\": \"123456\",\n \"cardLastFour\": \"7890\",\n \"acquirerId\": \"000000000123456\",\n \"categoryType\": \"MCC\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n }\n ],\n \"callbackUrl\": \"https://example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse")
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 \"transactions\": [\n {\n \"userId\": \"user_id_123456789\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": \"25.23\",\n \"currencyCode\": \"USD\",\n \"occurredAt\": \"2022-06-15 18:27:51Z\",\n \"categoryCode\": \"5812\",\n \"location\": {\n \"address\": \"1234 W 5th Ave Suite 100\",\n \"city\": \"New York\",\n \"region\": \"NY\",\n \"country\": \"USA\",\n \"postalCode\": \"10001\",\n \"latitude\": 45,\n \"longitude\": 120\n },\n \"de43\": \"de43_123456789\",\n \"merchantName\": \"Amazon\",\n \"organizationId\": \"organization_id_123\",\n \"programId\": \"program_id_123\",\n \"cardId\": \"card_id_123456789\",\n \"cardFirstSix\": \"123456\",\n \"cardLastFour\": \"7890\",\n \"acquirerId\": \"000000000123456\",\n \"categoryType\": \"MCC\",\n \"billingProfile\": \"standard\",\n \"customAttributes\": {\n \"custom_attribute_1\": \"value_1\",\n \"custom_attribute_2\": \"value_2\"\n }\n }\n ],\n \"callbackUrl\": \"https://example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"batchSize": 1,
"submittedAt": "2024-11-21T20:07:20.213660Z"
}{
"invalidField": [
"This field is required."
]
}{
"details": "Incorrect authentication credentials."
}{
"details": "Internal server error."
}Authorizations
Query Parameters
When true, returns enriched results inline in the response instead of a batchId. Microbatches are capped to ensure timely processing. See the Microbatch enrichment guide for details.
Body
An array of transactions with de43's to parse and enrich. Each transaction must have a unique transactionId. Maximum 50,000 transactions.
50000Show child attributes
Show child attributes
The URL to call when the batch job is complete.
"https://example.com/callback"
Callbacks
Response
Successful operation
- Option 1
- Card Enrichment Microbatch Results
Unique identifier for the batch job
Current status of the batch job
pending, running, completed, failed Number of transactions in the batch
x >= 11
Timestamp of when the batch was submitted
"2024-11-21T20:07:20.213660Z"

