Skip to content

sumup/sumup-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

sumup-go

Stars Go Reference Documentation CI Status License

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.

Installation

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-go

Documentation

For 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)
}

Authentication

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..."))

Examples

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.go

checkout - Creating and processing a checkout programmatically using test card details.

go run example/checkout/main.go

full - 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.go

and visit http://localhost:8080

Support

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.