idanalyzer

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 12 Imported by: 0

README

ID Analyzer Go SDK — Identity Verification, KYC, Document & Biometric API

Go Reference Go Report Card license

Official Go client library for the ID Analyzer API v2 — automate identity document verification, KYC onboarding and biometric checks in minutes. Standard-library only, no third-party dependencies.

Scan and authenticate passports, driver's licenses, ID cards, visas and residence permits from 190+ countries, run 1:1 face match and liveness detection, screen against AML / PEP / sanctions watchlists, and onboard users remotely with DocuPass hosted verification & e-signature.

Features

  • Document OCR & authentication — passport, driver's license, ID card, visa & residence-permit recognition from 190+ countries, including MRZ and PDF417 / AAMVA barcode parsing.
  • Biometric verification — 1:1 face match and liveness / presentation-attack detection.
  • AML screening — PEP, sanctions, watchlist and adverse-media checks.
  • DocuPass — hosted, no-code remote identity verification, KYC/AML onboarding and legally-binding e-signature.
  • KYC profiles, transaction vault, contract generation and webhooks.
  • US & EU data-residency regions.

⚠️ Never embed your API key in client-side apps (mobile, browser JS). Call the API from your server.

Installation

go get github.com/idanalyzer/id-analyzer-v2-go

Requires Go 1.22+.

Authentication & region

