Go SDK
Official Declined.io client for Go. Source: Enoros/declined-sdk/declined-go
Install
bash
go get github.com/Enoros/declined-sdk/declined-goInitialize
go
import (
"context"
declined "github.com/Enoros/declined-sdk/declined-go"
)
client := declined.New("decl_live_sk_...", declined.WithBaseURL("https://api.declined.io/api"))Send a payment failed event
go
_, err := client.Events.Create(context.Background(), declined.EventCreateParams{
EventID: "evt_123", Type: "payment_failed",
CustomerID: "cus_123", InvoiceID: "inv_456",
Amount: 24900, Currency: "usd", Provider: "stripe",
})Mark payment as recovered
When a customer pays outside Declined, notify the platform using either approach below. See the full Recoveries guide.
Via event API
go
_, err := client.Events.MarkPaymentRecovered(context.Background(), declined.EventCreateParams{
EventID: "evt_124", CustomerID: "cus_123", InvoiceID: "inv_456",
})Via recovery attempt ID
go
_, err := client.Recoveries.MarkRecovered(context.Background(), "ra_abc123")List resources
All SDKs expose customers, recoveries, sequences, webhooks, incentives, and analytics list methods. See the REST API reference for response shapes.