Banks Section Queries & Mutations

GetBanks

Retrieves a list of banks with optional pagination parameters.

Input Variables

  • skip: An integer representing the number of banks to skip. Use this for pagination.

  • first: An integer representing the maximum number of banks to retrieve.

query GetBanks($input: GetBanksInput) { getBanks(skip: $input.skip, first: $input.first) { code id name okraSlug } }
{ "input": { "skip": 0, "first": 10 } }
{ "data": { "getBanks": [ { "code": "120001", "id": "cl3vkf0vt4jrt0760mfy6gzfd", "name": "9Payment Service Bank", "okraSlug": null }, { "code": "", "id": "cl4gv46c8674u0806q3y3fp2n", "name": "Abbey Mortage Bank", "okraSlug": null }, { "code": "801", "id": "ckig2ooo809310886e59r678v", "name": "Abbey Mortgage Bank", "okraSlug": null }, { "code": "51204", "id": "ckus5zrqtqtaa0840e8rzp8ng", "name": "Above Only MFB", "okraSlug": null }, { "code": "51312", "id": "cl7k5eh39y5zg08184emaazjr", "name": "Abulesoro MFB", "okraSlug": null }, //... more banks, first 5 showed. ] } }

In the sample response, getBanks is an array containing objects representing banks. Each bank object includes the following fields:

  • code: A unique code representing the bank.

  • id: The ID of the bank.

  • name: The name of the bank.

  • okraSlug: The slug associated with the bank in the Okra system.
    Use the skip and first parameters for pagination to retrieve a specific number of banks and control the offset for querying large sets of banks.


GetBankById

The query allows you to retrieve bank information by providing the bank's unique identifier.

Input Variables:

  • getBankByIdId (required): The unique identifier of the bank you want to retrieve. This should be a valid ID that corresponds to a bank record.

In the sample response above, the requested bank's information is provided. The fields returned are:

  • id: The unique identifier of the bank.

  • name: The name of the bank.

  • code: The code associated with the bank.

  • okraSlug: The Okra slug associated with the bank.

Make sure to replace the sample input variable with the actual ID of the bank you want to retrieve. The response will contain the bank's details based on the provided ID.


ResolveAccountNumber

This query is used to resolve account information based on a bank ID and an account number.

Input Variables

The ResolveAccountNumber query accepts the following input variables:

  • bankId (ID): The unique identifier of the bank.

  • accountNumber (String): The account number to be resolved.

Response Fields

Upon executing the ResolveAccountNumber query, you can expect to receive the following response fields:

  • accountName (String): The name associated with the resolved account.

  • accountNumber (String): The account number that was resolved.

  • phoneNumber (String): The phone number associated with the account, if available.

  • responseCode (Int): A numeric code indicating the response status.

  • responseMessage (String): A message explaining the response code.

  • uniqueReference (String): A unique reference ID for tracking purposes.


resolveOkraBank

Retrieves information about a specific bank identified by okraBankId.

Input Variables

  • okraBankId (String!): The unique identifier of the bank.

Sample Response

  • code (String): The code associated with the bank.

  • id (String): The unique identifier of the bank.

  • name (String): The name of the bank.

  • okraSlug (String): The slug representing the bank.


Admin Adding Account Bank

The adminAddAccountBank mutation allows administrators to create a new bank account associated with a user account. This mutation requires authentication as an admin user. Upon successful execution, it will return the newly created bank account's ID and the associated bank's name.

In this example, the mutation adminAddAccountBank creates a new bank account with the account number "1234567890" and the account holder's name "John Doe" associated with the user account identified by the ID "ck1xcu4by6let0842lecvvrlv". The newly created bank account's ID is "ck1xcu4by6let0842lecvvrlv", and it is associated with the bank named "Example Bank."


Adding Account Bank

The addAccountBank mutation allows you to create a new account associated with a bank in the system. It takes an input variable of type CreateAccountBankInput, which contains the necessary information to create the account.

In the sample response:

  • "id": A unique identifier for the newly created account.

  • "bank.name": The name of the bank associated with the newly created account.


To Disable Account Bank

This mutation is used to disable a bank account. It takes an input variable containing the necessary information to identify the bank account and disables it. Once disabled, the bank account will no longer be accessible or active.


To Set Default Account Bank

The setDefaultAccountBank mutation allows you to set a default bank for accounts. This mutation takes an input variable of type SetDefaultAccountBankInput and returns the ID and name of the bank that was set as the default.

In this example, the default bank for the account with ID "ck1xcu4by6let0842lecvvrlv" was set to the bank with ID "kilocu4by6let0842lecvq12w". The response shows that the default bank for the account is now "Example Bank".


Verifying Bank Account Bank

The verifyBankAccountBank mutation allows you to verify a bank account using the provided accountNumber and bankCode. The response will contain a responseCode indicating the status of the verification process, as well as the accountNumber that was verified.

Please note that the actual response may contain additional fields, but the ones mentioned in the sample response are guaranteed to be present. In case of an error, the accountNumber field will be an empty string.


updateAccountBank

The updateAccountBank mutation updates the bank details for a user's account. It takes an UpdateAccountBankInput as input and returns the updated account's id and the bank's name.


ConnectBankToOkra

Connects a bank account to Okra with the specified input parameters.

Input Variables

  • input: An object containing the following fields:

    • accountBankId (String, required): The unique identifier of the bank account.

    • customerId (String, required): The unique identifier of the customer.

    • directDebitAuthorised (Boolean, required): Whether direct debit is authorized for the bank account.

    • okraAccountId (String, required): The unique identifier of the Okra account.

    • recordId (String, required): The unique identifier of the record.

In this Sample Response, the bank account with the provided input has been successfully connected to Okra. The response provides information about the connected account, including its name, number, and status.