> ## Documentation Index
> Fetch the complete documentation index at: https://docs.juicyway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Nigerian Banks

> Retrieve a list of all supported Nigerian banks with their codes

## Overview

This endpoint returns a comprehensive list of supported Nigerian banks and their corresponding codes. Use this endpoint to obtain the correct bank codes needed for bank transfers and account number resolution.

<Note>
  Bank codes are required for:

  * Validating account numbers
  * Creating bank transfer beneficiaries
  * Initiating bank transfers
</Note>

## Endpoint

```bash theme={null}
GET /payment-methods/banks
```

## Response Format

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

  <Expandable title="Bank Object">
    <ResponseField name="code" type="string">
      Bank code required for transfers

      * Format: 6-digit string
      * Example: "000023"
    </ResponseField>

    <ResponseField name="name" type="string">
      Official bank name

      * Example: "PROVIDUS BANK"
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.spendjuice.com/payment-methods/banks" \
  -H "Authorization:  YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.spendjuice.com/payment-methods/banks', {
    headers: {
      'Authorization': ' YOUR_API_KEY'
    }
  });

  const banks = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.spendjuice.com/payment-methods/banks',
      headers={'Authorization': ' YOUR_API_KEY'}
  )

  banks = response.json()
  ```
</CodeGroup>

## Example Response

<CodeGroup>
  ```json 200 Success theme={null}
  {
    "data": [
      {
        "code": "000014",
        "name": "ACCESS BANK"
      },
      {
        "code": "000023",
        "name": "PROVIDUS BANK"
      },
      {
        "code": "000013",
        "name": "ZENITH BANK"
      },
      {
        "code": "000017",
        "name": "GUARANTY TRUST BANK"
      }
    ]
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": {
      "code": "unauthorized",
      "message": "Invalid or missing API key"
    }
  }
  ```

  ```json 500 Server Error theme={null}
  {
    "error": {
      "code": "server_error",
      "message": "An unexpected error occurred"
    }
  }
  ```
</CodeGroup>

## Error Handling

<AccordionGroup>
  <Accordion title="401 - Unauthorized">
    Indicates invalid or missing API key

    * Verify your API key is valid
    * Check authorization header format
  </Accordion>

  <Accordion title="403 - Forbidden">
    Indicates insufficient permissions

    * Verify your API key has correct permissions
    * Check your account status
  </Accordion>

  <Accordion title="500 - Server Error">
    Indicates an internal server error

    * Retry the request after a short delay
    * Contact support if the error persists
  </Accordion>
</AccordionGroup>

## Usage Tips

1. **Cache Results**
   * Bank list changes infrequently
   * Cache results for up to 24 hours
   * Implement cache invalidation on errors

2. **Error Handling**
   * Implement retry logic for failed requests
   * Maintain a fallback bank list if needed
   * Log any persistent errors

3. **Data Validation**
   * Verify bank codes are 6 digits
   * Handle missing or null values
   * Validate against your supported banks list

## Best Practices

<Card>
  To ensure reliable bank transfers:

  * Always use current bank codes
  * Refresh cached bank lists daily
  * Validate codes before transactions
  * Handle bank name variations
  * Log any unrecognized bank codes
</Card>

<Warning>
  Never hardcode bank codes in your application. Always fetch them dynamically to ensure you're using the most current codes.
</Warning>
