The library follows an object-oriented approach
There are currently twelve (12) base categories namely:
- Customer
- Collections
- Transfer
- Bills
- Wallets
- Issuing
- Identity
- Transactions
- Counterparty
- Forex
- Institutions
- Misc
Learn more from the docs
$ pip install maplerad-python
A secret key is needed for authorization. It can be gotten from the Maplerad dashboard
Maplerad provides two environments to ensure a smooth and easy experience.
- sandbox: for development
- live: for production
Sandbox is your playground. You can credit your test wallets and use that to test your integrations, no real money will be debited or credited. Ensure to switch to Live when you are ready to launch.
All method calls under Live will be charged and real money will be debited or credited. You are advised to use this when you have fully tested your integrations and are ready to launch your product.
# import the package
from maplerad_python.auth import Authentication
secret_key = os.getenv("MAPLERAD_SECRET_KEY")
environment = "DEVELOPMENT"
auth = Authenticate(secret_key,environment)
customer = auth.customers()
payload = {
"email": user.email,
"first_name": user.first_name,
"last_name": user.last_name,
"country": country_type
}
result = customer.create_customer(payload)
payload = {
"customer_id": customer_id,
"phone": {
"phone_number": phone_number,
"phone_short_code": phone_short_code
},
"address": {
"city": address.city,
"country": address.country,
"postal_code": address.postal_code,
"state": address.state,
"street": address.street,
"street2": address.street2
},
"dob": dob,
"identification_number": identification_number
}
result = customer.upgrade_customer_tier1(payload)
payload = {
"customer_id": customer_id,
"identity": {
"country": identity.country,
"image": identity.image,
"number": identity.number,
"type": identity.type
}
}
result = customer.upgrade_customer_tier2(payload)
result = customer.get_customer(customer_id)
result = customer.get_all_customers()
result = customer.get_customer_cards(customer_id)
result = customer.get_customer_transactions(customer_id)
result = customer.get_customer_virtual_accounts(customer_id)
result = customer.customer_card_enrollment(customer_id, brand)
payload = {
"customer_id": customer_id,
"photo": photo,
"phone": {
"phone_number": phone.phone_number,
"phone_country_code": phone.phone_country_code
},
"middle_name": middle_name,
"identity": {
"country": identity.country,
"image": identity.image,
"number": identity.number,
"type": identity.type
}
}
result = customer.update_customer(payload)
result = customer.set_customer_blacklist_active(customer_id, status)
bills = auth.bills()
payload = {
"phone_number": phone_number,
"identifier": identifier,
"amount": amount
}
result = bills.buy_airtime(payload)
result = bills.get_airtime_billers(country)
result = bills.get_airtime_history()
collections = auth.collections()
payload = {
"customer_id": customer_id,
"currency": currency_type,
"preferred_bank": preferred_bank,
"deposit_account_id": deposit_account_id,
"meta": {
"occupation": occupation,
"utility_bill": utility_bill_url_or_file,
"bank_statement": bank_statement_url_or_file,
"identity_type": identity_type,
"identity_image": identity_image_url_or_file,
"identity_number": identity_number,
"identity_issued_date": identity_issued_date,
"identity_expiration": identity_expiration
}
}
result = collections.create_virtual_account(payload)
counterparty = auth.counterparty()
result = counterparty.blacklist(counterpartyID, status)
result = counterparty.get_counterparty(counterpartyID)
result = counterparty.get_all_counterparties()
fx = auth.fx()
payload = {
"source_currency": "NGN",
"target_currency": "USD",
"amount": "500",
}
result = fx.generate_quote(payload)
result = fx.exchange_currency(quote_reference)
result = fx.get_fx_history()
identity = auth.identity()
result = identity.verify_identity(bvn)
institution = auth.institution()
params = {
"page": "1",
"pageSize": "10",
"type": "bank",
"country": "US"
}
result = institution.get_all_institutions(params)
payload = {
"account_number": "1234567890",
"bank_code": "ABC123"
}
result = institution.resolve_institution(payload)
issuing = auth.issuing()
payload = {
"customer_id": "123456789",
"type": "VIRTUAL",
"currency": "USD",
"auto_approve": True,
"brand": "VISA",
"amount": 1000,
"card_pin": 1234
}
result = issuing.create_card(payload)
payload = {
"customer_id": "123456789",
"type": CardType.PHYSICAL.value,
"currency": "USD",
"auto_approve": True,
"brand": "MASTERCARD",
"amount": 2000,
"card_pin": 5678,
"name": "Business Card"
}
result = issuing.create_business_card(payload)
result = issuing.set_card_pin(cardID, pin)
result = issuing.get_card(cardID)
result = issuing.get_all_cards()
params = {
"page": "1",
"pageSize": "10",
"type": "purchase",
"status": "success"
}
result = issuing.get_card_transactions(cardID, params)
amount = 1000
result = issuing.fund_card(cardID, amount)
result = issuing.withdraw_from_card(cardID, amount)
result = issuing.freeze_card(cardID)
result = issuing.unfreeze_card(cardID)
misc = auth.misc()
result = misc.get_currencies()
result = misc.get_countries()
payload = {
"amount": "100",
"currency": "USD"
}
result = misc.credit_test_wallet(payload)
transactions = auth.transactions()
result = transactions.get_all_transactions()
result = transactions.get_transaction("transaction_id")
result = transactions.verify_collection_transaction("transaction_id")
transfers = auth.transfer()
payload = {
"account_number": "string",
"amount": 45454545,
"bank_code": "string",
"currency": "NGN",
}
result = transfers.naira_transfer(payload)
payload= {
"account_number": "1234567890",
"amount": 1000.0,
"bank_code": "ABC",
"currency": "USD",
"meta": {
"scheme": "DOM",
"sender": {
"first_name": "John",
"last_name": "Doe",
"phone_number": "1234567890",
"address": "123 Main Street",
"country": "USA"
},
"counterparty": {
"first_name": "Jane",
"last_name": "Smith",
"phone_number": "9876543210",
"address": "456 Elm Street",
"country": "Canada",
"identity": "12345"
}
},
"reason": "Payment",
"reference": "ABC123"
}
result = transfers.dom_transfer(payload)
payload = {
"account_number": "1234567890",
"amount": 1000.0,
"bank_code": "ABC",
"currency": "USD",
"meta": {
"scheme": "CASHPICKUP",
"sender": {
"first_name": "John",
"last_name": "Doe",
"phone_number": "1234567890",
"address": "123 Main Street",
"country": "USA"
},
"counterparty": {
"first_name": "Jane",
"last_name": "Smith",
"phone_number": "9876543210",
"address": "456 Elm Street",
"country": "Canada",
"identity": "12345"
}
},
"reason": "Payment",
"reference": "ABC123"
}
result = transfers.cash_pickup_transfer(payload)
result = transfers.get_transfer("transfer_id")
result = transfers.get_all_transfers()
wallets = auth.wallet()
result = wallets.get_wallets()
result = wallets.get_wallets_history()
result = wallets.get_wallets_history_by_currency("USD")
Twitter: 1madvirus
LinkedIN: Edwin Beshel Ayabie
Email: [email protected]