Skip to content

sumup/sumup-py

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

from sumup import Sumup client = Sumup(api_key="sup_sk_MvxmLOl0...") # Get merchant profile merchant = client.merchant.get() print(f"Merchant: {merchant.merchant_profile.merchant_code}")

Async Client

import asyncio from sumup import AsyncSumup async def main(): client = AsyncSumup(api_key="sup_sk_MvxmLOl0...") # Get merchant profile merchant = await client.merchant.get() print(f"Merchant: {merchant.merchant_profile.merchant_code}") asyncio.run(main())

Creating a Checkout

from sumup import Sumup from sumup.checkouts import CreateCheckoutBody import uuid client = Sumup(api_key="sup_sk_MvxmLOl0...") # Get merchant code merchant = client.merchant.get() merchant_code = merchant.merchant_profile.merchant_code # Create a checkout checkout = client.checkouts.create( body=CreateCheckoutBody( 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 from sumup.readers import CreateReaderCheckoutBody, CreateReaderCheckoutAmount client = Sumup(api_key="sup_sk_MvxmLOl0...") # Create a reader checkout reader_checkout = client.readers.create_checkout( reader_id="your-reader-id", body=CreateReaderCheckoutBody( total_amount=CreateReaderCheckoutAmount( 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}")

Version support policy

sumup-py maintains compatibility with Python versions that are no pass their End of life support, see Status of Python versions.

About

Python SDK for the SumUp API.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 5

Languages