/
Banks Section Queries & Mutations

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.

query GetBankById($getBankByIdId: ID) { getBankById(id: $getBankByIdId) { id name code okraSlug } }
{ "getBankByIdId": "jwff8hu3e8387y" }
{ "data": { "getBankById": { "id": "jwff8hu3e8387y", "name": "Example Bank", "code": "EXMBNK", "okraSlug": "example-bank" } } }

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.

query ResolveAccountNumber($bankId: ID!, $accountNumber: String!) { resolveAccountNumber(bankId: $bankId, accountNumber: $accountNumber) { accountName accountNumber phoneNumber responseCode responseMessage uniqueReference } }
{ "bankId": "scbuwfhi3764389u", "accountNumber": "9023847321", "accountType": "PERSONAL" //PERSONAL or BUSINESS }
{ "data": { "resolveAccountNumber": { "accountName": "John Doe", "accountNumber": "9023847321", "phoneNumber": "+1234567890", "responseCode": 200, "responseMessage": "Account resolved successfully", "uniqueReference": "abc123xyz" } } }

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.

query ResolveOkraBank($okraBankId: String!) { resolveOkraBank(okraBankId: $okraBankId) { code id name okraSlug } }
{ "okraBankId": "jfejnkwdy3uh3i" }
{ "data": { "resolveOkraBank": { "code": "BANK123", "id": "jfejnkwdy3uh3i", "name": "Example Bank", "okraSlug": "example-bank" } } }
curl -X POST -H "Content-Type: application/json" -d '{ "query": "query ResolveOkraBank($okraBankId: String!) { resolveOkraBank(okraBankId: $okraBankId) { code id name okraSlug } }", "variables": { "okraBankId": "jfejnkwdy3uh3i" } }' <https://staging-ignite.originate.ng/graphql>

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.

mutation adminAddAccountBank($input: AdminCreateAccountBankInput!) { adminAddAccountBank(input: $input){ id bank { name } } }
{ "input": { "bankId": "ck1xcu4by6let0842lecvvrlv", "accountId": "ck1xcu4by6let0842lecvvrlv", "accountNumber": "ck1xcu4by6let0842lecvvrlv", "accountName": "ck1xcu4by6let0842lecvvrlv" } }
{ "data": { "adminAddAccountBank": { "id": "ck1xcu4by6let0842lecvvrlv", "bank": { "name": "Example Bank" } } } }

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.

mutation addAccountBank($input: CreateAccountBankInput!) { addAccountBank(input: $input){ id bank { name } } }
{ "input": { "bankId": "kilocu4by6let0842lecvq12w", "accountNumber": "ck1xcu4by6let0842lecvvrlv", "accountName": "Sample Bank" } }
{ "data": { "addAccountBank": { "id": "kilocu4by6let0842lecvq12w", "bank": { "name": "Sample Bank" } } } }

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.

mutation { disableAccountBank(id: "ck1xcu4by6let0842lecvvrlv"){ id bank { name } } }
{ "input": { "bankId": "kilocu4by6let0842lecvq12w", "accountNumber": "ck1xcu4by6let0842lecvvrlv", "accountName": "Sample Bank" } }
{ "data": { "disableAccountBank": { "id": "ck1xcu4by6let0842lecvvrlv", "bank": { "name": "sample bank" } } } }

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.

mutation setDefaultAccountBank($input: SetDefaultAccountBankInput!){ setDefaultAccountBank(input: $input){ id bank { name } } }
{ "input": { "accountId": "ck1xcu4by6let0842lecvvrlv", "accountBankId": "kilocu4by6let0842lecvq12w" } }
{ "data": { "setDefaultAccountBank": { "id": "ck1xcu4by6let0842lecvvrlv", "bank": { "name": "Example Bank" } } } }

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.

mutation { verifyBankAccount(accountNumber: "accountNumber", bankCode: "bankCode"){ responseCode accountNumber } }
{ "input": { "bankId": "kilocu4by6let0842lecvq12w", "accountNumber": "ck1xcu4by6let0842lecvvrlv", "accountName": "Sample Bank" } }
{ "data": { "verifyBankAccount": { "responseCode": "SUCCESS", "accountNumber": "1234567890" } } }
{ "data": { "verifyBankAccount": { "responseCode": "ERROR", "accountNumber": "" } } }

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.

mutation updateAccountBank($input: UpdateAccountBankInput!) { updateAccountBank(input: $input){ id bank { name } } }
{ "input": { "accountBankId": "ck1xcu4by6let0842lecvvrlv", "bankId": "kilocu4by6let0842lecvq12w", "accountNumber": "1234567890", "accountName": "accountName", "password": "password", "setAsDefault": true } }
{ "data": { "updateAccountBank": { "id": "ck1xcu4by6let0842lecvvrlv", "bank": { "name": "New Bank 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.

mutation ConnectBankToOkra($input: ConnectBankToOkraInput!) { connectBankToOkra(input: $input) { accountName accountNumber id okraRecord { accountId directDebitAuthorised id } status } }
{ "input": { "accountBankId": "cbwuhu736try8723yf", "customerId": "jcb3fn2763hi2dj", "directDebitAuthorised": true, "okraAccountId": "qjchvebvu3467892hb", "recordId": "msbdcincwvc7328h" } }
{ "data": { "connectBankToOkra": { "accountName": "John Doe", "accountNumber": "1234567890", "id": "a8s7d6f5g4h3j2k1", "okraRecord": { "accountId": "qjchvebvu3467892hb", "directDebitAuthorised": true, "id": "b1c2d3e4f5g6" }, "status": "Connected" } } }

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.

Related content