Skip to content

byrnedo/go-fortnox

Repository files navigation

Go Fortnox Client

Go Report Card GoDoc Build Status Coverage Status

A client for Fortnox's REST api.

import (
    "github.com/byrnedo/go-fortnox"
    "context"
)

client := fortnox.NewClient(fortnox.WithAuthOpts("token", "secret"))

order, err := client.GetOrder(context.Background(), 1)
if err != nil {
    return errors.Wrap(err, "Error getting order")
}

There are quite a few endpoints that aren't implemented yet. Feel free to make an issue or pull request.

'ish Types (Floatish, Intish)

For some reason the fortnox api ocassionally gives back a float but sometimes a string for certain fields. I made these two types for dealing with those situations for unmarshalling.

Running Tests

You need to set the FORTNOX_AUTH_CODE, FORTNOX_ACCESS_TOKEN and FORTNOX_CLIENT_SECRET envs when running the tests.