sumup-py(Opens in a new tab) provides first-party Python bindings for every SumUp API. It ships both synchronous and asynchronous clients powered by httpx, includes Pydantic models for request bodies, and offers type hints for modern editors.
Installation
Section titled InstallationInstall with pip install sumup. If you use uv(Opens in a new tab), run uv add sumup.
Configure Authentication
Section titled Configure AuthenticationExpose your secret API key or OAuth access token as an environment variable and pass it to either the synchronous Sumup or asynchronous AsyncSumup client. You can also pass the key manually:
client = Sumup(api_key="sup_sk_MvxmLOl0...")Examples
Section titled ExamplesOnline Payment Checkout
Section titled Online Payment Checkoutimport os
from sumup import Sumupfrom sumup.checkouts.resource import CreateCheckoutBody
client = Sumup(api_key=os.environ["SUMUP_API_KEY"])checkout = client.checkouts.create( CreateCheckoutBody( merchant_code=os.environ["SUMUP_MERCHANT_CODE"], amount=25.00, checkout_reference="ORDER-1001", currency="EUR", description="Online payment via Payment Widget", ))
print(checkout.id)# Return checkout.id to your webpage so the SumUp Payment Widget can complete the payment.Cloud API Checkout
Section titled Cloud API Checkoutimport asyncioimport osfrom time import time
from sumup import AsyncSumupfrom sumup.readers.resource import ( CreateReaderCheckoutBody, CreateReaderCheckoutBodyAffiliate, CreateReaderCheckoutBodyTotalAmount,)
async def create_solo_checkout() -> None: client = AsyncSumup(api_key=os.environ["SUMUP_API_KEY"]) merchant_code = os.environ["SUMUP_MERCHANT_CODE"] readers = await client.readers.list(merchant_code) solo = next((reader for reader in readers.items if reader.device.model == "solo"), None) if solo is None: raise RuntimeError("Pair a Solo reader before using the Cloud API.")
checkout = await client.readers.create_checkout( merchant_code, solo.id, CreateReaderCheckoutBody( total_amount=CreateReaderCheckoutBodyTotalAmount(currency="EUR", minor_unit=2, value=1500), ), )
print(checkout.data.client_transaction_id)
asyncio.run(create_solo_checkout())