nowpesa

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 19 Imported by: 0

README

nowpesa — official Go SDK for the NowPesa payments API

Take payments across M-Pesa, card, mobile money and bank transfer from a single integration. This package is the official, fully-typed Go client for the NowPesa REST API.

go get github.com/NowPesa/go-sdk

Requires Go 1.22+. Zero runtime dependencies — everything is from the standard library.

Quick start

package main

import (
    "context"
    "fmt"
    "log"
    "os"

    nowpesa "github.com/NowPesa/go-sdk"
)

func main() {
    client := nowpesa.NewClient(
        os.Getenv("NOWPESA_KEY_ID"),
        os.Getenv("NOWPESA_KEY_SECRET"),
    )

    payment, err := client.Payments.Create(context.Background(), &nowpesa.CreatePaymentParams{
        Reference:  "order-1234",
        Amount:     10000, // minor units — 100.00 KES
        Currency:   "KES",
        Channel:    nowpesa.ChannelMpesaSTKPush,
        PayerPhone: "+254712345678",
    })
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(payment.ID, payment.Status)
}

Authentication

NowPesa uses HTTP Basic auth with an API key id + secret pair. Get keys from the dashboard, or bootstrap them programmatically:

bootstrap := nowpesa.NewClient("_", "_")
auth, err := bootstrap.Auth.Register(ctx, &nowpesa.RegisterParams{
    Email:        "founder@acme.example",
    Password:     "...",
    MerchantName: "Acme",
    Country:      "KE",
})
if err != nil { log.Fatal(err) }

client := nowpesa.NewClient(auth.APIKeyID, auth.APIKeySecret)

Payments

// M-Pesa STK Push — async; completes via webhook + status update.
stk, err := client.Payments.Create(ctx, &nowpesa.CreatePaymentParams{
    Reference:  "order-1",
    Amount:     1500,
    Currency:   "KES",
    Channel:    nowpesa.ChannelMpesaSTKPush,
    PayerPhone: "+254712345678",
})

// Card — synchronous; resolves before returning.
card, err := client.Payments.Create(ctx, &nowpesa.CreatePaymentParams{
    Reference: "order-2",
    Amount:    2500,
    Currency:  "USD",
    Channel:   nowpesa.ChannelCard,
    CardToken: "tok_visa_test",
})

// Get one.
fetched, err := client.Payments.Get(ctx, stk.ID)

// List with filters + cursor pagination.
page, err := client.Payments.List(ctx, &nowpesa.ListPaymentsParams{
    Status: nowpesa.PaymentSucceeded,
    Limit:  50,
})
if page.NextBefore != "" {
    next, _ := client.Payments.List(ctx, &nowpesa.ListPaymentsParams{
        Status: nowpesa.PaymentSucceeded,
        Limit:  50,
        Before: page.NextBefore,
    })
    _ = next
}

// Refund (full or partial; pass nil for a full refund of the remainder).
refund, err := client.Payments.Refund(ctx, card.ID, &nowpesa.RefundParams{Amount: 2500})
Idempotency

Mutating requests (POST/PUT/PATCH/DELETE) auto-attach an Idempotency-Key (UUIDv4) so network retries don't double-charge. Set your own via the param struct when you need explicit dedup across processes:

client.Payments.Create(ctx, &nowpesa.CreatePaymentParams{
    Reference:      "order-3",
    Amount:         1000,
    Currency:       "KES",
    Channel:        nowpesa.ChannelMpesaSTKPush,
    PayerPhone:     "+254712345678",
    IdempotencyKey: "order-3-v1",
})

Payouts

payout, err := client.Payouts.Create(ctx, &nowpesa.CreatePayoutParams{
    Amount:           100000,
    Currency:         "KES",
    DestinationPhone: "+254712345678",
    Remarks:          "weekly settlement",
})

Webhooks

Register an endpoint and verify signatures server-side:

