Install the Blnk Go SDK, run your first transaction, and find the Core docs for every SDK method.
The Blnk Go SDK is the official Go client for Blnk Core. This page gets you from install to a working transaction.For detailed documentation on each API, reference the Core documentation.
In a few minutes, you’ll have a Go app moving money on your Blnk ledger. That’s the starting point for wallets, transfers, and the rest of your product.
1
Launch Blnk
You need a running Blnk Core instance before using the SDK.
Install Blnk
Local install or Blnk Cloud
2
Install the Blnk Go SDK
Create a Go project and install the SDK. You need Go 1.22 or later.
bash
go mod init blnk-quickstartgo get github.com/blnkfinance/blnk-go
3
Client initialization
Parse your Blnk base URL and create a client. Pass a pointer to your API key when your instance requires authentication. The SDK sends it as the X-Blnk-Key header.Use nil when running locally without auth.
When Blnk returns a 4xx or 5xx status, the SDK wraps the response in ApiErrorResponse.Use errors.As to read the status code and response body. On success, inspect resp.StatusCode for logging or metrics.
Call client.Transaction.Create and pass a blnkgo.CreateTransactionRequest struct. It has two parts:
ParentTransaction holds the core transaction fields: amount, currency, source, destination, reference, and metadata.
Top-level fields control how the request is processed, such as AllowOverdraft, Inflight, and ScheduledFor.
ParentTransaction is an embedded struct in the Go SDK, not a field in the API request body. The API expects flat JSON with fields like amount and source at the root.Do not confuse this struct with the API response field parent_transaction, which is a transaction ID linking related records such as inflight commits or split distributions.
Transactions are the exception. Every other resource uses a single request struct with no nesting. Pass CreateLedgerRequest to client.Ledger.Create, CreateLedgerBalanceRequest to client.LedgerBalance.Create, and so on.
Go struct fields use PascalCase, like MetaData and LedgerID. These map to the API’s snake_case JSON fields (meta_data, ledger_id).You should always use the Go field names in your code.
Fields such as DOB, EffectiveDate, ScheduledFor, InflightCommitDate, and historical balance timestamps use time.Time (or *time.Time). Parse ISO 8601 strings with time.Parse(time.RFC3339, "...")—for example "2024-04-22T15:28:03Z" or "2024-12-21T01:36:46+01:00"—then pass the resulting value (use a pointer when the field is optional).
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.To ask questions or discuss issues, please contact us or join our Discord community.
The Go SDK is open-source on GitHub, and we welcome community issues and pull requests.If you run into problems installing or using the SDK, report them on GitHub.If an endpoint is documented in the API reference but missing from the Go SDK, we encourage opening an issue or submitting a pull request to help improve SDK coverage.