https://github.com/pj-simpson/godat
GoDat is an unofficial Go client library for the Codat API.
https://github.com/pj-simpson/godat
accounting-software client-library
Last synced: 5 months ago
JSON representation
GoDat is an unofficial Go client library for the Codat API.
- Host: GitHub
- URL: https://github.com/pj-simpson/godat
- Owner: pj-simpson
- License: mit
- Created: 2023-05-25T14:20:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-21T15:24:28.000Z (over 2 years ago)
- Last Synced: 2025-06-19T05:40:59.649Z (7 months ago)
- Topics: accounting-software, client-library
- Language: Go
- Homepage: https://docs.codat.io/
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoDat #
GoDat is an Unofficial Go library for interacting with the [Codat API](https://docs.codat.io/).
## Installation ##
```bash
go get github.com/pj-simpson/godat
```
## Usage ##
Get the Codat token from an enviroment variable.
Create a new Codat REST client.
Set the pagination query params via the PaginatedResponseOptions struct, to obtain 25 comapanies.
Call the 'Get Companies' method and print out the result.
```go
package main
import (
"fmt"
"os"
"github.com/pj-simpson/godat/pkg/godat"
"github.com/pj-simpson/godat/pkg/models"
)
func main() {
token := os.Getenv("CODAT_TOKEN")
codat := godat.NewCodatClient(token)
page := models.PaginatedResponseOptions{
Page: 1,
PageSize: 25,
}
comps, err := codat.GetCompanies(&page)
if err != nil {
fmt.Printf("%#v", err)
}
fmt.Printf("%#v", comps)
}
```
## License ##
MIT
## Caveats ##
Medium term aim for this package is to wrap the entire [Codat Accounting API](https://docs.codat.io/accounting-api#/).