Official Python SDK for the SumUp API.
Project description
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",
merchant_code="your-merchant-code",
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sumup-0.1.2.tar.gz.
File metadata
- Download URL: sumup-0.1.2.tar.gz
- Upload date:
- Size: 48.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8d424000c2209618c189476d6793bad35a54827c4991cc0476d94f7c89cf8fa
|
|
| MD5 |
4146bc80a58591fabaa586af7446bfd4
|
|
| BLAKE2b-256 |
9223a98ef7aec6c28086f8497897b42bd1a1937fff4a95eea5a207f2a2fdee2f
|
File details
Details for the file sumup-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sumup-0.1.2-py3-none-any.whl
- Upload date:
- Size: 56.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18de5f454af7b22ed0c5323b04cb10ad76de4e5f15b0cc106974a9bc4adcd476
|
|
| MD5 |
50940a5232004a2a18c8f819f25a6773
|
|
| BLAKE2b-256 |
717423db703ebdda1fa57aea351b3cf223f98dddd65d2de7737b304a1035c5de
|