IMPORTANT: This SDK is under development. We might still introduce minor breaking changes before reaching v1.
The Golang SDK for the SumUp API.
To learn more, check out our API Reference and Documentation.
sumup-go is compatible with projects using Go Modules.
Import the SDK using:
import (
"github.com/sumup/sumup-go"
)And run any of go build/go install/go test which will resolve the package automatically.
Alternatively, you can install the SDK using:
go get github.com/sumup/sumup-goFor complete documentation of SumUp APIs visit developer.sumup.com. Alternatively, refer to this simple example to get started:
package main
import (
"context"
"log"
"github.com/sumup/sumup-go"
"github.com/sumup/sumup-go/merchant"
)
func main() {
client := sumup.NewClient()
merchant, err := client.Merchants.Get(context.Background(), "MCNPLE22", merchant.GetAccountParams{})
if err != nil {
log.Printf("[ERROR] get merchant account: %v", err)
return
}
log.Printf("[INFO] merchant code: %s", merchant.MerchantCode)
}The easiest form of authenticating with SumUp APIs is using API keys. You can create API keys in the API key section of the developer portal. Store them securely. The SDK by default loads the API key from SUMUP_API_KEY environment variable. Alternatively, provide API key on your own:
client := sumup.NewClient(client.WithAPIKey("sup_sk_LZFWoLyd..."))The repository includes several examples demonstrating different use cases:
simple - Basic merchant account information retrieval showing how to initialize the SDK and make a simple API call.
go run example/simple/main.gocheckout - Creating and processing a checkout programmatically using test card details.
go run example/checkout/main.gofull - Complete web application demonstrating the full checkout flow with the SumUp payment widget. Shows how to create checkouts and integrate the widget in a real application.
go run example/full/main.goand visit http://localhost:8080
Our APIs and their public offering is limited and under heavy development. If you have any questions or inquiries reach out to our support team via the Contact Form.
For question specifically related to this Golang SDK please Open an Issue.
sumup-go SDK will always support latest 3 version of golang following the Golang Release Policy.