Exporting products and product variants
Contents
- Overview
- Version-specific information
- Permissions and Authentication
- Exporting products
- Exporting product variants
- Filtering product exports
- Checking task status and downloading
- Further reading
Overview
Export product catalog records and their variants from Spaaza.
To create a product export, send a POST /tasks request to the Services API with target.export_index set to "products" or "product-variants". See the Tasks API reference for full endpoint documentation.
Version-specific information
| Version | Change details |
|---|---|
| N/A | N/A |
Permissions and Authentication
Product 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.
Exporting products
Create a CSV export of all products 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 products export",
"target": {
"action": "export",
"export_index": "products",
"export_format": "csv"
},
"trigger": {
"once": "2026-05-26T12:00:00Z"
}
}'
Exporting product variants
Create a CSV export of all product variants:
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 product variants export",
"target": {
"action": "export",
"export_index": "product-variants",
"export_format": "csv"
},
"trigger": {
"once": "2026-05-26T12:00:00Z"
}
}'
Filtering product exports
You can apply segment filters to product exports in the same way as other export types. For example, to filter products by a keyword field:
"trigger": {
"once": "2026-05-26T12:00:00Z",
"segment": {
"entity": "people",
"index": "products",
"join": "all",
"chain_id": YOUR_CHAIN_ID,
"rules": [
{
"field_name": "category",
"field_type": "keyword",
"operator": "is",
"value": "Electronics"
}
]
}
}
See the Segment filter reference for the full list of operators, field types, and advanced filtering options.
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
- Segment filter reference — Full list of operators and field types for filtering
- Tasks API reference — Complete endpoint documentation