ep, err := client.Webhooks.Register(ctx, &nowpesa.RegisterEndpointParams{
    URL:        "https://api.example.com/webhooks/nowpesa",
    EventTypes: []string{"payment.succeeded", "payment.refunded"},
})
log.Printf("Store this — shown once: %s", ep.SigningSecret)
Verifying signatures
func handler(w http.ResponseWriter, r *http.Request) {
    body, _ := io.ReadAll(r.Body)
    if !nowpesa.VerifyWebhook(body, r.Header.Get("X-Nowpesa-Signature"), secret) {
        http.Error(w, "bad signature", http.StatusBadRequest)
        return
    }
    evt, _ := nowpesa.ParseEvent(body)
    switch evt.Type {
    case "payment.succeeded":
        var pay nowpesa.Payment
        _ = json.Unmarshal(evt.Data, &pay)
        // ...
    case "payment.refunded":
        // ...
    }
    w.WriteHeader(http.StatusOK)
}
Secret rotation

The two-step rotate → promote flow lets you cut over to a new secret without dropping events. Until you call PromoteSecret, deliveries carry both X-Nowpesa-Signature (current) and X-Nowpesa-Signature-Next (new). VerifyWebhook accepts either:

rotated, _ := client.Webhooks.RotateSecret(ctx, ep.ID)
// Persist rotated.SigningSecretNext.

ok := nowpesa.VerifyWebhook(body, r.Header.Get("X-Nowpesa-Signature"), currentSecret,
    nowpesa.VerifyOptions{
        NextSecret: newSecret,
        NextHeader: r.Header.Get("X-Nowpesa-Signature-Next"),
    },
)

// Once your fleet is using the new secret:
_, _ = client.Webhooks.PromoteSecret(ctx, ep.ID)

Statement

// Structured snapshot.
st, err := client.Statement.Get(ctx, &nowpesa.StatementParams{
    Since:    "2026-01-01",
    Currency: "KES",
})
fmt.Println(st.InboundSucceeded, st.PayoutsSucceeded)

// CSV stream straight to a file.
resp, err := client.Statement.DownloadCSV(ctx, nil)
if err != nil { log.Fatal(err) }
defer resp.Body.Close()
out, _ := os.Create("statement.csv")
defer out.Close()
io.Copy(out, resp.Body)

Error handling

Every method returns a typed error on non-2xx responses. Branch with errors.As:

import "errors"

_, err := client.Payments.Create(ctx, params)
var (
    val *nowpesa.ValidationError
    rl  *nowpesa.RateLimitError
    sv  *nowpesa.ServerError
)
switch {
case errors.As(err, &val):
    // 400 — surface val.Message to the user.
case errors.As(err, &rl):
    // 429 — rl.RetryAfter honors the server's hint.
    time.Sleep(rl.RetryAfter)
case errors.As(err, &sv):
    // 5xx — already retried up to MaxRetries times.
}

// Or unwrap to the underlying APIError:
if base, ok := nowpesa.AsAPIError(err); ok {
    log.Printf("status=%d type=%s message=%s req=%s",
        base.StatusCode, base.Type, base.Message, base.RequestID)
}

Retry policy

The client retries on 429, 5xx, and network errors:

  • 3 retries by default. Override with WithMaxRetries(n).
  • 429 honors the Retry-After header.
  • 5xx + network: exponential backoff (1s, 2s, 4s) + up to 30% jitter.
  • 4xx (other than 429) are NOT retried — they're caller bugs.

Configuration

client := nowpesa.NewClient(keyID, keySecret,
    nowpesa.WithBaseURL("https://api.nowpesa.com"),         // override for staging
    nowpesa.WithHTTPClient(&http.Client{Timeout: 30*time.Second}),
    nowpesa.WithMaxRetries(3),
    nowpesa.WithUserAgent("my-app/1.0"),
    nowpesa.WithDefaultHeader("X-My-App", "v1"),
)

Development

go test ./...      # unit tests + integration tests (auto-skipped if no edge-api)
go vet ./...

Integration tests hit a local edge-api at http://localhost:8080. They auto-skip if it's unreachable. Override:

NOWPESA_BASE_URL=http://localhost:8080 go test ./...
NOWPESA_INTEG=0 go test ./...                # force-skip integration
NOWPESA_SINK_HOST=127.0.0.1 go test ./...    # if edge-api runs on the host

License

MIT.

Documentation

Overview

Package nowpesa is the official Go SDK for the NowPesa payments API.

Quick start:

client := nowpesa.NewClient("key_id", "key_secret")

payment, err := client.Payments.Create(ctx, &nowpesa.CreatePaymentParams{
    Reference:  "order-1234",
    Amount:     10000,
    Currency:   "KES",
    Channel:    nowpesa.ChannelMpesaSTKPush,
    PayerPhone: "+254712345678",
})

All API methods return typed errors that wrap *Error. Branch with errors.As:

var rl *nowpesa.RateLimitError
if errors.As(err, &rl) {
    time.Sleep(rl.RetryAfter)
}

The Client retries 429, 5xx, and network errors with exponential backoff. 4xx (other than 429) are surfaced immediately.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyWebhook

func VerifyWebhook(body []byte, header, secret string, opts ...VerifyOptions) bool

VerifyWebhook returns true iff body + header are signed by secret and the t= timestamp is within tolerance. Constant-time compare.

Header format: "t=<unix_seconds>,v1=<hex_hmac_sha256>" — the signed payload is "<t>.<raw_body>".

Types

type APIError

type APIError struct {
	StatusCode int    // HTTP status; 0 when no response was received
	Type       string // `error.type` from the response envelope, or "network" / "unknown"
	Message    string // `error.message` from the envelope, or a synthesized fallback
	Body       string // Raw response body — useful for debugging
	Path       string // The endpoint that was called
	RequestID  string // X-Request-Id response header, if present
}

APIError is the base type returned from every Client method on non-2xx responses. Branch on the specific subtypes (e.g. *ValidationError, *RateLimitError) via errors.As — they all embed *APIError so its fields are promoted.

func AsAPIError

func AsAPIError(err error) (*APIError, bool)

AsAPIError unwraps any nowpesa typed error to its underlying *APIError. Returns false if err is not from this package.

func (*APIError) Error

func (e *APIError) Error() string

type AuthError

type AuthError struct{ *APIError }

type AuthResponse

type AuthResponse struct {
	MerchantID   string `json:"merchant_id"`
	MerchantName string `json:"merchant_name"`
	UserID       string `json:"user_id"`
	Email        string `json:"email"`
	Role         string `json:"role"`
	APIKeyID     string `json:"api_key_id"`
	APIKeySecret string `json:"api_key_secret"`
}

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

AuthService exposes the public /v1/auth/{register,login} endpoints. These are unauthenticated; the merchant has no API key yet.

func (*AuthService) Login

func (s *AuthService) Login(ctx context.Context, params *LoginParams) (*AuthResponse, error)

Login exchanges email + password for the merchant's API key.

func (*AuthService) Register

func (s *AuthService) Register(ctx context.Context, params *RegisterParams) (*AuthResponse, error)

Register creates a new merchant + initial user + API key.

type Channel

type Channel string
const (
	ChannelMpesaSTKPush Channel = "mpesa_stk_push"
	ChannelMpesaC2B     Channel = "mpesa_c2b"
	ChannelCard         Channel = "card"
	ChannelBankTransfer Channel = "bank_transfer"
	ChannelMobileMoney  Channel = "mobile_money"
)

type Client

type Client struct {
	Auth      *AuthService
	Payments  *PaymentsService
	Payouts   *PayoutsService
	Webhooks  *WebhooksService
	Statement *StatementService
	// contains filtered or unexported fields
}

Client is the entry point. Construct with NewClient and access resources via the exported service fields.

func NewClient

func NewClient(keyID, keySecret string, opts ...Option) *Client

NewClient constructs a Client. keyID and keySecret are the merchant's API key pair from the dashboard or POST /v1/auth/login.

type ConflictError

type ConflictError struct{ *APIError }

type CreatePaymentParams

type CreatePaymentParams struct {
	Reference string  `json:"reference"`
	Amount    int64   `json:"amount"`
	Currency  string  `json:"currency,omitempty"`
	Channel   Channel `json:"channel,omitempty"`
	// PayerPhone is required for mpesa_stk_push. E.164 with leading "+".
	PayerPhone string `json:"payer_phone,omitempty"`
	// CardToken is required for card. Tokenized PAN reference.
	CardToken string `json:"card_token,omitempty"`
	// IdempotencyKey overrides the auto-generated UUIDv4. Use to dedup
	// retries across processes.
	IdempotencyKey string `json:"-"`
}

type CreatePayoutParams

type CreatePayoutParams struct {
	Amount   int64  `json:"amount"`
	Currency string `json:"currency,omitempty"`
	// DestinationPhone is E.164 with leading "+". Overrides the
	// merchant's default payout number when set.
	DestinationPhone string `json:"destination_phone,omitempty"`
	Remarks          string `json:"remarks,omitempty"`
	IdempotencyKey   string `json:"-"`
}

