Our ready-made SDK helps you connect and integrate your app or website to the API gateway. Jump into the code, get started with Go!
// Load API
import "github.com/topups/topups-go-sdk"

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
topups := client.Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json")

// Call API with valid body parameters i.e mobile, amount, note, name, email, country, network, currency
response, err := topups.SendAirtime("254722000000","100","AIR0000001","Jane Wanjiku","jane.wanjiku@example.com","KE","Safaricom","KES")

if err != nil {
    panic(err)
}

// Process API response
fmt.Println(response)

API Reference Send Airtime
// Load API
import "github.com/topups/topups-go-sdk"

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
topups := client.Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json")

// Call API with valid body parameters i.e mobile, amount, note, name, email, country, network, currency, payment_network, payment_mobile, payment_name, payment_email
response, err := topups.BuyAirtime("254722000000","100","AIR0000001","Jane Wanjiku","jane.wanjiku@example.com","KE","Safaricom","KES","M-Pesa","254722002000","Joe Omondi","joe.omondi@example.com")

if err != nil {
    panic(err)
}

// Process API response
fmt.Println(response)

API Reference Buy Airtime
// Load API
import "github.com/topups/topups-go-sdk"

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
topups := client.Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json")

// Call API with valid body parameters i.e mobile, agent_number, store_number, amount, note, name, email, agent_name, country, network, currency
response, err := topups.SendAgentFloat("254722000000","678910","678910","1000","FLT0000001","Jane Wanjiku","jane.wanjiku@example.com","JANE ENTERPRISES","KE","M-Pesa","KES")

if err != nil {
    panic(err)
}

// Process API response
fmt.Println(response)

API Reference Send Agent Float
// Load API
import "github.com/topups/topups-go-sdk"

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
topups := client.Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json")

// Call API with valid body parameters i.e sender, recipient, message, note, name, email, country, network
response, err := topups.SendSMS("DEMO","254722000000","Jane, thank you for repaying your loan.","SMS0000001","Jane Wanjiku","jane.wanjiku@example.com","KE","Safaricom")

if err != nil {
    panic(err)
}

// Process API response
fmt.Println(response)

API Reference Send SMS
// Load API
import "github.com/topups/topups-go-sdk"

// Instantiate API request with valid header parameters i.e Authentication, Accept, Content-Type
topups := client.Topups("a12f4f9a99be83f1e631e379834864e7","application/json","application/json")

// Call API with valid body parameters i.e channel_type
response, err := topups.GetBalance("Airtime")

if err != nil {
    panic(err)
}

// Process API response
fmt.Println(response)

API Reference Get Balance