# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://switchng.gitbook.io/switch/utilities.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