type ForbiddenError

type ForbiddenError struct{ *APIError }

type ListDeliveriesParams

type ListDeliveriesParams struct {
	Status    string
	EventType string
	Limit     int
}

type ListPaymentsParams

type ListPaymentsParams struct {
	Status    PaymentStatus
	Channel   Channel
	Reference string
	Since     string
	Before    string
	Limit     int
}

type ListPaymentsResponse

type ListPaymentsResponse struct {
	Data       []Payment `json:"data"`
	NextBefore string    `json:"next_before,omitempty"`
}

type ListPayoutsParams

type ListPayoutsParams struct {
	Status PayoutStatus
	Since  string
	Before string
	Limit  int
}

type ListPayoutsResponse

type ListPayoutsResponse struct {
	Data       []Payout `json:"data"`
	NextBefore string   `json:"next_before,omitempty"`
}

type ListWebhookDeliveriesResponse

type ListWebhookDeliveriesResponse struct {
	Data []WebhookDelivery `json:"data"`
}

type ListWebhooksResponse

type ListWebhooksResponse struct {
	Data []WebhookEndpoint `json:"data"`
}

type LoginParams

type LoginParams struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type NetworkError

type NetworkError struct {
	Path string
	Err  error
}

NetworkError wraps a transport-layer failure (DNS, connect, TLS, timeout, etc.) with no HTTP response. Unwrap returns the underlying transport error so errors.Is works.

func (*NetworkError) Error

func (e *NetworkError) Error() string

func (*NetworkError) Unwrap

func (e *NetworkError) Unwrap() error

type NotFoundError

type NotFoundError struct{ *APIError }

type Option

type Option func(*Client)

Option configures a Client. Pass to NewClient.

func WithBaseURL

func WithBaseURL(u string) Option

WithBaseURL overrides the API endpoint. Useful for staging or local dev.

func WithDefaultHeader

func WithDefaultHeader(key, value string) Option

WithDefaultHeader sets a header sent on every request. Per-request headers (passed via service methods) override these.

func WithHTTPClient

func WithHTTPClient(h *http.Client) Option

WithHTTPClient injects a custom *http.Client. The default has a 30s timeout; supply your own for finer control (e.g. transport tracing).

func WithMaxRetries

func WithMaxRetries(n int) Option

WithMaxRetries sets the number of retries for 429/5xx/network errors. Default 3. Zero disables retries.

func WithSleepFunc

func WithSleepFunc(s func(time.Duration)) Option

WithSleepFunc swaps the sleep implementation used between retries. Exposed primarily for testing the retry loop without real waits.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent overrides the User-Agent header.

type Payment

type Payment struct {
	ID             string        `json:"id"`
	Reference      string        `json:"reference"`
	Amount         int64         `json:"amount"`
	Currency       string        `json:"currency"`
	Channel        Channel       `json:"channel"`
	Status         PaymentStatus `json:"status"`
	Fee            int64         `json:"fee,omitempty"`
	NetAmount      int64         `json:"net_amount,omitempty"`
	FailureReason  string        `json:"failure_reason,omitempty"`
	ChannelReceipt string        `json:"channel_receipt,omitempty"`
	RefundedAt     *time.Time    `json:"refunded_at,omitempty"`
	Refund         *Refund       `json:"refund,omitempty"`
	RefundedMinor  int64         `json:"refunded_minor,omitempty"`
	Refunds        []Refund      `json:"refunds,omitempty"`
	CreatedAt      *time.Time    `json:"created_at,omitempty"`
	UpdatedAt      *time.Time    `json:"updated_at,omitempty"`
}

type PaymentStatus

type PaymentStatus string
const (
	PaymentPending    PaymentStatus = "pending"
	PaymentProcessing PaymentStatus = "processing"
	PaymentSucceeded  PaymentStatus = "succeeded"
	PaymentFailed     PaymentStatus = "failed"
	PaymentCanceled   PaymentStatus = "canceled"
)

type PaymentsService

type PaymentsService struct {
	// contains filtered or unexported fields
}

func (*PaymentsService) Create

func (s *PaymentsService) Create(ctx context.Context, params *CreatePaymentParams) (*Payment, error)

