Skip to content

Python Changelog

Python SDK

We are happy to announce the release of our Python SDK. The SDK is maintained under sumup/sumup-py and covers all of SumUp’s public APIs. sumup-py support both synchronous and asynchronous calling convention.

import os
import asyncio
from sumup import AsyncSumup
from sumup.readers.resource import CreateReaderCheckoutBody, CreateReaderCheckoutBodyTotalAmount
async def main():
client = AsyncSumup()
merchant_code = os.environ["SUMUP_MERCHANT_CODE"]
readers = await client.readers.list(merchant_code)
reader = readers.items[0]
checkout = await client.readers().create_checkout(
merchant_code,
reader.id,
CreateReaderCheckoutBody(
total_amount=CreateReaderCheckoutBodyTotalAmount(
currency="EUR",
minor_unit=2,
value=1000,
),
description="sumup-py card reader checkout example",
),
)
print(checkout)
if __name__ == "__main__":
asyncio.run(main())

See the repository for more examples and don’t hesitate to let us know if you have any questions.