Introduction
Introduction

go-snap-bi is a Go implementation of Bank Indonesia’s SNAP (Standar Nasional Open API Pembayaran) payment standard — document version 1.0.2 (September 2024) — covering every API Service category published on the ASPI SNAP Developer Site.
This SDK targets SNAP standard version 1.0.2, published September
2024. If ASPI/Bank Indonesia release a newer document version, check the
GitHub repository before
assuming a field or endpoint here still matches the latest spec.
Independent, unofficial implementation of the standard published by Bank Indonesia and ASPI — not affiliated with or endorsed by either.
go get github.com/koriebruh/go-snap-biStatus
All 7 of the portal’s API Service categories are accounted for — 79 typed endpoint bindings across 5 domain packages, plus the shared signing/token/transport core.
| Portal category | Package | Service Codes | Endpoints |
|---|---|---|---|
| Registrasi | registration | 01–10, 81 | 11 |
| Informasi Saldo | balanceinfo | 11 | 1 |
| Riwayat Transaksi | transactionhistory | 12–14 | 3 |
| Transfer Kredit | transfercredit | 15–53, 75–78 | 43 |
| Transfer Debit | transferdebit | 54–72, 79–80 | 21 |
| Keamanan | root snap package (Authentication) | 73–74 | — |
| Administrasi | (no API endpoints on the portal — onboarding docs only) | — | — |
Keamanan’s Access Token endpoints live in the root package instead of their own subpackage: every other package needs them just to get a token, so they’re infrastructure, not a peer domain.
Design
The root
snap package holds only what every domain package needs: request signing, the access-token lifecycle, inbound-request verification, header assembly, response-code parsing, and the shared Money type. Each domain package maps 1:1 to an ASPI portal category.Every calling function follows the same pattern: marshal the typed request, sign and send it, check the response status (HTTP status is authoritative over the SNAP
responseCode body, never the other way around), and unmarshal into a typed response.Mandatory/Optional/Conditional field markers from the standard are preserved exactly as
omitempty presence; genuinely ambiguous or unspecified-shape fields are modeled as json.RawMessage rather than guessed at.Everything is Go standard library —
net/http, crypto/rsa, crypto/hmac, encoding/json.