Create initiates a payment via the requested channel. Card payments resolve synchronously; mpesa_stk_push returns immediately with status processing and finalizes via webhook.

func (*PaymentsService) Get

func (s *PaymentsService) Get(ctx context.Context, id string) (*Payment, error)

Get retrieves a single payment by id.

func (*PaymentsService) List

List returns a page of payments with cursor pagination. Carry the returned NextBefore back into the next call to walk forward.

func (*PaymentsService) Refund

func (s *PaymentsService) Refund(ctx context.Context, paymentID string, params *RefundParams) (*Refund, error)

Refund issues a full or partial refund. Pass nil for a full refund of the remaining balance.

type Payout

type Payout struct {
	ID               string       `json:"id"`
	Amount           int64        `json:"amount"`
	Currency         string       `json:"currency"`
	Channel          string       `json:"channel"`
	Status           PayoutStatus `json:"status"`
	DestinationPhone string       `json:"destination_phone"`
	ChannelReceipt   string       `json:"channel_receipt,omitempty"`
	FailureReason    string       `json:"failure_reason,omitempty"`
	CreatedAt        *time.Time   `json:"created_at,omitempty"`
	UpdatedAt        *time.Time   `json:"updated_at,omitempty"`
}

type PayoutStatus

type PayoutStatus string
const (
	PayoutPending   PayoutStatus = "pending"
	PayoutSucceeded PayoutStatus = "succeeded"
	PayoutFailed    PayoutStatus = "failed"
)

type PayoutsService

type PayoutsService struct {
	// contains filtered or unexported fields
}

func (*PayoutsService) Create

func (s *PayoutsService) Create(ctx context.Context, params *CreatePayoutParams) (*Payout, error)

func (*PayoutsService) Get

func (s *PayoutsService) Get(ctx context.Context, id string) (*Payout, error)

func (*PayoutsService) List

type PreconditionError

type PreconditionError struct{ *APIError }

type RateLimitError

type RateLimitError struct {
	*APIError
	RetryAfter time.Duration
}

RateLimitError is returned on HTTP 429. RetryAfter mirrors the Retry-After header (0 if absent or unparseable).

type Refund

type Refund struct {
	ID            string       `json:"id"`
	PaymentID     string       `json:"payment_id"`
	Amount        int64        `json:"amount"`
	Currency      string       `json:"currency"`
	Status        RefundStatus `json:"status"`
	FailureReason string       `json:"failure_reason,omitempty"`
	CreatedAt     time.Time    `json:"created_at"`
	UpdatedAt     time.Time    `json:"updated_at"`
}

type RefundParams

type RefundParams struct {
	// Amount in minor units. Zero/omitted refunds the remaining balance.
	Amount         int64  `json:"amount,omitempty"`
	Currency       string `json:"currency,omitempty"`
	IdempotencyKey string `json:"-"`
}

type RefundStatus

type RefundStatus string
const (
	RefundPending   RefundStatus = "pending"
	RefundSucceeded RefundStatus = "succeeded"
	RefundFailed    RefundStatus = "failed"
)

type RegisterEndpointParams

type RegisterEndpointParams struct {
	URL        string   `json:"url"`
	EventTypes []string `json:"event_types,omitempty"`
}

type RegisterParams

type RegisterParams struct {
	Email        string `json:"email"`
	Password     string `json:"password"`
	MerchantName string `json:"merchant_name"`
	Country      string `json:"country,omitempty"`
}

type ServerError

type ServerError struct{ *APIError }

type Statement

type Statement struct {
	MerchantID            string          `json:"merchant_id"`
	Currency              string          `json:"currency"`
	Since                 string          `json:"since,omitempty"`
	Before                string          `json:"before,omitempty"`
	InboundSucceeded      StatementBucket `json:"inbound_succeeded"`
	FeesPaidMinor         int64           `json:"fees_paid_minor"`
	RefundsSucceeded      StatementBucket `json:"refunds_succeeded"`
	PayoutsSucceeded      StatementBucket `json:"payouts_succeeded"`
	PayoutsPending        StatementBucket `json:"payouts_pending"`
	AvailablePayableMinor int64           `json:"available_payable_minor"`
	PayablePendingMinor   int64           `json:"payable_pending_minor"`
}

type StatementBucket

