> For the complete documentation index, see [llms.txt](https://switchng.gitbook.io/switch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://switchng.gitbook.io/switch/utilities.md).

# Utilities

```
STAGING_URL: https://switchapi3.azurewebsites.net
LIVE_URL: https://switchapi.azurewebsites.net
```

## Categories

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/categories/:category`

Retrieve categories

#### Path Parameters

| Name     | Type   | Description                                                                |
| -------- | ------ | -------------------------------------------------------------------------- |
| category | string | One of the following: ***vendor, product, budget*** or ***bill\_payment*** |

{% tabs %}
{% tab title="200 When :category = "product"" %}

```
{
    "message": "Product categories retrieved successfully",
    "data": [
        {
            "name": "savings",
            "description": "Need to put money aside towards a specific occasion? Our various savings options are here for you.",
            "sub": [
                "target_savings"
            ],
            "sub_descriptions": [
                "Automate your savings to make your goals happen."
            ],
            "image_url": "https://storage.googleapis.com/switch/Product_Category_Images/Savings.png",
            "colour_code": "#4046A8"
        },
        {
            "name": "insurance",
            "description": "Life happens, but there's insurance. Let us help you stay protected from financial loss.",
            "sub": [
                "health"
            ],
            "sub_descriptions": [
                "We help insure your medical expenses.",
                "Be prepared for any motor damages and theft of vehicles.",
                "Explore our life insurance policy.",
                "Traveling? our travel insurance has you covered."
            ],
            "image_url": "https://storage.googleapis.com/switch/Product_Category_Images/Insurance.png",
            "colour_code": "#52A9A6"
        }
    ]
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "This category does not exist"
}
```

{% endtab %}
{% endtabs %}

## Currencies

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/currencies/:processor`

Retrieve currencies supported by the supplied payment processor.

#### Path Parameters

| Name      | Type   | Description                     |
| --------- | ------ | ------------------------------- |
| processor | string | Payment processor (***pipit***) |

{% tabs %}
{% tab title="200 " %}

```
{
    "message": "Currencies supported by Pip iT retrieved successfully",
    "data": [
        {
            "name": "Canadian Dollar",
            "currency_code": "CAD"
        },
        {
            "name": "Euro",
            "currency_code": "EUR"
        },
        {
            "name": "Pound Sterling",
            "currency_code": "GBP"
        },
        {
            "name": "Hong Kong Dollar",
            "currency_code": "HKD"
        },
        {
            "name": "Mozambique Metical",
            "currency_code": "MZM"
        },
        {
            "name": "Philippine Peso",
            "currency_code": "PHP"
        },
        {
            "name": "Poland Zloty",
            "currency_code": "PLN"
        },
        {
            "name": "US Dollar",
            "currency_code": "USD"
        },
        {
            "name": "Rand",
            "currency_code": "ZAR"
        }
    ]
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "This processor does not exist"
}
```

{% endtab %}
{% endtabs %}

## States

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/utilities/:country/states`

Retrieves the states of the specified country.

#### Query Parameters

| Name    | Type   | Description                                                             |
| ------- | ------ | ----------------------------------------------------------------------- |
| country | string | **NG** for Nigeria, **GB** for UK, **US** for US and **CA** for Canada. |

{% tabs %}
{% tab title="200 " %}

```
{
  "message": "States retrieved successfully",
  "data": [
    "Abia",
    "Abuja FCT",
    "Adamawa",
    "Akwa Ibom",
    "Anambra",
    "Bauchi",
    "Bayelsa",
    "Benue",
    "Borno",
    "Cross River",
    "Delta",
    "Ebonyi",
    "Edo",
    "Ekiti",
    "Enugu",
    "Gombe",
    "Imo",
    "Jigawa",
    "Kaduna",
    "Kano",
    "Katsina",
    "Kebbi",
    "Kogi",
    "Kwara",
    "Lagos",
    "Nassarawa",
    "Niger",
    "Ogun",
    "Ondo",
    "Osun",
    "Oyo",
    "Plateau",
    "Rivers",
    "Sokoto",
    "Taraba",
    "Yobe",
    "Zamfara"
  ]
}
```

{% endtab %}
{% endtabs %}

## Countries

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/utilities/countries`

Retrieves the countries.

{% tabs %}
{% tab title="200 " %}

```
{
    "message": "Countries retrieved successfully",
    "data": [
        {
            "name": "Nigeria",
            "country_code": "NG"
        },
        {
            "name": "Canada",
            "country_code": "CA"
        },
        {
            "name": "United Kingdom",
            "country_code": "GB"
        },
        {
            "name": "USA",
            "country_code": "US"
        }
    ]
}
```

{% endtab %}
{% endtabs %}
