Overview
The Miscellaneous class provides utility methods for accessing reference data like supported banks, countries, and states. This information is essential for building forms and validating user input.
Methods
listBanks
Get a list of all supported banks and their details. Use this to populate bank selection dropdowns and get bank codes for verification.
const result = await paystack . miscellaneous . listBanks ({
country: "nigeria" ,
perPage: 50 ,
use_cursor: false
});
if ( result . data ) {
result . data . data . forEach ( bank => {
console . log ( ` ${ bank . name } - ${ bank . code } ` );
});
}
Parameters
The country to get banks for. Options: nigeria, ghana, kenya, south africa
Number of results per page (max: 100)
Use cursor-based pagination
Filter for banks that support pay with bank transfer
Filter for banks that support pay with bank
Filter for banks that are enabled for account verification
Cursor for the next page (when using cursor pagination)
Cursor for the previous page (when using cursor pagination)
Filter by gateway type. Options: emandate, digitalBankMandate
Filter by currency. Options: NGN, USD, GHS, ZAR, KES, XOF
Include NIP sort code in the response
Response
Indicates whether the request was successful
A message describing the result
Array of bank objects Show Bank object properties
The bank’s slug identifier
The bank code used for verification and transfers
Whether this bank supports pay with bank
Whether the bank is currently active
Whether the bank has been deleted
The country where the bank operates
The bank’s currency. Options: NGN, USD, GHS, ZAR, KES, XOF
ISO 8601 timestamp of when the bank was created
ISO 8601 timestamp of when the bank was last updated
listCountries
Get a list of all supported countries and their configuration details.
const result = await paystack . miscellaneous . listCountries ();
if ( result . data ) {
result . data . data . forEach ( country => {
console . log ( ` ${ country . name } ( ${ country . iso_code } )` );
console . log ( `Default currency: ${ country . default_currency_code } ` );
});
}
Parameters
This method takes no parameters.
Response
Indicates whether the request was successful
A message describing the result
Array of country objects Show Country object properties
The country’s ISO code (e.g., “NG”, “GH”)
The default currency code for the country
Default integration settings for the country
Relationships to other entities Show Relationship properties
Integration feature relationships
Integration type relationships
Payment method relationships
listStates
Get a list of all states in a specific country. Useful for address verification and form population.
const result = await paystack . miscellaneous . listStates ({
country: "NG"
});
if ( result . data ) {
result . data . data . forEach ( state => {
console . log ( ` ${ state . name } ( ${ state . abbreviation } )` );
});
}
Parameters
The country code (e.g., “NG” for Nigeria)
Response
Indicates whether the request was successful
A message describing the result
Array of state objects Show State object properties
The full name of the state
The state’s slug identifier
Common Use Cases
// Get all Nigerian banks
const { data } = await paystack . miscellaneous . listBanks ({
country: "nigeria" ,
enabled_for_verification: true
});
if ( data ) {
const bankOptions = data . data . map ( bank => ({
label: bank . name ,
value: bank . code
}));
// Use bankOptions in your form
}
Address Verification
// Get all states in Nigeria for address validation
const { data } = await paystack . miscellaneous . listStates ({
country: "NG"
});
if ( data ) {
const stateOptions = data . data . map ( state => ({
label: state . name ,
value: state . slug
}));
// Use stateOptions in your address form
}
Error Handling
All methods return a result object with data and error properties:
const result = await paystack . miscellaneous . listBanks ({
country: "nigeria"
});
if ( result . error ) {
console . error ( 'Failed to fetch banks:' , result . error . flatten ());
} else if ( result . data ) {
console . log ( `Found ${ result . data . data . length } banks` );
}