GoCardlessDeveloper Docs
Create a sandbox account

Bank Account Detail

View as Markdown

Retrieve bank account details in JWE encrypted format

Get encrypted bank details#

GET/bank_account_details/{customer_bank_account_id}

Returns bank account details in the flattened JSON Web Encryption format described in RFC 7516.

You must specify a Gc-Key-Id header when using this endpoint. See Public Key Setup for more details.

Path Parameters

NameTypeDescription
customer_bank_account_idrequiredstring

The customer bank account id

GET https://api.gocardless.com/bank_account_details/BA123 HTTP/1.1
Content-Type: application/json
Gc-Key-Id: PK123
@client.bank_account_details.get("BA123",
  headers: { 'Gc-Key-Id' => 'PK123' }
)
client.bank_account_details.get("BA123",
  headers={'Gc-Key-Id': 'PK123'}
)
const resp = await client.bankAccountDetails.find("BA123", {
  "Gc-Key-Id": "PK123",
});
$client->bankAccountDetails()->get("BA123", [
  "headers" => ['Gc-Key-Id' => 'PK123']
]);
client.bankAccountDetails().get("BA123").withHeader("Gc-Key-Id", "PK123").execute();
headers := map[string]string{
  "Gc-Key-Id": "PK123",
}

bankAccountDetails, err := client.BankAccountDetails.Get(
  ctx,
  "BA123",
  gocardless.BankAccountDetailGetParams{},
  gocardless.WithHeaders(headers),
)
var requestSettings = new GoCardless.Internals.RequestSettings
{
  CustomiseRequestMessage = (request) =>
  {
    request.Headers.Add("Gc-Key-Id", "PK123");
  }
};

var resp = await client.BankAccountDetails.GetAsync("BA123", null, requestSettings);
Responsehttp
HTTP/1.1 200 (OK)
Location: /bank_account_details/BA123
Content-Type: application/json
{
  "bank_account_details": {
    "protected": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJraWQiOiJiY2RkNDkzMmZhNjMxODY0MjI3YjhkZEZiMDdkMjQ5MDgyOGEzYWQ5OWM1OTYxNzc3ZDBjZTMzMDUyYjk5OGFiIn0",
    "encrypted_key": "pEQHNX_jCjKLIhZMa27C8cXgIlu7qUdrEcPuRwQw9EZyA_3vHG99gdd7YGQapVbSGEG43Hg5gi33Sgjsuekp6CumRFoBIKR7mANk5LUgfy6jFVFAC98RMiJ2H8yTBJlRiLonPRBILStNI8F7VU7cqqOOuCn7yeoeiJ7buSkqDW_ds9wrPC3uJgLZGyxPLU81R2WrE6b7hLVCpShLCBzH76wL3cPD5nYNT3eb5vqGl8SMb_mecZ-UnE5wfAzZhbU1CJ4qtlgFFiMt6HLFPvVAJBHlPdZaFcKotSjhOhk1rsySLrwKG9HmIBLykhED251jiIOyxTXIlNCzSMs23_R4XA",
    "iv": "6H4MLnhZGnwaWlQ2",
    "ciphertext": "Cntt_wZlkK4Ui7xI-BtAqf9V-FF41Cz8RxJd5KUGQJac",
    "tag": "WoaSncwUeLfU3IjgeFYtSQ"
  }
}
Response 200

Successful response

bank_account_detailsobject
5 properties
protectedstring

Base64 URL encoded JWE header values, containing the following keys:

  • alg: the asymmetric encryption type used to encrypt symmetric key, e.g: RSA-OAEP.
  • enc: the content encryption type, e.g: A256GCM.
  • kid: the ID of an RSA-2048 public key, from your JWKS, used to encrypt the AES key.
encrypted_keystring

Base64 URL encoded symmetric content encryption key, encrypted with the asymmetric key from your JWKS.

ivstring

Base64 URL encoded initialization vector, used during content encryption.

ciphertextstring

Base64 URL encoded encrypted payload, in this case bank details.

tagstring

Base64 URL encoded authentication tag, used to verify payload integrity during decryption.

Errors 400401404422500
400

Bad Request

401

Unauthorised

404

Not found

422

Validation Error

500

Internal Error

Error Body
codeinteger
documentation_urlstring
errorsarray
2 properties
reasonstring
messagestring
messagestring
request_idstring
typestring
metadataobject
linksobject