Thepeer Python SDK
Python SDK for Thepeer.
Quick Start
- Install thepeer-sdk
pip install thepeer-sdk
- Signup to get your API keys here
Usage
Initiate
from thepeer_sdk import ThepeerSdkClient
thepeer_sdk_client = ThepeerSdkClient(
secret_key="SECRET_KEY_GOES_HERE"
)
# Get the list of all indexed users
thepeer_sdk_client.list_users()
Available Methods
User
-
index_user
: Index a particular user on Thepeerparameters:
- name(str)
- identifier(str)
: unique user identifier - email(str)
returns: dict
-
list_users
: Get the list of all indexed usersparameters:
- page(int)
: page number to return - perPage(int)
: amount of records to return per page
returns: dict
- page(int)
-
update_user
: Update your user’s identifier when they make a profile update to their identifier on your platform.parameters:
- user_ref(str)
: the reference returned when the user was indexed - user_identifier(str)
: unique user identifier
returns: dict
- user_ref(str)
-
delete_user
: Delete a user in the event that a user deactivates their account on your platformparameters:
- user_ref(str)
: the reference returned when the user was indexed
returns: dict
- user_ref(str)
Link
-
get_user_links
: This returns all linked accounts associated with a user.parameters:
- user_ref(str)
: the reference returned when the user was indexed
returns: dict
- user_ref(str)
-
get_link
: Get a linked account detailsparameters:
- link_id(str)
: link ID
returns: dict
- link_id(str)
Send
-
verify_receipt
: Verify a particular receipt.parameters:
- receipt_ref(str)
: reference of the receipt to process
returns: dict
- receipt_ref(str)
-
process_receipt
: Process receipts generated from Thepeer inline.parameters:
- receipt_ref(str)
: reference of the receipt to process - event(str)
returns: dict
- receipt_ref(str)
Direct Charge
-
charge_link
: Charge your user’s linked account at any timeparameters:
- link_id(str)
: id of the link to charge - amount(int)
: amount to charge - remark(str)
: narration of the charge
returns: dict
- link_id(str)
-
authorize_charge
: authorize direct charge request via webhooksparameters:
- charge_ref(str)
: direct charge reference - event(str)
returns: dict
- charge_ref(str)
Upgrade
pip install --upgrade thepeer-sdk
Extra
Visit the official Thepeer documentation for more information.
License
See LICENSE.