Skip to main content

CSV Exports

Export your transaction history as CSV from the Reporting API (https://api.tensorrail.com, bearer-token auth).

There are two paths:

  • SynchronousGET /v1/exports/transactions.csv streams the file directly, for windows of ≤ 31 days and ≤ 10,000 rows.
  • AsynchronousPOST /v1/exports enqueues a job for anything larger; poll its status, then download the finished file. Files are retained for 7 days.

Scope: exports need payments:read.

Synchronous export

GET /v1/exports/transactions.csv

Query parameters

ParameterRequiredDescription
startYesFirst day, YYYY-MM-DD (UTC, inclusive)
endYesLast day, YYYY-MM-DD (UTC, inclusive)
payment_statusNoFilter by payment status
settlement_statusNoFilter by settlement status
qNoFree-text search
curl -o transactions_july.csv \
"https://api.tensorrail.com/v1/exports/transactions.csv?start=2026-07-01&end=2026-07-31" \
-H "Authorization: Bearer rail_full_live_xxx"

The response streams as text/csv with a Content-Disposition: attachment filename.

When the window is too large the endpoint returns 413 with a Retry-With: POST /v1/exports header and a structured body — switch to the async path:

{
"error": {
"code": "ERR_EXPORT_SYNC_TOO_LARGE",
"message": "date window is 62 days; the synchronous export allows ≤31 days. Use POST /v1/exports for larger windows.",
"retry_with": "POST /v1/exports"
}
}

Asynchronous export jobs

1. Enqueue

POST /v1/exports

Body — same filters as the sync query string, plus the dataset kind:

FieldRequiredDescription
kindYestransactions
start / endYesYYYY-MM-DD (UTC, inclusive)
payment_status, settlement_status, qNoFilters, as above
curl -X POST "https://api.tensorrail.com/v1/exports" \
-H "Authorization: Bearer rail_full_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "kind": "transactions", "start": "2026-01-01", "end": "2026-06-30" }'

Response 202 Accepted

{
"job_id": "exp_9f2a…",
"kind": "transactions",
"filters": { "start": "2026-01-01", "end": "2026-06-30" },
"status": "queued",
"row_count": 0,
"file_size_bytes": 0,
"created_at": "2026-08-03T10:00:00Z"
}

2. Poll

GET /v1/exports/{job_id}

Returns the same job object. status moves queued → running → done (or failed, with error_message). When done, row_count and file_size_bytes describe the rendered file, and started_at / completed_at are set. Jobs are typically picked up within seconds.

3. Download

GET /v1/exports/{job_id}/download

Streams the CSV when status is done.

StatusMeaning
200The CSV file
409The job is not done yet (body says the current status)
404No such job on your account
410The file has expired past the 7-day retention and is gone
curl -o transactions_h1.csv \
"https://api.tensorrail.com/v1/exports/exp_9f2a…/download" \
-H "Authorization: Bearer rail_full_live_xxx"

Retention

Finished export files (and their job records) are deleted 7 days after creation — exports can contain customer PII (the transactions CSV includes the customer email column), so they are not kept around. Download what you need within the window; after that, enqueue a fresh job.

Columns

The transactions export carries: payment_id, payment_attempt_id, created_at, amount_minor, currency, payment_status, settlement_status, transaction_type, connector, psp_transaction_id, payment_method, payment_method_type, commission_earned_minor, interchange_amount_minor, scheme_fee_amount_minor, acquirer_markup_amount_minor, fee_status, error_code, error_message, psp_error_code, psp_decline_code, retry_attempt, description, email, live_mode, network_transaction_id, refund_status, refunded_amount_minor.

The last four are appended at the end of the row, so a parser that reads by column position keeps working. Two of them matter for reconciliation: live_mode says which environment the row belongs to (an empty value means the row predates mode stamping, which is not the same statement as "test"), and network_transaction_id is the reference that appears on your bank statement — the UTR for a UPI collection, the scheme network id for a card.

Amounts are in minor units throughout; timestamps are UTC RFC 3339.