The official Go SDK for the Cynco API.
go get github.com/cynco-labs/cynco-gopackage main
import (
"context"
"fmt"
"github.com/cynco-labs/cynco-go"
)
func main() {
client := cynco.New("cy_...")
invoice, err := client.Invoices.Create(context.Background(), &cynco.InvoiceCreateParams{
Customer: "cus_abc123",
Items: []cynco.Item{
{Description: "Consulting", Amount: 5000},
},
})
if err != nil {
panic(err)
}
fmt.Println(invoice.ID)
}client := cynco.New(
"cy_...", // or use CYNCO_API_KEY env var
cynco.WithBaseURL("..."), // optional
cynco.WithTimeout(30 * time.Second), // optional
)MIT