tripletex-go

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2025 License: MIT

README

go reference badge

tripletex-go

Go API client for Tripletex. It's generated with oapi-codegen

Prerequisites

  1. consumerToken
  2. employeeToken

Usage

go get github.com/valuetechdev/tripletex-go/tripletex
import "github.com/valuetechdev/tripletex-go/tripletex"

func Whatever() error {
	token := NewToken(&tokenOpts{
		ConsumerToken: "",
		EmployeeToken: "",
	})

  tt, err := tripletex.New(&tripletex.APIClientOpts{})

  if err != nil {
    return fmt.Errorf("whatever failed: %w", err)
  }

	customersRes, err := c.CustomerSearchWithResponse(context.Background(), &CustomerSearchParams{})
  if err != nil {
    return fmt.Errorf("failed to search for customers: %w", err)
  }

  // Do something with customersRes

  return nil
}

Things to know

  • Tripletex's OpenAPI specification is valid, but not error-free.
    • There are duplicate types (eg. LeaveOfAbsenceType).
    • No endpoint specifies what the returning content-type is.
    • Emails can returned as empty strings ("").
  • We convert the original Tripletex API from Swagger 2.0 to OpenAPI 3 with Swagger's official tooling.

Directories

Path Synopsis
pkg
tripletex
Package tripletex provides primitives to interact with the openapi HTTP API.
Package tripletex provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL