Golang SDK
The Go SDK provides a clean and idiomatic Go interface for integrating with BagelPay.
📦 Installation Guide
go get github.com/bagelpay/bagelpay-sdk-go🚀 Quick Start
30-Second Quick Demo
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/bagelpay/bagelpay-sdk-go/src/bagelpay"
)
func main() {
// Initialize the client
client := bagelpay.NewClient(bagelpay.ClientConfig{
APIKey: "your-api-key",
TestMode: true,
})
ctx := context.Background()
// Create a product
product, err := client.CreateProduct(ctx, bagelpay.CreateProductRequest{
Name: fmt.Sprintf("Premium Subscription %d", time.Now().Unix()),
Description: "Monthly premium subscription with unique identifier",
Price: 29.99,
Currency: "USD",
BillingType: "subscription",
TaxInclusive: false,
TaxCategory: "digital_products",
RecurringInterval: "monthly",
TrialDays: 7,
})
if err != nil {
log.Fatalf("Failed to create product: %v", err)
}
fmt.Printf("✅ Product URL: %s\n", *product.ProductURL)
}Core Features
🛍️ Product Management
💳 Checkout & Payments
👥 Customer Management
📊 Analytics & Reporting
API Reference
Client Initialization
Convenience Constructors
Products
Create Product
List Products
Get Product
Update Product
Archive/Unarchive Product
Checkout
Create Checkout Session
Transactions
List Transactions
Subscriptions
List Subscriptions
Get Subscription
Cancel Subscription
Customers
List Customers
Error Handling
Error Types
Go Type Support
Environment Configuration
Test Mode
Production Mode
🚀 Webhook Integration
Examples
Support
Last updated