type StatementBucket struct {
	Count       int64 `json:"count"`
	AmountMinor int64 `json:"amount_minor"`
}

type StatementParams

type StatementParams struct {
	Since    string
	Before   string
	Currency string
}

type StatementService

type StatementService struct {
	// contains filtered or unexported fields
}

func (*StatementService) DownloadCSV

func (s *StatementService) DownloadCSV(ctx context.Context, params *StatementParams) (*http.Response, error)

DownloadCSV returns the raw *http.Response so the caller can stream the CSV body straight to disk or another HTTP response. Caller must close resp.Body when done.

resp, err := client.Statement.DownloadCSV(ctx, &nowpesa.StatementParams{...})
if err != nil { ... }
defer resp.Body.Close()
io.Copy(out, resp.Body)

func (*StatementService) Get

Get returns the merchant's statement as a structured snapshot.

type ValidationError

type ValidationError struct{ *APIError }

type VerifyOptions

type VerifyOptions struct {
	// Tolerance for the timestamp drift, default 300s.
	Tolerance time.Duration
	// NextSecret is the rotated-in secret. When set together with
	// NextHeader, VerifyWebhook returns true if EITHER signature
	// verifies — used during the rotate → promote window.
	NextSecret string
	NextHeader string
	// Now overrides the clock (testing). Defaults to time.Now.
	Now func() time.Time
}

VerifyOptions tunes VerifyWebhook. Zero value uses sane defaults (300s tolerance, no rotation header).

type WebhookDelivery

type WebhookDelivery struct {
	ID             string          `json:"id"`
	EndpointID     string          `json:"endpoint_id"`
	EventID        string          `json:"event_id"`
	EventType      string          `json:"event_type"`
	Status         string          `json:"status"`
	Attempts       int32           `json:"attempts"`
	LastStatusCode int32           `json:"last_status_code,omitempty"`
	LastError      string          `json:"last_error,omitempty"`
	LastAttemptAt  *time.Time      `json:"last_attempt_at,omitempty"`
	NextAttemptAt  *time.Time      `json:"next_attempt_at,omitempty"`
	CreatedAt      *time.Time      `json:"created_at,omitempty"`
	Payload        json.RawMessage `json:"payload,omitempty"`
}

type WebhookEndpoint

type WebhookEndpoint struct {
	ID                     string     `json:"id"`
	URL                    string     `json:"url"`
	EventTypes             []string   `json:"event_types"`
	CreatedAt              time.Time  `json:"created_at"`
	SigningSecret          string     `json:"signing_secret,omitempty"`
	SigningSecretNext      string     `json:"signing_secret_next,omitempty"`
	SigningSecretRotatedAt *time.Time `json:"signing_secret_rotated_at,omitempty"`
}

type WebhookEvent

type WebhookEvent struct {
	ID         string          `json:"id"`
	Type       string          `json:"type"`
	MerchantID string          `json:"merchant_id"`
	CreatedAt  time.Time       `json:"created_at"`
	Data       json.RawMessage `json:"data"`
}

WebhookEvent is the canonical envelope NowPesa POSTs to your endpoint. Use json.Unmarshal on Data into a channel-specific payload after branching on Type.

func ParseEvent

func ParseEvent(body []byte) (*WebhookEvent, error)

ParseEvent unmarshals the canonical webhook envelope from a raw body. Call after VerifyWebhook succeeds.

type WebhooksService

type WebhooksService struct {
	// contains filtered or unexported fields
}

func (*WebhooksService) Delete

func (s *WebhooksService) Delete(ctx context.Context, id string) error

func (*WebhooksService) Get

func (*WebhooksService) List

func (*WebhooksService) ListDeliveries

func (s *WebhooksService) ListDeliveries(ctx context.Context, endpointID string, params *ListDeliveriesParams) (*ListWebhookDeliveriesResponse, error)

func (*WebhooksService) PromoteSecret

func (s *WebhooksService) PromoteSecret(ctx context.Context, id string) (*WebhookEndpoint, error)

func (*WebhooksService) Register

func (*WebhooksService) ReplayDelivery

func (s *WebhooksService) ReplayDelivery(ctx context.Context, endpointID, deliveryID string) error

func (*WebhooksService) RotateSecret

func (s *WebhooksService) RotateSecret(ctx context.Context, id string) (*WebhookEndpoint, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL