Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/darrylmorley/go-lightspeed-retail


https://github.com/darrylmorley/go-lightspeed-retail

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

A Lightspeed Retail SDK in Go!

To initialise the SDK:

```
func main() {
// Read values from .env or another source
baseURL := os.Getenv("BASE_URL")
clientID := os.Getenv("CLIENT_ID")
clientSecret := os.Getenv("CLIENT_SECRET")
refreshToken := os.Getenv("CLIENT_REFRESH_TOKEN")

// Create a new SDK instance with the mock server's URL as the BaseURL
sdk := lightspeedsdk.NewSDK(baseURL, clientID, clientSecret, refreshToken)
// ...
}
```

Example, call Categories:

```
err = sdk.DoGet("/Category", &response)
if err != nil {
t.Fatalf("Error fetching categories: %v", err)
}
fmt.Printf("Categories: %+v\n", response)
fmt.Println("Number of categories:", len(response))
```

Currently only DoGet is implemented.