Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

incentro-ecx/go-commercelayer-sdk

Repository files navigation

Warning

This SDK has been deprecated. We recommend you to generate a Commercelayer Go client yourself based on the API specifications from Commercelayer.

Go Commercelayer SDK

This projects provides an API client to connect with the Commercelayer apis. It is automatically generated from the openapi definition so it should be feature complete.

Documentation

Usage

clientId := <client-id>
clientSecret := <client-secret>
apiEndpoint := <url>/api
authEndpoint := <ur>/oauth/token

ctx := context.Background()

credentials := clientcredentials.Config{
    ClientID:     clientId,
    ClientSecret: clientSecret,
    TokenURL:     authEndpoint,
    Scopes:       []string{},
}

httpClient := credentials.Client(ctx)

commercelayerClient := api.NewAPIClient(&api.Configuration{
    HTTPClient: httpClient,
    Debug:      true,
    Servers: []api.ServerConfiguration{
        {URL: apiEndpoint},
    },
})

data, resp, err := commercelayerClient.AddressesApi.GETAddresses(ctx).Execute()

Development

  • Make sure you have nodejs and npm installed
  • Run make to regenerate the whole SDK. This will also install the dependencies required to generate the SDK through npm.

About

A Golang Commercelayer SDK

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •