Skip to main content

Introduction

These are public endpoints available to all merchants. They provide data on supported countries and providers.

List of countries

curl --location --request GET 'https://api.hub2.io/data/countries' \
  --header 'Environment: sandbox' \
  --header 'Content-Type: application/json'
const url = 'https://api.hub2.io/data/countries';
const headers = {
  'Environment': 'sandbox',
  'Content-Type': 'application/json'
};

fetch(url, {
  method: 'GET',
  headers: headers
})
  .then(response => {
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    return response.json();
  })
  .then(data => {
    console.log(data);
  })
  .catch(error => {
    console.error('There was a problem with your fetch operation:', error);
  });

import requests

url = 'https://api.hub2.io/data/countries'
headers = {
    'Environment': 'sandbox',
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print('Error:', response.status_code)
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://api.hub2.io/data/countries");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.setRequestProperty("Environment", "sandbox");
            connection.setRequestProperty("Content-Type", "application/json");

            int responseCode = connection.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuffer response = new StringBuffer();

                while ((inputLine = in.readLine()) != null) {
                    response.append(inputLine);
                }
                in.close();

                System.out.println(response.toString());
            } else {
                System.out.println("Error: " + responseCode);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Please check the endpoint details in the API reference for full details.
The country code (BF, SN, etc.) should be used in the destination fields for payments and transfers.

List of providers

curl --location --request GET 'https://api.hub2.io/data/providers' \
  --header 'Environment: sandbox' \
  --header 'Content-Type: application/json'
const url = 'https://api.hub2.io/data/providers';
const headers = {
  'Environment': 'sandbox',
  'Content-Type': 'application/json'
};

fetch(url, {
  method: 'GET',
  headers: headers
})
  .then(response => {
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    return response.json();
  })
  .then(data => {
    console.log(data);
  })
  .catch(error => {
    console.error('There was a problem with your fetch operation:', error);
  });

import requests

url = 'https://api.hub2.io/data/providers'
headers = {
    'Environment': 'sandbox',
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print('Error:', response.status_code)
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://api.hub2.io/data/providers");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.setRequestProperty("Environment", "sandbox");
            connection.setRequestProperty("Content-Type", "application/json");

            int responseCode = connection.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuffer response = new StringBuffer();

                while ((inputLine = in.readLine()) != null) {
                    response.append(inputLine);
                }
                in.close();

                System.out.println(response.toString());
            } else {
                System.out.println("Error: " + responseCode);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Please check the endpoint details in the API reference for full details.
The name of the provider should be used in the destination fields for payments and transfers. This field is case-insensitive.