Categorygithub.com/fortifi/go-api
modulepackage
0.0.0-20230802165401-1aaa840d9d07
Repository: https://github.com/fortifi/go-api.git
Documentation: pkg.go.dev

# README

Fortifi go-api

Usage

Import api with your required client & models

import (
	api "github.com/fortifi/go-api"
	"github.com/fortifi/go-api/client/customers"
)

New Fortifi api instance with your service account credentials

	fortifi, err := api.NewInstance(
		"my-org-fid",
		"my-service-account-user",
		"my-service-account-key")

Use Fortifi

	// Example: Retrieve customer by external reference
	cid := "my-customer-external-reference"

	params := customers.NewGetCustomersFindByReferenceParams()
	params.SetReference(&cid)

	instance, err := fortifi.GetAPIInstance()
	if err != nil {
		panic(fmt.Sprintf("API instance not available %s\n", err.Error()))
	}

	response, err := instance.Customers.GetCustomersFindByReference(params, fortifi.GetAuthenticator())
	if err != nil {
		panic(fmt.Sprintf("failed to retrieve customer because %s\n", err.Error()))
	}

	fmt.Printf("Customers First Name is %s\n", response.Payload.FirstName)

# Packages

No description provided by the author
No description provided by the author

# Functions

NewInstance creates a new FortifiInstance with embeded tokenhelper.

# Structs

Authenticator auths fortifi requests.
Instance is a single org API instance.