Package: eversend
Eversend Python SDKPython SDK for Eversend payments APITable of ContentsInstallationInitializationUsageContribution GuidelinesLicenseInstallation$pipinstall-UeversendInitializationfromeversendimportEversendeversendClient=Eversend(clientId='clientId',clientSecret='clientSecret',version='v1')wallets=eversendClient.Wallets.list();You can get your clientId and clientSecret from the settings section in thedashboardUsageWalletsGet all walletswallets=eversendClient.Wallets.list();Get one walletwallets=eversendClient.Wallets.getOne('USD');TransactionsGet all transactionstransactions=eversendClient.Transactions.list(page=1,limit=10);Ifpageandlimitare not set, the default of1and10are used respectively.Get one transactiontransaction=eversendClient.Transactions.getOne(transactionId="EVS12345678");ExchangeTo 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 quotationquotation=eversendClient.Exchange.getQuotation(source="USD",destination="UGX",amount=10.0);Exchange currencyexchange=eversendClient.Exchange.exchange(token="dhhsggajjshhdhdhd",transactionRef="EVS-12345678",# optional field);BeneficiariesGet beneficiariesbeneficiaries=eversendClient.Beneficiaries.list(page=1,limit=10);Ifpageandlimitare not set, the default of1and10are used respectively.Get single beneficiarybeneficiary=eversendClient.Beneficiaries.getOne(beneficiaryId=100);Create a beneficiarybeneficiary=eversendClient.Beneficiaries.create(firstName="John",lastName="Okello",country="UG",# Alpha-2 country codephoneNumber="+256712345678",# Should be in international formatbankAccountName="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 requiredEdit a beneficiarybeneficiary=eversendClient.Beneficiaries.update(beneficiaryId=100,firstName="John",lastName="Okello",country="UG",# Alpha-2 country codephoneNumber="+256712345678",# Should be in international formatbankAccountName="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 requiredDelete a beneficiaryeversendClient.Beneficiaries.delete(beneficiaryId=100);CollectionsGet collection feescollectionFees=eversendClient.Collections.getFees(amount=1000,currency="KES",method="momo");Get collection OTPRequired when initiating mobile money collectionscollectionOTP=eversendClient.Collections.getOTP(phone="+256712345678");Initiate Mobile Money collectioncollection=eversendClient.Collections.initiate(method="momo",phone="+256712345678",amount=1000,country="UG",currency="UGX",pin=123456,# From phone number passed in Get Collection OTPpinId="dg524fhsgfde",# From Get Collection OTPtransactionRef="EVS-12345678",# Optional transaction ref generated by youcustomer={name="John Okello"}# Optional customer object with your metadata);PayoutsGet payout quotationquotation=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 beneficiarypayout=eversendClient.Payouts.initiate(beneficiaryId=100,quotationToken="token",transactionRef="EVS-12345678"# Optional transaction ref generated by you);Pay new beneficiarypayout=eversendClient.Payouts.initiate(firstName="John",lastName="Okello",country="UG",# Alpha-2 country codephoneNumber="+256712345678",# Should be in international formatbankAccountName="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 countriescountries=eversendClient.Payouts.countries()Get delivery banksbanks=eversendClient.Payouts.banks(country="UG");Contribution GuidelinesContributions are welcome and encouraged. Learn more about our contribution guidelineshereLicenseMIT ©Eversend