Skip to main content

Export All Transactions

GET 

/b/api/v1/dashboard/transaction/export

Overview

BaseTxnExportView is the base class for all transaction export endpoints in the dashboard. It generates a downloadable report (CSV or XLSX) of payment transactions with support for filtering, field selection, timezone adjustment, and multi-language headers.

Each plugin (e.g. payment_request, e_commerce, bulk) subclasses this view and sets its own txn_type. The export only includes parent transactions (child/refund transactions are excluded).


Authentication

All export endpoints require authentication using one of:

  • JWT Bearer Token: Authorization: Bearer <token>
  • Keycloak JWT: same Bearer scheme, issued by Keycloak
  • API Key: Authorization: Api-Key <key>

HTTP Request Headers

HeaderRequiredDescriptionExample
AuthorizationYesAuthentication credentialBearer eyJhbGci...
X-TimezoneNoIANA timezone name for date display in the exported file. Overrides the timezone query param.X-Timezone: Asia/Kuwait

Discovering Available Fields — OPTIONS Request

Before exporting, call OPTIONS on the same endpoint to get all available export column keys grouped by category, plus the list of valid timezones.

OPTIONS /api/v1/dashboard/<plugin>/export/
Authorization: Bearer <token>

Response structure:

{
"groups": [
{
"label": "Transaction Info",
"headers": [
{ "key": "order_no", "label": "Order No", "description": "Merchant order reference" },
{ "key": "amount", "label": "Amount", "description": "Transaction amount" },
{ "key": "state", "label": "State", "description": "Current transaction state" }
]
}
],
"timezones": [
{ "value": "Asia/Kuwait", "label": "(UTC+03:00) Asia/Kuwait" },
{ "value": "America/New_York", "label": "(UTC-05:00) America/New_York" }
]
}

Use the key values from this response as the fields query parameter values.


Response

On success (HTTP 201 Created) the response is a report object, not the file itself. The file is generated asynchronously and a download URL is returned.


Examples

Export all paid transactions for January 2025 as CSV

GET /api/v1/dashboard/payment-request/export/?state=paid&created_after=01/01/2025 00:00&created_before=31/01/2025 23:59
Authorization: Bearer <token>

Export as XLSX with selected fields only

GET /api/v1/dashboard/payment-request/export/?file_format=xlsx&fields=order_no,amount,currency_code,state,created
Authorization: Bearer <token>

Export with dates displayed in Kuwait timezone

GET /api/v1/dashboard/payment-request/export/?timezone=Asia/Kuwait
Authorization: Bearer <token>
X-Timezone: Asia/Kuwait

Export with Arabic column headers

GET /api/v1/dashboard/payment-request/export/?language=ar
Authorization: Bearer <token>

Export with dynamic field search filter

GET /api/v1/dashboard/payment-request/export/?q={"encrypted_customer_phone":"IjA1MXh4eHh4eHh4Ig"}
Authorization: Bearer <token>

Notes

  • Only parent transactions are exported. Refunds and child transactions are excluded.
  • The file URL in the response is time-limited. Re-request the report if the URL expires.
  • The status field may be pending or processing immediately after the request if the report is generated asynchronously. Poll the report list endpoint or wait for completed.
  • When both X-Timezone header and timezone query param are provided, the header takes priority.
  • The q parameter keys are encrypted field keys specific to each plugin's search configuration — always retrieve them from the OPTIONS response, do not hardcode them.

Responses

Report generated successfully with download URL