> ## Documentation Index
> Fetch the complete documentation index at: https://paystack-sdk.efobi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Miscellaneous

> Helper methods for accessing banks, countries, and states

## 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.

<CodeGroup>
  ```typescript TypeScript theme={null}
  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}`);
    });
  }
  ```

  ```javascript JavaScript theme={null}
  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}`);
    });
  }
  ```
</CodeGroup>

#### Parameters

<ParamField path="country" type="enum" required>
  The country to get banks for. Options: `nigeria`, `ghana`, `kenya`, `south africa`
</ParamField>

<ParamField path="perPage" type="number" default="50">
  Number of results per page (max: 100)
</ParamField>

<ParamField path="use_cursor" type="boolean" default="false">
  Use cursor-based pagination
</ParamField>

<ParamField path="pay_with_bank_transfer" type="boolean">
  Filter for banks that support pay with bank transfer
</ParamField>

<ParamField path="pay_with_bank" type="boolean">
  Filter for banks that support pay with bank
</ParamField>

<ParamField path="enabled_for_verification" type="boolean">
  Filter for banks that are enabled for account verification
</ParamField>

<ParamField path="next" type="string">
  Cursor for the next page (when using cursor pagination)
</ParamField>

<ParamField path="previous" type="string">
  Cursor for the previous page (when using cursor pagination)
</ParamField>

<ParamField path="gateway" type="enum">
  Filter by gateway type. Options: `emandate`, `digitalBankMandate`
</ParamField>

<ParamField path="type" type="string">
  Filter by bank type
</ParamField>

<ParamField path="currency" type="enum">
  Filter by currency. Options: `NGN`, `USD`, `GHS`, `ZAR`, `KES`, `XOF`
</ParamField>

<ParamField path="include_nip_sort_code" type="boolean">
  Include NIP sort code in the response
</ParamField>

#### Response

<ResponseField name="status" type="boolean">
  Indicates whether the request was successful
</ResponseField>

<ResponseField name="message" type="string">
  A message describing the result
</ResponseField>

<ResponseField name="data" type="array">
  Array of bank objects

  <Expandable title="Bank object properties">
    <ResponseField name="name" type="string">
      The bank's name
    </ResponseField>

    <ResponseField name="slug" type="string">
      The bank's slug identifier
    </ResponseField>

    <ResponseField name="code" type="string">
      The bank code used for verification and transfers
    </ResponseField>

    <ResponseField name="longcode" type="string">
      The bank's long code
    </ResponseField>

    <ResponseField name="gateway" type="unknown">
      Gateway information
    </ResponseField>

    <ResponseField name="pay_with_bank" type="boolean">
      Whether this bank supports pay with bank
    </ResponseField>

    <ResponseField name="active" type="boolean">
      Whether the bank is currently active
    </ResponseField>

    <ResponseField name="is_deleted" type="boolean">
      Whether the bank has been deleted
    </ResponseField>

    <ResponseField name="country" type="string">
      The country where the bank operates
    </ResponseField>

    <ResponseField name="currency" type="enum">
      The bank's currency. Options: `NGN`, `USD`, `GHS`, `ZAR`, `KES`, `XOF`
    </ResponseField>

    <ResponseField name="type" type="string">
      The type of bank
    </ResponseField>

    <ResponseField name="id" type="number">
      The bank's unique ID
    </ResponseField>

    <ResponseField name="createdAt" type="string | null">
      ISO 8601 timestamp of when the bank was created
    </ResponseField>

    <ResponseField name="updatedAt" type="string | null">
      ISO 8601 timestamp of when the bank was last updated
    </ResponseField>
  </Expandable>
</ResponseField>

***

### listCountries

Get a list of all supported countries and their configuration details.

<CodeGroup>
  ```typescript TypeScript theme={null}
  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}`);
    });
  }
  ```

  ```javascript JavaScript theme={null}
  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}`);
    });
  }
  ```
</CodeGroup>

#### Parameters

This method takes no parameters.

#### Response

<ResponseField name="status" type="boolean">
  Indicates whether the request was successful
</ResponseField>

<ResponseField name="message" type="string">
  A message describing the result
</ResponseField>

<ResponseField name="data" type="array">
  Array of country objects

  <Expandable title="Country object properties">
    <ResponseField name="id" type="number">
      The country's unique ID
    </ResponseField>

    <ResponseField name="name" type="string">
      The country's name
    </ResponseField>

    <ResponseField name="iso_code" type="string">
      The country's ISO code (e.g., "NG", "GH")
    </ResponseField>

    <ResponseField name="default_currency_code" type="string">
      The default currency code for the country
    </ResponseField>

    <ResponseField name="integration_defaults" type="object">
      Default integration settings for the country
    </ResponseField>

    <ResponseField name="relationships" type="object">
      Relationships to other entities

      <Expandable title="Relationship properties">
        <ResponseField name="currency" type="object">
          Currency relationships

          <Expandable title="Currency properties">
            <ResponseField name="type" type="string">
              The relationship type
            </ResponseField>

            <ResponseField name="data" type="array">
              Array of currency codes
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="integration_feature" type="object">
          Integration feature relationships
        </ResponseField>

        <ResponseField name="integration_type" type="object">
          Integration type relationships
        </ResponseField>

        <ResponseField name="payment_method" type="object">
          Payment method relationships
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

***

### listStates

Get a list of all states in a specific country. Useful for address verification and form population.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const result = await paystack.miscellaneous.listStates({
    country: "NG"
  });

  if (result.data) {
    result.data.data.forEach(state => {
      console.log(`${state.name} (${state.abbreviation})`);
    });
  }
  ```

  ```javascript JavaScript theme={null}
  const result = await paystack.miscellaneous.listStates({
    country: "NG"
  });

  if (result.data) {
    result.data.data.forEach(state => {
      console.log(`${state.name} (${state.abbreviation})`);
    });
  }
  ```
</CodeGroup>

#### Parameters

<ParamField path="country" type="string" required>
  The country code (e.g., "NG" for Nigeria)
</ParamField>

#### Response

<ResponseField name="status" type="boolean">
  Indicates whether the request was successful
</ResponseField>

<ResponseField name="message" type="string">
  A message describing the result
</ResponseField>

<ResponseField name="data" type="array">
  Array of state objects

  <Expandable title="State object properties">
    <ResponseField name="name" type="string">
      The full name of the state
    </ResponseField>

    <ResponseField name="slug" type="string">
      The state's slug identifier
    </ResponseField>

    <ResponseField name="abbreviation" type="string">
      The state's abbreviation
    </ResponseField>
  </Expandable>
</ResponseField>

## Common Use Cases

### Building a Bank Selection Form

```typescript theme={null}
// 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

```typescript theme={null}
// 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:

```typescript theme={null}
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`);
}
```

## Related Resources

<CardGroup cols={2}>
  <Card title="Verification" icon="shield-check" href="/api-reference/verification">
    Use bank codes for account verification
  </Card>

  <Card title="Paystack Miscellaneous API" icon="link" href="https://paystack.com/docs/api/miscellaneous/">
    Official Paystack Miscellaneous API documentation
  </Card>
</CardGroup>
