sumup

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 2

README

sumup-go

Stars Go Reference CI Status License Contributor Covenant

IMPORTANT: This SDK is under heavy development and subject to breaking changes.

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"
	"os"

	"github.com/sumup/sumup-go"
	"github.com/sumup/sumup-go/merchant"
)

func main() {
	client := sumup.NewClient()

	account, err := client.Merchant.GetAccount(context.Background(), merchant.GetAccountParams{})
	if err != nil {
		fmt.Printf("[ERROR] get merchant account: %v\n", err)
		return
	}

	fmt.Printf("[INFO] merchant profile: %+v\n", account.MerchantProfile)
}

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

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.

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var OAuth2Endpoint = oauth2.Endpoint{
	AuthURL:  "https://api.sumup.com/authorize",
	TokenURL: "https://api.sumup.com/token",
}

OAuth2Endpoint is SumUp's OAuth 2.0 endpoint.

Functions

This section is empty.

Types

type Client

type Client struct {
	Checkouts    *checkouts.CheckoutsService
	Customers    *customers.CustomersService
	Members      *members.MembersService
	Memberships  *memberships.MembershipsService
	Merchant     *merchant.MerchantService
	Payouts      *payouts.PayoutsService
	Readers      *readers.ReadersService
	Receipts     *receipts.ReceiptsService
	Roles        *roles.RolesService
	Subaccounts  *subaccounts.SubaccountsService
	Transactions *transactions.TransactionsService
	// contains filtered or unexported fields
}
Example
client := sumup.NewClient()

account, err := client.Merchant.Get(context.Background(), merchant.GetAccountParams{})
if err != nil {
	log.Printf("[ERROR] get merchant account: %v", err)
	return
}

log.Printf("[INFO] merchant profile: %+v", *account.MerchantProfile)

func NewClient

func NewClient(opts ...client.ClientOption) *Client

NewClient creates new SumUp API client. The client is by default configured environment variables (`SUMUP_API_KEY`). To override the default configuration use [ClientOption]s.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL