Unofficial Go SDK for integrating with the BCA Developer API.
The goal of this project is to provide an idiomatic, production-ready Go client for the BCA Developer API, with support for authentication, request signing, HTTP communication, and type-safe API clients.
Disclaimer: This is an unofficial, community-developed SDK and is not affiliated with or endorsed by Bank Central Asia (BCA).
- OAuth 2.0 Bearer Token Authentication
- Type-Safe API Clients - Strongly typed requests and responses
- Context-Aware Requests - Full support for cancellation and timeouts
- Automatic Retry Mechanisms - Configurable retry for transient failures
- Comprehensive Error Handling - Specific error types for better error handling
- Well-Documented - Clear examples and API reference
- Testable - Easy to mock and test
- RESTful Operations - Full CRUD support for resources
go get github.com/DoWithLogic/go-bca-sdkComplete examples are available in the examples/ directory:
examples/oauth2— BCA OAuth 2.0 authenticationexamples/snap— BCA SNAP authentication
API errors are returned as *APIError and contain both the HTTP response information and the BCA response information.
response, err := client.AccountInformation.BalanceInquiry(
context.Background(),
request,
"external-reference-123",
)
if err != nil {
var apiErr *bcaerrors.APIError
if errors.As(err, &apiErr) {
log.Println(apiErr.HTTPStatusCode)
log.Println(apiErr.ResponseCode)
log.Println(apiErr.ResponseMessage)
}
return
}The SDK supports configurable retries for retryable HTTP requests.
By default, retries are enabled for:
408 Request Timeout429 Too Many Requests5xx Server Errors
Retries are limited to idempotent HTTP methods by default. POST requests are not automatically retried to avoid unintentionally repeating operations such as money movement.
🚧 Work in Progress
The SDK is currently under active development. APIs and implementation details may change before the first stable release.