Python SDK

The Buckaroo Python SDK is an open source library that connects a Python application to the Buckaroo API.
It handles authentication, request signing and response parsing, so you can start payments, verify push messages and refund transactions with a few lines of code.
Running a store on an e-commerce platform? Use one of our ready-made plugins and apps instead. This SDK is for custom applications.
Requirements
| Requirement | Details |
|---|---|
| Buckaroo account | Create an account if you do not have one yet |
| Python | 3.9 or higher |
| OpenSSL | An up-to-date SSL/TLS toolkit |
Installation
Install the SDK with pip:
pip install buckaroo-sdkThe source code is on GitHub.
Quick start
Create the client with your store key and secret key, then start a payment and send the customer to the payment page:
from buckaroo import BuckarooClient
from buckaroo.services.payment_service import PaymentService
client = BuckarooClient("STORE_KEY", "SECRET_KEY", mode="test")
payments = PaymentService(client)
response = payments.create_payment(
"ideal",
{
"currency": "EUR",
"amount": 10.00,
"invoice": "INV-1001", # must be unique per payment
"description": "Order #1001",
"return_url": "https://example.com/buckaroo/return",
"return_url_cancel": "https://example.com/buckaroo/cancel",
"return_url_error": "https://example.com/buckaroo/error",
"return_url_reject": "https://example.com/buckaroo/reject",
"push_url": "https://example.com/buckaroo/push",
},
).pay()
if response.requires_action():
redirect_url = response.get_redirect_url() # send the customer hereThat starts an iDEAL | Wero payment in test mode. The result of the payment arrives on your push URL, so continue with these pages in order:
- Configuration: credentials, test and live mode, timeouts and environment variables
- Payments: start a payment, read the response and handle errors
- Push messages: receive and verify the payment result
- Order management: refunds, captures and cancellations
- Test and go live: what to test and how to switch to production
What you can build
The SDK covers the Buckaroo payment methods and the additional services iDIN, eMandates, Split Payments, Credit Management, PayPerEmail and Subscriptions. Every payment method is called the same way, with its own service code.
- Payment methods describes each method and its request parameters
- The examples folder in the repository has runnable scripts
- The README has examples for the additional services
Versioning
The SDK follows semantic versioning:
| Part | Meaning |
|---|---|
| MAJOR | Breaking changes that require additional testing and caution |
| MINOR | New functionality with limited impact |
| PATCH | Bug fixes and hotfixes only |
Every change is recorded in the changelog and on the releases page.
Contribute
The SDK is open source under the MIT license, and contributions are welcome. Read the contribution guidelines before you open a pull request.
Updated 14 days ago