Skip to main content

ThePeer Python Sdk

python SDK for ThePeer payment infrastructure

Reference Official Documentation

https://docs.thepeer.co/

Instantiate ThePeer api object

from ThePeer.client import Client

client = Client(api_key="YOUR PRIVATE KEY")

"""
returns all indexed users for your business
"""
client.get_users()


"""
Index/create users
data = {"name" : "", "identifier" : "", "email" : ""} 
"""
client.create_user(data=data)


"""
Update indexed user
the method requires two arguments, the user's ReferenceId and the user's new identifier
referenceId = ""
data = {"identifier" : ""}
"""
client.update_user(referenceId, data=data)


"""
Delete indexed user
this methods allows you to delete an indexed user on your business profile
referenceId = ""
"""
client.delete_user(referenceId)

# Transactions

"""
returns all the details of a particuar transaction
transactionId = ""
"""
client.get_transaction(transactionId)


"""
This method refunds a specific transaction back to its origin (business & user of that business)
it requires two arguments by default transactionId and refund details, alternatively, you can
pass in only the transactionId and we'd use the default refund data i.e data = {"reason": "possible fraud"}
"""
client.refund_transaction(transactionId)


"""
This returns all linked accounts associated with a user, It returns the user's account details along with he business the account resides on.
pass in the linkId to identify and get user's links
"""
client.get_user_links(linkId)


"""
Similarly the method returns a linked account details by passing its ID.
"""
client.get_user_link(linkId)


"""
This method enables you to charge your user's linked account
where data = {
    "amount": ,
    "remark": ""
}
"""
client.charge(linkId, data)


"""
This method allows you simulate receiving money

data = {
  "amount": ,
  "currency": "",
  "user_reference": ""
}

"""

Metadata

Release files for python-thepeer 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-thepeer 1.1.0
File Size Uploaded
python-thepeer-1.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-thepeer 1.1.0
File Interpreter ABI Platform
python_thepeer-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / python-thepeer-1.1.0.tar.gz

Download URL python-thepeer-1.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d65eada67b84bf53c5d44d89874891380e3974c5fc8259e155da49761b739c7d
BLAKE2b-256 checksum
How to use checksums
63f3040cbe2a596ae0b20401ec04207139be1e8d9d888c8c98b7687d366fdfec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.21.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3

Release files / python_thepeer-1.1.0-py3-none-any.whl

Download URL python_thepeer-1.1.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54c0b7c52942f2fbc5bdc6519c79bf5f16baf33884357434c8d7cda03a0a9c01
BLAKE2b-256 checksum
How to use checksums
62771922d5ccfad22dc15a0bbf13fce0d2d65234d6f71665eaf0d5fc7d2b4805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.21.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page