Skip to main content

Audience:

Developers

Get bank details using the API

Download a PDF of your bank details for the account's main IBAN, a list of virtual IBANs, or specific virtual IBANs with the API.

Main IBAN

  1. Call the account query.
  2. Enter the accountId.
  3. Add bankDetails to receive a download URL in the payload.

Query

Open in API Explorer
query getBankDetails {
account(accountId: "$YOUR_ACCOUNT_ID") {
bankDetails
}
}

Payload

  1. The response includes the download URL (line 4), which begins with bank-details.swan.io.
  2. Paste the URL into your browser, then press enter. This triggers the download of your PDF.
{
"data": {
"account": {
"bankDetails": "$DOWNLOAD_URL"
}
}
}

List of virtual IBANs

  1. Call the account query.
  2. Enter the accountId.
  3. Add virtualIbanEntries.
  4. Add pagination. The sample query returns the first 5 entries (line 3).
  5. Add bankDetails to receive a download URL in the payload (line 9).
  6. Add all other information you'd like to retrieve.

Query

Open in API Explorer
query getListVirtualBankDetails {
account(accountId: "$YOUR_ACCOUNT_ID") {
virtualIbanEntries(first: 5) {
edges {
cursor
node {
BIC
IBAN
bankDetails
id
status
}
}
}
}
}

Payload

  1. The response includes the download URL for each virtual IBAN (lines 10, 19), which begin with bank-details.swan.io.
  2. Paste the URL into your browser, then press enter. This triggers the download of your PDF.
{
"data": {
"account": {
"virtualIbanEntries": {
"edges": [
{
"node": {
"BIC": "SWNBFR22",
"IBAN": "$VIRTUAL_IBAN_1",
"bankDetails": "$DOWNLOAD_URL_1",
"id": "VIRTUAL_IBAN_ID_1",
"status": "Enabled"
}
},
{
"node": {
"BIC": "SWNBFR22",
"IBAN": "$VIRTUAL_IBAN_2",
"bankDetails": "$DOWNLOAD_URL_2",
"id": "VIRTUAL_IBAN_ID_2",
"status": "Enabled"
}
},
{
"node": {
"BIC": "SWNBFR22",
"IBAN": "$VIRTUAL_IBAN_3",
"bankDetails": "$DOWNLOAD_URL_3",
"id": "VIRTUAL_IBAN_ID_3",
"status": "Enabled"
}
},
{
"node": {
"BIC": "SWNBFR22",
"IBAN": "$VIRTUAL_IBAN_4",
"bankDetails": "$DOWNLOAD_URL_4",
"id": "VIRTUAL_IBAN_ID_4",
"status": "Enabled"
}
},
{
"node": {
"BIC": "SWNBFR22",
"IBAN": "$VIRTUAL_IBAN_5",
"bankDetails": "$DOWNLOAD_URL_5",
"id": "VIRTUAL_IBAN_ID_5",
"status": "Enabled"
}
}
]
}
}
}
}

Specific virtual IBANs

  1. Call the account query.
  2. Enter the accountId.
  3. Add virtualIbanEntries.
  4. Add filters, then the IDs for the virtual IBAN for which you'd like bank details download URLs.
  5. Add bankDetails to receive a download URL in the payload.
  6. Add all other information you'd like to retrieve.

Query

Open in API Explorer
One virtual IBAN ID
query getSpecificVirtualBankDetailsOne {
account(accountId: "$YOUR_ACCOUNT_ID") {
virtualIbanEntries(filters: { ids: "$YOUR_VIRTUAL_IBAN_ID" }) {
edges {
node {
bankDetails
}
}
}
}
}
Open in API Explorer
Multiple virtual IBAN IDs
query getSpecificVirtualBankDetailsMultiple {
account(accountId: "$YOUR_ACCOUNT_ID") {
virtualIbanEntries(
filters: { ids: ["$YOUR_VIRTUAL_IBAN_ID_1", "$YOUR_VIRTUAL_IBAN_ID_2"] }
) {
edges {
node {
bankDetails
}
}
}
}
}

Payload

  1. The response includes the download URL (line 8), which begins with bank-details.swan.io.
  2. Paste the URL into your browser, then press enter. This triggers the download of your PDF.
{
"data": {
"account": {
"virtualIbanEntries": {
"edges": [
{
"node": {
"bankDetails": "$DOWNLOAD_URL"
}
}
]
}
}
}
}