📄 Transaction Report (Server-to-Server)
POST {{API_BASE_URL}}/api/v1/report-generator/s2s
Note: Please contact your Facilero account manager to obtain the correct production or sandbox API base URL.
🧾 Overview
This endpoint allows merchants to programmatically download transaction reports for a specific date range in either CSV or XLS format.
It replicates the Export Transactions feature available in the Facilero Merchant Portal, but is designed for server-to-server (S2S) use. This is ideal for merchants looking to automate:
- Reconciliation workflows
- Accounting/reporting processes
- Internal or third-party integrations
🔐 Authentication & Headers
| Header Name | Required | Description |
|---|---|---|
x-merchant-key | ✅ | Your public merchant API key |
x-merchant-secret | ✅ | Your private merchant API secret |
Content-Type | ✅ | Must be set to application/json |
📤 Request Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dateFrom | string | Yes | Start date (YYYY-MM-DD) |
dateTo | string | Yes | End date (YYYY-MM-DD) |
dateSource | string | Yes | Date types: createdDate (default) or lastModifiedDate |
format | string | No | Report format: CSV (default) or XLS |
Dates can include time for more precise filtering (e.g.,"2025-07-05 00:00:00").
📥 Response
- Success: HTTP
200 OKReturns the report file as a binary stream. - Error: HTTP
4xx/5xxReturns a JSON error message.
✅ Example – Download CSV with Original Filename
curl -OJ '{{API_BASE_URL}}/api/v1/report-generator/s2s' \
-H 'x-merchant-key: YOUR_KEY' \
-H 'x-merchant-secret: YOUR_SECRET' \
-H 'Content-Type: application/json' \
--data '{"dateFrom":"2025-07-05 00:00:00","dateTo":"2025-07-06 23:59:59", "dateSource":"createdDate"}'
This will save the file using the name provided by the API (e.g.,transaction-report-YYYY-MM-DD.csv), assuming theContent-Dispositionheader is returned.
📊 Optional – Download XLS Format
curl -OJ '{{API_BASE_URL}}/api/v1/report-generator/s2s' \
-H 'x-merchant-key: YOUR_KEY' \
-H 'x-merchant-secret: YOUR_SECRET' \
-H 'Content-Type: application/json' \
--data '{"dateFrom":"2025-07-01","dateTo":"2025-07-07","dateSource":"createdDate" ,"format":"XLS"}'❌ Error Examples
1. Missing Fields
curl -X POST '{{API_BASE_URL}}/api/v1/report-generator/s2s' \
-H "Content-Type: application/json" \
-H "x-merchant-key: YOUR_KEY" \
-H "x-merchant-secret: YOUR_SECRET" \
-d '{"dateFrom":"","dateTo":"2025-07-07"}'Response:
{
"error": "Invalid or missing 'dateFrom' field"
}2. Invalid Credentials
curl -X POST '{{API_BASE_URL}}/api/v1/report-generator/s2s' \
-H "Content-Type: application/json" \
-H "x-merchant-key: INVALID" \
-H "x-merchant-secret: INVALID" \
-d '{"dateFrom":"2025-07-01","dateTo":"2025-07-07"}'Response:
{
"error": "Invalid merchant credentials"
}📘 Final Notes
- This API is designed for automation, not manual use — perfect for scheduled reconciliation or integration with external systems.
- The output format matches what is downloadable from the Merchant Portal.
- Include timestamps in your date range if you need more precise filtering.
- For access to the sandbox or production environment, please contact your Facilero account manager.
