Accept crypto payments in Go | Shieldz

Accept crypto payments in Go

Add non-custodial crypto checkout to your Go app: create an invoice, send the buyer to the hosted checkout, and fulfill on a signed webhook. Funds settle straight to your own wallet, $0 platform fees.

Install

// uses net/http, no SDK needed

Create an invoice and redirect to checkout

body, _ := json.Marshal(map[string]any{"amount_usd_cents": 5000, "memo": "Order"})
req, _ := http.NewRequest("POST", "https://shieldz.cash/api/v1/invoices", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHIELDZ_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
// parse res.Body into invoice, redirect to invoice.pay_url

Verify the webhook

// Verify the HMAC over "<t>.<rawBody>"
func verify(raw []byte, header, secret string) bool {
    var t, v1 string
    for _, p := range strings.Split(header, ",") {
        p = strings.TrimSpace(p)
        if strings.HasPrefix(p, "t=") { t = p[2:] }
        if strings.HasPrefix(p, "v1=") { v1 = p[3:] }
    }
    mac := hmac.New(sha256.New, []byte(secret))
    mac.Write([]byte(t + "." + string(raw)))
    return hmac.Equal([]byte(v1), []byte(hex.EncodeToString(mac.Sum(nil))))
}

Full reference: API docs, SDKs, API reference.

Explore Shieldz

Crypto payment gateway: overview, non-custodial, Zcash.

Accept a coin: Bitcoin, USDC, USDT, Zcash.

Compare: vs Coinbase Commerce, vs BTCPay Server, vs ZGo, vs CryptAPI, vs NOWPayments, vs Cryptomus, vs BitPay, vs CoinGate, vs OpenNode, vs Plisio, vs BlockBee, vs CoinPayments.

Use cases: For freelancers, For creators, For open-source projects, For online stores, For SaaS, For VPN & hosting providers, For agencies, For nonprofits, For digital sellers.

Guides: Node.js, FastAPI, .NET, WooCommerce.

Build: SDKs, API reference, quickstart. Learn: overview, blog, how it works, supported coins, pricing, is it safe, verify it yourself.