Quickstart
Complete your first payment flow with the nekuda Python SDK in under 5 minutes.
Welcome to the rapid-fire tour of the nekuda Python SDK. In less than five minutes you will:
- Install the package
- Authenticate with your API key
- Run your first card-reveal workflow with type-safe responses
This Python SDK handles the backend payment processing. You’ll also need to integrate our frontend wallet SDK to securely collect credit card details from users.
Step 1: Installation
The SDK ships as a single, pure-Python wheel with minimal dependencies – install is ~1 second.
Step 2: Authentication
Grab your secret key from the nekuda Dashboard and export it as an environment variable:
That’s all the configuration you need for the quickstart.
Step 3: Hello World
If everything is set up correctly you should see:
Step 4: End-to-End Flow with Type Safety 🎯
The snippet below walks through the full payment flow with type-safe responses. This flow requires a user_id
to associate the payment with a user, and a mandate_id
which is obtained after creating a mandate (the user’s intent to purchase).
Run it and you’ll see the card details with full type safety and IDE autocomplete support!
Complete Integration: Remember that in a real application, creating a mandate and requesting a token happen on your backend (using this Python SDK), while the actual card collection happens on your frontend using our React wallet SDK. A user_id
must be consistently used for both frontend and backend operations for a given user.
Step 5: Why Type Safety Matters 🛡️
With our typed response models:
- No more
KeyError
- IDE knows exactly what fields are available - Autocomplete everywhere - Your editor suggests available fields
- Validation built-in - Card numbers and expiry dates are validated
- Better error messages - Know exactly what went wrong
What’s Next?
Core Concepts
Understand NekudaClient, UserContext, and response models
Usage Guide
Deep dive into the complete payment flow
Configuration
Production-ready settings and customization
Error Handling
Build resilient applications with proper error handling
Happy hacking! 🎉