Skip to main content

Exporting wallet entries

Contents​

Overview​

Export wallet ledger entries from Spaaza, including credits, debits, balances, and associated user information.

To create a wallet entry export, send a POST /tasks request to the Services API with target.export_index set to "wallet-ledger". See the Tasks API reference for full endpoint documentation.

Version-specific information​

VersionChange details
N/AN/A

Permissions and Authentication​

Wallet entry exports use the Tasks API endpoints, which require chain-scoped authentication on the Services API. See Permissions and Authentication in the Tasks API reference for details on supported authentication methods.

Basic export (all wallet entries)​

Create an unfiltered CSV export of all wallet ledger entries for your chain:

curl -X POST 'https://{Services API hostname}/tasks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN_ID:ACCESS_TOKEN_SECRET' \
-d '{
"chain": YOUR_CHAIN_ID,
"desc": "Full wallet ledger export",
"target": {
"action": "export",
"export_index": "wallet-ledger",
"export_format": "csv"
},
"trigger": {
"once": "2026-05-26T12:00:00Z"
}
}'

Filtered export: wallet entries from the last 24 hours​

Use a relative_less_than rule on the timestamp field for incremental syncs:

curl -X POST 'https://{Services API hostname}/tasks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN_ID:ACCESS_TOKEN_SECRET' \
-d '{
"chain": YOUR_CHAIN_ID,
"desc": "Wallet entries from the last 24 hours",
"target": {
"action": "export",
"export_index": "wallet-ledger",
"export_format": "csv"
},
"trigger": {
"once": "2026-05-26T12:00:00Z",
"segment": {
"entity": "people",
"index": "wallet-ledger",
"join": "all",
"chain_id": YOUR_CHAIN_ID,
"rules": [
{
"field_name": "timestamp",
"field_type": "date",
"operator": "relative_less_than",
"time_factor": "day",
"time_amount": 1
}
]
}
}
}'

Filtered export: wallet entries in a date range​

Use is_between_date to export entries within a specific time window:

curl -X POST 'https://{Services API hostname}/tasks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN_ID:ACCESS_TOKEN_SECRET' \
-d '{
"chain": YOUR_CHAIN_ID,
"desc": "Wallet entries for April 2026",
"target": {
"action": "export",
"export_index": "wallet-ledger",
"export_format": "csv"
},
"trigger": {
"once": "2026-05-26T12:00:00Z",
"segment": {
"entity": "people",
"index": "wallet-ledger",
"join": "all",
"chain_id": YOUR_CHAIN_ID,
"rules": [
{
"field_name": "timestamp",
"field_type": "date",
"operator": "is_between_date",
"start_date": "2026-04-01T00:00:00Z",
"end_date": "2026-04-30T23:59:59Z"
}
]
}
}
}'

Checking task status and downloading​

After creating the export, poll the task status:

curl 'https://{Services API hostname}/tasks/{TASK_ID}' \
-H 'Authorization: Bearer ACCESS_TOKEN_ID:ACCESS_TOKEN_SECRET'

When the task state is DONE, request the download URL:

curl 'https://{Services API hostname}/tasks/{TASK_ID}/download_url' \
-H 'Authorization: Bearer ACCESS_TOKEN_ID:ACCESS_TOKEN_SECRET'

Download the file promptly — the URL expires after approximately one hour.

See Get a task and Get download URL for full endpoint details.

Further reading​