For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Categories

Endpoint: GET /categories

Description: Retrieves a list of available bill categories.

Authentication: Basic Auth (Username, Password)

Response:

200 OK: Returns a JSON array of category objects.


Sample Implementation

curl --request GET \
  --url 'http://154.113.16.142:9999/provipay/webapi/categories' \
  --header 'Authorization: Basic <base64-encoded-username:password>'
import requests

headers = {
    'Authorization': 'Basic <base64-encoded-username:password>'
}

response = requests.get('http://154.113.16.142:9999/provipay/webapi/categories', headers=headers)
if response.status_code == 200:
    print(response.json())
else:
    print(response.reason)
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        URL url = new URL("http://154.113.16.142:9999/provipay/webapi/categories");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        conn.setRequestProperty("Authorization", "Basic <base64-encoded-username:password>");

        int responseCode = conn.getResponseCode();
        if (responseCode == 200) {
            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String inputLine;
            StringBuilder response = new StringBuilder();
            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            in.close();
            System.out.println(response.toString());
        } else {
            System.out.println(conn.getResponseMessage());
        }
    }
}

The above command returns JSON structured like this:

Example Response:

[
    {
        "category_id": 1,
        "list_order": "1",
        "name": "Airtime TopUp"
    },
    {
        "category_id": 1007,
        "list_order": "1",
        "name": "Transportation"
    },
    ...
]

Last updated