Go SDK
Apideck offers a native SDK for Go. Choose one language below to see our API Reference in your application’s language.
Apideck offers a native SDK for Go. Choose one language below to see our API Reference in your application’s language.
The module supports all Apideck API endpoints. For complete information about the API, head to the docs. All endpoints require a valid apiKey so that's the only required parameter to initialize a new Apideck client
package main
import (
"context"
sdkgo "github.com/apideck-libraries/sdk-go"
"github.com/apideck-libraries/sdk-go/models/components"
"github.com/apideck-libraries/sdk-go/models/operations"
"log"
"os"
)
func main() {
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("<insert-api-key-here>")),
sdkgo.WithConsumerID("<insert-consumer-id-here>"),
sdkgo.WithAppID("<insert-application-id-here>"),
)
ctx := context.Background()
res, err := s.Accounting.TaxRates.List(ctx, operations.AccountingTaxRatesAllRequest{
ServiceID: sdkgo.String("salesforce"),
Filter: &components.TaxRatesFilter{
Assets: sdkgo.Bool(true),
Equity: sdkgo.Bool(true),
Expenses: sdkgo.Bool(true),
Liabilities: sdkgo.Bool(true),
Revenue: sdkgo.Bool(true),
},
PassThrough: map[string]any{
"search": "San Francisco",
},
Fields: sdkgo.String("id,updated_at"),
})
if err != nil {
log.Fatal(err)
}
if res.GetTaxRatesResponse != nil {
// handle response
}
}