Duitku Python API Client Library
Duitku API Library for Python
Supported Feature
| Feature | Function | HTTP Request | Description |
|---|---|---|---|
| Get Payment Method | duitku.payment.get_methods | POST /merchant/paymentmethod/getpaymentmethod | Get list of available payment methods |
| Craete New Invoice | duitku.invoice.create | POST /merchant/createInvoice | Create Transaction via POP API |
| Create New Transaction | duitku.transaction.create | POST /merchant/v2/inquiry | Create Transaction via V2 API |
| Get Transaction | duitku.transaction.get_status | POST /merchant/transactionStatus | Get Transaction via V2 API |
Requirements
- Python 3.5 or later
- Duitku account, register here
- API Key
Documentation
Installation
Get this library, add to your project
pip install Duitku
Example Usage
import requests
import Duitku
from http import HTTPStatus
from datetime import datetime
duitku = Duitku.Duitku()
client = duitku.client
client.merchant_code = "YOUR MERCHANT CODE"
client.api_key = "YOUR API KEY"
client.environment = client.SandboxEnv
create_invoice_req = {
"paymentAmount": 10001,
"merchantOrderId": datetime.now().strfti("%Y%m%d%H%M%S"),
"productDetails": "test invoice",
"email": "test@duitku.com",
"callbackUrl": "https://duitku.com/callback",
"returnUrl": "https://duitku.com"
}
result = self.duitku.invoice.create(create_invoice_req)
print(result)
More Detailed Example
- Invoice (Create Invoice - POP)
- Payment (Get Payment Method)
- Transaction (Create Transaction, Get Transaction Status)
- How to Write in FastAPI
Support
If you have a feature request or spotted a bug or a techical problem, create an issue here. For other questions, please contact duitku through their live chat on your dashboard.
License
MIT license. For more information, see the LICENSE file.
Metadata
Release files for Duitku 0.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| duitku-0.2.10.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duitku-0.2.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / duitku-0.2.10.tar.gz
| Download URL | duitku-0.2.10.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d8bac3032359b3281738f11b9f95bd348a70df4ca4ed2bec5b50ffcd89334f8
|
|
BLAKE2b-256 checksum How to use checksums |
cd62b1aa32ffd68aa08eab8e229c4fe315afe7b5b06f6bca797055a35a3f2a67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / duitku-0.2.10-py3-none-any.whl
| Download URL | duitku-0.2.10-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80c65a01888c5c27f1babca174404b0912b5a7d954a2afeb950b3dc917aed4ea
|
|
BLAKE2b-256 checksum How to use checksums |
ed2a16c76f9eb5fd473963a9370fd8ab1d20eb6de68aedb70ba85f199775a060
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|