Skip to main content

BTCPay Python SDK using the Greenfield API

Project description

BTCPay Python SDK

BTCPay had a Python SDK, but it was using the old legacy API, meaning the way to connect was outdated as well as the API responses it was giving. This library uses the Greenfield API and will follow the documentation provided by the BTCPay Server team.

As of right now, this is a work in progress and will be updated to add more API calls

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, run the command:

pip install btcpay-python-sdk

Install from source with:

python setup.py install

Dependencies

  • Python 2.7+
  • Requests
  • Setuptools

Usage

The library needs to be configured with your stores api key, store id, and host url.

To generate an API key, you need to log in to your BTCPay instance, click "Account" in the lower left corner, click "Manage Account", click the "API Keys" tab, and then generate your key.

import btcpay

btcpay.api_key = 'API_KEY_HERE'  # should use an env variable
btcpay.host_url = 'HOST_URL'
btcpay.store_id = 'STORE_ID'

# get all invoices
invoices = btcpay.Invoices.get_invoices()
print(invoices)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

btcpay-python-sdk-0.0.1.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

btcpay_python_sdk-0.0.1-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page