Easily Integrate BTCPay Server's API using Konfig's TypeScript SDK
Your TypeScript Application
+ Less code
+ Always up-to-date
Growing API Companies trust Konfig's SDKs to onboard developers to their API.
First, instantiate the SDK
It only takes a few lines of code.
index.ts
import { BtcPayServer } from 'btc-pay-server-typescript-sdk';
const btcPayServer = new BtcPayServer({
/*
* BTCPay Server supports authenticating and authorizing users through an API Key that is generated by them. Send the API Key as a header value to Authorization with the format: `token {token}`. For a smoother experience, you can generate a url that redirects users to an API key creation screen.
*
* The following permissions are available to the context of the user creating the API Key:
*
* * `unrestricted`: Unrestricted access
* * `btcpay.user.candeleteuser`: Delete user
* * `btcpay.user.canviewprofile`: View your profile
* * `btcpay.user.canmodifyprofile`: Manage your profile
* * `btcpay.user.canmanagenotificationsforuser`: Manage your notifications
* * `btcpay.user.canviewnotificationsforuser`: View your notifications
*
* The following permissions are available if the user is an administrator:
*
* * `btcpay.server.canviewusers`: View users
* * `btcpay.server.cancreateuser`: Create new users
* * `btcpay.server.canmanageusers`: Manage users
* * `btcpay.server.canmodifyserversettings`: Manage your server
* * `btcpay.server.canuseinternallightningnode`: Use the internal lightning node
* * `btcpay.server.canviewlightninginvoiceinternalnode`: View invoices from internal lightning node
* * `btcpay.server.cancreatelightninginvoiceinternalnode`: Create invoices with internal lightning node
*
* The following permissions applies to all stores of the user, you can limit to a specific store with the following format: `btcpay.store.cancreateinvoice:6HSHAEU4iYWtjxtyRs9KyPjM9GAQp8kw2T9VWbGG1FnZ`:
*
* * `btcpay.store.canmodifystoresettings`: Modify your stores
* * `btcpay.store.canviewcustodianaccounts`: View exchange accounts linked to your stores
* * `btcpay.store.canmanagecustodianaccounts`: Manage exchange accounts linked to your stores
* * `btcpay.store.candeposittocustodianaccount`: Deposit funds to exchange accounts linked to your stores
* * `btcpay.store.canwithdrawfromcustodianaccount`: Withdraw funds from exchange accounts to your store
* * `btcpay.store.cantradecustodianaccount`: Trade funds on your store's exchange accounts
* * `btcpay.store.canuselightningnode`: Use the lightning nodes associated with your stores
* * `btcpay.store.canviewlightninginvoice`: View the lightning invoices associated with your stores
* * `btcpay.store.cancreatelightninginvoice`: Create invoices from the lightning nodes associated with your stores
*
* Note that API Keys only limits permission of a user and can never expand it. If an API Key has the permission `btcpay.server.canmodifyserversettings` but that the user account creating this API Key is not administrator, the API Key will not be able to modify the server settings.
* Some permissions may include other permissions, see [this operation](https://docs.btcpayserver.org).
*
*/
apiKey: "AUTHORIZATION",
// BTCPay Server supports authenticating and authorizing users through the Basic HTTP authentication scheme. Send the user and password encoded in base64 with the format `Basic {base64(username:password)}`. Using this authentication method implicitly provides you with the `unrestricted` permission
Enjoy a buttery smooth developer experience with 173 SDK methods
Parameter
apikeystringrequired
The API Key to revoke
Response
200
The key has been deleted
404
The key is not found for this user
Endpoint
delete
/api/v1/api-keys/{apikey}
Parameter
apikeystringrequired
The API Key to revoke
idOrEmailstringrequired
The target user's id or email
Response
200
The key has been deleted
404
The key is not found for this user
Endpoint
delete
/api/v1/users/{idOrEmail}/api-keys/{apikey}
No Parameters
Response
200
401
Description of an error happening during processing of the request
Endpoint
delete
/api/v1/api-keys/current
No Parameters
Response
200
401
Description of an error happening during processing of the request
Endpoint
get
/api/v1/api-keys/current
Parameter
labelstring
permissionsarray
Response
200
401
Description of an error happening during processing of the request
default
Description of an error happening during processing of the request
Endpoint
post
/api/v1/api-keys
Parameter
idOrEmailstringrequired
The target user's id or email
labelstring
permissionsarray
Response
200
401
Description of an error happening during processing of the request
default
Description of an error happening during processing of the request
Endpoint
post
/api/v1/users/{idOrEmail}/api-keys
How Konfig Works
Konfig collects APIs and automatically generates SDKs so you can focus on building your application.
Konfig maintains the highest quality collection of OpenAPI Specifications on the internet in a GitHub repository
We pull OpenAPI Specifications from public sources, fix any errors, and make sure they pass our lint rules. We continually make sure the repository is up-to-date and collect up-time and response time metrics for every API.
Generates AI-Augmented SDKs from openapi-examples
Our SDK generator is trusted by growing API companies and goes through a rigorous testing process to ensure the generated SDKs are high-quality and easy to use.
Publishes to standard package managers
We publish to standard package managers like npm, PyPI, and Maven so you can easily integrate the SDK into your application.
About BTCPay Server
Start Accepting Bitcoin Payments With 0% Fees & No Third-party.
BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It's secure, private, censorship-resistant and free.
Essential Apps Built In
Features you use the most are baked right into every instance so you can hit the ground running. Create a Point-of-Sale app for your store, easily embed a tipping button on your website, send a payment link to a client across the globe, or launch a crowdfunding campaign to raise funds for your cause.
Great for Invoicing and Accounting
Generate and manage invoices with ease. Get notified when they get paid. Export your invoices in different format for smoother bookkeeping.
Native Wallet Management
Manage your incoming and outgoing funds with a built-in wallet that has hardware wallet support.
Self Host Or Use A Shared Server
Use a shared server if you're not tech savvy, or deploy your own instance on cloud servers or hardware devices. By sharing your server you can support friends or your local community.
Automation Via API
Manage your BTCPay Server (e.g. stores, invoices, users), automate your workflows and control access with our API.