package main
import (
"context"
"fmt"
"log"
"github.com/AhaSend/ahasend-go/api"
"github.com/google/uuid"
)
func main() {
// Create API client with authentication
client := api.NewAPIClient(
api.WithAPIKey("aha-sk-your-64-character-key"),
)
accountID := uuid.New()
subAccountID := uuid.New()
// Create context for the API call
ctx := context.Background()
// Soft-delete the sub account
response, httpResp, err := client.SubAccountsAPI.DeleteSubAccount(ctx, accountID, subAccountID)
if err != nil {
log.Fatalf("Error deleting sub account: %v", err)
}
if httpResp.StatusCode == 200 {
fmt.Printf("✅ Sub account deleted! Status: %d\n", httpResp.StatusCode)
if response != nil && response.Message != "" {
fmt.Printf("Response: %s\n", response.Message)
}
} else {
fmt.Printf("❌ Unexpected status code: %d\n", httpResp.StatusCode)
}
}