Demo to preview the settings
Introduction
OpenNode plugin offers a powerful REST API that supports the bitcoin lightning network and standard on-chain operations, with associated actions and events, allowing you to receive and send micro-transactions instantly.
Prerequisites: You must have an OpenNode platform account to interact with the OpenNode plugin. Create your development account at: https://dev.opennode.com
Integration
To integrate the OpenNode plugin, you must get the API key from your account. Open the account control panel, go to the "Developer" tab, and select the "Integrations" section.
After that, you will see the API keys section with the keys (if any).
Note! You will not be able to get the keys again after creation! Make sure that after creating the key, you have saved it!
To create a new key, click on the +Add key section
Insert the key label and select the permissions for this key. We recommend that you use the "Withdrawals" type to get all features.
Invoice | Read | Withdrawals | |
Create charge & fetch charge info | ✅ | ✅ | ✅ |
Fetch charges & withdrawals info | ❌ | ✅ | ✅ |
Initiate withdrawals | ❌ | ❌ | ✅ |
The field with IP Whitelist is optional
Leave it empty if you do not want to restrict the IP address of the server
Use an authenticator application to generate a 2FA token. And click the "Generate" button. You will see the generated key for your application. Save it!
Use this key in the plugin settings.
Note! If you want to use both keys, the key for testing and the key for real transactions then:
1. Add the API Key that was generated in OpenNode Live Environment in the first field.
2. Add the API Key that was generated in OpenNode Dev Environment in the second field.
Now you can use all plugin options!
Plugin actions
- Validate Webhook - This action validates the notification received from OpenNode Webhooks.
Fields:
Title | Description | Type |
Hashed order | This is a hash code sent by OpenNode with a notification. See more here. | string |
Event id | This is the id of the notification. Every OpenNode Webhooks notification has a notification id. See more here. | string |
Returns:
Title | Description | Type |
is valid | The answer of notification validity. | yes/no |
API Calls
Plugin Data Calls
- Account Balance - Retrieves the current account balance.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
- List activity - Retrieves the list of activities.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
- Charge Info (data) - Retrieves the info about a charge.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
id | The ID of the charge. | string |
Returns:
Please check the OpenNode documentation.
- List of Paid Charges - Retrieves a list of paid charges.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
- Withdrawal Info - Retrieves the info about a withdrawal.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
id | The ID of the withdrawal. | string |
Returns:
Please check the OpenNode documentation.
- List of Withdrawals - Retrieves a list of withdrawals.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
- Refund Info - Retrieves the info about a refund.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
id | The ID of the refund. | string |
Returns:
Please check the OpenNode documentation.
- List of Refunds - Retrieves a list of refunds.
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
- Exchange Rates - Retrieves all exchange rates.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
- Supported Currencies - Retrieves a list of supported currencies.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
Returns:
Please check the OpenNode documentation.
Plugin Action Calls
- Create Charge - It is used to create a charge.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
description | Arbitrary description string that will be attached to the charge. | string |
amount | Amount intended to be collected. The default currency is in 'satoshis', specify 'currency' param for fiat amounts. | string |
currency | Three-letter ISO currency code, in uppercase. If specified will generate a charge for the equivalent amount of BTC at the current exchange rates. | string |
customer_email | Payers email for merchant's internal use. | string |
customer_name | Payers name for merchant's internal use. | string |
order_id | Order id for merchant's internal use. | string |
callback_url | Bubble API endpoint URL to receive webhooks for payment status updates. | string |
Returns:
Please check the OpenNode documentation.
- Charge Info (action) - Retrieves the info about a charge.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
id | The ID of the charge. | string |
Returns:
Please check the OpenNode documentation.
- Initiate Withdrawals - It is used to initiate a withdrawal.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
type | Determines the type of the withdrawal. Options: "chain" (on-chain), "ln" (Lightning Network), "wire" (bank transfer). | string |
amount | Amount intended to be withdrawn from the account. Required for type "chain" and "wire". Amount in satoshis when type is "chain" and "ln". Amount in user's fiat currency when type is "wire". | string |
address | Address that funds will be withdrawn to. Required for type "chain" and "ln" withdrawals. Type "chain": On-chain address, Type: "ln": Lightning Payment request. | string |
callback_url | Bubble API endpoint URL to receive webhooks for payment status updates. | string |
Returns:
Please check the OpenNode documentation.
- Create Refund - It is used to create a refund.
Fields:
Title | Description | Type |
env | This field specifies the OpenNode Environment. Use "dev-api" for the development environment and "api" for the live environment. | string |
checkout_id | Underpaid charge ID. | string |
address | Bitcoin address to send the funds. | string |
email | The buyer email to get notified of the refund. | string |
Returns:
Please check the OpenNode documentation.
Workflow example
Display the info on paid charges
- On the page, it is placed a Repeating Group element.
- For “Type of content” is selected “List of Paid Charges body data (OpenNode)”.
- For “Data source” is selected “OpenNode - List of Paid Charges’ body”.
- For the “env” field of the “OpenNode - List of Paid Charges” data call is a Dynamic value because it helps to use the “OpenNode Dev Key” when the Bubble app is in test mode, and the “OpenNode Live Key” when the Bubble app is in live mode.
The Bubble test mode is when your Bubble app URL contains “/version-test”.
The Bubble live mode is when your Bubble app URL doesn't contain “/version-test”.
- In the Repeating Group element, it is the Group element with “Current cell’s List of Paid Charges…”.
- This Group element has Text elements that contain “Paid Charge” information.
- The result on page:
Subscribe for OpenNode Webhooks notification.
- On the page, it is created a form for Withdrawal initiation.
- In the workflow, is created an event When the Button Initiate Withdrawal is clicked with the “Initiate Withdrawals” action. In action, it is used the values from the form for Withdrawal initiation.
The “callback_url” field is the Bubble API endpoint that is created in backend workflows.
Note! When the status of created withdrawal will be updated the notification will be sent to the indicated URL.
- In the backend workflows, it is created “webhook” API.
- The first action in “webhook” API endpoint is “Validate Webhook”.
- The following action is used with the condition, only when the Webhook is valid.