Skip to main content

Easily Integrate
BTCPay Server's API using Konfig's TypeScript SDK

Need a TypeScript SDK for BTCPay Server's API?

Growing API Companies trust Konfig's SDKs to onboard developers to their API.

SnapTradeHumanloopSplititLeapGroundx

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.webhooks.canmodifywebhooks`: Modify stores webhooks
* * `btcpay.store.canviewstoresettings`: View your stores
* * `btcpay.store.canviewreports`: View your reports
* * `btcpay.store.cancreateinvoice`: Create an invoice
* * `btcpay.store.canviewinvoices`: View invoices
* * `btcpay.store.canmodifyinvoices`: Modify invoices
* * `btcpay.store.canmodifypaymentrequests`: Modify your payment requests
* * `btcpay.store.canviewpaymentrequests`: View your payment requests
* * `btcpay.store.canviewpullpayments`: View your pull payments
* * `btcpay.store.canmanagepullpayments`: Manage your pull payments
* * `btcpay.store.canarchivepullpayments`: Archive your pull payments
* * `btcpay.store.cancreatepullpayments`: Create pull payments
* * `btcpay.store.canmanagepayouts`: Manage payouts
* * `btcpay.store.canviewpayouts`: View payouts
* * `btcpay.store.cancreatenonapprovedpullpayments`: Create non-approved pull payments
* * `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
username: "USERNAME",
password: "PASSWORD"
})

Then, send your first request

We made it really easy.

index.ts

// Revoke an API Key
const deleteApiKeyResponse = btcPayServer.apiKeys.deleteApiKey({
apikey: "APIKEY"
})

Enjoy a buttery smooth developer experience with 173 SDK methods

How Konfig Works

Konfig collects APIs and automatically generates SDKs so you can focus on building your application.

openapi-examples

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.

openapi-examples-to-konfig

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.

konfig-to-package-managers

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.

BTCPay Server

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.

Keywords

payments
cryptocurrency

Start integrating BTCPay Server's API with Konfig