Pass your API key to NewClient, or set the IDANALYZER_KEY environment variable. The SDK targets the US endpoint (https://api2.idanalyzer.com) by default; select the EU endpoint with IDANALYZER_REGION=eu or idanalyzer.WithRegion("eu"). For on-premise ID Fort, use idanalyzer.WithBaseURL("https://your-host").

Quick start

package main

import (
	"fmt"
	"log"

	idanalyzer "github.com/idanalyzer/id-analyzer-v2-go"
)

func main() {
	client, err := idanalyzer.NewClient("YOUR_API_KEY")
	if err != nil {
		log.Fatal(err)
	}

	profile := idanalyzer.NewProfile(idanalyzer.SecurityMedium)
	result, err := client.Scanner.Scan(idanalyzer.ScanRequest{
		DocumentFront: "id_front.jpg",
		Face:          "selfie.jpg",
		Profile:       profile,
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(result["decision"]) // accept / review / reject
}

Examples

// AML / PEP / sanctions screening
client.AML.Search(idanalyzer.AMLSearchRequest{Name: "John Smith", Country: "US"}) // POST /aml
client.AML.SearchV3("John Smith", "", 10, 1)                                       // POST /amlv3

// KYB — business verification
// Verify a business from its registration/incorporation document: extract
// details, check official company registries, screen against sanctions/PEP,
// and return directors/owners to verify.
client.KYB.Verify(idanalyzer.KYBVerifyRequest{Document: "registration.jpg"})                       // document only
client.KYB.Verify(idanalyzer.KYBVerifyRequest{Document: "registration.jpg", Profile: "security_high"}) // with a KYC profile

// DocuPass — hosted remote verification link
link, _ := client.Docupass.Create(idanalyzer.DocupassCreateRequest{Profile: "YOUR_PROFILE_ID"})
fmt.Println(link["url"])

See example/main.go for more.

API coverage

The SDK wraps the complete ID Analyzer API v2 surface via service fields on the client:

Service Methods
client.Scanner Scan, QuickScan, VeryQuickScan
client.Biometric VerifyFace, VerifyLiveness
client.AML Search (/aml), SearchV3 (/amlv3)
client.KYB Verify (/kyb)
client.Contract Generate + template CRUD
client.Transaction Get, List, Update, Delete, Export, SaveImage, SaveFile
client.Docupass Create, List, Get, Delete
client.Profile KYC profile Create / List / Get / Update / Delete / Export
client.Webhook List, Resend, Delete
client.Account Get

Resources

Other ID Analyzer SDKs

PHP · Python · Node.js · .NET · Java · Go

License

MIT © ID Analyzer — see LICENSE.

Documentation

Overview

Package idanalyzer is the official Go client library for the ID Analyzer API v2.

It targets the api2.idanalyzer.com endpoint (US, default) or api2-eu.idanalyzer.com (EU). Create a client with NewClient and use the service fields (Scanner, Biometric, AML, KYB, Contract, Transaction, Docupass, Profile, Webhook, Account).

Index

Constants

View Source
const (
	SecurityNone   = "security_none"   // no enforced validation rules
	SecurityLow    = "security_low"    // minimal validation
	SecurityMedium = "security_medium" // balanced validation
	SecurityHigh   = "security_high"   // strictest validation
)

Preset KYC profile IDs. These built-in profiles select progressively stricter verification rules and can be passed to NewProfile.

Variables

This section is empty.

Functions

func ParseInput

func ParseInput(input string, allowCache bool) (string, error)

ParseInput accepts a file path, base64 string, URL, or (when allowCache) a "ref:" cache reference, and returns the value to send to the API.

Types

type AMLSearchRequest

type AMLSearchRequest struct {
	Name      string   // full name of the person or entity to screen
	IDNumber  string   // government/registration ID number to screen
	Entity    int      // 0=Person, 1=Corporation/Legal Entity
	Country   string   // ISO Alpha-2 country to bias/limit the search
	Database  []string // specific watchlist databases to query (default: all)
	BirthYear string   // year of birth, to disambiguate matches
}

AMLSearchRequest holds parameters for an AML v1 search (POST /aml). Either Name or IDNumber must be set.

type AMLService

type AMLService struct {
	// contains filtered or unexported fields
}

AMLService provides anti-money-laundering / sanctions screening operations. Access it via Client.AML.

func (*AMLService) Search

func (a *AMLService) Search(req AMLSearchRequest) (map[string]any, error)

Search screens a name or ID number against the AML watchlists (POST /aml). It returns the decoded JSON response, or an error.

func (*AMLService) SearchV3

func (a *AMLService) SearchV3(text, id string, limit, page int) (map[string]any, error)

SearchV3 screens against the AML v3 database (POST /amlv3). Provide either a free-text query (text) or a record id; limit caps the number of results (sent only when positive) and page selects the result page (1-based, sent only when positive). It returns the decoded JSON response, or an error.

type APIError

type APIError struct {
	Code    string
	Message string
}

APIError is returned when the API responds with an error object.

func (*APIError) Error

func (e *APIError) Error() string

type AccountService

type AccountService struct {
	// contains filtered or unexported fields
}

AccountService provides access to the authenticated account's profile and usage. Access it via Client.Account.

func (*AccountService) Get

func (a *AccountService) Get() (map[string]any, error)

Get retrieves the current account profile, quota and usage (GET /myaccount). It returns the decoded JSON response, or an error.

type BiometricService

type BiometricService struct {
	// contains filtered or unexported fields
}

BiometricService provides face matching and liveness operations. Access it via Client.Biometric.

func (*BiometricService) VerifyFace

func (b *BiometricService) VerifyFace(profile *Profile, referenceFaceImage, facePhoto, faceVideo, customData string) (map[string]any, error)

VerifyFace performs 1:1 face verification against a reference image (POST /face). profile (required) selects the KYC profile; referenceFaceImage (required) is the known face to match against; supply exactly one of facePhoto or faceVideo as the live capture to verify; customData is an optional string echoed on the transaction. It returns the decoded JSON response, or an error.

func (*BiometricService) VerifyLiveness

func (b *BiometricService) VerifyLiveness(profile *Profile, facePhoto, faceVideo, customData string) (map[string]any, error)

VerifyLiveness performs a standalone liveness check (POST /liveness). profile (required) selects the KYC profile; supply exactly one of facePhoto or faceVideo as the live capture; customData is an optional string echoed on the transaction. It returns the decoded JSON response, or an error.

type Client

type Client struct {
	Scanner     *ScannerService
	Biometric   *BiometricService
	AML         *AMLService
	KYB         *KYBService
	Contract    *ContractService
	Transaction *TransactionService
	Docupass    *DocupassService
	Profile     *ProfileService
	Webhook     *WebhookService
	Account     *AccountService
	// contains filtered or unexported fields
}

Client is an ID Analyzer API v2 client.

func NewClient

func NewClient(apiKey string, opts ...Option) (*Client, error)

NewClient creates a new client. The API key falls back to the IDANALYZER_KEY environment variable. The region falls back to IDANALYZER_REGION (default "us").

type ContractService

type ContractService struct {
	// contains filtered or unexported fields
}

ContractService provides contract/document template management and document generation. Access it via Client.Contract.

func (*ContractService) CreateTemplate

func (c *ContractService) CreateTemplate(name, content, orientation, timezone, font string) (map[string]any, error)

CreateTemplate creates a contract template (POST /contract). name and content (the template HTML body) are required; orientation, timezone and font set the rendering options. It returns the decoded JSON response, or an error.

func (*ContractService) DeleteTemplate

func (c *ContractService) DeleteTemplate(templateID string) (map[string]any, error)

DeleteTemplate deletes the contract template identified by templateID (required) (DELETE /contract/{id}). It returns the decoded JSON response, or an error.

func (*ContractService) Generate

func (c *ContractService) Generate(templateID, format, transactionID string, fillData map[string]any) (map[string]any, error)

Generate generates a document from a template (POST /generate). templateID (required) names the template; format defaults to "PDF" when empty; transactionID optionally links the document to an existing transaction whose data prefills the template; fillData supplies additional key/value pairs. It returns the decoded JSON response, or an error.

func (*ContractService) GetTemplate

func (c *ContractService) GetTemplate(templateID string) (map[string]any, error)

GetTemplate retrieves a contract template by its templateID (required) (GET /contract/{id}). It returns the decoded JSON response, or an error.

func (*ContractService) ListTemplate

func (c *ContractService) ListTemplate(order, limit, offset int, filterTemplateID string) (map[string]any, error)

ListTemplate lists contract templates (GET /contract). order sets the sort direction (1 ascending, -1 descending), limit caps the page size, offset skips records for pagination, and filterTemplateID (when non-empty) returns only the matching template. It returns the decoded JSON response, or an error.

func (*ContractService) UpdateTemplate

func (c *ContractService) UpdateTemplate(templateID, name, content, orientation, timezone, font string) (map[string]any, error)

UpdateTemplate updates the contract template identified by templateID (required) (POST /contract/{id}). name, content, orientation, timezone and font replace the stored template's corresponding fields. It returns the decoded JSON response, or an error.

type DocupassCreateRequest

type DocupassCreateRequest struct {
	Profile               string // KYC profile ID (required)
	Mode                  int    // 0=Document+Face, 1=Document, 2=Face, 3=e-Signature
	ContractFormat        string // generated contract format (default "pdf")
	ContractGenerate      string // contract template ID to generate and present
	ContractSign          string // contract template ID requiring an e-signature
	ContractPrefill       string // key/value data (JSON) merged into the contract
	Reusable              bool   // allow the link to be used more than once
	CustomData            string // arbitrary string echoed on the transaction
	Language              string // UI language code for the hosted page
	ReferenceDocument     string // reference document front to match against
	ReferenceDocumentBack string // reference document back to match against
	ReferenceFace         string // reference face image to match against
	UserPhone             string // end-user phone number (e.g. for SMS delivery)
	VerifyAddress         string // assert the holder's address matches this value
	VerifyAge             string // assert the age falls in this range, e.g. "18-40"
	VerifyDOB             string // assert the date of birth; docupass uses the upper-case "verifyDOB" field
	VerifyDocumentNumber  string // assert the document number matches this value
	VerifyName            string // assert the holder's name matches this value
	VerifyPostcode        string // assert the postcode matches this value
}

DocupassCreateRequest holds parameters for creating a Docupass (POST /docupass). Profile is required; all other fields are optional.

type DocupassService

type DocupassService struct {
	// contains filtered or unexported fields
}

DocupassService provides hosted-verification ("Docupass") link management. Access it via Client.Docupass.

func (*DocupassService) Create

func (d *DocupassService) Create(req DocupassCreateRequest) (map[string]any, error)

Create creates a Docupass hosted-verification link from req (POST /docupass). req.Profile is required. It returns the decoded JSON response, or an error.

func (*DocupassService) Delete

func (d *DocupassService) Delete(reference string) (map[string]any, error)

Delete deletes the Docupass identified by reference (required) (DELETE /docupass/{reference}). It returns the decoded JSON response, or an error.

func (*DocupassService) Get

func (d *DocupassService) Get(reference string) (map[string]any, error)

Get retrieves the single Docupass identified by reference (required) (GET /docupass/{reference}). It returns the decoded JSON response, or an error.

func (*DocupassService) List

func (d *DocupassService) List(order, limit, offset int) (map[string]any, error)

List lists Docupass records (GET /docupass). order sets the sort direction (1 ascending, -1 descending), limit caps the page size and offset skips records for pagination. It returns the decoded JSON response, or an error.

type InvalidArgumentError

type InvalidArgumentError struct{ Message string }

InvalidArgumentError is returned for invalid client-side arguments.

func (*InvalidArgumentError) Error

func (e *InvalidArgumentError) Error() string

type KYBService added in v1.1.0

type KYBService struct {
	// contains filtered or unexported fields
}

KYBService provides Know Your Business (KYB) verification: it verifies a business from its registration/incorporation document by extracting the company details, checking official company registries, screening against sanctions/PEP watchlists, and returning directors and owners to verify. Access it via Client.KYB.

func (*KYBService) Verify added in v1.1.0

func (k *KYBService) Verify(req KYBVerifyRequest) (map[string]any, error)

Verify verifies a business from its registration/incorporation document (POST /kyb). A document is required; an optional profile selects the KYC profile. It extracts the company details, checks official company registries, screens against sanctions/PEP watchlists, and returns directors and owners to verify. It returns the decoded JSON response, or an error.

type KYBVerifyRequest added in v1.1.0

type KYBVerifyRequest struct {
	Document string // registration/incorporation document: file path, raw base64, URL, or data URL (required)
	Profile  string // optional KYC profile to apply to the verification
}

KYBVerifyRequest holds parameters for a business verification (POST /kyb). A Document is required; Profile is optional.

type Option

type Option func(*Client) error

Option configures a Client.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL overrides the API base URL entirely (e.g. for an on-premise ID Fort host).

func WithHTTPClient

func WithHTTPClient(h *http.Client) Option

WithHTTPClient sets a custom *http.Client.

func WithRegion

func WithRegion(region string) Option

WithRegion sets the API region ("us" or "eu"). Overrides IDANALYZER_REGION.

type Profile

type Profile struct {
	ID       string         // preset or stored profile ID (see the Security* constants)
	Override map[string]any // per-call setting overrides applied on top of the profile
}

Profile builds a KYC profile / profileOverride object that can be attached to scan, biometric and docupass calls, or used to create/update a stored profile via ProfileService. Its setter methods mutate the receiver and return it, so they can be chained.

func NewProfile

func NewProfile(profileID string) *Profile

NewProfile creates a Profile. If profileID is empty, SecurityNone is used.

func (*Profile) AAMVABarcodeParsing

func (p *Profile) AAMVABarcodeParsing(b bool) *Profile

AAMVABarcodeParsing enables parsing of the AAMVA PDF417 barcode on North American IDs. It returns the receiver for chaining.

func (*Profile) AutoCrop

func (p *Profile) AutoCrop(crop, advancedCrop bool) *Profile

AutoCrop enables cropping of the output image. crop enables basic edge cropping; advancedCrop enables perspective-corrected cropping. It returns the receiver for chaining.

func (*Profile) CanvasSize

func (p *Profile) CanvasSize(pixels int) *Profile

CanvasSize sets the maximum dimension, in pixels, to which input images are scaled before processing. It returns the receiver for chaining.

func (*Profile) DecisionTrigger

func (p *Profile) DecisionTrigger(reviewTrigger, rejectTrigger float64) *Profile

DecisionTrigger sets the aggregate score triggers that move a transaction to "review" (reviewTrigger) or "reject" (rejectTrigger). It returns the receiver for chaining.

func (*Profile) InferFullName

func (p *Profile) InferFullName(b bool) *Profile

InferFullName enables deriving the full name when only name parts are present. It returns the receiver for chaining.

func (*Profile) ObjectDetection

func (p *Profile) ObjectDetection(b bool) *Profile

ObjectDetection enables detection of physical/screen/printout document presentation. It returns the receiver for chaining.

func (*Profile) Obscure

func (p *Profile) Obscure(fieldKeys []string) *Profile

Obscure lists result field keys whose values should be redacted from the response. It returns the receiver for chaining.

func (*Profile) OrientationCorrection

func (p *Profile) OrientationCorrection(b bool) *Profile

OrientationCorrection enables automatic rotation of misaligned document images. It returns the receiver for chaining.

func (*Profile) OutputImage

func (p *Profile) OutputImage(enable bool, format string) *Profile

OutputImage controls whether an output image is returned and, when enable is true, its format (e.g. "jpg" or "png"). It returns the receiver for chaining.

func (*Profile) OutputSize

func (p *Profile) OutputSize(pixels int) *Profile

OutputSize sets the maximum dimension, in pixels, of returned output images. It returns the receiver for chaining.

func (*Profile) RestrictDocumentCountry

func (p *Profile) RestrictDocumentCountry(countryCodes string) *Profile

RestrictDocumentCountry restricts accepted issuing countries to countryCodes (ISO Alpha-2, comma separated). It returns the receiver for chaining.

func (*Profile) RestrictDocumentState

func (p *Profile) RestrictDocumentState(states string) *Profile

RestrictDocumentState restricts accepted issuing states to states (comma separated). It returns the receiver for chaining.

func (*Profile) RestrictDocumentType

func (p *Profile) RestrictDocumentType(documentType string) *Profile

RestrictDocumentType restricts accepted document types to documentType (a combination of the type codes, e.g. "PD" for passport and driver license). It returns the receiver for chaining.

func (*Profile) SaveResult

func (p *Profile) SaveResult(saveTransaction, saveImages bool) *Profile

SaveResult controls whether transaction results and output images are stored. saveTransaction enables persisting the transaction record; saveImages (honored only when saveTransaction is true) also stores the images. It returns the receiver for chaining.

func (*Profile) SetTimezone

func (p *Profile) SetTimezone(tz string) *Profile

SetTimezone sets the timezone (e.g. "America/New_York") used for timestamps in results and reports. It returns the receiver for chaining.

func (*Profile) SetWarning

func (p *Profile) SetWarning(code string, enabled bool, reviewThreshold, rejectThreshold, weight float64) *Profile

SetWarning fine-tunes how the validation component identified by code affects the decision: enabled toggles the component, reviewThreshold and rejectThreshold set its per-component score triggers, and weight scales its contribution. It returns the receiver for chaining.

func (*Profile) SplitFirstName

func (p *Profile) SplitFirstName(b bool) *Profile

SplitFirstName enables splitting a combined first/middle name into separate fields. It returns the receiver for chaining.

func (*Profile) Threshold

func (p *Profile) Threshold(key string, value float64) *Profile

Threshold sets a single named validation threshold (key) to value within the profile's thresholds map. It returns the receiver for chaining.

func (*Profile) TransactionAuditReport

func (p *Profile) TransactionAuditReport(b bool) *Profile

TransactionAuditReport enables generation of a PDF audit report for the transaction. It returns the receiver for chaining.

func (*Profile) Webhook

func (p *Profile) Webhook(url string) *Profile

Webhook sets the URL to which transaction results are POSTed. It returns the receiver for chaining.

type ProfileService

type ProfileService struct {
	// contains filtered or unexported fields
}

ProfileService provides server-side KYC profile management. Access it via Client.Profile.

func (*ProfileService) Create

func (s *ProfileService) Create(name string, p *Profile) (map[string]any, error)

Create creates a KYC profile (POST /profile). name (required) is the profile label; the optional p supplies the profile's settings via its Override map. It returns the decoded JSON response, or an error.

func (*ProfileService) Delete

func (s *ProfileService) Delete(profileID string) (map[string]any, error)

Delete deletes the KYC profile identified by profileID (required) (DELETE /profile/{id}). It returns the decoded JSON response, or an error.

func (*ProfileService) Export

func (s *ProfileService) Export(profileID string) (map[string]any, error)

Export exports the full settings of the KYC profile identified by profileID (required) (GET /export/profile/{id}). It returns the decoded JSON response, or an error.

func (*ProfileService) Get

func (s *ProfileService) Get(profileID string) (map[string]any, error)

Get retrieves the KYC profile identified by profileID (required) (GET /profile/{id}). It returns the decoded JSON response, or an error.

func (*ProfileService) List

func (s *ProfileService) List(order, limit, offset int) (map[string]any, error)

List lists KYC profiles (GET /profile). order sets the sort direction (1 ascending, -1 descending), limit caps the page size and offset skips records for pagination. It returns the decoded JSON response, or an error.

func (*ProfileService) Update

func (s *ProfileService) Update(profileID, name string, p *Profile) (map[string]any, error)

Update updates the KYC profile identified by profileID (required) (PUT /profile/{id}). name sets the profile label and the optional p supplies the settings to store via its Override map. It returns the decoded JSON response, or an error.

type ScanRequest

type ScanRequest struct {
	DocumentFront string   // file path, base64, URL, or "ref:" cache reference (required)
	DocumentBack  string   // back of the document, same accepted forms as DocumentFront
	Face          string   // selfie photo for biometric verification
	FaceVideo     string   // selfie video for biometric verification (used when Face is empty)
	Profile       *Profile // KYC profile to apply (required; build with NewProfile)

	RestrictCountry      string         // accept only these issuing countries (ISO Alpha-2, comma separated)
	RestrictState        string         // accept only these issuing states (comma separated)
	RestrictType         string         // accept only these document types (e.g. "PD")
	VerifyName           string         // assert the holder's name matches this value
	VerifyDob            string         // assert the date of birth (YYYY/MM/DD)
	VerifyAge            string         // assert the age falls in this range, e.g. "18-40"
	VerifyAddress        string         // assert the holder's address matches this value
	VerifyPostcode       string         // assert the postcode matches this value
	VerifyDocumentNumber string         // assert the document number matches this value
	ContractGenerate     string         // contract template ID to fill from the scan result
	ContractFormat       string         // generated contract format (e.g. "PDF")
	ContractPrefill      map[string]any // extra key/value data merged into the contract
	IP                   string         // end-user IP address, for geolocation/risk signals
	CustomData           string         // arbitrary string echoed back on the transaction
}

ScanRequest holds the inputs and options for a standard scan (POST /scan). DocumentFront and Profile are required; all other fields are optional.

type ScannerService

type ScannerService struct {
	// contains filtered or unexported fields
}

ScannerService provides identity document scanning operations. Access it via Client.Scanner.

func (*ScannerService) QuickScan

func (s *ScannerService) QuickScan(documentFront, documentBack string, cacheImage bool) (map[string]any, error)

QuickScan initiates a quick OCR-only scan. documentFront (required) and documentBack accept a file path, base64 string or URL. When cacheImage is true the uploaded image is retained server-side so it can be reused via a "ref:" reference. It returns the decoded JSON response, or an error.

func (*ScannerService) Scan

func (s *ScannerService) Scan(req ScanRequest) (map[string]any, error)

Scan initiates a full identity document scan and optional biometric verification. The request's DocumentFront and Profile fields are required; it returns the decoded JSON response as a map, or an error (including *InvalidArgumentError for missing inputs and *APIError for an API-reported failure).

func (*ScannerService) VeryQuickScan

func (s *ScannerService) VeryQuickScan(documentFront, documentBack string, cacheImage bool) (map[string]any, error)

VeryQuickScan initiates a very fast OCR-only scan. Its parameters and return value match QuickScan; it trades accuracy for lower latency.

type TransactionListOptions

type TransactionListOptions struct {
	Order            int    // sort direction: 1 ascending, -1 descending (default -1)
	Limit            int    // maximum records to return (default 10)
	Offset           int    // records to skip, for pagination
	CreatedAtMin     int    // earliest creation time, Unix seconds (0 = no bound)
	CreatedAtMax     int    // latest creation time, Unix seconds (0 = no bound)
	FilterCustomData string // match the transaction's customData field
	FilterDecision   string // match the decision: "accept", "review" or "reject"
	FilterDocupass   string // match the originating Docupass reference
	FilterProfileID  string // match the KYC profile ID used
}

TransactionListOptions holds filters for listing/exporting transactions. The zero value is valid: Order defaults to -1 (descending) and Limit to 10.

type TransactionService

type TransactionService struct {
	// contains filtered or unexported fields
}

TransactionService provides access to stored transaction records and the image/file vault. Access it via Client.Transaction.

func (*TransactionService) Delete

func (t *TransactionService) Delete(transactionID string) (map[string]any, error)

Delete deletes the transaction identified by transactionID (required) (DELETE /transaction/{id}). It returns the decoded JSON response, or an error.

func (*TransactionService) Export

func (t *TransactionService) Export(dest, exportType string, transactionIDs []string, ignoreUnrecognized, ignoreDuplicate bool, opts TransactionListOptions) error

Export requests a transaction archive and downloads it to the local path dest (required) (POST /export/transaction). exportType is "csv" (default when empty) or "json". transactionIDs, when non-empty, exports only those records; otherwise the date and filter fields of opts (CreatedAtMin/Max, FilterCustomData/Decision/Docupass/ProfileID) select the set. ignoreUnrecognized and ignoreDuplicate skip those records. It returns an error on bad arguments, an API error, or a download failure.

func (*TransactionService) Get

func (t *TransactionService) Get(transactionID string) (map[string]any, error)

Get retrieves the single transaction identified by transactionID (required) (GET /transaction/{id}). It returns the decoded JSON response, or an error.

func (*TransactionService) List

List retrieves transaction history filtered and paginated by opts (GET /transaction). It returns the decoded JSON response, or an error.

func (*TransactionService) SaveFile

func (t *TransactionService) SaveFile(fileName, dest string) error

SaveFile downloads the vault file named fileName (required) and writes it to the local path dest (required) (GET /filevault/{name}). It returns an error if the arguments are missing or the download fails.

func (*TransactionService) SaveImage

func (t *TransactionService) SaveImage(imageToken, dest string) error

SaveImage downloads the vault image identified by imageToken (required) and writes it to the local path dest (required) (GET /imagevault/{token}). It returns an error if the arguments are missing or the download fails.

func (*TransactionService) Update

func (t *TransactionService) Update(transactionID, decision string) (map[string]any, error)

Update overrides the decision on the transaction identified by transactionID (required) (PATCH /transaction/{id}). decision must be one of "accept", "review" or "reject". It returns the decoded JSON response, or an error.

type WebhookService

type WebhookService struct {
	// contains filtered or unexported fields
}

WebhookService provides access to webhook delivery logs. Access it via Client.Webhook.

func (*WebhookService) Delete

func (w *WebhookService) Delete(webhookID string) (map[string]any, error)

Delete deletes the webhook delivery log identified by webhookID (required) (DELETE /webhook/{id}). It returns the decoded JSON response, or an error.

func (*WebhookService) List

func (w *WebhookService) List(order, limit, offset int, event string, success int, createdAtMin, createdAtMax string) (map[string]any, error)

List lists webhook delivery logs (GET /webhook). order sets the sort direction (1 ascending, -1 descending); limit and offset paginate; event (when non-empty) filters by event name; success filters by delivery outcome (0 failed, 1 succeeded — any other value applies no filter); createdAtMin and createdAtMax (when non-empty) bound the creation time. It returns the decoded JSON response, or an error.

func (*WebhookService) Resend

func (w *WebhookService) Resend(webhookID string) (map[string]any, error)

Resend re-delivers the webhook identified by webhookID (required) (POST /webhook/{id}). It returns the decoded JSON response, or an error.

Jump to

Keyboard shortcuts

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