Skip to main content

Generate an account statement

Generate an account statement for a custom time period using the API or on your Dashboard.

Account statements vs. transaction confirmations

Account statements include all booked transactions (SEPA Credit Transfers, SEPA Direct Debit, card transactions, fees, internal transfers, and all other transaction types). This is different from transaction confirmation statements, which only confirm specific SEPA Credit Transfer transactions.

API guide​

  1. Call the generateAccountStatement mutation.
  2. Add the accountId (line 4).
  3. Add the openingDate and closingDate using format YYYY-MM-DDT00:00:00.000Z (lines 5-6).
    • Maximum period: three months.
  4. Set the language for your account statement, and provide the file format (PDF or CSV) (lines 7-8).
  5. Add all information you'd like to review about the statement (lines 11-27).

Mutation​

Open in API Explorer
mutation GenerateAccountStatement {
generateAccountStatement(
input: {
accountId: "$ACCOUNT_ID"
openingDate: "2024-04-12T00:00:00.000Z"
closingDate: "2024-06-12T00:00:00.000Z"
language: nl
format: PDF
}
) {
closingDate
createdAt
feeCredits {
currency
value
}
feeDebits {
currency
value
}
id
openingDate
period
statusInfo {
status
}
updatedAt
}
}

Payload​

The mutation returns all of the requested information.

The period field shows Custom (line 16) for on-demand statements. Swan automatically generates statements with period values of Monthly or Custom.

The statusInfo.status shows Pending while Swan generates the statement (line 18).

{
"data": {
"generateAccountStatement": {
"closingDate": "2024-06-12T00:00:00.000Z",
"createdAt": "2024-06-20T15:56:50.096Z",
"feeCredits": {
"currency": "EUR",
"value": "5.50"
},
"feeDebits": {
"currency": "EUR",
"value": "12.00"
},
"id": "$ACCOUNT_STATEMENT_ID",
"openingDate": "2024-04-12T00:00:00.000Z",
"period": "Custom",
"statusInfo": {
"status": "Pending"
},
"updatedAt": "2024-06-20T15:56:52.423Z"
}
}
}

Retrieve generated statement​

After generating the account statement, the statusInfo > status changes to Generated. When the status is Generated, you can retrieve the download URL.

  1. Call the accountStatement query.
  2. Add the account statement id (line 2).
  3. Add statusInfo for all statuses (line 8). The URL to download the statement is provided in statusInfo > GeneratedStatusInfo > url (line 12).
Open in API Explorer
query GetAccountStatement {
accountStatement(id: "$ACCOUNT_STATEMENT_ID") {
closingDate
createdAt
id
openingDate
period
statusInfo {
status
... on GeneratedStatusInfo {
status
url
}
... on PendingStatusInfo {
status
}
... on FailedStatusInfo {
status
}
... on VoidedStatusInfo {
status
url
}
}
updatedAt
}
}

Payload​

The period field shows Custom (line 8) for on-demand statements.

Use the url to download the statement (line 12).

  1. Copy the url from the payload.
  2. Paste the url into your preferred browser and press enter.
  3. The document downloads automatically.
{
"data": {
"accountStatement": {
"closingDate": "2024-06-12T00:00:00.000Z",
"createdAt": "2024-06-20T15:56:50.096Z",
"id": "$ACCOUNT_STATEMENT_ID",
"openingDate": "2024-04-12T00:00:00.000Z",
"period": "Custom",
"statusInfo": {
"__typename": "GeneratedStatusInfo",
"status": "Generated",
"url": "$DOWNLOAD_URL"
},
"updatedAt": "2024-06-20T15:56:58.234Z"
}
}
}
Account statement statuses
  • Pending: The statement is being generated.
  • Generated: The statement is ready to download. The url field contains the download link.
  • Failed: Statement generation failed. Double-check your account ID and generate a new statement.
  • Voided: The statement has been voided. A voided statement url is still available for reference.

Dashboard​

You can also generate statements from your Dashboard.

  1. Go to Dashboard > Data > Accounts.
  2. Open the account for which you want to generate a statement (not pictured).
  3. Go to the Account statements tab.
  4. Click + New

Screenshot of the Dashboard Account statements tab

  1. Enter the opening date and closing date. The time period can cover up to three months.
  2. Choose the format and language.
  3. Click Save.

Screenshot of Dashboard modal to generate an account statement

Your new statement appears on your list of account statements with the status Pending. After the status changes to Generated, you can download your statement.

Screenshot of new account statement line with pending status