Export receipts
curl --request POST \
--url https://api.truthlocks.com/v1/receipts/export \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"receipt_type": "<string>",
"from": "<string>",
"to": "<string>",
"format": "json"
}
'import requests
url = "https://api.truthlocks.com/v1/receipts/export"
payload = {
"receipt_type": "<string>",
"from": "<string>",
"to": "<string>",
"format": "json"
}
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({receipt_type: '<string>', from: '<string>', to: '<string>', format: 'json'})
};
fetch('https://api.truthlocks.com/v1/receipts/export', 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.truthlocks.com/v1/receipts/export",
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([
'receipt_type' => '<string>',
'from' => '<string>',
'to' => '<string>',
'format' => 'json'
]),
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://api.truthlocks.com/v1/receipts/export"
payload := strings.NewReader("{\n \"receipt_type\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"format\": \"json\"\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://api.truthlocks.com/v1/receipts/export")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"receipt_type\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/receipts/export")
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 \"receipt_type\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"format\": \"json\"\n}"
response = http.request(request)
puts response.read_body{
"export_id": "<string>",
"status": "<string>",
"download_url": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Receipts
Export Receipts
Queue a bulk export and download receipts as JSON or CSV.
POST
/
v1
/
receipts
/
export
Export receipts
curl --request POST \
--url https://api.truthlocks.com/v1/receipts/export \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"receipt_type": "<string>",
"from": "<string>",
"to": "<string>",
"format": "json"
}
'import requests
url = "https://api.truthlocks.com/v1/receipts/export"
payload = {
"receipt_type": "<string>",
"from": "<string>",
"to": "<string>",
"format": "json"
}
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({receipt_type: '<string>', from: '<string>', to: '<string>', format: 'json'})
};
fetch('https://api.truthlocks.com/v1/receipts/export', 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.truthlocks.com/v1/receipts/export",
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([
'receipt_type' => '<string>',
'from' => '<string>',
'to' => '<string>',
'format' => 'json'
]),
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://api.truthlocks.com/v1/receipts/export"
payload := strings.NewReader("{\n \"receipt_type\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"format\": \"json\"\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://api.truthlocks.com/v1/receipts/export")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"receipt_type\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"format\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truthlocks.com/v1/receipts/export")
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 \"receipt_type\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"format\": \"json\"\n}"
response = http.request(request)
puts response.read_body{
"export_id": "<string>",
"status": "<string>",
"download_url": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Queues an async bulk export job. Returns immediately with
status: pending. Poll GET /v1/receipt-exports/{id} for completion and a pre-signed download URL.
Request
string
required
Export format:
json or csv.object
Optional filters to narrow the export.
string
Filter by receipt type name (e.g.
payment_receipt).string
Filter by receipt status:
active, revoked, superseded, redacted.string
Start of date range (RFC 3339).
string
End of date range (RFC 3339).
Response
string
UUID of the export job.
string
pending | running | complete | failedstring
Requested format (
json or csv).string
ISO 8601 timestamp.
Polling for completion
PollGET /v1/receipt-exports/{export_id} until status is complete. The response will include a pre-signed download_url.
This endpoint moved from
/v1/receipts/export/{id} to /v1/receipt-exports/{id}. Update any polling URLs that use the old path.Export status values
| Status | Meaning |
|---|---|
pending | Queued, not yet started |
running | Processing records |
complete | Done — download_url is available |
failed | Error — see error_message |

