Documentation
¶
Overview ¶
Package lnbot is the official Go SDK for ln.bot — Bitcoin for AI Agents.
Send and receive sats over the Lightning Network. Create wallets, generate invoices, make payments, and stream real-time settlement events via SSE.
Zero dependencies beyond the standard library. Every method takes a context.Context as its first argument.
client := lnbot.New("key_...")
invoice, _ := client.Invoices.Create(ctx, &lnbot.CreateInvoiceParams{
Amount: 1000,
Memo: lnbot.Ptr("Coffee"),
})
Get your API key at https://ln.bot
Also available as a TypeScript SDK (https://www.npmjs.com/package/@lnbot/sdk), Python SDK (https://pypi.org/project/lnbot/), and Rust SDK (https://crates.io/crates/lnbot).
Index ¶
- Constants
- func Ptr[T any](v T) *T
- type APIError
- type Address
- type AddressInvoice
- type AddressTransfer
- type AddressesService
- func (s *AddressesService) Create(ctx context.Context, params *CreateAddressParams) (*Address, error)
- func (s *AddressesService) Delete(ctx context.Context, address string) error
- func (s *AddressesService) List(ctx context.Context) ([]Address, error)
- func (s *AddressesService) Transfer(ctx context.Context, address string, params *TransferAddressParams) (*AddressTransfer, error)
- type BackupService
- type BadRequestError
- type Client
- type ConflictError
- type CreateAddressParams
- type CreateInvoiceForAddressParams
- type CreateInvoiceForWalletParams
- type CreateInvoiceParams
- type CreateL402ChallengeParams
- type CreatePaymentParams
- type CreateWalletParams
- type CreateWebhookParams
- type EventsService
- type ForbiddenError
- type Invoice
- type InvoiceEvent
- type InvoicesService
- func (s *InvoicesService) Create(ctx context.Context, params *CreateInvoiceParams) (*Invoice, error)
- func (s *InvoicesService) CreateForAddress(ctx context.Context, params *CreateInvoiceForAddressParams) (*AddressInvoice, error)
- func (s *InvoicesService) CreateForWallet(ctx context.Context, params *CreateInvoiceForWalletParams) (*AddressInvoice, error)
- func (s *InvoicesService) Get(ctx context.Context, number int) (*Invoice, error)
- func (s *InvoicesService) GetByHash(ctx context.Context, paymentHash string) (*Invoice, error)
- func (s *InvoicesService) List(ctx context.Context, params *ListInvoicesParams) ([]Invoice, error)
- func (s *InvoicesService) Watch(ctx context.Context, number int, timeout *int) (<-chan InvoiceEvent, <-chan error)
- func (s *InvoicesService) WatchByHash(ctx context.Context, paymentHash string, timeout *int) (<-chan InvoiceEvent, <-chan error)
- type KeysService
- type L402Challenge
- type L402PayResponse
- type L402Service
- func (s *L402Service) CreateChallenge(ctx context.Context, params *CreateL402ChallengeParams) (*L402Challenge, error)
- func (s *L402Service) Pay(ctx context.Context, params *PayL402Params) (*L402PayResponse, error)
- func (s *L402Service) Verify(ctx context.Context, params *VerifyL402Params) (*VerifyL402Response, error)
- type ListInvoicesParams
- type ListPaymentsParams
- type ListTransactionsParams
- type NotFoundError
- type Option
- type PasskeyAssertionParams
- type PasskeyAttestationParams
- type PasskeyAuthenticationChallenge
- type PasskeyRegistrationChallenge
- type PayL402Params
- type Payment
- type PaymentEvent
- type PaymentsService
- func (s *PaymentsService) Create(ctx context.Context, params *CreatePaymentParams) (*Payment, error)
- func (s *PaymentsService) Get(ctx context.Context, number int) (*Payment, error)
- func (s *PaymentsService) GetByHash(ctx context.Context, paymentHash string) (*Payment, error)
- func (s *PaymentsService) List(ctx context.Context, params *ListPaymentsParams) ([]Payment, error)
- func (s *PaymentsService) Watch(ctx context.Context, number int, timeout *int) (<-chan PaymentEvent, <-chan error)
- func (s *PaymentsService) WatchByHash(ctx context.Context, paymentHash string, timeout *int) (<-chan PaymentEvent, <-chan error)
- type RecoveryPassphrase
- type RecoveryRestoreParams
- type RestoreService
- func (s *RestoreService) PasskeyBegin(ctx context.Context) (*PasskeyAuthenticationChallenge, error)
- func (s *RestoreService) PasskeyComplete(ctx context.Context, params *PasskeyAssertionParams) (*RestoredWallet, error)
- func (s *RestoreService) Recovery(ctx context.Context, params *RecoveryRestoreParams) (*RestoredWallet, error)
- type RestoredWallet
- type RotatedAPIKey
- type Transaction
- type TransactionsService
- type TransferAddressParams
- type UnauthorizedError
- type UpdateWalletParams
- type VerifyL402Params
- type VerifyL402Response
- type Wallet
- type WalletCredentials
- type WalletEvent
- type WalletsService
- type Webhook
- type WebhookWithSecret
- type WebhooksService
Constants ¶
const (
// Version is the SDK version sent in the User-Agent header.
Version = "0.5.0"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct {
Address string `json:"address"`
Generated bool `json:"generated"`
Cost int64 `json:"cost"`
CreatedAt *time.Time `json:"createdAt"`
}
Address represents a Lightning address.
type AddressInvoice ¶ added in v0.3.0
type AddressInvoice struct {
Bolt11 string `json:"bolt11"`
Amount int64 `json:"amount"`
ExpiresAt *time.Time `json:"expiresAt"`
}
AddressInvoice is an invoice created via wallet ID or Lightning address.
type AddressTransfer ¶
type AddressTransfer struct {
Address string `json:"address"`
TransferredTo string `json:"transferredTo"`
}
AddressTransfer is returned after transferring an address.
type AddressesService ¶
type AddressesService struct {
// contains filtered or unexported fields
}
AddressesService handles Lightning address operations.
func (*AddressesService) Create ¶
func (s *AddressesService) Create(ctx context.Context, params *CreateAddressParams) (*Address, error)
Create creates a new Lightning address for the current wallet.
func (*AddressesService) Delete ¶
func (s *AddressesService) Delete(ctx context.Context, address string) error
Delete removes a Lightning address.
func (*AddressesService) List ¶
func (s *AddressesService) List(ctx context.Context) ([]Address, error)
List returns all Lightning addresses for the current wallet.
func (*AddressesService) Transfer ¶
func (s *AddressesService) Transfer(ctx context.Context, address string, params *TransferAddressParams) (*AddressTransfer, error)
Transfer moves a Lightning address to another wallet.
type BackupService ¶
type BackupService struct {
// contains filtered or unexported fields
}
BackupService handles wallet backup operations.
func (*BackupService) PasskeyBegin ¶
func (s *BackupService) PasskeyBegin(ctx context.Context) (*PasskeyRegistrationChallenge, error)
PasskeyBegin starts the passkey registration flow for wallet backup.
func (*BackupService) PasskeyComplete ¶
func (s *BackupService) PasskeyComplete(ctx context.Context, params *PasskeyAttestationParams) error
PasskeyComplete finishes the passkey registration flow by verifying the attestation.
func (*BackupService) Recovery ¶
func (s *BackupService) Recovery(ctx context.Context) (*RecoveryPassphrase, error)
Recovery generates a recovery passphrase for the current wallet.
type BadRequestError ¶
type BadRequestError struct{ *APIError }
BadRequestError is returned for 400 responses.
func (*BadRequestError) Unwrap ¶
func (e *BadRequestError) Unwrap() error
type Client ¶
type Client struct {
Wallets *WalletsService
Keys *KeysService
Invoices *InvoicesService
Payments *PaymentsService
Addresses *AddressesService
Transactions *TransactionsService
Webhooks *WebhooksService
Events *EventsService
Backup *BackupService
Restore *RestoreService
L402 *L402Service
// contains filtered or unexported fields
}
Client is the LnBot API client.
type ConflictError ¶
type ConflictError struct{ *APIError }
ConflictError is returned for 409 responses.
func (*ConflictError) Unwrap ¶
func (e *ConflictError) Unwrap() error
type CreateAddressParams ¶
type CreateAddressParams struct {
Address *string `json:"address,omitempty"`
}
CreateAddressParams are the parameters for creating a Lightning address.
type CreateInvoiceForAddressParams ¶ added in v0.3.0
type CreateInvoiceForAddressParams struct {
Address string `json:"address"`
Amount int64 `json:"amount"`
Tag *string `json:"tag,omitempty"`
Comment *string `json:"comment,omitempty"`
}
CreateInvoiceForAddressParams are the parameters for creating an invoice for a Lightning address. No authentication required. Rate limited by IP.
type CreateInvoiceForWalletParams ¶ added in v0.3.0
type CreateInvoiceForWalletParams struct {
WalletID string `json:"walletId"`
Amount int64 `json:"amount"`
Reference *string `json:"reference,omitempty"`
Comment *string `json:"comment,omitempty"`
}
CreateInvoiceForWalletParams are the parameters for creating an invoice for a specific wallet. No authentication required. Rate limited by IP.
type CreateInvoiceParams ¶
type CreateInvoiceParams struct {
Amount int64 `json:"amount"`
Reference *string `json:"reference,omitempty"`
Memo *string `json:"memo,omitempty"`
}
CreateInvoiceParams are the parameters for creating a new invoice.
type CreateL402ChallengeParams ¶ added in v0.5.0
type CreateL402ChallengeParams struct {
Amount int64 `json:"amount"`
Description *string `json:"description,omitempty"`
ExpirySeconds *int `json:"expirySeconds,omitempty"`
Caveats []string `json:"caveats,omitempty"`
}
CreateL402ChallengeParams are the parameters for creating an L402 challenge.
type CreatePaymentParams ¶
type CreatePaymentParams struct {
Target string `json:"target"`
Amount *int64 `json:"amount,omitempty"`
IdempotencyKey *string `json:"idempotencyKey,omitempty"`
MaxFee *int64 `json:"maxFee,omitempty"`
Reference *string `json:"reference,omitempty"`
}
CreatePaymentParams are the parameters for creating a new payment. Target accepts a Lightning address (user@domain), LNURL, or BOLT11 invoice.
type CreateWalletParams ¶
type CreateWalletParams struct {
Name *string `json:"name,omitempty"`
}
CreateWalletParams are the parameters for creating a new wallet.
type CreateWebhookParams ¶
type CreateWebhookParams struct {
URL string `json:"url"`
}
CreateWebhookParams are the parameters for creating a webhook.
type EventsService ¶ added in v0.4.0
type EventsService struct {
// contains filtered or unexported fields
}
EventsService handles the wallet event stream.
func (*EventsService) Stream ¶ added in v0.4.0
func (s *EventsService) Stream(ctx context.Context) (<-chan WalletEvent, <-chan error)
Stream opens an SSE stream of all wallet events. Events include invoice.created, invoice.settled, payment.created, payment.settled, and payment.failed. The channel is closed when the stream ends. Cancel the context to abort.
type ForbiddenError ¶
type ForbiddenError struct{ *APIError }
ForbiddenError is returned for 403 responses.
func (*ForbiddenError) Unwrap ¶
func (e *ForbiddenError) Unwrap() error
type Invoice ¶
type Invoice struct {
Number int `json:"number"`
Status string `json:"status"`
Amount int64 `json:"amount"`
Bolt11 string `json:"bolt11"`
Reference *string `json:"reference"`
Memo *string `json:"memo"`
Preimage *string `json:"preimage"`
TxNumber *int `json:"txNumber"`
CreatedAt *time.Time `json:"createdAt"`
SettledAt *time.Time `json:"settledAt"`
ExpiresAt *time.Time `json:"expiresAt"`
}
Invoice represents a Lightning invoice.
type InvoiceEvent ¶
InvoiceEvent represents a server-sent event for an invoice.
type InvoicesService ¶
type InvoicesService struct {
// contains filtered or unexported fields
}
InvoicesService handles Lightning invoice operations.
func (*InvoicesService) Create ¶
func (s *InvoicesService) Create(ctx context.Context, params *CreateInvoiceParams) (*Invoice, error)
Create creates a new Lightning invoice.
func (*InvoicesService) CreateForAddress ¶ added in v0.3.0
func (s *InvoicesService) CreateForAddress(ctx context.Context, params *CreateInvoiceForAddressParams) (*AddressInvoice, error)
CreateForAddress creates an invoice for the wallet owning the given Lightning address. No authentication required. Rate limited by IP.
func (*InvoicesService) CreateForWallet ¶ added in v0.3.0
func (s *InvoicesService) CreateForWallet(ctx context.Context, params *CreateInvoiceForWalletParams) (*AddressInvoice, error)
CreateForWallet creates an invoice for a specific wallet by its ID (wal_xxx). No authentication required. Rate limited by IP.
func (*InvoicesService) GetByHash ¶ added in v0.5.0
GetByHash returns a single invoice by its payment hash.
func (*InvoicesService) List ¶
func (s *InvoicesService) List(ctx context.Context, params *ListInvoicesParams) ([]Invoice, error)
List returns invoices for the current wallet.
func (*InvoicesService) Watch ¶
func (s *InvoicesService) Watch(ctx context.Context, number int, timeout *int) (<-chan InvoiceEvent, <-chan error)
Watch opens an SSE stream and sends events to the returned channel. The channel is closed when the stream ends. Cancel the context to abort.
func (*InvoicesService) WatchByHash ¶ added in v0.5.0
func (s *InvoicesService) WatchByHash(ctx context.Context, paymentHash string, timeout *int) (<-chan InvoiceEvent, <-chan error)
WatchByHash opens an SSE stream for an invoice identified by payment hash. The channel is closed when the stream ends. Cancel the context to abort.
type KeysService ¶
type KeysService struct {
// contains filtered or unexported fields
}
KeysService handles API key operations.
func (*KeysService) Rotate ¶
func (s *KeysService) Rotate(ctx context.Context, slot int) (*RotatedAPIKey, error)
Rotate rotates the API key at the given slot (0 = primary, 1 = secondary).
type L402Challenge ¶ added in v0.5.0
type L402Challenge struct {
Macaroon string `json:"macaroon"`
Invoice string `json:"invoice"`
PaymentHash string `json:"paymentHash"`
ExpiresAt time.Time `json:"expiresAt"`
WwwAuthenticate string `json:"wwwAuthenticate"`
}
L402Challenge is returned when an L402 challenge is created.
type L402PayResponse ¶ added in v0.5.0
type L402PayResponse struct {
Authorization *string `json:"authorization"`
PaymentHash string `json:"paymentHash"`
Preimage *string `json:"preimage"`
Amount int64 `json:"amount"`
Fee *int64 `json:"fee"`
PaymentNumber int `json:"paymentNumber"`
Status string `json:"status"`
}
L402PayResponse is returned after paying an L402 challenge.
type L402Service ¶ added in v0.5.0
type L402Service struct {
// contains filtered or unexported fields
}
L402Service handles L402 paywall authentication operations.
func (*L402Service) CreateChallenge ¶ added in v0.5.0
func (s *L402Service) CreateChallenge(ctx context.Context, params *CreateL402ChallengeParams) (*L402Challenge, error)
CreateChallenge creates an L402 challenge (invoice + macaroon) for paywall authentication.
func (*L402Service) Pay ¶ added in v0.5.0
func (s *L402Service) Pay(ctx context.Context, params *PayL402Params) (*L402PayResponse, error)
Pay pays an L402 challenge and returns a ready-to-use Authorization header.
func (*L402Service) Verify ¶ added in v0.5.0
func (s *L402Service) Verify(ctx context.Context, params *VerifyL402Params) (*VerifyL402Response, error)
Verify verifies an L402 authorization token. Stateless — checks signature, preimage, and caveats.
type ListInvoicesParams ¶
ListInvoicesParams are the pagination parameters for listing invoices.
type ListPaymentsParams ¶
ListPaymentsParams are the pagination parameters for listing payments.
type ListTransactionsParams ¶
ListTransactionsParams are the pagination parameters for listing transactions.
type NotFoundError ¶
type NotFoundError struct{ *APIError }
NotFoundError is returned for 404 responses.
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
type Option ¶
type Option func(*Client)
Option configures the Client.
func WithHTTPClient ¶
WithHTTPClient sets a custom *http.Client.
type PasskeyAssertionParams ¶
type PasskeyAssertionParams struct {
SessionID string `json:"sessionId"`
Assertion map[string]any `json:"assertion"`
}
PasskeyAssertionParams are the parameters for completing passkey restore.
type PasskeyAttestationParams ¶
type PasskeyAttestationParams struct {
SessionID string `json:"sessionId"`
Attestation map[string]any `json:"attestation"`
}
PasskeyAttestationParams are the parameters for completing passkey backup.
type PasskeyAuthenticationChallenge ¶
type PasskeyAuthenticationChallenge struct {
SessionID string `json:"sessionId"`
Options map[string]any `json:"options"`
}
PasskeyAuthenticationChallenge is returned when beginning passkey restore.
type PasskeyRegistrationChallenge ¶
type PasskeyRegistrationChallenge struct {
SessionID string `json:"sessionId"`
Options map[string]any `json:"options"`
}
PasskeyRegistrationChallenge is returned when beginning passkey backup.
type PayL402Params ¶ added in v0.5.0
type PayL402Params struct {
WwwAuthenticate string `json:"wwwAuthenticate"`
MaxFee *int64 `json:"maxFee,omitempty"`
Reference *string `json:"reference,omitempty"`
Wait *bool `json:"wait,omitempty"`
Timeout *int `json:"timeout,omitempty"`
}
PayL402Params are the parameters for paying an L402 challenge.
type Payment ¶
type Payment struct {
Number int `json:"number"`
Status string `json:"status"`
Amount int64 `json:"amount"`
MaxFee int64 `json:"maxFee"`
ServiceFee int64 `json:"serviceFee"`
ActualFee *int64 `json:"actualFee"`
Address string `json:"address"`
Reference *string `json:"reference"`
Preimage *string `json:"preimage"`
TxNumber *int `json:"txNumber"`
FailureReason *string `json:"failureReason"`
CreatedAt *time.Time `json:"createdAt"`
SettledAt *time.Time `json:"settledAt"`
}
Payment represents a Lightning payment.
type PaymentEvent ¶ added in v0.3.0
PaymentEvent represents a server-sent event for a payment.
type PaymentsService ¶
type PaymentsService struct {
// contains filtered or unexported fields
}
PaymentsService handles Lightning payment operations.
func (*PaymentsService) Create ¶
func (s *PaymentsService) Create(ctx context.Context, params *CreatePaymentParams) (*Payment, error)
Create sends a new Lightning payment. The target can be a Lightning address (user@domain), LNURL, or BOLT11 invoice.
func (*PaymentsService) GetByHash ¶ added in v0.5.0
GetByHash returns a single payment by its payment hash.
func (*PaymentsService) List ¶
func (s *PaymentsService) List(ctx context.Context, params *ListPaymentsParams) ([]Payment, error)
List returns payments for the current wallet.
func (*PaymentsService) Watch ¶ added in v0.3.0
func (s *PaymentsService) Watch(ctx context.Context, number int, timeout *int) (<-chan PaymentEvent, <-chan error)
Watch opens an SSE stream and sends events to the returned channel. The channel is closed when the stream ends. Cancel the context to abort.
func (*PaymentsService) WatchByHash ¶ added in v0.5.0
func (s *PaymentsService) WatchByHash(ctx context.Context, paymentHash string, timeout *int) (<-chan PaymentEvent, <-chan error)
WatchByHash opens an SSE stream for a payment identified by payment hash. The channel is closed when the stream ends. Cancel the context to abort.
type RecoveryPassphrase ¶
type RecoveryPassphrase struct {
Passphrase string `json:"passphrase"`
}
RecoveryPassphrase is returned when backup via recovery passphrase is initiated.
type RecoveryRestoreParams ¶
type RecoveryRestoreParams struct {
Passphrase string `json:"passphrase"`
}
RecoveryRestoreParams are the parameters for restoring via recovery passphrase.
type RestoreService ¶
type RestoreService struct {
// contains filtered or unexported fields
}
RestoreService handles wallet restore operations.
func (*RestoreService) PasskeyBegin ¶
func (s *RestoreService) PasskeyBegin(ctx context.Context) (*PasskeyAuthenticationChallenge, error)
PasskeyBegin starts the passkey authentication flow for wallet restore.
func (*RestoreService) PasskeyComplete ¶
func (s *RestoreService) PasskeyComplete(ctx context.Context, params *PasskeyAssertionParams) (*RestoredWallet, error)
PasskeyComplete finishes the passkey authentication flow and restores the wallet.
func (*RestoreService) Recovery ¶
func (s *RestoreService) Recovery(ctx context.Context, params *RecoveryRestoreParams) (*RestoredWallet, error)
Recovery restores a wallet using a recovery passphrase. Does not require authentication.
type RestoredWallet ¶
type RestoredWallet struct {
WalletID string `json:"walletId"`
Name string `json:"name"`
PrimaryKey string `json:"primaryKey"`
SecondaryKey string `json:"secondaryKey"`
}
RestoredWallet is returned after a successful wallet restore.
type RotatedAPIKey ¶
RotatedAPIKey is returned after rotating an API key.
type Transaction ¶
type Transaction struct {
Number int `json:"number"`
Type string `json:"type"`
Amount int64 `json:"amount"`
BalanceAfter int64 `json:"balanceAfter"`
NetworkFee int64 `json:"networkFee"`
ServiceFee int64 `json:"serviceFee"`
PaymentHash *string `json:"paymentHash"`
Preimage *string `json:"preimage"`
Reference *string `json:"reference"`
Note *string `json:"note"`
CreatedAt *time.Time `json:"createdAt"`
}
Transaction represents a wallet transaction.
type TransactionsService ¶
type TransactionsService struct {
// contains filtered or unexported fields
}
TransactionsService handles wallet transaction operations.
func (*TransactionsService) List ¶
func (s *TransactionsService) List(ctx context.Context, params *ListTransactionsParams) ([]Transaction, error)
List returns transactions for the current wallet.
type TransferAddressParams ¶
type TransferAddressParams struct {
TargetWalletKey string `json:"targetWalletKey"`
}
TransferAddressParams are the parameters for transferring an address.
type UnauthorizedError ¶
UnauthorizedError is returned for 401 responses.
func (*UnauthorizedError) Unwrap ¶
func (e *UnauthorizedError) Unwrap() error
type UpdateWalletParams ¶
type UpdateWalletParams struct {
Name string `json:"name"`
}
UpdateWalletParams are the parameters for updating a wallet.
type VerifyL402Params ¶ added in v0.5.0
type VerifyL402Params struct {
Authorization string `json:"authorization"`
}
VerifyL402Params are the parameters for verifying an L402 token.
type VerifyL402Response ¶ added in v0.5.0
type VerifyL402Response struct {
Valid bool `json:"valid"`
PaymentHash *string `json:"paymentHash"`
Caveats []string `json:"caveats"`
Error *string `json:"error"`
}
VerifyL402Response is returned when verifying an L402 token.
type Wallet ¶
type Wallet struct {
WalletID string `json:"walletId"`
Name string `json:"name"`
Balance int64 `json:"balance"`
OnHold int64 `json:"onHold"`
Available int64 `json:"available"`
}
Wallet represents a LnBot wallet.
type WalletCredentials ¶
type WalletCredentials struct {
WalletID string `json:"walletId"`
PrimaryKey string `json:"primaryKey"`
SecondaryKey string `json:"secondaryKey"`
Name string `json:"name"`
Address string `json:"address"`
RecoveryPassphrase string `json:"recoveryPassphrase"`
}
WalletCredentials is returned when a new wallet is created. It contains the API keys and recovery passphrase.
type WalletEvent ¶ added in v0.4.0
type WalletEvent struct {
Event string `json:"event"`
CreatedAt string `json:"createdAt"`
Data json.RawMessage `json:"data"`
}
WalletEvent represents a real-time event from the wallet event stream.
type WalletsService ¶
type WalletsService struct {
// contains filtered or unexported fields
}
WalletsService handles wallet operations.
func (*WalletsService) Create ¶
func (s *WalletsService) Create(ctx context.Context, params *CreateWalletParams) (*WalletCredentials, error)
Create creates a new wallet. Does not require authentication.
func (*WalletsService) Current ¶
func (s *WalletsService) Current(ctx context.Context) (*Wallet, error)
Current returns the wallet associated with the current API key.
func (*WalletsService) Update ¶
func (s *WalletsService) Update(ctx context.Context, params *UpdateWalletParams) (*Wallet, error)
Update modifies the current wallet's settings.
type Webhook ¶
type Webhook struct {
ID string `json:"id"`
URL string `json:"url"`
Active bool `json:"active"`
CreatedAt *time.Time `json:"createdAt"`
}
Webhook represents a webhook endpoint.
type WebhookWithSecret ¶
type WebhookWithSecret struct {
ID string `json:"id"`
URL string `json:"url"`
Secret string `json:"secret"`
CreatedAt *time.Time `json:"createdAt"`
}
WebhookWithSecret is returned when a webhook is created. It includes the secret used for signature verification.
type WebhooksService ¶
type WebhooksService struct {
// contains filtered or unexported fields
}
WebhooksService handles webhook operations.
func (*WebhooksService) Create ¶
func (s *WebhooksService) Create(ctx context.Context, params *CreateWebhookParams) (*WebhookWithSecret, error)
Create registers a new webhook endpoint.