Documentation
¶
Overview ¶
Package idanalyzer is the official Go client library for the ID Analyzer API v2.
It targets the load-balanced api2.idanalyzer.com fleet (US, default) or api2-eu.idanalyzer.com (EU). Create a client with NewClient and use the service fields (Scanner, Biometric, AML, Contract, Transaction, Docupass, Profile, Webhook, Account).
Index ¶
- Constants
- func ParseInput(input string, allowCache bool) (string, error)
- type AMLSearchRequest
- type AMLService
- type APIError
- type AccountService
- type BiometricService
- type Client
- type ContractService
- func (c *ContractService) CreateTemplate(name, content, orientation, timezone, font string) (map[string]any, error)
- func (c *ContractService) DeleteTemplate(templateID string) (map[string]any, error)
- func (c *ContractService) Generate(templateID, format, transactionID string, fillData map[string]any) (map[string]any, error)
- func (c *ContractService) GetTemplate(templateID string) (map[string]any, error)
- func (c *ContractService) ListTemplate(order, limit, offset int, filterTemplateID string) (map[string]any, error)
- func (c *ContractService) UpdateTemplate(templateID, name, content, orientation, timezone, font string) (map[string]any, error)
- type DocupassCreateRequest
- type DocupassService
- func (d *DocupassService) Create(req DocupassCreateRequest) (map[string]any, error)
- func (d *DocupassService) Delete(reference string) (map[string]any, error)
- func (d *DocupassService) Get(reference string) (map[string]any, error)
- func (d *DocupassService) List(order, limit, offset int) (map[string]any, error)
- type InvalidArgumentError
- type Option
- type Profile
- func (p *Profile) AAMVABarcodeParsing(b bool) *Profile
- func (p *Profile) AutoCrop(crop, advancedCrop bool) *Profile
- func (p *Profile) CanvasSize(pixels int) *Profile
- func (p *Profile) DecisionTrigger(reviewTrigger, rejectTrigger float64) *Profile
- func (p *Profile) InferFullName(b bool) *Profile
- func (p *Profile) ObjectDetection(b bool) *Profile
- func (p *Profile) Obscure(fieldKeys []string) *Profile
- func (p *Profile) OrientationCorrection(b bool) *Profile
- func (p *Profile) OutputImage(enable bool, format string) *Profile
- func (p *Profile) OutputSize(pixels int) *Profile
- func (p *Profile) RestrictDocumentCountry(countryCodes string) *Profile
- func (p *Profile) RestrictDocumentState(states string) *Profile
- func (p *Profile) RestrictDocumentType(documentType string) *Profile
- func (p *Profile) SaveResult(saveTransaction, saveImages bool) *Profile
- func (p *Profile) SetTimezone(tz string) *Profile
- func (p *Profile) SetWarning(code string, enabled bool, reviewThreshold, rejectThreshold, weight float64) *Profile
- func (p *Profile) SplitFirstName(b bool) *Profile
- func (p *Profile) Threshold(key string, value float64) *Profile
- func (p *Profile) TransactionAuditReport(b bool) *Profile
- func (p *Profile) Webhook(url string) *Profile
- type ProfileService
- func (s *ProfileService) Create(name string, p *Profile) (map[string]any, error)
- func (s *ProfileService) Delete(profileID string) (map[string]any, error)
- func (s *ProfileService) Export(profileID string) (map[string]any, error)
- func (s *ProfileService) Get(profileID string) (map[string]any, error)
- func (s *ProfileService) List(order, limit, offset int) (map[string]any, error)
- func (s *ProfileService) Update(profileID, name string, p *Profile) (map[string]any, error)
- type ScanRequest
- type ScannerService
- type TransactionListOptions
- type TransactionService
- func (t *TransactionService) Delete(transactionID string) (map[string]any, error)
- func (t *TransactionService) Export(dest, exportType string, transactionIDs []string, ...) error
- func (t *TransactionService) Get(transactionID string) (map[string]any, error)
- func (t *TransactionService) List(opts TransactionListOptions) (map[string]any, error)
- func (t *TransactionService) SaveFile(fileName, dest string) error
- func (t *TransactionService) SaveImage(imageToken, dest string) error
- func (t *TransactionService) Update(transactionID, decision string) (map[string]any, error)
- type WebhookService
Constants ¶
const ( SecurityNone = "security_none" SecurityLow = "security_low" SecurityMedium = "security_medium" SecurityHigh = "security_high" )
Preset KYC profile IDs.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AMLSearchRequest ¶
type AMLSearchRequest struct {
Name string
IDNumber string
Entity int // 0=Person, 1=Corporation/Legal Entity
Country string
Database []string
BirthYear string
}
AMLSearchRequest holds parameters for an AML v1 search (POST /aml).
type AMLService ¶
type AMLService struct {
// contains filtered or unexported fields
}
func (*AMLService) Search ¶
func (a *AMLService) Search(req AMLSearchRequest) (map[string]any, error)
Search screens against the AML database (POST /aml).
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
type BiometricService ¶
type BiometricService struct {
// contains filtered or unexported fields
}
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).
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).
type Client ¶
type Client struct {
Scanner *ScannerService
Biometric *BiometricService
AML *AMLService
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.
type ContractService ¶
type ContractService struct {
// contains filtered or unexported fields
}
func (*ContractService) CreateTemplate ¶
func (c *ContractService) CreateTemplate(name, content, orientation, timezone, font string) (map[string]any, error)
CreateTemplate creates a contract template (POST /contract).
func (*ContractService) DeleteTemplate ¶
func (c *ContractService) DeleteTemplate(templateID string) (map[string]any, error)
DeleteTemplate deletes a contract template (DELETE /contract/{id}).
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).
func (*ContractService) GetTemplate ¶
func (c *ContractService) GetTemplate(templateID string) (map[string]any, error)
GetTemplate retrieves a contract template (GET /contract/{id}).
func (*ContractService) ListTemplate ¶
func (c *ContractService) ListTemplate(order, limit, offset int, filterTemplateID string) (map[string]any, error)
ListTemplate lists contract templates (GET /contract).
func (*ContractService) UpdateTemplate ¶
func (c *ContractService) UpdateTemplate(templateID, name, content, orientation, timezone, font string) (map[string]any, error)
UpdateTemplate updates a contract template (POST /contract/{id}).
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
ContractGenerate string
ContractSign string
ContractPrefill string
Reusable bool
CustomData string
Language string
ReferenceDocument string
ReferenceDocumentBack string
ReferenceFace string
UserPhone string
VerifyAddress string
VerifyAge string
VerifyDOB string // note: docupass uses the upper-case "verifyDOB" field
VerifyDocumentNumber string
VerifyName string
VerifyPostcode string
}
DocupassCreateRequest holds parameters for creating a Docupass (POST /docupass).
type DocupassService ¶
type DocupassService struct {
// contains filtered or unexported fields
}
func (*DocupassService) Create ¶
func (d *DocupassService) Create(req DocupassCreateRequest) (map[string]any, error)
Create creates a Docupass link (POST /docupass).
func (*DocupassService) Delete ¶
func (d *DocupassService) Delete(reference string) (map[string]any, error)
Delete deletes a Docupass (DELETE /docupass/{reference}).
type InvalidArgumentError ¶
type InvalidArgumentError struct{ Message string }
InvalidArgumentError is returned for invalid client-side arguments.
func (*InvalidArgumentError) Error ¶
func (e *InvalidArgumentError) Error() string
type Option ¶
Option configures a Client.
func WithBaseURL ¶
WithBaseURL overrides the API base URL entirely (e.g. for an on-premise ID Fort host).
func WithHTTPClient ¶
WithHTTPClient sets a custom *http.Client.
func WithRegion ¶
WithRegion sets the API region ("us" or "eu"). Overrides IDANALYZER_REGION.
type 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.
func NewProfile ¶
NewProfile creates a Profile. If profileID is empty, SecurityNone is used.
func (*Profile) AAMVABarcodeParsing ¶
func (*Profile) CanvasSize ¶
func (*Profile) DecisionTrigger ¶
DecisionTrigger sets the review/reject score triggers.
func (*Profile) InferFullName ¶
func (*Profile) ObjectDetection ¶
func (*Profile) OrientationCorrection ¶
func (*Profile) OutputImage ¶
OutputImage controls whether an output image is returned, and its format.
func (*Profile) OutputSize ¶
func (*Profile) RestrictDocumentCountry ¶
RestrictDocumentCountry restricts accepted issuing countries (ISO Alpha-2, comma separated).
func (*Profile) RestrictDocumentState ¶
RestrictDocumentState restricts accepted issuing states (comma separated).
func (*Profile) RestrictDocumentType ¶
RestrictDocumentType restricts accepted document types (e.g. "PD").
func (*Profile) SaveResult ¶
SaveResult controls whether transaction results and output images are stored.
func (*Profile) SetTimezone ¶
func (*Profile) SetWarning ¶
func (p *Profile) SetWarning(code string, enabled bool, reviewThreshold, rejectThreshold, weight float64) *Profile
SetWarning fine-tunes how a validation component affects the decision.
func (*Profile) SplitFirstName ¶
func (*Profile) TransactionAuditReport ¶
type ProfileService ¶
type ProfileService struct {
// contains filtered or unexported fields
}
func (*ProfileService) Delete ¶
func (s *ProfileService) Delete(profileID string) (map[string]any, error)
Delete deletes a KYC profile (DELETE /profile/{id}).
func (*ProfileService) Export ¶
func (s *ProfileService) Export(profileID string) (map[string]any, error)
Export exports a KYC profile (GET /export/profile/{id}).
func (*ProfileService) Get ¶
func (s *ProfileService) Get(profileID string) (map[string]any, error)
Get retrieves a KYC profile (GET /profile/{id}).
type ScanRequest ¶
type ScanRequest struct {
DocumentFront string // file path, base64, URL, or "ref:" cache reference (required)
DocumentBack string
Face string // selfie photo for biometric verification
FaceVideo string // selfie video for biometric verification
Profile *Profile
RestrictCountry string
RestrictState string
RestrictType string
VerifyName string
VerifyDob string // YYYY/MM/DD
VerifyAge string // e.g. "18-40"
VerifyAddress string
VerifyPostcode string
VerifyDocumentNumber string
ContractGenerate string
ContractFormat string
ContractPrefill map[string]any
IP string
CustomData string
}
ScanRequest holds the inputs and options for a standard scan (POST /scan).
type ScannerService ¶
type ScannerService struct {
// contains filtered or unexported fields
}
func (*ScannerService) QuickScan ¶
func (s *ScannerService) QuickScan(documentFront, documentBack string, cacheImage bool) (map[string]any, error)
QuickScan initiates a quick OCR-only scan.
func (*ScannerService) Scan ¶
func (s *ScannerService) Scan(req ScanRequest) (map[string]any, error)
Scan initiates a full identity document scan and optional biometric verification.
func (*ScannerService) VeryQuickScan ¶
func (s *ScannerService) VeryQuickScan(documentFront, documentBack string, cacheImage bool) (map[string]any, error)
VeryQuickScan initiates a very fast OCR-only scan.
type TransactionListOptions ¶
type TransactionListOptions struct {
Order int
Limit int
Offset int
CreatedAtMin int
CreatedAtMax int
FilterCustomData string
FilterDecision string
FilterDocupass string
FilterProfileID string
}
TransactionListOptions holds filters for listing/exporting transactions.
type TransactionService ¶
type TransactionService struct {
// contains filtered or unexported fields
}
func (*TransactionService) Delete ¶
func (t *TransactionService) Delete(transactionID string) (map[string]any, error)
Delete deletes a transaction (DELETE /transaction/{id}).
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 dest (POST /export/transaction).
func (*TransactionService) Get ¶
func (t *TransactionService) Get(transactionID string) (map[string]any, error)
Get retrieves a single transaction (GET /transaction/{id}).
func (*TransactionService) List ¶
func (t *TransactionService) List(opts TransactionListOptions) (map[string]any, error)
List retrieves transaction history (GET /transaction).
func (*TransactionService) SaveFile ¶
func (t *TransactionService) SaveFile(fileName, dest string) error
SaveFile downloads a vault file to dest (GET /filevault/{name}).
func (*TransactionService) SaveImage ¶
func (t *TransactionService) SaveImage(imageToken, dest string) error
SaveImage downloads a vault image to dest (GET /imagevault/{token}).
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
func (*WebhookService) Delete ¶
func (w *WebhookService) Delete(webhookID string) (map[string]any, error)
Delete deletes a webhook delivery log (DELETE /webhook/{id}).