Go Changelog
Go SDK flat structure refactor
We have refactored the Go SDK into a flat package structure to simplify imports and make the public API easier to discover. This is a breaking change.
What Changed
- Types and services previously nested under subpackages are now exported directly from
github.com/sumup/sumup-go. - Import paths that referenced nested modules need to be updated.
Migration
Update your imports and type references to use the root package. For example:
// Beforeimport "github.com/sumup/sumup-go/checkouts"
// Afterimport "github.com/sumup/sumup-go"If you run into issues, please open a ticket or let us know.
Go SDK
We are happy to announce the beta release of our Go SDK. The SDK is maintained under sumup/sumup-go with its acompanying documentation at pkg.go.dev.
The Go SDK provides easy access to SumUp APIs:
package main
import ( "context" "log"
"github.com/sumup/sumup-go")
func main() { ctx := context.Background() client := sumup.NewClient()
checkout, err := client.Checkouts.Create(ctx, sumup.CheckoutsCreateParams{ Amount: 123, CheckoutReference: "TX000001", Currency: sumup.CurrencyEUR, MerchantCode: "MK0001", }) if err != nil { log.Printf("[ERROR] create checkout: %v", err) return }
log.Printf("[INFO] checkout created: id=%q, amount=%v, currency=%q", *checkout.ID, *checkout.Amount, string(*checkout.Currency))
checkoutSuccess, err := client.Checkouts.Process(ctx, *checkout.ID, sumup.CheckoutsProcessParams{ Card: &sumup.Card{ Cvv: "123", ExpiryMonth: "12", ExpiryYear: "2023", Name: "Boaty McBoatface", Number: "4200000000000042", }, PaymentType: sumup.ProcessCheckoutPaymentTypeCard, }) if err != nil { log.Printf("[ERROR] process checkout: %v", err) return }
success, _ := checkoutSuccess.AsCheckoutSuccess() log.Printf("[INFO] checkout processed: id=%q, transaction_id=%q", *success.ID, string((*success.Transactions)[0].ID))}See the repository for more examples and don’t hesitate to let us know if you have any questions.