Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"starlight-links-validator": "^0.25.3",
"starlight-llms-txt": "0.11.0",
"tsx": "4.23.12",
"typescript": "^6.0.3",
"typescript": "6.0.3",
"typescript-eslint": "8.64.0",
"vitest": "4.1.10",
"wrangler": "4.127.1"
Expand Down
10 changes: 8 additions & 2 deletions src/components/ApiDocs/ExampleRequest.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
import { MultiCode } from "@components/Code";
import {
cli,
curl,
dotnet,
go,
java,
node,
php,
python,
rust,
typescript,
} from "@lib/codesamples";
import type { OperationObject } from "src/types/openapi";
import OperationEndpoint from "./OperationEndpoint.astro";
Expand All @@ -28,9 +29,14 @@ const { operation } = Astro.props;
code: curl(operation),
lang: "bash",
},
{
label: "CLI",
code: cli(operation),
lang: "bash",
},
{
label: "JavaScript",
code: node(operation),
code: typescript(operation),
lang: "ts",
},
{
Expand Down
10 changes: 10 additions & 0 deletions src/components/ApiDocs/SDKList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ListItemGroup } from "@sumup-oss/circuit-ui";
import bashIcon from "@assets/languages/bash.svg";
import dotnetIcon from "@assets/languages/dotnet.svg";
import goIcon from "@assets/languages/go.svg";
import javaIcon from "@assets/languages/java.svg";
Expand All @@ -22,6 +23,15 @@ export default () => {
style={{ marginTop: "var(--cui-spacings-mega)" }}
label="SDKs"
items={[
{
key: "cli",
leadingComponent: () => (
<SDKIcon src={bashIcon.src} alt="Command line icon" />
),
label: "CLI",
href: "/tools/cli/",
variant: "navigation",
},
{
key: "javascript",
leadingComponent: () => (
Expand Down
25 changes: 19 additions & 6 deletions src/components/ApiDocs/TopSections.astro
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ const sectionAttrs = (id: ApiTopSection) =>
<LRGrid class="sdks">
<div>
<MarkdownContent class="info">
<SectionHeading as="h2" id="sdks-heading">SDKs</SectionHeading>
<SectionHeading as="h2" id="sdks-heading">
SDKs
</SectionHeading>
<p>
The SumUp SDKs reduce the amount of work required to use our REST
APIs. SumUp maintains SDKs for PHP, JavaScript, Python, Java, Go,
Rust, and .NET.
The SumUp SDKs and command-line interface reduce the amount of work
required to use our REST APIs. Use the CLI directly from your
terminal, or choose an SDK for PHP, JavaScript, Python, Java, Go,
Rust, or .NET.
</p>
</MarkdownContent>
<SDKList />
Expand All @@ -89,7 +92,12 @@ const sectionAttrs = (id: ApiTopSection) =>
options={[
{
label: "cURL",
code: "# Select a client library to see installation instructions.",
code: "# Select the CLI or an SDK to see installation instructions.",
lang: "bash",
},
{
label: "CLI",
code: "brew install sumup/cli/sumup",
lang: "bash",
},
{
Expand Down Expand Up @@ -146,7 +154,7 @@ uv add sumup`,
]}
isLanguageSelect
>
<div slot="left">Install SDK</div>
<div slot="left">Install</div>
</MultiCode>
<Card style={{ marginTop: "var(--cui-spacings-mega)" }}>
<Body size="s">
Expand Down Expand Up @@ -197,6 +205,11 @@ uv add sumup`,
-H "Authorization: Bearer sup_sk_MvxmLOl0..."`,
lang: "bash",
},
{
label: "CLI",
code: "export SUMUP_API_KEY='sup_sk_MvxmLOl0...'",
lang: "bash",
},
{
label: "JavaScript",
code: `import { SumUp } from '@sumup/sdk';
Expand Down
3 changes: 2 additions & 1 deletion src/content.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { docsLoader } from "@astrojs/starlight/loaders";
import { docsSchema } from "@astrojs/starlight/schema";
import { glob } from "astro/loaders";
import { defineCollection, z } from "astro:content";
import { z } from "astro/zod";
import { defineCollection } from "astro:content";
import { openapiDescriptionsLoader } from "./loaders/openapiDescriptions";

const help = defineCollection({
Expand Down
1 change: 1 addition & 0 deletions src/content/docs/online-payments/checkouts/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ SumUp provides the following checkout integrations for online payments:
- [Hosted Checkout](/online-payments/checkouts/hosted-checkout/) - SumUp-hosted payment page with minimal integration effort
- [Swift Checkout SDK](/online-payments/checkouts/swift-checkout/) - accelerated wallet checkout for Apple Pay and Google Pay
- [Server-side SDKs](/tools/sdks/) - JavaScript, Go, Python, Java, PHP, .NET, and Rust clients for the SumUp API
- [SumUp CLI](/tools/cli/) - command-line access to the SumUp API for development and automation
- [React Native SDK](/online-payments/sdks/react-native/) - payment sheet for mobile apps
2 changes: 1 addition & 1 deletion src/content/docs/online-payments/guides/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ With your sandbox merchant account, begin making API calls with real data. Sandb

When finished experimenting with the sandbox merchant account, switch back to a regular account for business purposes.

SumUp provides official SDKs for JavaScript, Go, Python, Java, PHP, .NET, and Rust — visit the [SDKs overview page](/tools/sdks/) to choose the client that fits your stack.
SumUp provides official SDKs for JavaScript, Go, Python, Java, PHP, .NET, and Rust, as well as the [SumUp CLI](/tools/cli/) for working from a terminal. Visit the [SDKs overview page](/tools/sdks/) to choose the client that fits your stack.
118 changes: 118 additions & 0 deletions src/content/docs/tools/cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: CLI
description: Install and use the SumUp command-line interface to interact with SumUp APIs from your terminal.
sidebar:
order: 101
links:
- title: Source code
href: https://github.com/sumup/sumup-cli
- title: Releases
href: https://github.com/sumup/sumup-cli/releases
---

The SumUp CLI, `sumup`, lets you manage your SumUp account and call SumUp APIs from a terminal. Use it to explore API operations, run development workflows, or write scripts without setting up an SDK project.

The [API reference](/api/) includes a **CLI** sample for every operation supported by the tool.

## Install the CLI

Install the CLI with [Homebrew](https://brew.sh/):

```bash
brew install sumup/cli/sumup
```

Alternatively, install it with Go:

```bash
go install github.com/sumup/sumup-cli/cmd/sumup
```

Confirm that the installation succeeded:

```bash
sumup version
```

## Configure Authentication

Create a secret API key in the [developer dashboard](https://me.sumup.com/developers), then expose it to the CLI through the `SUMUP_API_KEY` environment variable:

```bash
export SUMUP_API_KEY=sup_sk_your_api_key
```

You can also pass an API key with the global `--api-key` option. Avoid saving secret API keys in shell history or source control.

## Set Your Merchant Context

Commands that operate on a merchant accept the `--merchant-code` option. To avoid repeating it, select a merchant interactively and save it as your current context:

```bash
sumup context set
```

View or clear the saved context with:

```bash
sumup context get
sumup context unset
```

An explicit `--merchant-code` option overrides the saved context.

## Run Commands

Create an online checkout:

```bash
sumup checkouts create \
--reference order-123 \
--amount 19.99 \
--currency EUR \
--merchant-code M123 \
--description "Ticket purchase"
```

List the readers paired with a merchant:

```bash
sumup readers list --merchant-code M123
```

Add the global `--json` option when a script needs machine-readable output:

```bash
sumup --json readers list --merchant-code M123
```

Use the built-in help to discover available resources, operations, and options:

```bash
sumup --help
sumup checkouts --help
sumup checkouts create --help
```

## Enable Shell Completion

Generate and load a completion script for your shell:

```bash
# bash
source <(sumup completion bash)

# zsh
source <(sumup completion zsh)

# fish
sumup completion fish > ~/.config/fish/completions/sumup.fish
```

Release archives also include pre-generated completion scripts and a man page.

## Next Steps

- Browse the [API reference](/api/) and select the **CLI** tab for operation-specific commands.
- Review [authorization options](/tools/authorization/) before using the CLI with production accounts.
- Use an [official server SDK](/tools/sdks/) when you need typed clients and application-level integration.
4 changes: 3 additions & 1 deletion src/content/docs/tools/sdks/index.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
title: SDKs
description: Build on SumUp's APIs with officially supported server-side SDKs.
description: Build on SumUp's APIs with the SumUp CLI or an officially supported server-side SDK.
sidebar:
label: Overview
order: 100
---

SumUp maintains open-source server SDKs that wrap the public API and handle authentication, pagination, and resource helpers. You can use the same SDK for online payments and for card-present payments through the Cloud API. Each guide includes examples for creating an online checkout and starting a checkout on a paired Solo reader.

Prefer working from a terminal? The [SumUp CLI](/tools/cli/) provides commands for SumUp API operations without requiring you to write an application.

## Choose Your SDK

- **[JavaScript](/tools/sdks/javascript/)** – published on npm as `@sumup/sdk` with first-class TypeScript typings and ESM support across JavaScript runtimes.
Expand Down
5 changes: 5 additions & 0 deletions src/content/help/support-libraries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ SumUp maintains multiple SDKs and APIs to simplify your integration work across
- [JavaScript / TypeScript, Go, Python, Java, PHP, .NET, and Rust SDK guides](/tools/sdks/) cover server-to-SumUp API calls for online payments and remote Solo reader management through the Cloud API.
- Use these when you’re building checkout pages, recurring billing, or card-present integrations from a backend or platform that can make API requests.

## Command Line Interface

- The [SumUp CLI](/tools/cli/) lets you call SumUp APIs from a terminal without writing an application.
- Use it for exploring operations, development workflows, and scripts that consume JSON output.

## Card-Present Integrations

- [Android SDK](https://github.com/sumup/sumup-android-sdk) and [iOS SDK](https://github.com/sumup/sumup-ios-sdk) let you embed our reader experience inside native apps.
Expand Down
Loading