Transaction Report


๐Ÿ“„ Transaction Report (Server-to-Server)

POST {{API_BASE_URL}}/api/v1/report-generator/s2s

โ„น๏ธ

Note: Please contact your finsino 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 finsino 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 NameRequiredDescription
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

NameTypeRequiredDescription
dateFromstringYesStart date (YYYY-MM-DD)
dateTostringYesEnd date (YYYY-MM-DD)
dateSourcestringYesDate types: createdDate (default) or lastModifiedDate
formatstringNoReport 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 OK Returns the report file as a binary stream.
  • Error: HTTP 4xx/5xx Returns 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 the Content-Disposition header 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 finsino account manager.