Skip to main content

SumUp Python SDK

pypi Documentation CI Status pypi download License

IMPORTANT: This SDK is under development. We might still introduce minor breaking changes before reaching v1.

The Python SDK for the SumUp API.

Installation

Install the latest version of the SumUp SDK:

pip install sumup
# or
uv add sumup

Usage

Synchronous Client

import os

from sumup import Sumup

client = Sumup(api_key="sup_sk_MvxmLOl0...")

# Get merchant profile
merchant = client.merchants.get(merchant_code=os.environ["SUMUP_MERCHANT_CODE"])
print(f"Merchant: {merchant.merchant_code}")

Async Client

import asyncio
import os

from sumup import AsyncSumup


async def main():
    client = AsyncSumup(api_key="sup_sk_MvxmLOl0...")

    # Get merchant profile
    merchant = await client.merchants.get(merchant_code=os.environ["SUMUP_MERCHANT_CODE"])
    print(f"Merchant: {merchant.merchant_code}")


asyncio.run(main())

Creating a Checkout

import os
import uuid

from sumup import Sumup

client = Sumup(api_key="sup_sk_MvxmLOl0...")
merchant_code = os.environ["SUMUP_MERCHANT_CODE"]

# Create a checkout
checkout = client.checkouts.create(
    amount=10.00,
    currency="EUR",
    checkout_reference=str(uuid.uuid4()),
    merchant_code=merchant_code,
    description="Test payment",
    redirect_url="https://example.com/success",
    return_url="https://example.com/webhook",
)

print(f"Checkout ID: {checkout.id}")
print(f"Checkout Reference: {checkout.checkout_reference}")

Creating a Reader Checkout

from sumup import Sumup

client = Sumup(api_key="sup_sk_MvxmLOl0...")

# Create a reader checkout
reader_checkout = client.readers.create_checkout(
    reader_id="your-reader-id",
    merchant_code="your-merchant-code",
    total_amount={
        "value": 1000,  # 10.00 EUR (amount in cents)
        "currency": "EUR",
        "minor_unit": 2,
    },
    description="Coffee purchase",
    return_url="https://example.com/webhook",
)

print(f"Reader checkout created: {reader_checkout}")

Handling Events

Create a handler with your event signing secret and register typed callbacks:

import os

from sumup import Sumup
from sumup.events import EventNotification, ReaderCreatedEvent

client = Sumup(api_key=os.environ["SUMUP_API_KEY"])


def fallback(event: EventNotification) -> None:
    print(f"Received {event.type}")


events = client.events_handler(os.environ["SUMUP_EVENT_SECRET"], fallback)


@events.on_reader_created
def reader_created(event: ReaderCreatedEvent) -> None:
    reader = event.fetch_object()
    print(f"Reader paired: {reader.id}")


# In your HTTP route, pass the unchanged body and the complete
# X-SumUp-Webhook-Signature header value:
events.handle(raw_body, signature)

You can also register an existing function with events.on_reader_created(callback).

Send a 2xx response after handling succeeds. Reject EventSignatureError and EventPayloadError with 400; return 500 for EventCallbackError so processing can be retried. Make callbacks idempotent and configure body limits in your server.

Use AsyncSumup with async callbacks, await events.handle(...), and await event.fetch_object_async() for async servers. For parsing without callbacks, use client.parse_event_notification(body, signature, secret).

See the runnable Flask and FastAPI examples for complete HTTP routes and error handling.

Version Support Policy

sumup-py maintains compatibility with Python versions that have not passed end-of-life. As of June 8, 2026, that means Python 3.10 through 3.14. See Status of Python versions.

Metadata

Release files for sumup 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sumup 0.3.4
File Size Uploaded
sumup-0.3.4.tar.gz 73.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sumup 0.3.4
File Interpreter ABI Platform
sumup-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 151.0 kB

Release files / sumup-0.3.4.tar.gz

Download URL sumup-0.3.4.tar.gz
Size 73.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fd390253903a06f995f837c8ee91d236d56bd54e0223724a9232665c22c04288
BLAKE2b-256 checksum
How to use checksums
77743f2405c12522f6bb52d9087956ba2ed36056d57d775da288a8129373d923
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sumup-0.3.4-py3-none-any.whl

Download URL sumup-0.3.4-py3-none-any.whl
Size 78.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efa29165319de6ba9f0b2d02a728606a5a450a9d88d7820475272f44f8fb8b7b
BLAKE2b-256 checksum
How to use checksums
c04062026ce2f4342a4a73f63eda9ffd913879e962a633a88e0d982667268e8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.22

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page