ZBD Logo

Python package for ZBD API

import zebedee client = zebedee.Project(ZBD_API_KEY, CALLBACK_URL) ln_payment_response = client.send_payment_to_lightning_address( lightning_address="santos@zbd.gg", amount_msats=10000, comment="payment comment", internal_id="test:1") print(ln_payment_response)

Getting Started

The Python package for ZBD API is available under zebedee-py. When building tools with ZBD support we encourage you to include zbd in your setup.py or pyproject.toml files.

All you have to do to get started is add zebedee-py as a dependency to your Python-based project. You can do so using pip:

pip install zebedee

Now let's authenticate a specific Wallet with that ZBD Project's API Key.

Authentication

In order to authenticate your Project Wallet with the ZBD API, you will need to provide your ZBD Project's API Key to the zebedee-py package. You can find your Project API Key in the ZBD Developer Dashboard.

First you must import the zebedee-py package client into your codebase, and then instantiate it with your Project API Key (replace `YOUR_API_KEY_HERE` below with your actual ZBD Project's API Key).

import zebedee client = zebedee.Project("YOUR_API_KEY_HERE", "CALLBACK_URL") print(client.get_wallet_details())

You're all set. Now let's move some money at the speed of the internet! Check the SDK API Reference below for more information on how to use the zebedee-py package.

zebedee-py

The goal of the project is to create a beautiful and extensible experience for developers using ZBD APIs in a Python environment. The ZBD community has taken on the challenge and built the Python package themselves. The focus is to provide parity with ZBD REST API, as well as providing further stability for developers.

API Reference

Below is a comprehensive list of the methods and functions available in the zebedee-py package. These methods are ONLY available to the zebedee.Project client instance after it's been properly authenticated with a Project's API Key.

MethodEntityDescription
create_charge
Charge

Creates a new Charge / Payment Request in the Bitcoin Lightning Network, payable by any Bitcoin Lightning wallet.

Parameters:

amount_msats

required

The amount for the Charge -> in millisatoshis.
description

required

Note or comment for this Charge (visible to payer).
amount_of_seconds_to_expire_afterTime until charge expiration -> in seconds.
internal_idOpen metadata string property.


Resources:

View response payload examples
get_charge
Charge

Retrieves all information relating to a specific Charge / Payment Request.

Parameters:

charge_id: String

required

A String representing the ID of the Charge.


Resources:

View response payload examples
create_static_charge
Static Charge

Creates a new Static Charge / LNURL Pay in the Bitcoin Lightning Network, payable by any Bitcoin Lightning wallet.

Parameters:

min_amount_msats

required

The amount for the Charge -> in millisatoshis.
max_amount_msats

required

Note or comment for this Charge (visible to payer).
description

required

Note or comment for this Static Charge (visible to payer).
internal_idOpen metadata string property.
success_messageThe message shown to the user after they make a successful payment.
allowed_slotsSet the maximum number of payments. Use None for unlimited payments.


Resources:

View response payload examples
get_static_charge
Static Charge

Retrieves all information relating to a specific Static Charge / LNURL Pay.

Parameters:

static_charge_id: String

required

A String representing the ID of the Static Charge.


Resources:

View response payload examples
update_static_charge
Static Charge

Perform updates to any of the allowed properties of a Static Charge.

Parameters:

min_amount_msats

optional

The amount for the Charge -> in millisatoshis.
max_amount_msats

optional

Note or comment for this Charge (visible to payer).
description

optional

Note or comment for this Static Charge (visible to payer).
internal_id

optional

Open metadata string property.
success_message

optional

The message shown to the user after they make a successful payment.
allowed_slots

optional

Set the maximum number of payments. Use None for unlimited payments.


Resources:

View response payload examples
create_withdrawal_request
Withdrawal Request

A Withdrawal Request is a QR code that allows someone to scan and receive Bitcoin (e.g. Withdrawals).

Parameters:

amount_msats

required

The amount for the Withdrawal Request -> in millisatoshis.
amount_of_seconds_to_expire_afterTime until Withdrawal Request expires -> in seconds.
descriptionNote or comment for this Withdrawal Request (visible to payer).
internal_idOpen metadata string property.
callback_url

required

The endpoint ZBD will POST Withdrawal Request updates to.


Resources:

View response payload examples
get_withdrawal_request
Withdrawal Request

Retrieves details about a specific Withdrawal Request.

Parameters:

String: withdrawal_request_id

required

A String representing the ID of the Withdrawal Request.


Resources:

View response payload examples
send_payment_to_lightning_address
Lightning Address

Send Bitcoin payments directly to a Lightning Address. A Lightning Address is an internet identifier (akin to an email address -- andre@zbd.gg) that anyone can send Bitcoin Lightning Network payments to.

Parameters:

lightning_address

required

The Lightning Address of the intended recipient.
amount_msats

required

The amount for the Payment -> in millisatoshis.
commentNote or description of this Payment.


Resources:

View response payload examples
validate_lightning_address
Lightning Address

Not all internet identifiers are Lightning Addresses / compatible with the Lightning Address protocol. Use this endpoint in order to validate whether a user's entered Lightning Address is valid.

Parameters:

lightning_address: &LnAddress

required

The LnAddress reference containing the address to be validated.


Resources:

View response payload examples
fetch_charge_from_lightning_address
Lightning Address

Generates a Bitcoin Lightning Charge / Payment Request for a given Lightning Address destination. Depending on your system's configuration or your product's UX, you may need the ability to generate Charges for specific users using a different provider than ZBD.

Parameters:

lightning_address

required

The Lightning Address of the intended recipient.
amount_msats

required

The amount for the Charge -> in millisatoshis.
descriptionNote or comment of this Charge.


Resources:

View response payload examples
get_wallet_details
Wallet

Retrieves the total balance of a given Project Wallet.



Resources:

View response payload examples
transfer_zbd_funds
Wallet

Initiates a transfer of funds between two Project Wallets you own.

Parameters:

amount_msats

required

The amount to be transferred -> in millisatoshis.
receiver_wallet_id

required

The Wallet ID of the recipient Project.


Resources:

View response payload examples
send_keysend_payment
Keysend

This endpoint exposes the ability to make payment directly to a Lightning Network node Public Key, without the need for a Payment Request / Charge.

Parameters:

amount_msats

required

The amount for the Payment -> in millisatoshis.
public_key

required

The Public Key for the destination Lightning Node.
metadataTLV key value pairs / data records.


Resources:

View response payload examples
pay_invoice
Payment

Pays a Charge / Payment Request in the Bitcoin Lightning Network.

Parameters:

invoice

required

Lightning Network Payment Request/Charge.
descriptionNote or comment for this Payment.
internal_idOpen metadata string property.


Resources:

View response payload examples
get_payment_details
Payment

Retrieves all the information related to a specific Payment.

Parameters:

zbd_id: String

required

A String representing the ID of the Payment.


Resources:

View response payload examples
send_payment_to_gamertag
ZBD Gamertag

This API endpoint is used to send Bitcoin payments directly to a user's ZBD Gamertag.

Parameters:

amount_msats

required

The amount for the Payment -> in millisatoshis.
gamertag

required

Desination ZBD gamertag.
descriptionNote or comment for this Payment (visible to recipient).


Resources:

View response payload examples
get_gamertag_transaction_details
ZBD Gamertag

Get a given ZBD Gamertag when provided with a ZBD User's ID.

Parameters:

transaction_id: String

required

A String representing the ZBD Gamertag Payment Transaction ID.


Resources:

View response payload examples
get_user_id_from_gamertag
ZBD Gamertag

Get a given ZBD User's ID when provided with a ZBD Gamertag.

Parameters:

gamertag: String

required

A String representing the ZBD Gamertag of the ZBD user.


Resources:

View response payload examples
get_gamertag_from_user_id
ZBD Gamertag

Invoked when the app first loads. If a plugin reloads, it's invoked again with the existing app.

Parameters:

user_id: String

required

A String representing the specified ZBD User ID.


Resources:

View response payload examples
is_supported_region
Utility

If you wish to know whether the incoming user request is coming from a region/country where ZBD is supported or not, you can use this simple API endpoint and pass the target IP address as a parameter.

Parameters:

ip: String

required

A String representing the IP Address being checked.


Resources:

View response payload examples
get_zbd_prod_server_ip
Utility

The ZBD API relies on callback URLs for keeping you informed about updates that occur to any Charges, Payments, or Withdrawals you've created. In order to ensure that any incoming callback message is indeed from a trusted ZBD API infrastructure server, we provide this API endpoint for you to know which IP addresses real requests come from.



Resources:

View response payload examples
btc_usd_price
Utility

Get the latest price for Bitcoin in US Dollars. The exchange rate feed is refreshed every 5 seconds and is based upon a combination of industry-leading partner exchange providers's price feeds.



Resources:

View response payload examples
convert_msats_to_sats
Utility

Get the sats value from msats.

Parameters:

amount_msats: String

required

A String representing the sats amount being converted.
convert_sats_to_msats
Utility

Get the msats value from sats.

Parameters:

amount_sats: String

required

A String representing the sats amount being converted.

Community Support

Feature Request? Bugfix? Recommendations? We're all ears! Head on over to the zebedee-py Issues page and submit one. We also welcome Pull Requests and other contributions to the library.