Get Spending report for the card as xlsx file

Get Spending Report for Card as XLSX File

The POST /api/paymentCards/spendingReportXl endpoint generates a detailed spending report in Excel (XLSX) format for a specified payment card. The report covers all transactions made with the card during a defined date range and is returned as a file download object containing Base64-encoded content. This endpoint is useful for financial analysis, auditing, and record-keeping.

Endpoint

POST /api/paymentCards/spendingReportXl

Authentication

Bearer token required. Obtain via:

POST https://api.banking.netevia.dev/api/auth/v2

Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.

When to use

Use this endpoint when a cardholder or authorized user needs an exportable spending summary for a specific payment card. It is particularly valuable for end-of-period reporting, expense reconciliation, or providing customers with a downloadable transaction history in a format compatible with spreadsheet applications.

Request Body

FieldTypeRequiredDescription
paymentCardIdstringYesThe unique identifier of the payment card for which the report is generated. Minimum length: 1 character.
dateFromstring (date-time)YesStart of the reporting period in ISO 8601 date-time format (e.g., 2024-01-01T00:00:00Z).
dateTostring (date-time)YesEnd of the reporting period in ISO 8601 date-time format (e.g., 2024-01-31T23:59:59Z).
{
  "paymentCardId": "card-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "dateFrom": "2024-01-01T00:00:00Z",
  "dateTo": "2024-01-31T23:59:59Z"
}

Response

200 OK

FieldTypeDescription
namestringThe suggested filename for the generated XLSX file (e.g., spending_report_January_2024.xlsx). May be null.
contentstringBase64-encoded binary content of the XLSX file. Decode and save with an .xlsx extension to open in a spreadsheet application. May be null.
contentTypestringMIME type of the file content (e.g., application/vnd.openxmlformats-officedocument.spreadsheetml.sheet). May be null.
{
  "name": "spending_report_January_2024.xlsx",
  "content": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAA...",
  "contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}

Error Codes

CodeWhen it happens
400Missing required fields (paymentCardId, dateFrom, or dateTo) or invalid date-time format
401Token missing, expired, or invalid
403Insufficient permissions to access the specified card
404Payment card not found for the provided paymentCardId
500Internal server error

Common Mistakes

  • Providing dateFrom or dateTo in a non-ISO 8601 format; always use the date-time format such as 2024-01-01T00:00:00Z.
  • Setting dateFrom later than dateTo, which results in an empty or invalid report range.
  • Omitting paymentCardId or passing an empty string; the field has a minimum length of 1 character and is required.
  • Attempting to decode the content field without Base64 decoding first; the XLSX binary is Base64-encoded in the response.

Related Endpoints

  • POST /api/paymentCards/spendingReport — Retrieve a spending report for a card in JSON format instead of XLSX
  • GET /api/paymentCards/{paymentCardId} — Retrieve details for a specific payment card
  • GET /api/paymentCards — List all payment cards for the authenticated customer

Example

curl -X POST https://api.banking.netevia.dev/api/paymentCards/spendingReportXl \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentCardId": "card-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "dateFrom": "2024-01-01T00:00:00Z",
    "dateTo": "2024-01-31T23:59:59Z"
  }'
Body Params
string
required
length ≥ 1
date-time
required
date-time
required
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json