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": "<string>",
"transactionId": "transaction_id_123456789",
"amount": 123,
"currencyCode": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"categoryCode": "<string>",
"location": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123
},
"de43": "<string>",
"merchantName": "<string>",
"organizationId": "<string>",
"programId": "<string>",
"cardId": "<string>",
"cardFirstSix": "<string>",
"cardLastFour": "<string>",
"acquirerId": "<string>",
"categoryType": "MCC",
"customAttributes": {}
}
],
"callbackUrl": "<string>"
}
'import requests
url = "https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse"
payload = {
"transactions": [
{
"userId": "<string>",
"transactionId": "transaction_id_123456789",
"amount": 123,
"currencyCode": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"categoryCode": "<string>",
"location": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123
},
"de43": "<string>",
"merchantName": "<string>",
"organizationId": "<string>",
"programId": "<string>",
"cardId": "<string>",
"cardFirstSix": "<string>",
"cardLastFour": "<string>",
"acquirerId": "<string>",
"categoryType": "MCC",
"customAttributes": {}
}
],
"callbackUrl": "<string>"
}
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: '<string>',
transactionId: 'transaction_id_123456789',
amount: 123,
currencyCode: '<string>',
occurredAt: '2023-11-07T05:31:56Z',
categoryCode: '<string>',
location: {
address: '<string>',
city: '<string>',
region: '<string>',
country: '<string>',
postalCode: '<string>',
latitude: 123,
longitude: 123
},
de43: '<string>',
merchantName: '<string>',
organizationId: '<string>',
programId: '<string>',
cardId: '<string>',
cardFirstSix: '<string>',
cardLastFour: '<string>',
acquirerId: '<string>',
categoryType: 'MCC',
customAttributes: {}
}
],
callbackUrl: '<string>'
})
};
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' => '<string>',
'transactionId' => 'transaction_id_123456789',
'amount' => 123,
'currencyCode' => '<string>',
'occurredAt' => '2023-11-07T05:31:56Z',
'categoryCode' => '<string>',
'location' => [
'address' => '<string>',
'city' => '<string>',
'region' => '<string>',
'country' => '<string>',
'postalCode' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'de43' => '<string>',
'merchantName' => '<string>',
'organizationId' => '<string>',
'programId' => '<string>',
'cardId' => '<string>',
'cardFirstSix' => '<string>',
'cardLastFour' => '<string>',
'acquirerId' => '<string>',
'categoryType' => 'MCC',
'customAttributes' => [
]
]
],
'callbackUrl' => '<string>'
]),
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\": \"<string>\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"categoryCode\": \"<string>\",\n \"location\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"de43\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"programId\": \"<string>\",\n \"cardId\": \"<string>\",\n \"cardFirstSix\": \"<string>\",\n \"cardLastFour\": \"<string>\",\n \"acquirerId\": \"<string>\",\n \"categoryType\": \"MCC\",\n \"customAttributes\": {}\n }\n ],\n \"callbackUrl\": \"<string>\"\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\": \"<string>\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"categoryCode\": \"<string>\",\n \"location\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"de43\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"programId\": \"<string>\",\n \"cardId\": \"<string>\",\n \"cardFirstSix\": \"<string>\",\n \"cardLastFour\": \"<string>\",\n \"acquirerId\": \"<string>\",\n \"categoryType\": \"MCC\",\n \"customAttributes\": {}\n }\n ],\n \"callbackUrl\": \"<string>\"\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\": \"<string>\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"categoryCode\": \"<string>\",\n \"location\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"de43\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"programId\": \"<string>\",\n \"cardId\": \"<string>\",\n \"cardFirstSix\": \"<string>\",\n \"cardLastFour\": \"<string>\",\n \"acquirerId\": \"<string>\",\n \"categoryType\": \"MCC\",\n \"customAttributes\": {}\n }\n ],\n \"callbackUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchSize": 2,
"submittedAt": "2023-11-07T05:31:56Z"
}{
"invalidField": [
"<string>"
]
}{
"details": "<string>"
}{
"details": "<string>"
}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": "<string>",
"transactionId": "transaction_id_123456789",
"amount": 123,
"currencyCode": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"categoryCode": "<string>",
"location": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123
},
"de43": "<string>",
"merchantName": "<string>",
"organizationId": "<string>",
"programId": "<string>",
"cardId": "<string>",
"cardFirstSix": "<string>",
"cardLastFour": "<string>",
"acquirerId": "<string>",
"categoryType": "MCC",
"customAttributes": {}
}
],
"callbackUrl": "<string>"
}
'import requests
url = "https://east.sandbox.spade.com/batches/transactions/cards/enrich/parse"
payload = {
"transactions": [
{
"userId": "<string>",
"transactionId": "transaction_id_123456789",
"amount": 123,
"currencyCode": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"categoryCode": "<string>",
"location": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123
},
"de43": "<string>",
"merchantName": "<string>",
"organizationId": "<string>",
"programId": "<string>",
"cardId": "<string>",
"cardFirstSix": "<string>",
"cardLastFour": "<string>",
"acquirerId": "<string>",
"categoryType": "MCC",
"customAttributes": {}
}
],
"callbackUrl": "<string>"
}
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: '<string>',
transactionId: 'transaction_id_123456789',
amount: 123,
currencyCode: '<string>',
occurredAt: '2023-11-07T05:31:56Z',
categoryCode: '<string>',
location: {
address: '<string>',
city: '<string>',
region: '<string>',
country: '<string>',
postalCode: '<string>',
latitude: 123,
longitude: 123
},
de43: '<string>',
merchantName: '<string>',
organizationId: '<string>',
programId: '<string>',
cardId: '<string>',
cardFirstSix: '<string>',
cardLastFour: '<string>',
acquirerId: '<string>',
categoryType: 'MCC',
customAttributes: {}
}
],
callbackUrl: '<string>'
})
};
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' => '<string>',
'transactionId' => 'transaction_id_123456789',
'amount' => 123,
'currencyCode' => '<string>',
'occurredAt' => '2023-11-07T05:31:56Z',
'categoryCode' => '<string>',
'location' => [
'address' => '<string>',
'city' => '<string>',
'region' => '<string>',
'country' => '<string>',
'postalCode' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'de43' => '<string>',
'merchantName' => '<string>',
'organizationId' => '<string>',
'programId' => '<string>',
'cardId' => '<string>',
'cardFirstSix' => '<string>',
'cardLastFour' => '<string>',
'acquirerId' => '<string>',
'categoryType' => 'MCC',
'customAttributes' => [
]
]
],
'callbackUrl' => '<string>'
]),
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\": \"<string>\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"categoryCode\": \"<string>\",\n \"location\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"de43\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"programId\": \"<string>\",\n \"cardId\": \"<string>\",\n \"cardFirstSix\": \"<string>\",\n \"cardLastFour\": \"<string>\",\n \"acquirerId\": \"<string>\",\n \"categoryType\": \"MCC\",\n \"customAttributes\": {}\n }\n ],\n \"callbackUrl\": \"<string>\"\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\": \"<string>\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"categoryCode\": \"<string>\",\n \"location\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"de43\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"programId\": \"<string>\",\n \"cardId\": \"<string>\",\n \"cardFirstSix\": \"<string>\",\n \"cardLastFour\": \"<string>\",\n \"acquirerId\": \"<string>\",\n \"categoryType\": \"MCC\",\n \"customAttributes\": {}\n }\n ],\n \"callbackUrl\": \"<string>\"\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\": \"<string>\",\n \"transactionId\": \"transaction_id_123456789\",\n \"amount\": 123,\n \"currencyCode\": \"<string>\",\n \"occurredAt\": \"2023-11-07T05:31:56Z\",\n \"categoryCode\": \"<string>\",\n \"location\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"de43\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"programId\": \"<string>\",\n \"cardId\": \"<string>\",\n \"cardFirstSix\": \"<string>\",\n \"cardLastFour\": \"<string>\",\n \"acquirerId\": \"<string>\",\n \"categoryType\": \"MCC\",\n \"customAttributes\": {}\n }\n ],\n \"callbackUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batchSize": 2,
"submittedAt": "2023-11-07T05:31:56Z"
}{
"invalidField": [
"<string>"
]
}{
"details": "<string>"
}{
"details": "<string>"
}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"

