Export points transactions
Description
Export a report of transactions for the selected points currency over a specified period to a CSV file. To get the result, you need to check the task status and download the resulting file.
Step 1. Create an export task
Request URL
Method: POST
https://example.com/api/v1.1/loyalty/transactions_export
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| loyalty_program_id | int | 123 | Yes | Loyalty program ID |
| points_currency_eid | string | "bonus_points" | Yes, if points_currency_iid is not provided | External points currency ID |
| points_currency_iid | int | 1 | Yes, if points_currency_eid is not provided | Internal points currency ID |
| from_id | string | "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" | No | Transaction ID (UUID) for pagination; if omitted, export starts from the beginning of the period |
| date_from | string (RFC3339) | "2023-09-01T00:00:00Z" | Yes | Period start date (inclusive) |
| date_to | string (RFC3339) | "2023-09-30T23:59:59Z" | Yes | Period end date (inclusive) |
Request example
- JSON
- XML
{
"loyalty_program_id": 123,
"points_currency_eid": "bonus_points",
"date_from": "2023-09-01T00:00:00Z",
"date_to": "2023-09-30T23:59:59Z",
"from_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}
<xml>
<loyalty_program_id>123</loyalty_program_id>
<points_currency_eid>bonus_points</points_currency_eid>
<date_from>2023-09-01T00:00:00Z</date_from>
<date_to>2023-09-30T23:59:59Z</date_to>
<from_id>a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8</from_id>
</xml>
Response example
- JSON
- XML
{
"data": {
"task_id": "task_b2f9fd6a-2499-4a63-b592-f15d4e3b69c5"
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<task_id>task_b2f9fd6a-2499-4a63-b592-f15d4e3b69c5</task_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| task_id | string (UUID) | Export task ID |
Step 2. Check export status
Request URL
Method: POST
https://example.com/api/v1.1/tasks/status
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| task_id | string | "task_b2f9fd6a-2499-4a63-b592-f15d4e3b69c5" | Yes | Export task ID |
Request example
- JSON
- XML
{
"task_id": "task_b2f9fd6a-2499-4a63-b592-f15d4e3b69c5"
}
<xml>
<task_id>task_b2f9fd6a-2499-4a63-b592-f15d4e3b69c5</task_id>
</xml>
Response example
- JSON
- XML
{
"data": {
"status": "completed",
"progress": 100,
"result": {
"hashed_file": "jvIXPQX2T9MxHZuKnxGHCz1ZxdvYKGjcyy_Fy31ByPCo6wNtU1lyrCMTfagIIURdpL8jbRysirZ0gJcmVNCXhcX5qK_trhiw/Transactions_loyalty_1_1_2023-09-01T00 00 00Z_2026-09-30T23 59 59Z.zip",
"is_api": true,
"loyalty_id": 1,
"next_from_id": "1148b0b0-d33d-4d27-b582-8058ce7fc740",
"points_currency_iid": 0,
"total": 1000
}
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<status>completed</status>
<progress>100</progress>
<result>
<hashed_file>jvIXPQX2T9MxHZuKnxGHCz1ZxdvYKGjcyy_Fy31ByPCo6wNtU1lyrCMTfagIIURdpL8jbRysirZ0gJcmVNCXhcX5qK_trhiw/Transactions_loyalty_1_1_2023-09-01T00 00 00Z_2026-09-30T23 59 59Z.zip</hashed_file>
<is_api>true</is_api>
<loyalty_id>1</loyalty_id>
<next_from_id>1148b0b0-d33d-4d27-b582-8058ce7fc740</next_from_id>
<points_currency_iid>0</points_currency_iid>
<total>1000</total>
</result>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| status | string | Task status |
| progress | int | Execution progress |
| hashed_file | string | Hashed file name for download |
| is_api | bool | Export via API |
| loyalty_id | int | Loyalty program ID |
| next_from_id | string | Next transaction ID for pagination; if not empty, not all data has been exported and you can pass this UUID as from_id in a new export request to get the next batch |
| points_currency_iid | int | Internal points currency ID |
| total | int | Total number of exported transactions |
| error | int | Error code |
| error_text | string | Error text |
Step 3. Download the result
The file download link looks like this:
https://example.com/api/download/jvIXPQX2T9MxHZuKnxGHCz1ZxdvYKGjcyy_Fy31ByPCo6wNtU1lyrCMTfagIIURdpL8jbRysirZ0gJcmVNCXhcX5qK_trhiw/Transactions_loyalty_1_1_2023-09-01T00%2000%2000Z_2026-09-30T23%2059%2059Z.zip
https://example.com— platform domainapi/download/— path to the download endpointjvIXPQX2T9MxHZuKnxGHCz1ZxdvYKGjcyy_Fy31ByPCo6wNtU1lyrCMTfagIIURdpL8jbRysirZ0gJcmVNCXhcX5qK_trhiw/Transactions_loyalty_1_1_2023-09-01T00%2000%2000Z_2026-09-30T23%2059%2059Z.zip— value of thehashed_fileparameter from the previous response
To download the file, send a GET request to the specified link with the authorization header Authorization: Bearer <token>.