Eversend Python SDK
Python SDK for Eversend payments API
Table of Contents
Installation
$ pip install -U eversend
Initialization
from eversend import Eversend
eversendClient = Eversend(clientId= 'clientId', clientSecret= 'clientSecret', version='v1')
wallets = eversendClient.Wallets.list();
You can get your clientId and clientSecret from the settings section in the dashboard
Usage
Wallets
Get all wallets
wallets = eversendClient.Wallets.list();
Get one wallet
wallets = eversendClient.Wallets.getOne('USD');
Transactions
Get all transactions
transactions = eversendClient.Transactions.list(
page = 1,
limit = 10
);
If page and limit are not set, the default of 1 and 10 are used respectively.
Get one transaction
transaction = eversendClient.Transactions.getOne(
transactionId= "EVS12345678"
);
Exchange
To exchange from one wallet to another, you first have to generate a quotation. This returns a token with a 30s timeout that you can use to make the exchange.
Get exchange quotation
quotation = eversendClient.Exchange.getQuotation(
source = "USD",
destination = "UGX",
amount = 10.0
);
Exchange currency
exchange = eversendClient.Exchange.exchange(
token = "dhhsggajjshhdhdhd",
transactionRef = "EVS-12345678", # optional field
);
Beneficiaries
Get beneficiaries
beneficiaries = eversendClient.Beneficiaries.list(
page = 1,
limit = 10
);
If page and limit are not set, the default of 1 and 10 are used respectively.
Get single beneficiary
beneficiary = eversendClient.Beneficiaries.getOne(
beneficiaryId = 100
);
Create a beneficiary
beneficiary = eversendClient.Beneficiaries.create(
firstName = "John",
lastName = "Okello",
country = "UG", # Alpha-2 country code
phoneNumber = "+256712345678", # Should be in international format
bankAccountName = "John Okello",
bankAccountNumber = "12345678",
bankName = "Stanbic Bank",
bankCode = 1234 # You can get the bank code from payouts.getDeliveryBanks()
);
Note that all bank fields are optional if bank payments will not be required
Edit a beneficiary
beneficiary = eversendClient.Beneficiaries.update(
beneficiaryId = 100,
firstName = "John",
lastName = "Okello",
country = "UG", # Alpha-2 country code
phoneNumber = "+256712345678", # Should be in international format
bankAccountName = "John Okello",
bankAccountNumber = "12345678",
bankName = "Stanbic Bank",
bankCode = 1234 # You can get the bank code from payouts.getDeliveryBanks()
);
Note that all bank fields are optional if bank payments will not be required
Delete a beneficiary
eversendClient.Beneficiaries.delete(
beneficiaryId = 100
);
Collections
Get collection fees
collectionFees = eversendClient.Collections.getFees(
amount = 1000,
currency = "KES",
method = "momo"
);
Get collection OTP
Required when initiating mobile money collections
collectionOTP = eversendClient.Collections.getOTP(
phone = "+256712345678"
);
Initiate Mobile Money collection
collection = eversendClient.Collections.initiate(
method = "momo",
phone = "+256712345678",
amount = 1000,
country = "UG",
currency = "UGX",
pin = 123456, # From phone number passed in Get Collection OTP
pinId = "dg524fhsgfde", # From Get Collection OTP
transactionRef = "EVS-12345678", # Optional transaction ref generated by you
customer = { name = "John Okello" } # Optional customer object with your metadata
);
Payouts
Get payout quotation
quotation = eversendClient.Payouts.getQuotation(
sourceWallet = "USD",
amount = 100,
type = "momo",
destinationCountry = "KE",
destinationCurrency = "KES",
amountType = "SOURCE", # amountType can be SOURCE or DESTINATION
);
amountTyperefers to whether you want amount to representsourceWallet(SOURCE) ordestinationCurrency(DESTINATION)
Pay existing beneficiary
payout = eversendClient.Payouts.initiate(
beneficiaryId = 100,
quotationToken = "token",
transactionRef = "EVS-12345678" # Optional transaction ref generated by you
);
Pay new beneficiary
payout = eversendClient.Payouts.initiate(
firstName = "John",
lastName = "Okello",
country = "UG", # Alpha-2 country code
phoneNumber = "+256712345678", # Should be in international format
bankAccountName = "John Okello",
bankAccountNumber = "12345678",
bankName = "Stanbic Bank",
bankCode = 1234, # You can get the bank code from payouts.getDeliveryBanks()
quotationToken = "token",
transactionRef = "EVS-12345678" # Optional transaction ref generated by you
);
Get delivery countries
countries = eversendClient.Payouts.countries()
Get delivery banks
banks = eversendClient.Payouts.banks(
country = "UG"
);
Contribution Guidelines
Contributions are welcome and encouraged. Learn more about our contribution guidelines here
License
MIT © Eversend
Release files for eversend 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eversend-1.0.1.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eversend-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / eversend-1.0.1.tar.gz
| Download URL | eversend-1.0.1.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2710a4f0f3ae72b2bc26c9cec5aaf3fdeb015f74dc3c6a2a3c3985088f0c5d9e
|
|
BLAKE2b-256 checksum How to use checksums |
93e6f6f1d94df31f21ad0f353f7aeea994a3f7b967b4ce7c831e0da72132e1d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / eversend-1.0.1-py3-none-any.whl
| Download URL | eversend-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82d3fe4e66b367aa39d00a38bebe69eea4cee9c1fe7c614646085d5bedfef7dc
|
|
BLAKE2b-256 checksum How to use checksums |
144d3b53a900a875e88e2856bd5a65b38df712e1b1a7487005b923fd10027c77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|