{"id":40970172,"url":"https://github.com/thepeerstack/python-sdk","last_synced_at":"2026-01-22T06:42:22.506Z","repository":{"id":40599036,"uuid":"484701855","full_name":"thepeerstack/python-sdk","owner":"thepeerstack","description":"official python sdk for interacting with thepeer payment processing infrastructure","archived":false,"fork":false,"pushed_at":"2023-09-02T19:58:41.000Z","size":62,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-29T08:02:05.017Z","etag":null,"topics":["fintech","hacktoberfest","python","sdk"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pythepeer/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thepeerstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-23T09:22:30.000Z","updated_at":"2025-05-03T22:32:19.000Z","dependencies_parsed_at":"2022-07-16T10:16:31.199Z","dependency_job_id":null,"html_url":"https://github.com/thepeerstack/python-sdk","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/thepeerstack/python-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepeerstack%2Fpython-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepeerstack%2Fpython-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepeerstack%2Fpython-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepeerstack%2Fpython-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thepeerstack","download_url":"https://codeload.github.com/thepeerstack/python-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepeerstack%2Fpython-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28657095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fintech","hacktoberfest","python","sdk"],"created_at":"2026-01-22T06:42:21.781Z","updated_at":"2026-01-22T06:42:22.496Z","avatar_url":"https://github.com/thepeerstack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thepeer python-sdk\n\n![example workflow](https://github.com/thepeerstack/python-sdk/actions/workflows/pytests.yml/badge.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/pythepeer?style=flat-square) ![PyPI - License](https://img.shields.io/pypi/l/pythepeer) ![PyPI](https://img.shields.io/pypi/v/pythepeer) ![Codecov](https://img.shields.io/codecov/c/gh/E-wave112/py-thepeer?token=gYijsI9TCm)\n\n\u003e Thepeer's official python sdk for developers to use in their python projects.\n\n- To start using this sdk, create an account at https://thepeer.co/ if you haven't already.\n- You can then retrieve your API keys from your [dashboard](https://dashboard.thepeer.co/)\n\n## Installation\nTo install this sdk, run the command:\n```bash\npip install pythepeer\n```\n\n## Usage\nInstantiate ```Thepeer``` class like so:\n```python\nfrom thepeer import Thepeer\n\n# create an instance of Thepeer class\n\nthepeer_instance = Thepeer(\"YOUR_API_KEY_HERE\")\n\n```\n\n## Available methods exposed by the sdk\n\n**Note:**\n - For more info about the exposed methods, please refer to the general [documentation](https://docs.thepeer.co/)\n - Be sure to keep your API Credentials securely in [environment variables](https://www.twilio.com/blog/environment-variables-python)\n\n### Indexing a user\nThis method describes how to index a user on your account (this is usually the first step before using other methods)\n\n```python\ntest = thepeer_instance.index_user(\"Osagie Iyayi\", \"iyayiemmanuel1@gmail.com\", \"iyayiemmanuel1@gmail.com\")\n```\n\n#### Parameters supported\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```name```        | ```string```                   | ```true```     | ```The name of user to be indexed```.\n| ```identifier```            | ```string```                   |  ```true```    | ```the identifier of the account(either email or username).```\n| ```email```        | ```string```                   | ```true```     | ```the email of the user```                                                                        |\n\n### Validating a HMAC signature\nThis method validates incoming an [hmac](https://www.okta.com/identity-101/hmac/) signature with the payload and credentials that was passed with it\n\n**Pro Tip:** it is used to verify that an incoming webhook event/response is coming from thepeer's servers\n\n```python\ntest = thepeer_instance.validate_signature(data,signature)\n```\n#### Parameters supported\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```data```           | ```dictionary```                  |  ```true```    | ```the payload containing the data to be authenticated```\n|  ```signature```       | ```string```                   | ```true```     | ```The HMAC signature```                                                                        |\n\n### Get an indexed user\nThis method gets the information of an indexed user\n\n```python\ntest = thepeer_instance.view_user(\"3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd\")\n```\n\n#### Parameters supported\n\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```reference```            | ```string```                  |  ```true```    | ```the unique reference returned when the user was indexed```\n\n### Get all indexed users\nThis method returns all indexed users for a specific account\n\n```python\ntest = thepeer_instance.all_users(1,15)\n```\n\n#### Parameters supported\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```page```            | ```integer```               |  ```false```    | ```the first page displaying all the indexed users. defaults to 1```\n|  ```per_page```      | ```integer```                  | ```false```     | ```The number of users to display per page. defaults to 15          ```                                                          |\n\n\n### Update an indexed user\nThis method helps to update the details of an indexed user\n\n```python\ntest = thepeer_instance.update_user(reference,**data)\n```\n#### Parameters supported\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```reference```            | ```string```               |  ```true```    | ```the unique reference returned when the user was indexed```\n|  ```data```      | ```Any```                  | ```true```    | ```A keyword argument which contains on or more of the indexed user's email, name or identifier```                                                                   |\n\n### Sample\n```python\ntest = thepeer_instance.update_user(\"3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd\", identifier=\"dwave101@yahoo.com\",\n    name=\"Edmond Kirsch\",\n    email=\"dwave101@gmail.com\")\n```\n### Remove an indexed user\nThis method helps to remove the details of an indexed user from a specific account\n\n```python\ntest = thepeer_instance.delete_user(\"3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd\")\n```\n\n#### Parameters supported\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```reference```            | ```string```                  |  ```true```    | ```the unique reference returned when the user was indexed```\n\n\n\n\n ### Get Businesses\nThis method returns businesses based on the API they integrated.\n\n```python\ntest = thepeer_instance.get_businesses(\"checkout\")\n```\n\n#### Parameters supported\n\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```channel```            | ```string```                  |  ```true```    | ```The specific API to return businesses of. supported values are send, checkout, and direct_charge```\n\n\n### Generate a Checkout\nThis method allows you to generate a link for your customer to make a one-time payment with\n```python\ntest = thepeer_instance.generate_checkout({\n    \"amount\": 1000000,\n    \"currency\": \"NGN\",\n    \"redirect_url\": \"https://esportfolio.netlify.app\",\n    \"email\": \"jevede6918@muzitp.com\",\n    \"meta\":{\n        \"name\": \"Eddie Kirsch\",\n        \"identifier\": \"eddiekirsch\",\n    }\n})\n```\n\n#### Parameters required\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```redirect_url```        | ```string```                   | ```false```     | ```The url Thepeer should redirect to after the customer completes payment.```\n| ```amount```            | ```integer```               |  ```true```    | ```The amount you are debiting the customer. This should be in kobo. The minimum value is 10000```\n| ```email```        | ```string```                   | ```true```     | ```The customer’s email address```                                                                     |\n| ```currency```               | ```string```                    | ```true```    | ```The currency the transaction should be carried out in. The supported value is NGN.```\n| ```meta```               | ```dictionary```                    | ```false```    | ```An object containing additional attributes you will like to have in your transaction response.```\n\n\n### Get user links\n\nThis method returns all linked accounts of a user, the user’s account details, as well as the business the account is on.\n```python\ntest = thepeer_instance.get_user_links(\"3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd\")\n```\n#### Parameters required\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```reference```            | ```string```                  |  ```true```    | ```the unique reference returned when the user was indexed```\n\n\n### Get single link (linked account)\n\nThis method returns a user's linked account's details.\n\n```python\ntest = thepeer_instance.get_single_link(\"da14a90c-61c2-4cf7-a837-e3112a2d0c3d\")\n```\n\n#### Parameters required\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```link_id```           | ```string```                  |  ```true```    | ```The link’s identifier```\n\n\n### Charge a link\nThis method allows a business to charge a user via their linked account\n```python\ntest = thepeer_instance.charge_link(link_id, amount, remark, currency)\n```\n\n#### Parameters required\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```link_id```        | ```string```                   | ```true```     | ```The link’s identifier```\n| ```amount```            | ```integer```               |  ```true```    | ```the amount of the whole transaction```\n| ```remark```        | ```string```                   | ```true```     | ```short detail about the transaction```                                                                     |\n| ```currency```               | ```string```                    | ```false```    | ```The denomination medium of paying (either one of NGN and USD). defaults to NGN```\n\n### Authorize charge\nThis method allows a business to authorize a direct charge request made by a user\n\n```python\ntest = thepeer_instance.authorize_charge(charge_reference, event)\n```\n#### Parameters required\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```charge_reference```            | ```string```          |  ```true```   | ```the reference associated to a pending charge request```\n|  ```event```     | ```string```                | ```true```     | ```the type of webhook event```                                              |\n\n**Pro Tip:** the various types of webhook events are available [here](https://docs.thepeer.co/webhooks/overview)\n\n\n### Get transaction detail\nThis method gets the details of a transaction\n```python\ntest = thepeer_instance.get_transaction_detail(\"eda58ee3-4f2c-4aa4-9da7-10a2b8ced453\")\n```\n\n#### Parameters required\n\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```transaction_id```           | ```string```                  |  ```true```    | ```the unique transaction identifier```\n\n### Refund transaction\nThis method allows a business to refund a transaction back to the user for obvious reasons\n```python\ntest = thepeer_instance.refund_transaction(\"28e52edf-16d9-4921-8a54-ef34d7029707\", \"possible threat actor\"):\n```\n\n#### Parameters required\n| Parameters           | Data type                 | Required | Description                                                                                                                                                                                                                                         |\n|----------------------|---------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```transaction_id```            | ```string```          |  ```true```   | ```the unique transaction identifier```\n|  ```reason```     | ```string```                | ```false```    | ```a short sentence explaining reasons for the refund```                                              |\n\n\n\n \u003c!-- ## License\nThis project is MIT Licensed (MIT). Please see the [License File](https://github.com/thepeerstack/python-sdk/blob/main/LICENSE) for more information. --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepeerstack%2Fpython-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepeerstack%2Fpython-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepeerstack%2Fpython-sdk/lists"}