Skip to main content

Go Examples

Complete Go example client for integrating with the 123hub API using the standard library (crypto/sha512, net/http, encoding/json).
This is a reference implementation, not an official SDK package. It uses only Go standard library modules with no external dependencies required.

Configuration

Store your credentials in environment variables:

Client Package

Usage Examples

Ping (Health Check)

Create a Deposit Payment

The examples below use INR (India), but the same client works for every supported country — just change the serviceID, currency, and country values.

Create a Withdrawal (Payout)

Check Payment Status

Get Balance

Error Handling

Successful responses return HTTP 200. Most errors return HTTP 400; some use 403, 404, 409, 429 or 5xx (see Error codes). The client returns the parsed body for every standard envelope, so always use the Success field to determine the outcome:

Complete Example