Documentation
¶
Overview ¶
Package verisec is the official Go library for the VeriSec API: identity (KYC) checks on faces, documents, MRZ, contact details and sanctions, and Financial reads of cheques, payment cards, banks and BINs.
Create a client with your key, then call an API:
client, err := verisec.New(os.Getenv("VERISEC_API_KEY")) // sk_test_… or ak_live_…
if err != nil {
log.Fatal(err)
}
result, err := client.Face.Verify(ctx, &verisec.FaceVerifyParams{
Image1: verisec.ImageFromPath("selfie.jpg"),
Image2: verisec.ImageFromPath("id-photo.jpg"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Match, result.Similarity, result.LastResponse.RequestID)
Every API is a method named after its operationId (face.verify is Client.Face.Verify, phone.otp.send is Client.Phone.Otp.Send). It takes a context, its params (the operation's x-params-type, such as FaceVerifyParams) and request options, and returns the answer type: for KYC the envelope's data, for Financial the answer object, each with a LastResponse field (status, headers, request id, warnings, latency). The answers of the major APIs (Face Match, Document Read, Sanctions Screening, …) are open results: see OpenResult.
KYC images are Image values (ImageFromPath, ImageFromBytes, ImageFromReader, ImageFromBase64), sent as base64; Financial uploads are *File values (FileFromPath, FileFromBytes, FileFromReader), sent as multipart/form-data.
Live keys (ak_live_…) also take WithClientCredentials: the client exchanges them for a short-lived token and keeps it fresh. Calls are charged only when they succeed, so the client sends a call again only when nothing can have been charged (a 429, a 5xx, a connection that never opened), never after a timeout or a connection that dropped once the request was sent. Errors are *APIError (IsInsufficientCredits, IsRateLimited, …) and *ConnectionError values. ConstructEvent verifies and parses webhook deliveries (Standard Webhooks).
The types and the resource methods are generated from the API's OpenAPI description (spec/openapi.json) by internal/gen: go generate ./... after the spec changes.
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func Float(v float64) *float64
- func GenerateTestHeaders(payload []byte, secret string, timestamp ...time.Time) http.Header
- func Int(v int64) *int64
- func IsAuthentication(err error) bool
- func IsInsufficientCredits(err error) bool
- func IsInvalidRequest(err error) bool
- func IsNotFound(err error) bool
- func IsPermission(err error) bool
- func IsRateLimited(err error) bool
- func IsServerError(err error) bool
- func String(v string) *string
- func VerifySignature(payload []byte, headers http.Header, secret string, tolerance ...time.Duration) error
- type APIError
- type AgeGateCheckout
- type AgeGateCheckoutMetadata
- type AgeGateCheckoutMetadataCtx
- type AgeGateCheckoutParams
- type AgeGateCheckoutResponse
- type AgeGateService
- type AgeService
- type AgeVerify
- type AgeVerifyLive
- type AgeVerifyLiveMetadata
- type AgeVerifyLiveMetadataCtx
- type AgeVerifyLiveParams
- type AgeVerifyLiveResponse
- type AgeVerifyMetadata
- type AgeVerifyMetadataCtx
- type AgeVerifyParams
- type AgeVerifyResponse
- type ApiEnv
- type BankLookup
- type BankLookupParams
- type BankLookupQuery
- type BankMatch
- type BankMatchRead
- type BankResolved
- type BanksService
- type BinRecord
- type BinService
- type CardCheck
- type CardCheckParams
- type CardExpiry
- type CardExpiryParams
- type CardField
- type CardFingerprint
- type CardFingerprintParams
- type CardNumber
- type CardNumberParams
- type CardRead
- type CardReadParams
- type CardReadSchemeChecks
- type CardResponse
- type CardResponseImage
- type CardsService
- func (s *CardsService) Check(ctx context.Context, params *CardCheckParams, opts ...RequestOption) (*CardCheck, error)
- func (s *CardsService) Expiry(ctx context.Context, params *CardExpiryParams, opts ...RequestOption) (*CardExpiry, error)
- func (s *CardsService) Fingerprint(ctx context.Context, params *CardFingerprintParams, opts ...RequestOption) (*CardFingerprint, error)
- func (s *CardsService) Number(ctx context.Context, params *CardNumberParams, opts ...RequestOption) (*CardNumber, error)
- func (s *CardsService) Read(ctx context.Context, params *CardReadParams, opts ...RequestOption) (*CardResponse, error)
- type ChequeAmount
- type ChequeAmountCurrency
- type ChequeAmountParams
- type ChequeBank
- type ChequeBankCountry
- type ChequeBankParams
- type ChequeBankRead
- type ChequeDate
- type ChequeDateParams
- type ChequeDeepRead
- type ChequeDeepReadImage
- type ChequeDeepReadImageQuality
- type ChequeDeepReadTiming
- type ChequeMicrLineParams
- type ChequeMicrParams
- type ChequeParties
- type ChequePartiesParams
- type ChequeReadParams
- type ChequeResponse
- type ChequeResponseImage
- type ChequeResponseQuality
- type ChequeResponseReadOn
- type ChequesService
- func (s *ChequesService) Amount(ctx context.Context, params *ChequeAmountParams, opts ...RequestOption) (*ChequeAmount, error)
- func (s *ChequesService) Bank(ctx context.Context, params *ChequeBankParams, opts ...RequestOption) (*ChequeBank, error)
- func (s *ChequesService) Date(ctx context.Context, params *ChequeDateParams, opts ...RequestOption) (*ChequeDate, error)
- func (s *ChequesService) Micr(ctx context.Context, params *ChequeMicrParams, opts ...RequestOption) (*ChequeResponse, error)
- func (s *ChequesService) MicrLine(ctx context.Context, params *ChequeMicrLineParams, opts ...RequestOption) (*MicrLine, error)
- func (s *ChequesService) Parties(ctx context.Context, params *ChequePartiesParams, opts ...RequestOption) (*ChequeParties, error)
- func (s *ChequesService) Read(ctx context.Context, params *ChequeReadParams, opts ...RequestOption) (*ChequeDeepRead, error)
- type Client
- type ClientOption
- type ConnectionError
- type ContactDossier
- type ContactDossierParams
- type ContactDossierResponse
- type ContactService
- type CountryInfo
- type DeepCheque
- type DeepChequeMicr
- type DeepChequeMicrQuality
- type DocumentAuthenticity
- type DocumentAuthenticityCheck
- type DocumentAuthenticityImageQuality
- type DocumentAuthenticityParams
- type DocumentAuthenticityResponse
- type DocumentAuthenticitySummary
- type DocumentClassify
- type DocumentClassifyParams
- type DocumentClassifyResponse
- type DocumentFields
- type DocumentFieldsField
- type DocumentFieldsParams
- type DocumentFieldsResponse
- type DocumentFieldsSummary
- type DocumentMrz
- type DocumentMrzCheckDigits
- type DocumentMrzCheckDigitsBirthDate
- type DocumentMrzCheckDigitsComposite
- type DocumentMrzCheckDigitsDocNumber
- type DocumentMrzCheckDigitsExpiry
- type DocumentMrzCheckDigitsPersonalNumber
- type DocumentMrzParams
- type DocumentMrzParsed
- type DocumentMrzPrintQuality
- type DocumentMrzProblem
- type DocumentMrzResponse
- type DocumentPortrait
- type DocumentPortraitParams
- type DocumentPortraitResponse
- type DocumentRead
- type DocumentReadParams
- type DocumentReadParamsDocHint
- type DocumentReadResponse
- type DocumentsService
- func (s *DocumentsService) Authenticity(ctx context.Context, params *DocumentAuthenticityParams, opts ...RequestOption) (*DocumentAuthenticity, error)
- func (s *DocumentsService) Classify(ctx context.Context, params *DocumentClassifyParams, opts ...RequestOption) (*DocumentClassify, error)
- func (s *DocumentsService) Fields(ctx context.Context, params *DocumentFieldsParams, opts ...RequestOption) (*DocumentFields, error)
- func (s *DocumentsService) Mrz(ctx context.Context, params *DocumentMrzParams, opts ...RequestOption) (*DocumentMrz, error)
- func (s *DocumentsService) Portrait(ctx context.Context, params *DocumentPortraitParams, opts ...RequestOption) (*DocumentPortrait, error)
- func (s *DocumentsService) Read(ctx context.Context, params *DocumentReadParams, opts ...RequestOption) (*DocumentRead, error)
- type EmailFootprint
- type EmailFootprintAccount
- type EmailFootprintParams
- type EmailFootprintResponse
- type EmailService
- type EmailVerify
- type EmailVerifyMailServer
- type EmailVerifyParams
- type EmailVerifyResponse
- type EmailVerifyRisk
- type ExpiryStatus
- type FaceAge
- type FaceAgeParams
- type FaceAgeParamsCrop
- type FaceAgeResponse
- type FaceAnalyze
- type FaceAnalyzeParams
- type FaceAnalyzeParamsCrop
- type FaceAnalyzeResponse
- type FaceAttributes
- type FaceAttributesFace
- type FaceAttributesFaceAttribute
- type FaceAttributesMetadata
- type FaceAttributesMetadataCtx
- type FaceAttributesParams
- type FaceAttributesResponse
- type FaceCluster
- type FaceClusterMetadata
- type FaceClusterMetadataCtx
- type FaceClusterPair
- type FaceClusterParams
- type FaceClusterParamsFace
- type FaceClusterResponse
- type FaceCount
- type FaceCountFace
- type FaceCountMetadata
- type FaceCountMetadataCtx
- type FaceCountParams
- type FaceCountResponse
- type FaceCrop
- type FaceCropCrop
- type FaceCropMetadata
- type FaceCropMetadataCtx
- type FaceCropParams
- type FaceCropResponse
- type FaceDedupe
- type FaceDedupeMetadata
- type FaceDedupeMetadataCtx
- type FaceDedupeParams
- type FaceDedupeParamsExisting
- type FaceDedupeResponse
- type FaceDetect
- type FaceDetectFace
- type FaceDetectMetadata
- type FaceDetectMetadataCtx
- type FaceDetectParams
- type FaceDetectResponse
- type FaceEmotion
- type FaceEmotionFace
- type FaceEmotionMetadata
- type FaceEmotionMetadataCtx
- type FaceEmotionParams
- type FaceEmotionResponse
- type FaceLoginAuthenticate
- type FaceLoginAuthenticateMetadata
- type FaceLoginAuthenticateMetadataCtx
- type FaceLoginAuthenticateParams
- type FaceLoginAuthenticateParamsGallery
- type FaceLoginAuthenticateResponse
- type FaceLoginService
- type FaceMatch
- type FaceMatchParams
- type FaceMatchParamsCrop
- type FaceMatchParamsImage
- type FaceMatchResponse
- type FacePpe
- type FacePpeFace
- type FacePpeMetadata
- type FacePpeMetadataCtx
- type FacePpeParams
- type FacePpeResponse
- type FaceQuality
- type FaceQualityParams
- type FaceQualityParamsOutput
- type FaceQualityParamsOutputCrop
- type FaceQualityResponse
- type FaceRedact
- type FaceRedactMetadata
- type FaceRedactMetadataCtx
- type FaceRedactParams
- type FaceRedactResponse
- type FaceSearch
- type FaceSearchBest
- type FaceSearchMatch
- type FaceSearchMetadata
- type FaceSearchMetadataCtx
- type FaceSearchParams
- type FaceSearchParamsGallery
- type FaceSearchResponse
- type FaceService
- func (s *FaceService) Age(ctx context.Context, params *FaceAgeParams, opts ...RequestOption) (*FaceAge, error)
- func (s *FaceService) Analyze(ctx context.Context, params *FaceAnalyzeParams, opts ...RequestOption) (*FaceAnalyze, error)
- func (s *FaceService) Attributes(ctx context.Context, params *FaceAttributesParams, opts ...RequestOption) (*FaceAttributes, error)
- func (s *FaceService) Cluster(ctx context.Context, params *FaceClusterParams, opts ...RequestOption) (*FaceCluster, error)
- func (s *FaceService) Count(ctx context.Context, params *FaceCountParams, opts ...RequestOption) (*FaceCount, error)
- func (s *FaceService) Crop(ctx context.Context, params *FaceCropParams, opts ...RequestOption) (*FaceCrop, error)
- func (s *FaceService) Dedupe(ctx context.Context, params *FaceDedupeParams, opts ...RequestOption) (*FaceDedupe, error)
- func (s *FaceService) Detect(ctx context.Context, params *FaceDetectParams, opts ...RequestOption) (*FaceDetect, error)
- func (s *FaceService) Emotion(ctx context.Context, params *FaceEmotionParams, opts ...RequestOption) (*FaceEmotion, error)
- func (s *FaceService) Match(ctx context.Context, params *FaceMatchParams, opts ...RequestOption) (*FaceMatch, error)
- func (s *FaceService) Ppe(ctx context.Context, params *FacePpeParams, opts ...RequestOption) (*FacePpe, error)
- func (s *FaceService) Quality(ctx context.Context, params *FaceQualityParams, opts ...RequestOption) (*FaceQuality, error)
- func (s *FaceService) Redact(ctx context.Context, params *FaceRedactParams, opts ...RequestOption) (*FaceRedact, error)
- func (s *FaceService) Search(ctx context.Context, params *FaceSearchParams, opts ...RequestOption) (*FaceSearch, error)
- func (s *FaceService) Similarity(ctx context.Context, params *FaceSimilarityParams, opts ...RequestOption) (*FaceSimilarity, error)
- func (s *FaceService) Verify(ctx context.Context, params *FaceVerifyParams, opts ...RequestOption) (*FaceVerify, error)
- func (s *FaceService) Watchlist(ctx context.Context, params *FaceWatchlistParams, opts ...RequestOption) (*FaceWatchlist, error)
- type FaceSimilarity
- type FaceSimilarityCompared
- type FaceSimilarityMetadata
- type FaceSimilarityMetadataCtx
- type FaceSimilarityParams
- type FaceSimilarityResponse
- type FaceVerify
- type FaceVerifyCompared
- type FaceVerifyMetadata
- type FaceVerifyMetadataCtx
- type FaceVerifyParams
- type FaceVerifyResponse
- type FaceWatchlist
- type FaceWatchlistEntry
- type FaceWatchlistMetadata
- type FaceWatchlistMetadataCtx
- type FaceWatchlistParams
- type FaceWatchlistParamsList
- type FaceWatchlistResponse
- type File
- type FraudService
- type FraudSignupCheck
- type FraudSignupCheckMetadata
- type FraudSignupCheckMetadataCtx
- type FraudSignupCheckParams
- type FraudSignupCheckParamsExisting
- type FraudSignupCheckResponse
- type IdentityService
- type IdentityVerify
- type IdentityVerifyMetadata
- type IdentityVerifyMetadataCtx
- type IdentityVerifyParams
- type IdentityVerifyResponse
- type IdentityVerifySteps
- type IdentityVerifyStepsLiveness
- type IdentityVerifyStepsMatch
- type IdentityVerifyStepsQuality
- type Image
- type IpAnalyze
- type IpAnalyzeAnonymity
- type IpAnalyzeLocation
- type IpAnalyzeLocationCoordinates
- type IpAnalyzeNetwork
- type IpAnalyzeParams
- type IpAnalyzeResponse
- type IpService
- type IssueCode
- type KioskPhoto
- type KioskPhotoMetadata
- type KioskPhotoMetadataCtx
- type KioskPhotoParams
- type KioskPhotoResponse
- type KioskService
- type LivenessAntispoof
- type LivenessAntispoofMetadata
- type LivenessAntispoofMetadataCtx
- type LivenessAntispoofParams
- type LivenessAntispoofResponse
- type LivenessCheck
- type LivenessCheckParams
- type LivenessCheckResponse
- type LivenessGate
- type LivenessGateMetadata
- type LivenessGateMetadataCtx
- type LivenessGateParams
- type LivenessGateResponse
- type LivenessService
- func (s *LivenessService) Antispoof(ctx context.Context, params *LivenessAntispoofParams, opts ...RequestOption) (*LivenessAntispoof, error)
- func (s *LivenessService) Check(ctx context.Context, params *LivenessCheckParams, opts ...RequestOption) (*LivenessCheck, error)
- func (s *LivenessService) Gate(ctx context.Context, params *LivenessGateParams, opts ...RequestOption) (*LivenessGate, error)
- type MicrField
- type MicrLine
- type MicrLineLine
- type MicrNamedValue
- type MicrNamedValuePart
- type MicrStandardLayout
- type MicrTemplate
- type MicrZone
- type MrzParse
- type MrzParseParams
- type MrzParseParsed
- type MrzParseParsedCheckDigits
- type MrzParseParsedCheckDigitsBirthDate
- type MrzParseParsedCheckDigitsComposite
- type MrzParseParsedCheckDigitsDocNumber
- type MrzParseParsedCheckDigitsExpiry
- type MrzParseParsedCheckDigitsPersonalNumber
- type MrzParseResponse
- type MrzRead
- type MrzReadParams
- type MrzReadResponse
- type MrzRecognize
- type MrzRecognizeParams
- type MrzRecognizeResponse
- type MrzService
- func (s *MrzService) Parse(ctx context.Context, params *MrzParseParams, opts ...RequestOption) (*MrzParse, error)
- func (s *MrzService) Read(ctx context.Context, params *MrzReadParams, opts ...RequestOption) (*MrzRead, error)
- func (s *MrzService) Recognize(ctx context.Context, params *MrzRecognizeParams, opts ...RequestOption) (*MrzRecognize, error)
- type OpenResult
- type OsintService
- type OsintUsername
- type OsintUsernameParams
- type OsintUsernameProfile
- type OsintUsernameResponse
- type OsintWeb
- type OsintWebLeftOut
- type OsintWebParams
- type OsintWebResponse
- type OsintWebResult
- type PhoneLookup
- type PhoneLookupCallForwarding
- type PhoneLookupCaller
- type PhoneLookupCountry
- type PhoneLookupFormat
- type PhoneLookupLine
- type PhoneLookupParams
- type PhoneLookupResponse
- type PhoneLookupRisk
- type PhoneLookupSimSwap
- type PhoneLookupSmsPumping
- type PhoneOtpCheck
- type PhoneOtpCheckParams
- type PhoneOtpCheckResponse
- type PhoneOtpSend
- type PhoneOtpSendParams
- type PhoneOtpSendResponse
- type PhoneOtpService
- type PhoneService
- type PhotoAutofix
- type PhotoAutofixMetadata
- type PhotoAutofixMetadataCtx
- type PhotoAutofixParams
- type PhotoAutofixResponse
- type PhotoBestFrame
- type PhotoBestFrameMetadata
- type PhotoBestFrameMetadataCtx
- type PhotoBestFrameParams
- type PhotoBestFrameRanking
- type PhotoBestFrameResponse
- type PhotoCompliance
- type PhotoComplianceCheck
- type PhotoComplianceMetadata
- type PhotoComplianceMetadataCtx
- type PhotoComplianceParams
- type PhotoComplianceResponse
- type PhotoGate
- type PhotoGateMetadata
- type PhotoGateMetadataCtx
- type PhotoGateParams
- type PhotoGateResponse
- type PhotoPolicy
- type PhotoPolicyCheck
- type PhotoPolicyMetadata
- type PhotoPolicyMetadataCtx
- type PhotoPolicyParams
- type PhotoPolicyResponse
- type PhotoService
- func (s *PhotoService) Autofix(ctx context.Context, params *PhotoAutofixParams, opts ...RequestOption) (*PhotoAutofix, error)
- func (s *PhotoService) BestFrame(ctx context.Context, params *PhotoBestFrameParams, opts ...RequestOption) (*PhotoBestFrame, error)
- func (s *PhotoService) Compliance(ctx context.Context, params *PhotoComplianceParams, opts ...RequestOption) (*PhotoCompliance, error)
- func (s *PhotoService) Gate(ctx context.Context, params *PhotoGateParams, opts ...RequestOption) (*PhotoGate, error)
- func (s *PhotoService) Policy(ctx context.Context, params *PhotoPolicyParams, opts ...RequestOption) (*PhotoPolicy, error)
- type ProctorCheck
- type ProctorCheckMetadata
- type ProctorCheckMetadataCtx
- type ProctorCheckParams
- type ProctorCheckResponse
- type ProctorService
- type ProofOfAddressAnalyze
- type ProofOfAddressAnalyzeParams
- type ProofOfAddressAnalyzeParamsExpected
- type ProofOfAddressAnalyzeResponse
- type ProofOfAddressService
- type RequestOption
- type ResolvedCurrency
- type ResponseInfo
- type RoutingProof
- type RoutingType
- type ScanSource
- type ScanStatus
- type ScreeningCrypto
- type ScreeningCryptoCounts
- type ScreeningCryptoParams
- type ScreeningCryptoResponse
- type ScreeningCryptoResult
- type ScreeningCryptoResultLabel
- type ScreeningCryptoResultListing
- type ScreeningIp
- type ScreeningIpParams
- type ScreeningIpResponse
- type ScreeningSanctions
- type ScreeningSanctionsParams
- type ScreeningSanctionsResponse
- type ScreeningService
- func (s *ScreeningService) Crypto(ctx context.Context, params *ScreeningCryptoParams, opts ...RequestOption) (*ScreeningCrypto, error)
- func (s *ScreeningService) Ip(ctx context.Context, params *ScreeningIpParams, opts ...RequestOption) (*ScreeningIp, error)
- func (s *ScreeningService) Sanctions(ctx context.Context, params *ScreeningSanctionsParams, opts ...RequestOption) (*ScreeningSanctions, error)
- type SignatureVerificationError
- type TextBoxes
- type TextBoxesBox
- type VisionField
- type VisionResult
- type VisionResultAmount
- type VisionResultBank
- type VisionResultCrossing
- type VisionResultCurrency
- type VisionResultDate
- type VisionResultDrawer
- type VisionResultSignature
- type WebhookEvent
Examples ¶
Constants ¶
const ( // DefaultBaseURL is where requests go unless WithBaseURL or VERISEC_BASE_URL says otherwise. DefaultBaseURL = "https://verisec.mmose.me" // DefaultTimeout is how long one attempt may take. A deep cheque read can take up to about 250 seconds, and a // call cut off by the client may still finish, and be charged, on the server. DefaultTimeout = 300 * time.Second // DefaultMaxRetries is how many times a call is sent again when nothing can have been charged (so three // attempts in all). DefaultMaxRetries = 2 )
const DefaultWebhookTolerance = 300 * time.Second
DefaultWebhookTolerance is how far a delivery's timestamp may be from now before it is rejected as a possible replay.
const Version = "1.0.0"
Version is the version of this library, sent in the User-Agent header.
Variables ¶
var ( // ErrNoAPIKey is returned by New when it gets no API key and VERISEC_API_KEY is unset. ErrNoAPIKey = errors.New("verisec: no API key: pass one to verisec.New or set VERISEC_API_KEY") // ErrNoClientCredentials is returned by New for a live key (ak_live_…) without its client id and secret. ErrNoClientCredentials = errors.New("verisec: a live key (ak_live_…) also needs its client id and secret: pass verisec.WithClientCredentials(id, secret), or set VERISEC_CLIENT_ID and VERISEC_CLIENT_SECRET") )
Functions ¶
func GenerateTestHeaders ¶
GenerateTestHeaders signs payload with secret the way VeriSec signs deliveries, for testing your webhook handler: webhook-id (random), webhook-timestamp (now, or the time you pass) and webhook-signature.
func IsAuthentication ¶
IsAuthentication reports whether err is a 401: no API key, or a key (or live token) that is not valid, expired or revoked, or a wrong client id or secret.
func IsInsufficientCredits ¶
IsInsufficientCredits reports whether err is a 402: not enough credits for the call, or the key reached its spend cap. Nothing was charged.
func IsInvalidRequest ¶
IsInvalidRequest reports whether err is an API error about the request itself: a field missing or not valid, a file too large or not an image (400, 413, 415, 422 and the other 4xx below).
func IsPermission ¶
IsPermission reports whether err is a 403: the key may not call this API (permission, environment or IP allow-list).
func IsRateLimited ¶
IsRateLimited reports whether err is a 429 that was still refused after the retries: wait RetryAfter. Nothing was charged.
func IsServerError ¶
IsServerError reports whether err is a 5xx that persisted through the retries: the check could not run. Nothing was charged; it is safe to try again later.
func VerifySignature ¶
func VerifySignature(payload []byte, headers http.Header, secret string, tolerance ...time.Duration) error
VerifySignature checks a webhook delivery against the raw request body and your endpoint's signing secret (whsec_…, shown once when you create the endpoint). Deliveries are signed as Standard Webhooks: the headers webhook-id, webhook-timestamp and webhook-signature, the signature being "v1,<base64 HMAC-SHA256 of id.timestamp.body>" (several, space-separated, while a secret rotates; any match passes). The svix-id, svix-timestamp and svix-signature names work too, and header names are matched in any case.
It returns a *SignatureVerificationError when a header is missing, no signature matches, or the timestamp is more than the tolerance from now: five minutes, or the tolerance you pass (zero or less skips the time check). Pass the body exactly as it arrived, before any JSON parsing.
Types ¶
type APIError ¶
type APIError struct {
// Status is the HTTP status code.
Status int
// Code is the machine-readable reason, such as "invalid_input", "parameter_unknown", "missing_key" or
// "insufficient_credits". Empty when the answer has none.
Code string
// Message says what went wrong, for developers.
Message string
// Param is the request field the error is about, in the API's spelling, when there is one.
Param string
// RequestID identifies the call. Quote it when you contact support.
RequestID string
// RetryAfter is how long the API asked you to wait (the Retry-After header), mostly on a 429. Zero when it
// did not say.
RetryAfter time.Duration
// Header holds the response headers.
Header http.Header
}
APIError is an error answer from the VeriSec API: a 4xx or 5xx status, or a KYC answer with ok: false. Match it with errors.As, or test its family with IsInvalidRequest, IsAuthentication, IsInsufficientCredits, IsPermission, IsNotFound, IsRateLimited and IsServerError:
result, err := client.Face.Verify(ctx, params)
var apiErr *verisec.APIError
switch {
case verisec.IsInsufficientCredits(err):
// top up credits in the console; nothing was charged
case errors.As(err, &apiErr):
log.Println(apiErr.Status, apiErr.Code, apiErr.Param, apiErr.RequestID)
}
The client sends 429 and 5xx answers again before an APIError reaches you; nothing was charged for either.
Example ¶
package main
import (
"context"
"errors"
"log"
"os"
"time"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
client, _ := verisec.New(os.Getenv("VERISEC_API_KEY"))
params := &verisec.FaceVerifyParams{Image1: verisec.ImageFromPath("selfie.jpg"), Image2: verisec.ImageFromPath("id-photo.jpg")}
_, err := client.Face.Verify(context.Background(), params,
verisec.WithRequestTimeout(time.Minute), verisec.WithRequestMaxRetries(0), verisec.WithHeader("X-Trace-Id", "abc"))
if err != nil {
var apiErr *verisec.APIError
var connErr *verisec.ConnectionError
switch {
case verisec.IsInsufficientCredits(err):
log.Print("Not enough credits (or the key's spend cap): top up in the console. Nothing was charged.")
case errors.As(err, &apiErr) && verisec.IsRateLimited(err):
log.Printf("Rate limited: wait %s.", apiErr.RetryAfter)
case errors.As(err, &apiErr):
log.Printf("%d %s (param %s, request %s): %s", apiErr.Status, apiErr.Code, apiErr.Param, apiErr.RequestID, apiErr.Message)
case errors.As(err, &connErr):
log.Printf("No answer (timeout: %v): %s", connErr.Timeout, connErr.Message)
}
}
}
Output:
type AgeGateCheckout ¶
type AgeGateCheckout struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Allowed bool `json:"allowed,omitempty"`
Age []float64 `json:"age,omitempty"`
Live bool `json:"live,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata AgeGateCheckoutMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
AgeGateCheckout is the answer of Age-gated Checkout.
func (AgeGateCheckout) MarshalJSON ¶
func (v AgeGateCheckout) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeGateCheckout) UnmarshalJSON ¶
func (v *AgeGateCheckout) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeGateCheckoutMetadata ¶
type AgeGateCheckoutMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx AgeGateCheckoutMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeGateCheckoutMetadata is the metadata member of AgeGateCheckout.
func (AgeGateCheckoutMetadata) MarshalJSON ¶
func (v AgeGateCheckoutMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeGateCheckoutMetadata) UnmarshalJSON ¶
func (v *AgeGateCheckoutMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeGateCheckoutMetadataCtx ¶
type AgeGateCheckoutMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeGateCheckoutMetadataCtx is the ctx member of AgeGateCheckoutMetadata.
func (AgeGateCheckoutMetadataCtx) MarshalJSON ¶
func (v AgeGateCheckoutMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeGateCheckoutMetadataCtx) UnmarshalJSON ¶
func (v *AgeGateCheckoutMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeGateCheckoutParams ¶
type AgeGateCheckoutParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Selfie Image `json:"selfie,omitempty"`
// Minimum age.
//
// Default 18.
MinAge *int64 `json:"minAge,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
AgeGateCheckoutParams is the request of Age-gated Checkout: POST /v1/age-gate/checkout.
type AgeGateCheckoutResponse ¶
type AgeGateCheckoutResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Age-gated Checkout.
Data AgeGateCheckout `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeGateCheckoutResponse is the envelope of every Age-gated Checkout answer. The client returns its Data (a AgeGateCheckout) and puts the rest in LastResponse.
func (AgeGateCheckoutResponse) MarshalJSON ¶
func (v AgeGateCheckoutResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeGateCheckoutResponse) UnmarshalJSON ¶
func (v *AgeGateCheckoutResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeGateService ¶
type AgeGateService struct {
// contains filtered or unexported fields
}
AgeGateService holds the ageGate APIs: Checkout.
func (*AgeGateService) Checkout ¶
func (s *AgeGateService) Checkout(ctx context.Context, params *AgeGateCheckoutParams, opts ...RequestOption) (*AgeGateCheckout, error)
Checkout calls Age-gated Checkout: POST /v1/age-gate/checkout.
Age and liveness together for an age-restricted sale: allowed only when old enough and live.
Price: 0.25 credits per successful call.
type AgeService ¶
type AgeService struct {
// contains filtered or unexported fields
}
AgeService holds the age APIs: Verify and VerifyLive.
func (*AgeService) Verify ¶
func (s *AgeService) Verify(ctx context.Context, params *AgeVerifyParams, opts ...RequestOption) (*AgeVerify, error)
Verify calls Age Check: POST /v1/age/verify.
An age gate: pass or fail against a minimum age, deciding on the lower end of the range (strict) or the midpoint.
Price: 0.05 credits per successful call.
func (*AgeService) VerifyLive ¶
func (s *AgeService) VerifyLive(ctx context.Context, params *AgeVerifyLiveParams, opts ...RequestOption) (*AgeVerifyLive, error)
VerifyLive calls Age Check + Liveness: POST /v1/age/verify-live.
The age gate plus liveness: allowed only when the person is old enough AND the face is live.
Price: 0.25 credits per successful call.
type AgeVerify ¶
type AgeVerify struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Age []float64 `json:"age,omitempty"`
Allowed bool `json:"allowed,omitempty"`
MinAge float64 `json:"minAge,omitempty"`
Basis string `json:"basis,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata AgeVerifyMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
AgeVerify is the answer of Age Check.
func (AgeVerify) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerify) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyLive ¶
type AgeVerifyLive struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Age []float64 `json:"age,omitempty"`
Allowed bool `json:"allowed,omitempty"`
Live bool `json:"live,omitempty"`
Basis string `json:"basis,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata AgeVerifyLiveMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
AgeVerifyLive is the answer of Age Check + Liveness.
func (AgeVerifyLive) MarshalJSON ¶
func (v AgeVerifyLive) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyLive) UnmarshalJSON ¶
func (v *AgeVerifyLive) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyLiveMetadata ¶
type AgeVerifyLiveMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx AgeVerifyLiveMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeVerifyLiveMetadata is the metadata member of AgeVerifyLive.
func (AgeVerifyLiveMetadata) MarshalJSON ¶
func (v AgeVerifyLiveMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyLiveMetadata) UnmarshalJSON ¶
func (v *AgeVerifyLiveMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyLiveMetadataCtx ¶
type AgeVerifyLiveMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeVerifyLiveMetadataCtx is the ctx member of AgeVerifyLiveMetadata.
func (AgeVerifyLiveMetadataCtx) MarshalJSON ¶
func (v AgeVerifyLiveMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyLiveMetadataCtx) UnmarshalJSON ¶
func (v *AgeVerifyLiveMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyLiveParams ¶
type AgeVerifyLiveParams struct {
// Face image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Minimum age.
//
// Default 21.
MinAge *int64 `json:"minAge,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
AgeVerifyLiveParams is the request of Age Check + Liveness: POST /v1/age/verify-live.
type AgeVerifyLiveResponse ¶
type AgeVerifyLiveResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Age Check + Liveness.
Data AgeVerifyLive `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeVerifyLiveResponse is the envelope of every Age Check + Liveness answer. The client returns its Data (a AgeVerifyLive) and puts the rest in LastResponse.
func (AgeVerifyLiveResponse) MarshalJSON ¶
func (v AgeVerifyLiveResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyLiveResponse) UnmarshalJSON ¶
func (v *AgeVerifyLiveResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyMetadata ¶
type AgeVerifyMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx AgeVerifyMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeVerifyMetadata is the metadata member of AgeVerify.
func (AgeVerifyMetadata) MarshalJSON ¶
func (v AgeVerifyMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyMetadata) UnmarshalJSON ¶
func (v *AgeVerifyMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyMetadataCtx ¶
type AgeVerifyMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeVerifyMetadataCtx is the ctx member of AgeVerifyMetadata.
func (AgeVerifyMetadataCtx) MarshalJSON ¶
func (v AgeVerifyMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyMetadataCtx) UnmarshalJSON ¶
func (v *AgeVerifyMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type AgeVerifyParams ¶
type AgeVerifyParams struct {
// Face image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Minimum age.
//
// Default 18.
MinAge *int64 `json:"minAge,omitempty"`
// Decide on.
//
// One of "lowerBound" (Lower end of the range) or "midpoint" (Middle of the range). Default "lowerBound".
Policy *string `json:"policy,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
AgeVerifyParams is the request of Age Check: POST /v1/age/verify.
type AgeVerifyResponse ¶
type AgeVerifyResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Age Check.
Data AgeVerify `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
AgeVerifyResponse is the envelope of every Age Check answer. The client returns its Data (a AgeVerify) and puts the rest in LastResponse.
func (AgeVerifyResponse) MarshalJSON ¶
func (v AgeVerifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*AgeVerifyResponse) UnmarshalJSON ¶
func (v *AgeVerifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ApiEnv ¶
type ApiEnv = string
ApiEnv is the environment the read is recorded in: the credential's.
One of "live" or "test".
type BankLookup ¶
type BankLookup struct {
// Always `bank_lookup`.
Object string `json:"object,omitempty"`
// The query as received.
Query BankLookupQuery `json:"query,omitempty"`
// The best match. Absent when nothing matched.
Bank BankResolved `json:"bank,omitempty"`
// How surely your name and the bank's name are the same bank, 0 to 1.
NameMatch float64 `json:"name_match,omitempty"`
// True when the match is sure: name match 0.80 or more, or an exact BIC.
Verified bool `json:"verified,omitempty"`
// Other close banks, best first.
Alternatives []BankResolved `json:"alternatives,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
BankLookup is a bank looked up in the directory.
func (BankLookup) MarshalJSON ¶
func (v BankLookup) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*BankLookup) UnmarshalJSON ¶
func (v *BankLookup) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type BankLookupParams ¶
type BankLookupParams struct {
// The bank's name, as you have it.
Name *string `json:"name,omitempty"`
// ISO 3166-1 alpha-2. Narrows a name search.
Country *string `json:"country,omitempty"`
// BIC / SWIFT code, 8 or 11 characters. When given, the name is not needed.
BIC *string `json:"bic,omitempty"`
}
BankLookupParams are the query parameters of Look up a bank: GET /v2/banks.
type BankLookupQuery ¶
type BankLookupQuery struct {
Name string `json:"name,omitempty"`
Country string `json:"country,omitempty"`
BIC string `json:"bic,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
BankLookupQuery is the query as received.
func (BankLookupQuery) MarshalJSON ¶
func (v BankLookupQuery) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*BankLookupQuery) UnmarshalJSON ¶
func (v *BankLookupQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type BankMatch ¶
type BankMatch struct {
// What the document says.
Read BankMatchRead `json:"read,omitempty"`
// The bank matched in the directory. Absent when none matched.
Resolved BankResolved `json:"resolved,omitempty"`
// How strong the match is, 0 to 1.
MatchConfidence float64 `json:"match_confidence,omitempty"`
// How surely the two names name the same bank, 0 to 1.
NameMatch float64 `json:"name_match,omitempty"`
// Other close banks, best first.
Alternatives []BankResolved `json:"alternatives,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
BankMatch is a bank read on a document, matched in the directory.
func (BankMatch) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*BankMatch) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type BankMatchRead ¶
type BankMatchRead struct {
Name string `json:"name,omitempty"`
Country string `json:"country,omitempty"`
Branch string `json:"branch,omitempty"`
Address string `json:"address,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
BankMatchRead is what the document says.
func (BankMatchRead) MarshalJSON ¶
func (v BankMatchRead) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*BankMatchRead) UnmarshalJSON ¶
func (v *BankMatchRead) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type BankResolved ¶
type BankResolved struct {
// The bank's directory id.
ProfileID string `json:"profile_id,omitempty"`
// The bank's name.
Name string `json:"name,omitempty"`
Country string `json:"country,omitempty"`
// ISO 3166-1 alpha-2.
CountryCode string `json:"country_code,omitempty"`
City string `json:"city,omitempty"`
Address string `json:"address,omitempty"`
BIC string `json:"bic,omitempty"`
Routing string `json:"routing,omitempty"`
Parent string `json:"parent,omitempty"`
// Only when the record states it plainly.
//
// One of "active", "dissolved" or null.
Status string `json:"status,omitempty"`
// The bank's logo, relative to the API base.
LogoURL string `json:"logo_url,omitempty"`
// The country's flag (SVG), relative to the API base.
FlagURL string `json:"flag_url,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
BankResolved is a bank from VeriSec's directory of about 75,000 banks.
func (BankResolved) MarshalJSON ¶
func (v BankResolved) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*BankResolved) UnmarshalJSON ¶
func (v *BankResolved) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type BanksService ¶
type BanksService struct {
// contains filtered or unexported fields
}
BanksService holds the banks APIs: Lookup.
func (*BanksService) Lookup ¶
func (s *BanksService) Lookup(ctx context.Context, params *BankLookupParams, opts ...RequestOption) (*BankLookup, error)
Lookup calls Look up a bank: GET /v2/banks.
Finds a bank in the directory by BIC, or by name (best with the country). Trust `bank` when `verified` is true; otherwise look at `alternatives`. Send `name` or `bic`; neither answers `400 missing_query`.
Price: 0.002 credits per successful call.
type BinRecord ¶
type BinRecord struct {
// The first 6 to 8 digits.
BIN string `json:"bin,omitempty"`
// Visa, Mastercard, American Express, Discover…
Network string `json:"network,omitempty"`
// Debit, Credit…
Type string `json:"type,omitempty"`
// Classic, Gold, World…
Level string `json:"level,omitempty"`
// The issuing bank's name.
Issuer string `json:"issuer,omitempty"`
// Issuing country, ISO 3166-1 alpha-2.
Country string `json:"country,omitempty"`
CountryName string `json:"country_name,omitempty"`
CountryCode3 string `json:"country_code3,omitempty"`
// Flag emoji.
Flag string `json:"flag,omitempty"`
// The country's flag (SVG), relative to the API base.
FlagURL string `json:"flag_url,omitempty"`
// The issuer in the bank directory, with logo. Returned by GET /v2/bin/{digits}.
Bank *BankMatch `json:"bank,omitempty"`
// ISO 4217.
Currency string `json:"currency,omitempty"`
CurrencyName string `json:"currency_name,omitempty"`
// One of "credit", "debit", "prepaid", "charge" or "unknown".
Funding string `json:"funding,omitempty"`
IsPrepaid bool `json:"is_prepaid,omitempty"`
IsCommercial bool `json:"is_commercial,omitempty"`
IsReloadable bool `json:"is_reloadable,omitempty"`
// One of "consumer" or "commercial".
Category string `json:"category,omitempty"`
IssuerCountry string `json:"issuer_country,omitempty"`
// Issuer contact, when known.
Phone string `json:"phone,omitempty"`
// Issuer website, when known.
URL string `json:"url,omitempty"`
// Which tier answered.
Source string `json:"source,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
BinRecord is who issued a card. Fields that are unknown are absent.
func (BinRecord) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*BinRecord) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type BinService ¶
type BinService struct {
// contains filtered or unexported fields
}
BinService holds the bin APIs: Lookup.
func (*BinService) Lookup ¶
func (s *BinService) Lookup(ctx context.Context, digits string, opts ...RequestOption) (*BinRecord, error)
Lookup calls Look up a BIN: GET /v2/bin/{digits}.
Looks up the first 6 to 8 digits of a card: network, type, level, funding, issuer, country with its flag, currency, and the issuer's record in the bank directory. Fewer than 6 digits answer `400 bin_too_short`; a BIN not in the tables `404 bin_not_found`.
Price: 0.002 credits per successful call.
type CardCheck ¶
type CardCheck struct {
// Always `card_check`.
Object string `json:"object,omitempty"`
First6 string `json:"first6,omitempty"`
Last4 string `json:"last4,omitempty"`
Length int64 `json:"length,omitempty"`
Network string `json:"network,omitempty"`
LuhnValid bool `json:"luhn_valid,omitempty"`
// The length fits the network.
LengthValid bool `json:"length_valid,omitempty"`
// Luhn and length both hold.
SchemeValid bool `json:"scheme_valid,omitempty"`
// When an expiry was sent.
Expired bool `json:"expired,omitempty"`
// When an expiry was sent.
ExpiresInDays int64 `json:"expires_in_days,omitempty"`
// `expiring_soon`: 60 days or less left.
ExpiryStatus ExpiryStatus `json:"expiry_status,omitempty"`
// Who issued a card. Fields that are unknown are absent.
BIN BinRecord `json:"bin,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
CardCheck: Checks on a typed card number. Only the first six and last four digits come back.
func (CardCheck) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardCheck) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardCheckParams ¶
type CardCheckParams struct {
// 12 to 19 digits; spaces are ignored. Never stored. Required.
Number string `json:"number,omitempty"`
// MM/YY.
Expiry *string `json:"expiry,omitempty"`
}
CardCheckParams is the request of Check a card number: POST /v2/cards/check.
type CardExpiry ¶
type CardExpiry struct {
// Always `card_expiry`.
Object string `json:"object,omitempty"`
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// Why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
IssueCode IssueCode `json:"issue_code,omitempty"`
Issue string `json:"issue,omitempty"`
// MM/YY as printed.
ValidThru string `json:"valid_thru,omitempty"`
// MM/YY, when printed.
ValidFrom string `json:"valid_from,omitempty"`
Expired bool `json:"expired,omitempty"`
// Negative once expired.
ExpiresInDays int64 `json:"expires_in_days,omitempty"`
// `expiring_soon`: 60 days or less left.
ExpiryStatus ExpiryStatus `json:"expiry_status,omitempty"`
// 0 to 100.
Confidence float64 `json:"confidence,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
CardExpiry is the expiry date from a card photo.
func (CardExpiry) MarshalJSON ¶
func (v CardExpiry) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardExpiry) UnmarshalJSON ¶
func (v *CardExpiry) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardExpiryParams ¶
type CardExpiryParams struct {
// The card photo: JPG, PNG or BMP, up to 10 MB. The photo is never stored. Required.
Image *File `json:"image,omitempty"`
}
CardExpiryParams is the request of Read a card's expiry date: POST /v2/cards/expiry.
type CardField ¶
type CardField struct {
// Field name: `number`, `valid_thru`, `holder_name`…
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
// 0 to 100.
Confidence float64 `json:"confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
CardField is one field as the engine emitted it. The engine may attach other keys (for example `valid` on the number, `box`); they are kept.
func (CardField) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardField) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardFingerprint ¶
type CardFingerprint struct {
// Always `card_fingerprint`.
Object string `json:"object,omitempty"`
// `cf_` + 24 hex. The same card always gives the same value; it cannot be turned back into the number.
Fingerprint string `json:"fingerprint,omitempty"`
First6 string `json:"first6,omitempty"`
Last4 string `json:"last4,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
CardFingerprint is the answer of Fingerprint a card number.
func (CardFingerprint) MarshalJSON ¶
func (v CardFingerprint) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardFingerprint) UnmarshalJSON ¶
func (v *CardFingerprint) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardFingerprintParams ¶
type CardFingerprintParams struct {
// 12 to 19 digits; spaces are ignored. Never stored. Required.
Number string `json:"number,omitempty"`
}
CardFingerprintParams is the request of Fingerprint a card number: POST /v2/cards/fingerprint.
type CardNumber ¶
type CardNumber struct {
// Always `card_number`.
Object string `json:"object,omitempty"`
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// Why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
IssueCode IssueCode `json:"issue_code,omitempty"`
Issue string `json:"issue,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// The full number: in this response only, never stored.
Number string `json:"number,omitempty"`
First6 string `json:"first6,omitempty"`
Last4 string `json:"last4,omitempty"`
Length int64 `json:"length,omitempty"`
Network string `json:"network,omitempty"`
LuhnValid bool `json:"luhn_valid,omitempty"`
SchemeValid bool `json:"scheme_valid,omitempty"`
// 0 to 100.
Confidence float64 `json:"confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
CardNumber is the card number from a photo.
func (CardNumber) MarshalJSON ¶
func (v CardNumber) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardNumber) UnmarshalJSON ¶
func (v *CardNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardNumberParams ¶
type CardNumberParams struct {
// The card photo: JPG, PNG or BMP, up to 10 MB. The photo is never stored. Required.
Image *File `json:"image,omitempty"`
}
CardNumberParams is the request of Read a card number: POST /v2/cards/number.
type CardRead ¶
type CardRead struct {
Index int64 `json:"index,omitempty"`
// The engine's label, for example `Card #1`.
Description string `json:"description,omitempty"`
// Every field the engine read, verbatim.
Fields []CardField `json:"fields,omitempty"`
// Summary confidence for the card, 0 to 100.
Confidence float64 `json:"confidence,omitempty"`
// The engine's own box, verbatim.
WarpedBox []float64 `json:"warpedBox,omitempty"`
// Four corners x1,y1 … x4,y4, in image pixels.
Box []float64 `json:"box,omitempty"`
// The full number: in the read response only, never in stored copies.
Number string `json:"number,omitempty"`
First6 string `json:"first6,omitempty"`
Last4 string `json:"last4,omitempty"`
// Digits in the number; 0 when it could not be read.
Length int64 `json:"length,omitempty"`
// Keyed hash of the number, `cf_` + 24 hex: stable across scans, safe to store.
Fingerprint string `json:"fingerprint,omitempty"`
LuhnValid bool `json:"luhn_valid,omitempty"`
// Luhn and a length that fits the network.
SchemeValid bool `json:"scheme_valid,omitempty"`
SchemeChecks CardReadSchemeChecks `json:"scheme_checks,omitempty"`
NetworkFromPrefix string `json:"network_from_prefix,omitempty"`
Expired bool `json:"expired,omitempty"`
// Negative once expired.
ExpiresInDays int64 `json:"expires_in_days,omitempty"`
// `expiring_soon`: 60 days or less left.
ExpiryStatus ExpiryStatus `json:"expiry_status,omitempty"`
// Who issued a card. Fields that are unknown are absent.
BIN BinRecord `json:"bin,omitempty"`
Bank *BankMatch `json:"bank,omitempty"`
// The engine's own card-level pass flag.
NumberValid bool `json:"number_valid,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
CardRead is one payment card in a photo.
func (CardRead) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardRead) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardReadParams ¶
type CardReadParams struct {
// The card photo: JPG, PNG or BMP, up to 10 MB. The photo is never stored. Required.
Image *File `json:"image,omitempty"`
}
CardReadParams is the request of Read a payment card: POST /v2/cards/read.
type CardReadSchemeChecks ¶
type CardReadSchemeChecks struct {
Luhn bool `json:"luhn,omitempty"`
Length bool `json:"length,omitempty"`
// The BIN is in the tables.
IINKnown bool `json:"iin_known,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
CardReadSchemeChecks is the scheme_checks member of CardRead.
func (CardReadSchemeChecks) MarshalJSON ¶
func (v CardReadSchemeChecks) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardReadSchemeChecks) UnmarshalJSON ¶
func (v *CardReadSchemeChecks) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardResponse ¶
type CardResponse struct {
// Scan id, `crd_` followed by 12 characters.
ID string `json:"id,omitempty"`
// Always `card`.
Object string `json:"object,omitempty"`
// When it was created (ISO 8601, UTC).
CreatedAt string `json:"created_at,omitempty"`
// Where the call came from, as shown in the console's logs.
Source ScanSource `json:"source,omitempty"`
// The environment the read is recorded in: the credential's.
Env ApiEnv `json:"env,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// Why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
IssueCode IssueCode `json:"issue_code,omitempty"`
// Plain-words reason, when not `read`.
Issue string `json:"issue,omitempty"`
// Dimensions only: card photos are never stored.
Image CardResponseImage `json:"image,omitempty"`
CardsDetected int64 `json:"cards_detected,omitempty"`
// Every card found, strongest first.
Cards []CardRead `json:"cards,omitempty"`
// The primary card, without its `bin` and `bank` (they sit alongside). Absent when unreadable.
Card CardRead `json:"card,omitempty"`
// Who issued a card. Fields that are unknown are absent.
BIN BinRecord `json:"bin,omitempty"`
Bank *BankMatch `json:"bank,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
CardResponse is a card read (the Card service's wire format). Stored copies (lists, retrieve) never contain the full number.
func (CardResponse) MarshalJSON ¶
func (v CardResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardResponse) UnmarshalJSON ¶
func (v *CardResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardResponseImage ¶
type CardResponseImage struct {
Width int64 `json:"width,omitempty"`
Height int64 `json:"height,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
CardResponseImage: Dimensions only: card photos are never stored.
func (CardResponseImage) MarshalJSON ¶
func (v CardResponseImage) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CardResponseImage) UnmarshalJSON ¶
func (v *CardResponseImage) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type CardsService ¶
type CardsService struct {
// contains filtered or unexported fields
}
CardsService holds the cards APIs: Read, Number, Expiry, Check and Fingerprint.
func (*CardsService) Check ¶
func (s *CardsService) Check(ctx context.Context, params *CardCheckParams, opts ...RequestOption) (*CardCheck, error)
Check calls Check a card number: POST /v2/cards/check.
Checks a typed card number, for example from a checkout form: the Luhn checksum, a length that fits the network, the expiry when sent, and the BIN record. Accept the card when `scheme_valid` is true and `expired` is not. Only the first six and last four digits come back; nothing is stored.
Price: 0.002 credits per successful call.
func (*CardsService) Expiry ¶
func (s *CardsService) Expiry(ctx context.Context, params *CardExpiryParams, opts ...RequestOption) (*CardExpiry, error)
Expiry calls Read a card's expiry date: POST /v2/cards/expiry.
Reads the expiry date from a card photo and works out whether the card has expired and how many days it has left. Nothing is stored.
Price: 0.02 credits per successful call.
func (*CardsService) Fingerprint ¶
func (s *CardsService) Fingerprint(ctx context.Context, params *CardFingerprintParams, opts ...RequestOption) (*CardFingerprint, error)
Fingerprint calls Fingerprint a card number: POST /v2/cards/fingerprint.
Turns a card number into a fingerprint: always the same for the same card, and impossible to turn back into the number. Store it to recognise a card you have seen before; a card read from a photo carries the same fingerprint.
Price: 0.002 credits per successful call.
func (*CardsService) Number ¶
func (s *CardsService) Number(ctx context.Context, params *CardNumberParams, opts ...RequestOption) (*CardNumber, error)
Number calls Read a card number: POST /v2/cards/number.
Reads the card number from a photo, with its network and checks. Nothing is stored.
Price: 0.02 credits per successful call.
func (*CardsService) Read ¶
func (s *CardsService) Read(ctx context.Context, params *CardReadParams, opts ...RequestOption) (*CardResponse, error)
Read calls Read a payment card: POST /v2/cards/read.
Reads every card in a photo: number, expiry and holder with their confidences, the checks (Luhn, length for the network, expiry), the BIN record and the issuer in the bank directory. The full number is in this response only; the stored copy keeps the first six and last four digits, and the photo is never stored.
Price: 0.03 credits per successful call.
type ChequeAmount ¶
type ChequeAmount struct {
// Always `cheque_amount`.
Object string `json:"object,omitempty"`
// The amount box, as written.
Figures string `json:"figures,omitempty"`
// The amount in words, as written.
Words string `json:"words,omitempty"`
// The amount as a number.
Numeric float64 `json:"numeric,omitempty"`
// Words and figures say the same amount.
Agreement bool `json:"agreement,omitempty"`
Currency ChequeAmountCurrency `json:"currency,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ChequeAmount is the amount on a cheque. Fields the face does not show are absent.
func (ChequeAmount) MarshalJSON ¶
func (v ChequeAmount) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeAmount) UnmarshalJSON ¶
func (v *ChequeAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeAmountCurrency ¶
type ChequeAmountCurrency struct {
// ISO 4217.
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
Symbol string `json:"symbol,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeAmountCurrency is the currency member of ChequeAmount.
func (ChequeAmountCurrency) MarshalJSON ¶
func (v ChequeAmountCurrency) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeAmountCurrency) UnmarshalJSON ¶
func (v *ChequeAmountCurrency) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeAmountParams ¶
type ChequeAmountParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
}
ChequeAmountParams is the request of Read a cheque's amount: POST /v2/cheques/amount.
type ChequeBank ¶
type ChequeBank struct {
// Always `cheque_bank`.
Object string `json:"object,omitempty"`
// The bank as printed on the cheque.
Read ChequeBankRead `json:"read,omitempty"`
// The matched bank. Absent when no bank matched.
Bank BankResolved `json:"bank,omitempty"`
// How strong the match is, 0 to 1.
MatchConfidence float64 `json:"match_confidence,omitempty"`
Country ChequeBankCountry `json:"country,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ChequeBank is the bank printed on a cheque, matched in the directory.
func (ChequeBank) MarshalJSON ¶
func (v ChequeBank) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeBank) UnmarshalJSON ¶
func (v *ChequeBank) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeBankCountry ¶
type ChequeBankCountry struct {
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
Flag string `json:"flag,omitempty"`
FlagURL string `json:"flag_url,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeBankCountry is the country member of ChequeBank.
func (ChequeBankCountry) MarshalJSON ¶
func (v ChequeBankCountry) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeBankCountry) UnmarshalJSON ¶
func (v *ChequeBankCountry) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeBankParams ¶
type ChequeBankParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
}
ChequeBankParams is the request of Read a cheque's bank: POST /v2/cheques/bank.
type ChequeBankRead ¶
type ChequeBankRead struct {
Name string `json:"name,omitempty"`
Branch string `json:"branch,omitempty"`
Address string `json:"address,omitempty"`
Country string `json:"country,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeBankRead is the bank as printed on the cheque.
func (ChequeBankRead) MarshalJSON ¶
func (v ChequeBankRead) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeBankRead) UnmarshalJSON ¶
func (v *ChequeBankRead) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeDate ¶
type ChequeDate struct {
// Always `cheque_date`.
Object string `json:"object,omitempty"`
// The date as written.
Raw string `json:"raw,omitempty"`
// The same date as YYYY-MM-DD.
ISO string `json:"iso,omitempty"`
// Days since the date; negative when it is in the future.
AgeDays int64 `json:"age_days,omitempty"`
// True when the date is in the future.
PostDated bool `json:"post_dated,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ChequeDate is the date on a cheque. Your own rules decide when a cheque is stale.
func (ChequeDate) MarshalJSON ¶
func (v ChequeDate) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeDate) UnmarshalJSON ¶
func (v *ChequeDate) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeDateParams ¶
type ChequeDateParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
}
ChequeDateParams is the request of Read a cheque's date: POST /v2/cheques/date.
type ChequeDeepRead ¶
type ChequeDeepRead struct {
// Scan id, `chq_` followed by 12 characters.
ID string `json:"id,omitempty"`
// Always `cheque_read`.
Object string `json:"object,omitempty"`
// When it was created (ISO 8601, UTC).
CreatedAt string `json:"created_at,omitempty"`
// Where the call came from, as shown in the console's logs.
Source ScanSource `json:"source,omitempty"`
// The environment the read is recorded in: the credential's.
Env ApiEnv `json:"env,omitempty"`
// The MICR engine's time alone, in milliseconds; `timing` has the rest.
ProcessingMs int64 `json:"processing_ms,omitempty"`
Image ChequeDeepReadImage `json:"image,omitempty"`
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// The MICR engine's own read (authoritative for the code line).
MICR ChequeResponse `json:"micr,omitempty"`
// What the vision reader read. Absent when it found nothing or could not be reached.
Vision VisionResult `json:"vision,omitempty"`
// A bank read on a document, matched in the directory.
Bank BankMatch `json:"bank,omitempty"`
// A full currency record (ISO 4217 + CLDR).
Currency ResolvedCurrency `json:"currency,omitempty"`
// From the bank directory, else the face, else a national MICR layout.
Country CountryInfo `json:"country,omitempty"`
// Set when the vision reader could not be reached; the MICR part still stands.
ReaderError string `json:"reader_error,omitempty"`
// Every text box on the image, for drawing only (no text).
TextBoxes TextBoxes `json:"text_boxes,omitempty"`
// Only when the photo holds more than one cheque. The fields above are cheque 1.
Cheques []DeepCheque `json:"cheques,omitempty"`
// Where the time went, in milliseconds.
Timing ChequeDeepReadTiming `json:"timing,omitempty"`
// Photo quality from the check before the read. It never blocks the read, only warns.
ImageQuality ChequeDeepReadImageQuality `json:"image_quality,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ChequeDeepRead is the whole cheque: the MICR read, what the face says, the bank, country and currency.
func (ChequeDeepRead) MarshalJSON ¶
func (v ChequeDeepRead) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeDeepRead) UnmarshalJSON ¶
func (v *ChequeDeepRead) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeDeepReadImage ¶
type ChequeDeepReadImage struct {
Width int64 `json:"width,omitempty"`
Height int64 `json:"height,omitempty"`
// The stored photo, relative to the API base.
URL string `json:"url,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeDeepReadImage is the image member of ChequeDeepRead.
func (ChequeDeepReadImage) MarshalJSON ¶
func (v ChequeDeepReadImage) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeDeepReadImage) UnmarshalJSON ¶
func (v *ChequeDeepReadImage) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeDeepReadImageQuality ¶
type ChequeDeepReadImageQuality struct {
// One of "ok", "document_not_found", "too_far", "blurry", "glare" or "unreadable".
Status string `json:"status,omitempty"`
Normalised bool `json:"normalised,omitempty"`
Ms int64 `json:"ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeDeepReadImageQuality: Photo quality from the check before the read. It never blocks the read, only warns.
func (ChequeDeepReadImageQuality) MarshalJSON ¶
func (v ChequeDeepReadImageQuality) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeDeepReadImageQuality) UnmarshalJSON ¶
func (v *ChequeDeepReadImageQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeDeepReadTiming ¶
type ChequeDeepReadTiming struct {
MICRMs int64 `json:"micr_ms,omitempty"`
ModelMs int64 `json:"model_ms,omitempty"`
BoxesMs int64 `json:"boxes_ms,omitempty"`
TotalMs int64 `json:"total_ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeDeepReadTiming is where the time went, in milliseconds.
func (ChequeDeepReadTiming) MarshalJSON ¶
func (v ChequeDeepReadTiming) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeDeepReadTiming) UnmarshalJSON ¶
func (v *ChequeDeepReadTiming) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeMicrLineParams ¶
type ChequeMicrLineParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
// The MICR font. `auto` finds it.
//
// One of "auto", "e13b" or "cmc7". Default "auto".
Format *string `json:"format,omitempty"`
}
ChequeMicrLineParams is the request of Read just the MICR line: POST /v2/cheques/micr-line.
type ChequeMicrParams ¶
type ChequeMicrParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
// The MICR font. `auto` finds it.
//
// One of "auto", "e13b" or "cmc7". Default "auto".
Format *string `json:"format,omitempty"`
}
ChequeMicrParams is the request of Read a cheque's MICR line: POST /v2/cheques/micr.
type ChequeParties ¶
type ChequeParties struct {
// Always `cheque_parties`.
Object string `json:"object,omitempty"`
// The name the cheque is paid to.
Payee string `json:"payee,omitempty"`
// The account holder printed on the cheque.
Drawer string `json:"drawer,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ChequeParties is who a cheque pays and who pays it. A name not on the cheque is left out, never guessed.
func (ChequeParties) MarshalJSON ¶
func (v ChequeParties) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeParties) UnmarshalJSON ¶
func (v *ChequeParties) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequePartiesParams ¶
type ChequePartiesParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
}
ChequePartiesParams is the request of Read a cheque's payee and drawer: POST /v2/cheques/parties.
type ChequeReadParams ¶
type ChequeReadParams struct {
// The cheque photo: JPG, PNG or BMP, up to 10 MB. Read exactly as uploaded, never resized. Required.
Image *File `json:"image,omitempty"`
// The MICR font. `auto` finds it.
//
// One of "auto", "e13b" or "cmc7". Default "auto".
Format *string `json:"format,omitempty"`
}
ChequeReadParams is the request of Read a whole cheque: POST /v2/cheques/read.
type ChequeResponse ¶
type ChequeResponse struct {
// Scan id, `chq_` followed by 12 characters.
ID string `json:"id,omitempty"`
// Always `cheque`.
Object string `json:"object,omitempty"`
// When it was created (ISO 8601, UTC).
CreatedAt string `json:"created_at,omitempty"`
// Where the call came from, as shown in the console's logs.
Source ScanSource `json:"source,omitempty"`
// The environment the read is recorded in: the credential's.
Env ApiEnv `json:"env,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// Why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
IssueCode IssueCode `json:"issue_code,omitempty"`
// The same reason in plain words, safe to show a person.
Issue string `json:"issue,omitempty"`
Image ChequeResponseImage `json:"image,omitempty"`
// How many MICR lines were found.
ZonesDetected int64 `json:"zones_detected,omitempty"`
// Every MICR line found, strongest first.
Zones []MicrZone `json:"zones,omitempty"`
// The primary (strongest) line. Absent when unreadable.
MICR MicrZone `json:"micr,omitempty"`
// Capture-quality signals.
Quality ChequeResponseQuality `json:"quality,omitempty"`
// Only when a national MICR layout proves the country.
Country CountryInfo `json:"country,omitempty"`
// Present when only a resized copy named fields; boxes are mapped back to the original.
ReadOn ChequeResponseReadOn `json:"read_on,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ChequeResponse is a cheque's MICR read (the MICR service's wire format).
func (ChequeResponse) MarshalJSON ¶
func (v ChequeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeResponse) UnmarshalJSON ¶
func (v *ChequeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeResponseImage ¶
type ChequeResponseImage struct {
Width int64 `json:"width,omitempty"`
Height int64 `json:"height,omitempty"`
// The stored photo, relative to the API base.
URL string `json:"url,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeResponseImage is the image member of ChequeResponse.
func (ChequeResponseImage) MarshalJSON ¶
func (v ChequeResponseImage) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeResponseImage) UnmarshalJSON ¶
func (v *ChequeResponseImage) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeResponseQuality ¶
type ChequeResponseQuality struct {
// Page rotation, degrees.
Rotation float64 `json:"rotation,omitempty"`
// Primary line skew, degrees.
Skew float64 `json:"skew,omitempty"`
// Weakest character.
MinCharConfidence float64 `json:"min_char_confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeResponseQuality: Capture-quality signals.
func (ChequeResponseQuality) MarshalJSON ¶
func (v ChequeResponseQuality) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeResponseQuality) UnmarshalJSON ¶
func (v *ChequeResponseQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequeResponseReadOn ¶
type ChequeResponseReadOn struct {
Image string `json:"image,omitempty"`
Scale float64 `json:"scale,omitempty"`
Width int64 `json:"width,omitempty"`
Height int64 `json:"height,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ChequeResponseReadOn: Present when only a resized copy named fields; boxes are mapped back to the original.
func (ChequeResponseReadOn) MarshalJSON ¶
func (v ChequeResponseReadOn) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ChequeResponseReadOn) UnmarshalJSON ¶
func (v *ChequeResponseReadOn) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ChequesService ¶
type ChequesService struct {
// contains filtered or unexported fields
}
ChequesService holds the cheques APIs: Read, Micr, MicrLine, Amount, Date, Parties and Bank.
func (*ChequesService) Amount ¶
func (s *ChequesService) Amount(ctx context.Context, params *ChequeAmountParams, opts ...RequestOption) (*ChequeAmount, error)
Amount calls Read a cheque's amount: POST /v2/cheques/amount.
Reads the amount in figures and in words, turns it into a number, says whether the two agree, and resolves the currency. Nothing is stored.
Price: 0.02 credits per successful call.
func (*ChequesService) Bank ¶
func (s *ChequesService) Bank(ctx context.Context, params *ChequeBankParams, opts ...RequestOption) (*ChequeBank, error)
Bank calls Read a cheque's bank: POST /v2/cheques/bank.
Reads the bank printed on the cheque and matches it in the directory of about 75,000 banks. A bank not in the directory is never forced onto another: `bank` is left out. Nothing is stored.
Price: 0.02 credits per successful call.
func (*ChequesService) Date ¶
func (s *ChequesService) Date(ctx context.Context, params *ChequeDateParams, opts ...RequestOption) (*ChequeDate, error)
Date calls Read a cheque's date: POST /v2/cheques/date.
Reads the cheque's date as written and as YYYY-MM-DD, with its age in days (negative when post-dated). Nothing is stored.
Price: 0.02 credits per successful call.
func (*ChequesService) Micr ¶
func (s *ChequesService) Micr(ctx context.Context, params *ChequeMicrParams, opts ...RequestOption) (*ChequeResponse, error)
Micr calls Read a cheque's MICR line: POST /v2/cheques/micr.
Finds and reads every MICR code line on a cheque (E-13B or CMC-7) and names its fields: the layout template for the layout, a national standard when one applies (Canada, India), and the US routing-number proof. The read and the photo are kept in the scan history.
Price: 0.02 credits per successful call.
func (*ChequesService) MicrLine ¶
func (s *ChequesService) MicrLine(ctx context.Context, params *ChequeMicrLineParams, opts ...RequestOption) (*MicrLine, error)
MicrLine calls Read just the MICR line: POST /v2/cheques/micr-line.
Reads the strongest MICR line with the same engine and naming as the full reads and returns a small response: the line, its named fields, its layout and confidence. Nothing is stored.
Price: 0.02 credits per successful call.
Example ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
client, _ := verisec.New(os.Getenv("VERISEC_API_KEY"))
ctx := context.Background()
chequeBytes, _ := os.ReadFile("cheque.jpg")
cheque, err := client.Cheques.Read(ctx, &verisec.ChequeReadParams{Image: verisec.FileFromPath("cheque.jpg")})
if err != nil {
log.Fatal(err)
}
fmt.Println(cheque.Object)
line, err := client.Cheques.MicrLine(ctx, &verisec.ChequeMicrLineParams{
Image: verisec.FileFromBytes(chequeBytes, "cheque.jpg"),
Format: verisec.String("e13b"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(line.Line.Text, line.LastResponse.RequestID)
card, _ := client.Cards.Check(ctx, &verisec.CardCheckParams{Number: "4242 4242 4242 4242", Expiry: verisec.String("09/29")})
bin, _ := client.Bin.Lookup(ctx, "424242")
bank, _ := client.Banks.Lookup(ctx, &verisec.BankLookupParams{Name: verisec.String("Harbor Point Bank"), Country: verisec.String("US")})
fmt.Println(card.SchemeValid, bin.Network, bank.Verified)
}
Output:
func (*ChequesService) Parties ¶
func (s *ChequesService) Parties(ctx context.Context, params *ChequePartiesParams, opts ...RequestOption) (*ChequeParties, error)
Parties calls Read a cheque's payee and drawer: POST /v2/cheques/parties.
Reads who the cheque is paid to (the name after Pay) and whose account pays it (the account holder printed on the cheque). Nothing is stored.
Price: 0.02 credits per successful call.
func (*ChequesService) Read ¶
func (s *ChequesService) Read(ctx context.Context, params *ChequeReadParams, opts ...RequestOption) (*ChequeDeepRead, error)
Read calls Read a whole cheque: POST /v2/cheques/read.
Reads everything on a cheque in one call: the MICR line with its named fields, what is written on the face (payee, amount in figures and words, date, drawer, bank, crossing, signature), the bank matched in the directory, and the country and currency. A photo with several cheques returns each in `cheques`. The read and the photo are kept in the scan history.
Price: 0.05 credits per successful call.
type Client ¶
type Client struct {
// Face holds the face APIs: Analyze, Detect, Count, Attributes, Ppe, Emotion, Crop, Redact, Match, Verify, Similarity, Search, Dedupe, Watchlist, Cluster, Age and Quality.
Face *FaceService
// Age holds the age APIs: Verify and VerifyLive.
Age *AgeService
// Photo holds the photo APIs: Compliance, Policy, Gate, Autofix and BestFrame.
Photo *PhotoService
// Liveness holds the liveness APIs: Check, Antispoof and Gate.
Liveness *LivenessService
// Identity holds the identity APIs: Verify.
Identity *IdentityService
// FaceLogin holds the faceLogin APIs: Authenticate.
FaceLogin *FaceLoginService
// Fraud holds the fraud APIs: SignupCheck.
Fraud *FraudService
// Proctor holds the proctor APIs: Check.
Proctor *ProctorService
// AgeGate holds the ageGate APIs: Checkout.
AgeGate *AgeGateService
// Kiosk holds the kiosk APIs: Photo.
Kiosk *KioskService
// Documents holds the documents APIs: Read, Classify, Mrz, Portrait, Authenticity and Fields.
Documents *DocumentsService
// ProofOfAddress holds the proofOfAddress APIs: Analyze.
ProofOfAddress *ProofOfAddressService
// Mrz holds the mrz APIs: Read, Recognize and Parse.
Mrz *MrzService
// Email holds the email APIs: Verify and Footprint.
Email *EmailService
// Osint holds the osint APIs: Username and Web.
Osint *OsintService
// Phone holds the phone APIs: Lookup and Otp (a resource).
Phone *PhoneService
// Screening holds the screening APIs: Ip, Sanctions and Crypto.
Screening *ScreeningService
// Ip holds the ip APIs: Analyze.
Ip *IpService
// Contact holds the contact APIs: Dossier.
Contact *ContactService
// Cheques holds the cheques APIs: Read, Micr, MicrLine, Amount, Date, Parties and Bank.
Cheques *ChequesService
// Banks holds the banks APIs: Lookup.
Banks *BanksService
// Cards holds the cards APIs: Read, Number, Expiry, Check and Fingerprint.
Cards *CardsService
// Bin holds the bin APIs: Lookup.
Bin *BinService
// contains filtered or unexported fields
}
Client calls the VeriSec API: identity (KYC) and Financial checks. Create one with New and share it: it is safe for concurrent use.
Every API is a method, grouped as the API groups them (client.Face.Verify, client.Phone.Otp.Send, client.Cheques.MicrLine). Each method takes a context first and request options last, and returns the answer (for KYC, the envelope's data) with the response info in its LastResponse field:
result, err := client.Face.Verify(ctx, &verisec.FaceVerifyParams{
Image1: verisec.ImageFromPath("selfie.jpg"),
Image2: verisec.ImageFromPath("id-photo.jpg"),
})
func New ¶
func New(apiKey string, opts ...ClientOption) (*Client, error)
New returns a client for an API key: a test key (sk_test_…), sent as the bearer token, or a live key (ak_live_…) together with WithClientCredentials. An empty key falls back to VERISEC_API_KEY.
It returns ErrNoAPIKey without a key, ErrNoClientCredentials for a live key without its client id and secret, and an error for a base URL that is not absolute. The client is safe for concurrent use: create one and share it.
Example ¶
package main
import (
"log"
"os"
"time"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
client, err := verisec.New(os.Getenv("VERISEC_API_KEY")) // sk_test_… or ak_live_…
if err != nil {
log.Fatal(err)
}
_ = client
// a live key also takes its client id and secret
live, err := verisec.New(os.Getenv("VERISEC_API_KEY"),
verisec.WithClientCredentials(os.Getenv("VERISEC_CLIENT_ID"), os.Getenv("VERISEC_CLIENT_SECRET")),
verisec.WithTimeout(5*time.Minute), verisec.WithMaxRetries(3))
if err != nil {
log.Fatal(err)
}
_ = live
}
Output:
type ClientOption ¶
type ClientOption func(*clientConfig)
A ClientOption configures a Client. Pass options to New.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ClientOption
WithBaseURL sends requests to another host, such as a local test server. Defaults to VERISEC_BASE_URL, then https://verisec.mmose.me.
func WithClientCredentials ¶
func WithClientCredentials(clientID, clientSecret string) ClientOption
WithClientCredentials sets the client id and secret issued with a live API key (ak_live_…). The client exchanges the three at POST /v2/oauth/token for a short-lived bearer token, keeps it until a minute before it expires (concurrent calls share one exchange), and fetches a new one once when the API answers 401.
Without this option, VERISEC_CLIENT_ID and VERISEC_CLIENT_SECRET are used.
func WithHTTPClient ¶
func WithHTTPClient(hc *http.Client) ClientOption
WithHTTPClient sends requests through your own *http.Client, for proxies, custom TLS or instrumentation. Leave its Timeout at zero: the client times each attempt itself (WithTimeout).
func WithMaxRetries ¶
func WithMaxRetries(n int) ClientOption
WithMaxRetries sets how many times a call is sent again after a 429, a 5xx or a connection that never opened. Defaults to 2; 0 turns retries off.
func WithTimeout ¶
func WithTimeout(d time.Duration) ClientOption
WithTimeout sets how long one attempt may take, reading the answer included. Defaults to 300 seconds; 0 means no limit. A call that times out is not sent again, because it may still run (and be charged) on the server; bound the whole call, retries included, with the context's deadline.
type ConnectionError ¶
type ConnectionError struct {
// Timeout reports whether an attempt ran out of time waiting for the answer (WithTimeout,
// WithRequestTimeout).
Timeout bool
// Message says what happened.
Message string
// Err is the underlying network error.
Err error
// contains filtered or unexported fields
}
ConnectionError means a call got no answer: the network failed, the connection dropped, or an attempt timed out (then Timeout is true). Match it with errors.As.
A connection that never opened is sent again first, up to the retry limit, and then reported as a ConnectionError: nothing was sent, so nothing was charged. A timeout, or a connection that dropped after the request went out, is never sent again: the check may still have run, and been charged, on the server. The message says which happened.
When the context you passed ends, calls return the context's error instead.
func (*ConnectionError) Unwrap ¶
func (e *ConnectionError) Unwrap() error
Unwrap returns the underlying network error.
type ContactDossier ¶
type ContactDossier struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ContactDossier is the full result of Contact Dossier: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type ContactDossierParams ¶
type ContactDossierParams struct {
// Email.
Email *string `json:"email,omitempty"`
// Phone. With its country code.
Phone *string `json:"phone,omitempty"`
// Name.
Name *string `json:"name,omitempty"`
// Date of birth. YYYY-MM-DD.
Dob *string `json:"dob,omitempty"`
// Country. ISO alpha-2.
Country *string `json:"country,omitempty"`
// IP address.
IP *string `json:"ip,omitempty"`
// Wallet address.
Wallet *string `json:"wallet,omitempty"`
// Slower checks. Each adds up to a few minutes.
//
// Default [].
Include []string `json:"include,omitempty"`
}
ContactDossierParams is the request of Contact Dossier: POST /v1/verify/contact.
type ContactDossierResponse ¶
type ContactDossierResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Contact Dossier: everything the check found. See the fields listed in the operation.
Data ContactDossier `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ContactDossierResponse is the envelope of every Contact Dossier answer. The client returns its Data (a ContactDossier) and puts the rest in LastResponse.
func (ContactDossierResponse) MarshalJSON ¶
func (v ContactDossierResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ContactDossierResponse) UnmarshalJSON ¶
func (v *ContactDossierResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ContactService ¶
type ContactService struct {
// contains filtered or unexported fields
}
ContactService holds the contact APIs: Dossier.
func (*ContactService) Dossier ¶
func (s *ContactService) Dossier(ctx context.Context, params *ContactDossierParams, opts ...RequestOption) (*ContactDossier, error)
Dossier calls Contact Dossier: POST /v1/verify/contact.
Everything in one call: email, phone, IP, sanctions screening and wallet, each part in exactly the same shape as its own API. The slower checks (accounts, username, adverse media) are opt-in.
Price: 1.39 credits per successful call.
type CountryInfo ¶
type CountryInfo struct {
// ISO 3166-1 alpha-2, upper case.
Code string `json:"code,omitempty"`
// Country name.
Name string `json:"name,omitempty"`
// Flag emoji.
Flag string `json:"flag,omitempty"`
// Where the country came from.
//
// One of "bank_directory", "cheque_face" or "micr_line".
Source string `json:"source,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
CountryInfo is the cheque's country and where it came from.
func (CountryInfo) MarshalJSON ¶
func (v CountryInfo) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*CountryInfo) UnmarshalJSON ¶
func (v *CountryInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DeepCheque ¶
type DeepCheque struct {
// 1-based, from the top (left to right when side by side).
Index int64 `json:"index,omitempty"`
MICR DeepChequeMicr `json:"micr,omitempty"`
Vision *VisionResult `json:"vision,omitempty"`
// A bank read on a document, matched in the directory.
Bank BankMatch `json:"bank,omitempty"`
Country *CountryInfo `json:"country,omitempty"`
Currency *ResolvedCurrency `json:"currency,omitempty"`
ReaderError string `json:"reader_error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DeepCheque is one cheque of a photo that holds several.
func (DeepCheque) MarshalJSON ¶
func (v DeepCheque) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DeepCheque) UnmarshalJSON ¶
func (v *DeepCheque) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DeepChequeMicr ¶
type DeepChequeMicr struct {
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// Why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
IssueCode IssueCode `json:"issue_code,omitempty"`
Issue string `json:"issue,omitempty"`
ZonesDetected int64 `json:"zones_detected,omitempty"`
Zones []MicrZone `json:"zones,omitempty"`
// One MICR line, exactly as the engine returns it, plus values derived from its text.
MICR MicrZone `json:"micr,omitempty"`
// The cheque's country and where it came from.
Country CountryInfo `json:"country,omitempty"`
Quality DeepChequeMicrQuality `json:"quality,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DeepChequeMicr is the micr member of DeepCheque.
func (DeepChequeMicr) MarshalJSON ¶
func (v DeepChequeMicr) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DeepChequeMicr) UnmarshalJSON ¶
func (v *DeepChequeMicr) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DeepChequeMicrQuality ¶
type DeepChequeMicrQuality struct {
Rotation float64 `json:"rotation,omitempty"`
Skew float64 `json:"skew,omitempty"`
MinCharConfidence float64 `json:"min_char_confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DeepChequeMicrQuality is the quality member of DeepChequeMicr.
func (DeepChequeMicrQuality) MarshalJSON ¶
func (v DeepChequeMicrQuality) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DeepChequeMicrQuality) UnmarshalJSON ¶
func (v *DeepChequeMicrQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentAuthenticity ¶
type DocumentAuthenticity struct {
Overall string `json:"overall,omitempty"`
Failed []string `json:"failed,omitempty"`
Summary DocumentAuthenticitySummary `json:"summary,omitempty"`
Checks []DocumentAuthenticityCheck `json:"checks,omitempty"`
ImageQuality DocumentAuthenticityImageQuality `json:"image_quality,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
DocumentAuthenticity is the answer of Document Authenticity.
func (DocumentAuthenticity) MarshalJSON ¶
func (v DocumentAuthenticity) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentAuthenticity) UnmarshalJSON ¶
func (v *DocumentAuthenticity) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentAuthenticityCheck ¶
type DocumentAuthenticityCheck struct {
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentAuthenticityCheck is the check member of DocumentAuthenticity.
func (DocumentAuthenticityCheck) MarshalJSON ¶
func (v DocumentAuthenticityCheck) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentAuthenticityCheck) UnmarshalJSON ¶
func (v *DocumentAuthenticityCheck) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentAuthenticityImageQuality ¶
type DocumentAuthenticityImageQuality struct {
Focus string `json:"focus,omitempty"`
Glare string `json:"glare,omitempty"`
Portrait string `json:"portrait,omitempty"`
Bounds string `json:"bounds,omitempty"`
Perspective string `json:"perspective,omitempty"`
Resolution string `json:"resolution,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentAuthenticityImageQuality is the image_quality member of DocumentAuthenticity.
func (DocumentAuthenticityImageQuality) MarshalJSON ¶
func (v DocumentAuthenticityImageQuality) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentAuthenticityImageQuality) UnmarshalJSON ¶
func (v *DocumentAuthenticityImageQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentAuthenticityParams ¶
type DocumentAuthenticityParams struct {
// Document front. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
ImageFront Image `json:"image_front,omitempty"`
// Document back. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
ImageBack Image `json:"image_back,omitempty"`
}
DocumentAuthenticityParams is the request of Document Authenticity: POST /v1/idv/authenticity.
type DocumentAuthenticityResponse ¶
type DocumentAuthenticityResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Document Authenticity.
Data DocumentAuthenticity `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentAuthenticityResponse is the envelope of every Document Authenticity answer. The client returns its Data (a DocumentAuthenticity) and puts the rest in LastResponse.
func (DocumentAuthenticityResponse) MarshalJSON ¶
func (v DocumentAuthenticityResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentAuthenticityResponse) UnmarshalJSON ¶
func (v *DocumentAuthenticityResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentAuthenticitySummary ¶
type DocumentAuthenticitySummary struct {
Pass float64 `json:"pass,omitempty"`
Fail float64 `json:"fail,omitempty"`
NotChecked float64 `json:"not_checked,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentAuthenticitySummary is the summary member of DocumentAuthenticity.
func (DocumentAuthenticitySummary) MarshalJSON ¶
func (v DocumentAuthenticitySummary) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentAuthenticitySummary) UnmarshalJSON ¶
func (v *DocumentAuthenticitySummary) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentClassify ¶
type DocumentClassify struct {
DocumentName string `json:"document_name,omitempty"`
DocType string `json:"doc_type,omitempty"`
Category string `json:"category,omitempty"`
Country string `json:"country,omitempty"`
CountryName string `json:"country_name,omitempty"`
State any `json:"state,omitempty"`
Year string `json:"year,omitempty"`
Size string `json:"size,omitempty"`
HasMRZ bool `json:"has_mrz,omitempty"`
HasChip bool `json:"has_chip,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
DocumentClassify is the answer of Document Classify.
func (DocumentClassify) MarshalJSON ¶
func (v DocumentClassify) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentClassify) UnmarshalJSON ¶
func (v *DocumentClassify) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentClassifyParams ¶
type DocumentClassifyParams struct {
// Document. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
}
DocumentClassifyParams is the request of Document Classify: POST /v1/idv/classify.
type DocumentClassifyResponse ¶
type DocumentClassifyResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Document Classify.
Data DocumentClassify `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentClassifyResponse is the envelope of every Document Classify answer. The client returns its Data (a DocumentClassify) and puts the rest in LastResponse.
func (DocumentClassifyResponse) MarshalJSON ¶
func (v DocumentClassifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentClassifyResponse) UnmarshalJSON ¶
func (v *DocumentClassifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentFields ¶
type DocumentFields struct {
DateFormat string `json:"date_format,omitempty"`
Count float64 `json:"count,omitempty"`
Summary DocumentFieldsSummary `json:"summary,omitempty"`
Fields []DocumentFieldsField `json:"fields,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
DocumentFields is the answer of Document Fields.
func (DocumentFields) MarshalJSON ¶
func (v DocumentFields) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentFields) UnmarshalJSON ¶
func (v *DocumentFields) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentFieldsField ¶
type DocumentFieldsField struct {
Type float64 `json:"type,omitempty"`
Label string `json:"label,omitempty"`
Status string `json:"status,omitempty"`
Sources []string `json:"sources,omitempty"`
SourcesAgree string `json:"sources_agree,omitempty"`
ValueMasked string `json:"value_masked,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentFieldsField is the field member of DocumentFields.
func (DocumentFieldsField) MarshalJSON ¶
func (v DocumentFieldsField) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentFieldsField) UnmarshalJSON ¶
func (v *DocumentFieldsField) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentFieldsParams ¶
type DocumentFieldsParams struct {
// Document. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
}
DocumentFieldsParams is the request of Document Fields: POST /v1/idv/fields.
type DocumentFieldsResponse ¶
type DocumentFieldsResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Document Fields.
Data DocumentFields `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentFieldsResponse is the envelope of every Document Fields answer. The client returns its Data (a DocumentFields) and puts the rest in LastResponse.
func (DocumentFieldsResponse) MarshalJSON ¶
func (v DocumentFieldsResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentFieldsResponse) UnmarshalJSON ¶
func (v *DocumentFieldsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentFieldsSummary ¶
type DocumentFieldsSummary struct {
Pass float64 `json:"pass,omitempty"`
Fail float64 `json:"fail,omitempty"`
NotChecked float64 `json:"not_checked,omitempty"`
SourcesDisagree float64 `json:"sources_disagree,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentFieldsSummary is the summary member of DocumentFields.
func (DocumentFieldsSummary) MarshalJSON ¶
func (v DocumentFieldsSummary) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentFieldsSummary) UnmarshalJSON ¶
func (v *DocumentFieldsSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrz ¶
type DocumentMrz struct {
Lines []string `json:"lines,omitempty"`
Format string `json:"format,omitempty"`
Valid bool `json:"valid,omitempty"`
Expired bool `json:"expired,omitempty"`
Problems []DocumentMrzProblem `json:"problems,omitempty"`
CheckDigits DocumentMrzCheckDigits `json:"check_digits,omitempty"`
PrintQuality DocumentMrzPrintQuality `json:"print_quality,omitempty"`
Parsed DocumentMrzParsed `json:"parsed,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
DocumentMrz is the answer of Document MRZ.
func (DocumentMrz) MarshalJSON ¶
func (v DocumentMrz) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrz) UnmarshalJSON ¶
func (v *DocumentMrz) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzCheckDigits ¶
type DocumentMrzCheckDigits struct {
DocNumber DocumentMrzCheckDigitsDocNumber `json:"doc_number,omitempty"`
BirthDate DocumentMrzCheckDigitsBirthDate `json:"birth_date,omitempty"`
Expiry DocumentMrzCheckDigitsExpiry `json:"expiry,omitempty"`
PersonalNumber DocumentMrzCheckDigitsPersonalNumber `json:"personal_number,omitempty"`
Composite DocumentMrzCheckDigitsComposite `json:"composite,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzCheckDigits is the check_digits member of DocumentMrz.
func (DocumentMrzCheckDigits) MarshalJSON ¶
func (v DocumentMrzCheckDigits) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzCheckDigits) UnmarshalJSON ¶
func (v *DocumentMrzCheckDigits) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzCheckDigitsBirthDate ¶
type DocumentMrzCheckDigitsBirthDate struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzCheckDigitsBirthDate is the birth_date member of DocumentMrzCheckDigits.
func (DocumentMrzCheckDigitsBirthDate) MarshalJSON ¶
func (v DocumentMrzCheckDigitsBirthDate) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzCheckDigitsBirthDate) UnmarshalJSON ¶
func (v *DocumentMrzCheckDigitsBirthDate) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzCheckDigitsComposite ¶
type DocumentMrzCheckDigitsComposite struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzCheckDigitsComposite is the composite member of DocumentMrzCheckDigits.
func (DocumentMrzCheckDigitsComposite) MarshalJSON ¶
func (v DocumentMrzCheckDigitsComposite) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzCheckDigitsComposite) UnmarshalJSON ¶
func (v *DocumentMrzCheckDigitsComposite) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzCheckDigitsDocNumber ¶
type DocumentMrzCheckDigitsDocNumber struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzCheckDigitsDocNumber is the doc_number member of DocumentMrzCheckDigits.
func (DocumentMrzCheckDigitsDocNumber) MarshalJSON ¶
func (v DocumentMrzCheckDigitsDocNumber) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzCheckDigitsDocNumber) UnmarshalJSON ¶
func (v *DocumentMrzCheckDigitsDocNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzCheckDigitsExpiry ¶
type DocumentMrzCheckDigitsExpiry struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzCheckDigitsExpiry is the expiry member of DocumentMrzCheckDigits.
func (DocumentMrzCheckDigitsExpiry) MarshalJSON ¶
func (v DocumentMrzCheckDigitsExpiry) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzCheckDigitsExpiry) UnmarshalJSON ¶
func (v *DocumentMrzCheckDigitsExpiry) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzCheckDigitsPersonalNumber ¶
type DocumentMrzCheckDigitsPersonalNumber struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzCheckDigitsPersonalNumber is the personal_number member of DocumentMrzCheckDigits.
func (DocumentMrzCheckDigitsPersonalNumber) MarshalJSON ¶
func (v DocumentMrzCheckDigitsPersonalNumber) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzCheckDigitsPersonalNumber) UnmarshalJSON ¶
func (v *DocumentMrzCheckDigitsPersonalNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzParams ¶
type DocumentMrzParams struct {
// Document page with the MRZ. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
}
DocumentMrzParams is the request of Document MRZ: POST /v1/idv/mrz.
type DocumentMrzParsed ¶
type DocumentMrzParsed struct {
SurnameAndGivenNames string `json:"Surname And Given Names,omitempty"`
RemainderTerm string `json:"RemainderTerm,omitempty"`
DateOfBirth string `json:"Date of Birth,omitempty"`
GivenNames string `json:"Given Names,omitempty"`
Surname string `json:"Surname,omitempty"`
DateOfExpiry string `json:"Date of Expiry,omitempty"`
DocumentClassCode string `json:"Document Class Code,omitempty"`
IssuingStateName string `json:"Issuing State Name,omitempty"`
FinalCheckdigit string `json:"Final Checkdigit,omitempty"`
OptionalDataCheckDigit string `json:"Optional Data CheckDigit,omitempty"`
OptionalData string `json:"Optional Data,omitempty"`
IssuingStateCode string `json:"Issuing State Code,omitempty"`
DocumentNumber string `json:"Document Number,omitempty"`
DocumentNumberCheckdigit string `json:"Document Number Checkdigit,omitempty"`
NationalityCode string `json:"Nationality Code,omitempty"`
DateOfBirthCheckdigit string `json:"Date of Birth Checkdigit,omitempty"`
Sex string `json:"Sex,omitempty"`
DateOfExpiryCheckdigit string `json:"Date of Expiry Checkdigit,omitempty"`
PersonalNumber string `json:"Personal Number,omitempty"`
MRZType string `json:"MRZ Type,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzParsed is the parsed member of DocumentMrz.
func (DocumentMrzParsed) MarshalJSON ¶
func (v DocumentMrzParsed) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzParsed) UnmarshalJSON ¶
func (v *DocumentMrzParsed) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzPrintQuality ¶
type DocumentMrzPrintQuality struct {
CheckSums string `json:"check_sums,omitempty"`
Contrast string `json:"contrast,omitempty"`
DocFormat string `json:"doc_format,omitempty"`
MRZFormat string `json:"mrz_format,omitempty"`
PrintPosition string `json:"print_position,omitempty"`
Stains string `json:"stains,omitempty"`
Symbols string `json:"symbols,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzPrintQuality is the print_quality member of DocumentMrz.
func (DocumentMrzPrintQuality) MarshalJSON ¶
func (v DocumentMrzPrintQuality) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzPrintQuality) UnmarshalJSON ¶
func (v *DocumentMrzPrintQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzProblem ¶
type DocumentMrzProblem struct {
Field string `json:"field,omitempty"`
Issue string `json:"issue,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzProblem is the problem member of DocumentMrz.
func (DocumentMrzProblem) MarshalJSON ¶
func (v DocumentMrzProblem) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzProblem) UnmarshalJSON ¶
func (v *DocumentMrzProblem) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentMrzResponse ¶
type DocumentMrzResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Document MRZ.
Data DocumentMrz `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentMrzResponse is the envelope of every Document MRZ answer. The client returns its Data (a DocumentMrz) and puts the rest in LastResponse.
func (DocumentMrzResponse) MarshalJSON ¶
func (v DocumentMrzResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentMrzResponse) UnmarshalJSON ¶
func (v *DocumentMrzResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentPortrait ¶
type DocumentPortrait struct {
PortraitRef string `json:"portrait_ref,omitempty"`
FaceDetected bool `json:"face_detected,omitempty"`
FacesOnDocument float64 `json:"faces_on_document,omitempty"`
FaceConfidence float64 `json:"face_confidence,omitempty"`
Portrait string `json:"portrait,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
DocumentPortrait is the answer of Document Portrait.
func (DocumentPortrait) MarshalJSON ¶
func (v DocumentPortrait) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentPortrait) UnmarshalJSON ¶
func (v *DocumentPortrait) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentPortraitParams ¶
type DocumentPortraitParams struct {
// Document. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
}
DocumentPortraitParams is the request of Document Portrait: POST /v1/idv/portrait.
type DocumentPortraitResponse ¶
type DocumentPortraitResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Document Portrait.
Data DocumentPortrait `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentPortraitResponse is the envelope of every Document Portrait answer. The client returns its Data (a DocumentPortrait) and puts the rest in LastResponse.
func (DocumentPortraitResponse) MarshalJSON ¶
func (v DocumentPortraitResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentPortraitResponse) UnmarshalJSON ¶
func (v *DocumentPortraitResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentRead ¶
type DocumentRead struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
DocumentRead is the full result of Document Read: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type DocumentReadParams ¶
type DocumentReadParams struct {
// Document front. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
ImageFront Image `json:"image_front,omitempty"`
// Document back. The reverse side, when it carries data. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
ImageBack Image `json:"image_back,omitempty"`
// Scenario.
//
// One of "FullProcess" (Full process), "FullAuth" (Full + authenticity), "Barcode" (Barcode only) or "Mrz" (MRZ only). Default "FullProcess".
Scenario *string `json:"scenario,omitempty"`
DocHint *DocumentReadParamsDocHint `json:"doc_hint,omitempty"`
}
DocumentReadParams is the request of Document Read: POST /v1/idv/read.
type DocumentReadParamsDocHint ¶
type DocumentReadParamsDocHint struct {
// Expected country. ISO code, for example RW or RWA.
Country *string `json:"country,omitempty"`
// Expected type.
//
// One of "" (Any), "passport" (Passport), "national_id" (National ID), "driving_licence" (Driving licence) or "residence_permit" (Residence permit). Default "".
Type *string `json:"type,omitempty"`
}
DocumentReadParamsDocHint is the doc_hint member of DocumentReadParams.
type DocumentReadResponse ¶
type DocumentReadResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Document Read: everything the check found. See the fields listed in the operation.
Data DocumentRead `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
DocumentReadResponse is the envelope of every Document Read answer. The client returns its Data (a DocumentRead) and puts the rest in LastResponse.
func (DocumentReadResponse) MarshalJSON ¶
func (v DocumentReadResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*DocumentReadResponse) UnmarshalJSON ¶
func (v *DocumentReadResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type DocumentsService ¶
type DocumentsService struct {
// contains filtered or unexported fields
}
DocumentsService holds the documents APIs: Read, Classify, Mrz, Portrait, Authenticity and Fields.
func (*DocumentsService) Authenticity ¶
func (s *DocumentsService) Authenticity(ctx context.Context, params *DocumentAuthenticityParams, opts ...RequestOption) (*DocumentAuthenticity, error)
Authenticity calls Document Authenticity: POST /v1/idv/authenticity.
The document's checks and the capture's image quality. Each item is pass, fail or not_checked, with one overall verdict.
Price: 0.25 credits per successful call.
func (*DocumentsService) Classify ¶
func (s *DocumentsService) Classify(ctx context.Context, params *DocumentClassifyParams, opts ...RequestOption) (*DocumentClassify, error)
Classify calls Document Classify: POST /v1/idv/classify.
Just the identity of the document: its name, category, issuing country, year and a confidence.
Price: 0.02 credits per successful call.
func (*DocumentsService) Fields ¶
func (s *DocumentsService) Fields(ctx context.Context, params *DocumentFieldsParams, opts ...RequestOption) (*DocumentFields, error)
Fields calls Document Fields: POST /v1/idv/fields.
Which fields were read, from which sources, whether each is valid, and whether the sources agree. Values are masked, so it is safe to log.
Price: 0.02 credits per successful call.
func (*DocumentsService) Mrz ¶
func (s *DocumentsService) Mrz(ctx context.Context, params *DocumentMrzParams, opts ...RequestOption) (*DocumentMrz, error)
Mrz calls Document MRZ: POST /v1/idv/mrz.
The MRZ read from the document: the raw lines, the parsed fields, and every check digit recomputed under ICAO 9303 (the same rule for every country).
Price: 0.06 credits per successful call.
func (*DocumentsService) Portrait ¶
func (s *DocumentsService) Portrait(ctx context.Context, params *DocumentPortraitParams, opts ...RequestOption) (*DocumentPortrait, error)
Portrait calls Document Portrait: POST /v1/idv/portrait.
The portrait cut from the document, and a one-time reference you can pass straight to Face Verify or Face Match as image1.
Price: 0.02 credits per successful call.
func (*DocumentsService) Read ¶
func (s *DocumentsService) Read(ctx context.Context, params *DocumentReadParams, opts ...RequestOption) (*DocumentRead, error)
Read calls Document Read: POST /v1/idv/read.
The full read of an ID document. Returns every container the reader produced, type, printed and MRZ fields, portrait, security and image-quality checks, under data.ContainerList. An optional hint says whether the document matches what you expected.
Price: 0.35 credits per successful call.
type EmailFootprint ¶
type EmailFootprint struct {
Email string `json:"email,omitempty"`
Count float64 `json:"count,omitempty"`
Accounts []EmailFootprintAccount `json:"accounts,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
EmailFootprint is the answer of Email Accounts.
func (EmailFootprint) MarshalJSON ¶
func (v EmailFootprint) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailFootprint) UnmarshalJSON ¶
func (v *EmailFootprint) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type EmailFootprintAccount ¶
type EmailFootprintAccount struct {
Site string `json:"site,omitempty"`
Domain string `json:"domain,omitempty"`
RecoveryEmailHint any `json:"recovery_email_hint,omitempty"`
PhoneHint any `json:"phone_hint,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
EmailFootprintAccount is the account member of EmailFootprint.
func (EmailFootprintAccount) MarshalJSON ¶
func (v EmailFootprintAccount) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailFootprintAccount) UnmarshalJSON ¶
func (v *EmailFootprintAccount) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type EmailFootprintParams ¶
type EmailFootprintParams struct {
// Email. Required.
Email string `json:"email,omitempty"`
}
EmailFootprintParams is the request of Email Accounts: POST /v1/email/footprint.
type EmailFootprintResponse ¶
type EmailFootprintResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Email Accounts.
Data EmailFootprint `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
EmailFootprintResponse is the envelope of every Email Accounts answer. The client returns its Data (a EmailFootprint) and puts the rest in LastResponse.
func (EmailFootprintResponse) MarshalJSON ¶
func (v EmailFootprintResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailFootprintResponse) UnmarshalJSON ¶
func (v *EmailFootprintResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type EmailService ¶
type EmailService struct {
// contains filtered or unexported fields
}
EmailService holds the email APIs: Verify and Footprint.
func (*EmailService) Footprint ¶
func (s *EmailService) Footprint(ctx context.Context, params *EmailFootprintParams, opts ...RequestOption) (*EmailFootprint, error)
Footprint calls Email Accounts: POST /v1/email/footprint.
The sites where an email address has an account, found through each site's sign-up and recovery forms.
Price: 0.1 credits per successful call.
func (*EmailService) Verify ¶
func (s *EmailService) Verify(ctx context.Context, params *EmailVerifyParams, opts ...RequestOption) (*EmailVerify, error)
Verify calls Email Risk: POST /v1/email/verify.
Whether an address can receive mail and whether the mailbox exists, flagging temporary inboxes and typos, with a risk level and the reasons behind it.
Price: 0.05 credits per successful call.
type EmailVerify ¶
type EmailVerify struct {
Email string `json:"email,omitempty"`
Domain string `json:"domain,omitempty"`
SyntaxOK bool `json:"syntax_ok,omitempty"`
Suggestion any `json:"suggestion,omitempty"`
Disposable bool `json:"disposable,omitempty"`
FreeProvider bool `json:"free_provider,omitempty"`
MailServer EmailVerifyMailServer `json:"mail_server,omitempty"`
Mailbox string `json:"mailbox,omitempty"`
Deliverable string `json:"deliverable,omitempty"`
Risk EmailVerifyRisk `json:"risk,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
EmailVerify is the answer of Email Risk.
func (EmailVerify) MarshalJSON ¶
func (v EmailVerify) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailVerify) UnmarshalJSON ¶
func (v *EmailVerify) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type EmailVerifyMailServer ¶
type EmailVerifyMailServer struct {
Found bool `json:"found,omitempty"`
Hosts []string `json:"hosts,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
EmailVerifyMailServer is the mail_server member of EmailVerify.
func (EmailVerifyMailServer) MarshalJSON ¶
func (v EmailVerifyMailServer) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailVerifyMailServer) UnmarshalJSON ¶
func (v *EmailVerifyMailServer) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type EmailVerifyParams ¶
type EmailVerifyParams struct {
// Email. Required.
Email string `json:"email,omitempty"`
}
EmailVerifyParams is the request of Email Risk: POST /v1/email/verify.
type EmailVerifyResponse ¶
type EmailVerifyResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Email Risk.
Data EmailVerify `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
EmailVerifyResponse is the envelope of every Email Risk answer. The client returns its Data (a EmailVerify) and puts the rest in LastResponse.
func (EmailVerifyResponse) MarshalJSON ¶
func (v EmailVerifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailVerifyResponse) UnmarshalJSON ¶
func (v *EmailVerifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type EmailVerifyRisk ¶
type EmailVerifyRisk struct {
Level string `json:"level,omitempty"`
Reasons []any `json:"reasons,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
EmailVerifyRisk is the risk member of EmailVerify.
func (EmailVerifyRisk) MarshalJSON ¶
func (v EmailVerifyRisk) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*EmailVerifyRisk) UnmarshalJSON ¶
func (v *EmailVerifyRisk) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ExpiryStatus ¶
type ExpiryStatus = string
ExpiryStatus: `expiring_soon`: 60 days or less left.
One of "valid", "expiring_soon", "expired" or "unknown".
type FaceAge ¶
type FaceAge struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceAge is the full result of Age Estimation: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type FaceAgeParams ¶
type FaceAgeParams struct {
// Face image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Only the central face.
//
// Default false.
OnlyCentralFace *bool `json:"onlyCentralFace,omitempty"`
Crop *FaceAgeParamsCrop `json:"crop,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceAgeParams is the request of Age Estimation: POST /v1/face/age.
type FaceAgeParamsCrop ¶
type FaceAgeParamsCrop struct {
// Aligned crop. Recommended: the range is most exact with a crop.
//
// One of "" (No crop), 0 (3:4 portrait), 1 (4:5 portrait (standard)), 2 (2:3 portrait), 3 (1:1 square) or 4 (3:4 portrait, wider). Default 1.
Type any `json:"type,omitempty"`
}
FaceAgeParamsCrop is the crop member of FaceAgeParams.
type FaceAgeResponse ¶
type FaceAgeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Age Estimation: everything the check found. See the fields listed in the operation.
Data FaceAge `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAgeResponse is the envelope of every Age Estimation answer. The client returns its Data (a FaceAge) and puts the rest in LastResponse.
func (FaceAgeResponse) MarshalJSON ¶
func (v FaceAgeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAgeResponse) UnmarshalJSON ¶
func (v *FaceAgeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAnalyze ¶
type FaceAnalyze struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceAnalyze is the full result of Face Analyze: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type FaceAnalyzeParams ¶
type FaceAnalyzeParams struct {
// Face image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Only the central face. Off returns every face in the image.
//
// Default false.
OnlyCentralFace *bool `json:"onlyCentralFace,omitempty"`
Crop *FaceAnalyzeParamsCrop `json:"crop,omitempty"`
// Attributes to return. Any of the 13 attributes.
Attributes []string `json:"attributes,omitempty"`
// Your quality checks. A check passes when its value is within your range.
//
// Default [{"name":"Yaw","range":[-5,5]},{"name":"BlurLevel","range":[0,0.15]}].
QualityChecks []any `json:"qualityChecks,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceAnalyzeParams is the request of Face Analyze: POST /v1/face/analyze.
type FaceAnalyzeParamsCrop ¶
type FaceAnalyzeParamsCrop struct {
// Aligned crop. An aligned crop of each face at this shape.
//
// One of "" (No crop), 0 (3:4 portrait), 1 (4:5 portrait (standard)), 2 (2:3 portrait), 3 (1:1 square) or 4 (3:4 portrait, wider). Default 1.
Type any `json:"type,omitempty"`
}
FaceAnalyzeParamsCrop is the crop member of FaceAnalyzeParams.
type FaceAnalyzeResponse ¶
type FaceAnalyzeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Face Analyze: everything the check found. See the fields listed in the operation.
Data FaceAnalyze `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAnalyzeResponse is the envelope of every Face Analyze answer. The client returns its Data (a FaceAnalyze) and puts the rest in LastResponse.
func (FaceAnalyzeResponse) MarshalJSON ¶
func (v FaceAnalyzeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAnalyzeResponse) UnmarshalJSON ¶
func (v *FaceAnalyzeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAttributes ¶
type FaceAttributes struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Faces []FaceAttributesFace `json:"faces,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceAttributesMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceAttributes is the answer of Face Attributes.
func (FaceAttributes) MarshalJSON ¶
func (v FaceAttributes) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAttributes) UnmarshalJSON ¶
func (v *FaceAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAttributesFace ¶
type FaceAttributesFace struct {
ROI []float64 `json:"roi,omitempty"`
Attributes []FaceAttributesFaceAttribute `json:"attributes,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAttributesFace is the face member of FaceAttributes.
func (FaceAttributesFace) MarshalJSON ¶
func (v FaceAttributesFace) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAttributesFace) UnmarshalJSON ¶
func (v *FaceAttributesFace) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAttributesFaceAttribute ¶
type FaceAttributesFaceAttribute struct {
Name string `json:"name,omitempty"`
Value any `json:"value,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAttributesFaceAttribute is the attribute member of FaceAttributesFace.
func (FaceAttributesFaceAttribute) MarshalJSON ¶
func (v FaceAttributesFaceAttribute) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAttributesFaceAttribute) UnmarshalJSON ¶
func (v *FaceAttributesFaceAttribute) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAttributesMetadata ¶
type FaceAttributesMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceAttributesMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAttributesMetadata is the metadata member of FaceAttributes.
func (FaceAttributesMetadata) MarshalJSON ¶
func (v FaceAttributesMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAttributesMetadata) UnmarshalJSON ¶
func (v *FaceAttributesMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAttributesMetadataCtx ¶
type FaceAttributesMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAttributesMetadataCtx is the ctx member of FaceAttributesMetadata.
func (FaceAttributesMetadataCtx) MarshalJSON ¶
func (v FaceAttributesMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAttributesMetadataCtx) UnmarshalJSON ¶
func (v *FaceAttributesMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceAttributesParams ¶
type FaceAttributesParams struct {
// Face image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Attributes to return. Required.
Attributes []string `json:"attributes,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceAttributesParams is the request of Face Attributes: POST /v1/face/attributes.
type FaceAttributesResponse ¶
type FaceAttributesResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Attributes.
Data FaceAttributes `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceAttributesResponse is the envelope of every Face Attributes answer. The client returns its Data (a FaceAttributes) and puts the rest in LastResponse.
func (FaceAttributesResponse) MarshalJSON ¶
func (v FaceAttributesResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceAttributesResponse) UnmarshalJSON ¶
func (v *FaceAttributesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCluster ¶
type FaceCluster struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Clusters [][]string `json:"clusters,omitempty"`
Pairs []FaceClusterPair `json:"pairs,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceClusterMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceCluster is the answer of Face Cluster.
func (FaceCluster) MarshalJSON ¶
func (v FaceCluster) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCluster) UnmarshalJSON ¶
func (v *FaceCluster) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceClusterMetadata ¶
type FaceClusterMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceClusterMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceClusterMetadata is the metadata member of FaceCluster.
func (FaceClusterMetadata) MarshalJSON ¶
func (v FaceClusterMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceClusterMetadata) UnmarshalJSON ¶
func (v *FaceClusterMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceClusterMetadataCtx ¶
type FaceClusterMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceClusterMetadataCtx is the ctx member of FaceClusterMetadata.
func (FaceClusterMetadataCtx) MarshalJSON ¶
func (v FaceClusterMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceClusterMetadataCtx) UnmarshalJSON ¶
func (v *FaceClusterMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceClusterPair ¶
type FaceClusterPair struct {
A string `json:"a,omitempty"`
B string `json:"b,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceClusterPair is the pair member of FaceCluster.
func (FaceClusterPair) MarshalJSON ¶
func (v FaceClusterPair) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceClusterPair) UnmarshalJSON ¶
func (v *FaceClusterPair) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceClusterParams ¶
type FaceClusterParams struct {
// Faces. 2 to 8 faces, each with your own id. Required.
Faces []FaceClusterParamsFace `json:"faces,omitempty" verisec:"list,id=id,label=face"`
// Threshold. Two faces join a group at or above this similarity.
//
// Default 0.75.
Threshold *float64 `json:"threshold,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceClusterParams is the request of Face Cluster: POST /v1/face/cluster.
type FaceClusterParamsFace ¶
type FaceClusterParamsFace struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your id for this face (the SDKs fill in face-1, face-2, ... when left out).
ID *string `json:"id,omitempty"`
}
FaceClusterParamsFace is the face member of FaceClusterParams.
type FaceClusterResponse ¶
type FaceClusterResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Cluster.
Data FaceCluster `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceClusterResponse is the envelope of every Face Cluster answer. The client returns its Data (a FaceCluster) and puts the rest in LastResponse.
func (FaceClusterResponse) MarshalJSON ¶
func (v FaceClusterResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceClusterResponse) UnmarshalJSON ¶
func (v *FaceClusterResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCount ¶
type FaceCount struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
FaceCount float64 `json:"faceCount,omitempty"`
OK bool `json:"ok,omitempty"`
Rule string `json:"rule,omitempty"`
Faces []FaceCountFace `json:"faces,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceCountMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceCount is the answer of Face Count.
func (FaceCount) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCount) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCountFace ¶
type FaceCountFace struct {
ROI []float64 `json:"roi,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCountFace is the face member of FaceCount.
func (FaceCountFace) MarshalJSON ¶
func (v FaceCountFace) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCountFace) UnmarshalJSON ¶
func (v *FaceCountFace) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCountMetadata ¶
type FaceCountMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceCountMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCountMetadata is the metadata member of FaceCount.
func (FaceCountMetadata) MarshalJSON ¶
func (v FaceCountMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCountMetadata) UnmarshalJSON ¶
func (v *FaceCountMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCountMetadataCtx ¶
type FaceCountMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCountMetadataCtx is the ctx member of FaceCountMetadata.
func (FaceCountMetadataCtx) MarshalJSON ¶
func (v FaceCountMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCountMetadataCtx) UnmarshalJSON ¶
func (v *FaceCountMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCountParams ¶
type FaceCountParams struct {
// Image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Expected faces. ok is true only when the count equals this.
//
// Default 1.
Expected *int64 `json:"expected,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceCountParams is the request of Face Count: POST /v1/face/count.
type FaceCountResponse ¶
type FaceCountResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Count.
Data FaceCount `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCountResponse is the envelope of every Face Count answer. The client returns its Data (a FaceCount) and puts the rest in LastResponse.
func (FaceCountResponse) MarshalJSON ¶
func (v FaceCountResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCountResponse) UnmarshalJSON ¶
func (v *FaceCountResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCrop ¶
type FaceCrop struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Crops []FaceCropCrop `json:"crops,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceCropMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceCrop is the answer of Smart Crop.
func (FaceCrop) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCrop) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCropCrop ¶
type FaceCropCrop struct {
ROI []float64 `json:"roi,omitempty"`
RotationAngle float64 `json:"rotationAngle,omitempty"`
Crop string `json:"crop,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCropCrop is the crop member of FaceCrop.
func (FaceCropCrop) MarshalJSON ¶
func (v FaceCropCrop) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCropCrop) UnmarshalJSON ¶
func (v *FaceCropCrop) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCropMetadata ¶
type FaceCropMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceCropMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCropMetadata is the metadata member of FaceCrop.
func (FaceCropMetadata) MarshalJSON ¶
func (v FaceCropMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCropMetadata) UnmarshalJSON ¶
func (v *FaceCropMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCropMetadataCtx ¶
type FaceCropMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCropMetadataCtx is the ctx member of FaceCropMetadata.
func (FaceCropMetadataCtx) MarshalJSON ¶
func (v FaceCropMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCropMetadataCtx) UnmarshalJSON ¶
func (v *FaceCropMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceCropParams ¶
type FaceCropParams struct {
// Image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Crop shape.
//
// One of 0 (3:4 portrait), 1 (4:5 portrait (standard)), 2 (2:3 portrait), 3 (1:1 square) or 4 (3:4 portrait, wider). Default 3.
Type *int64 `json:"type,omitempty"`
// Only the central face.
//
// Default true.
OnlyCentralFace *bool `json:"onlyCentralFace,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceCropParams is the request of Smart Crop: POST /v1/face/crop.
type FaceCropResponse ¶
type FaceCropResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Smart Crop.
Data FaceCrop `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceCropResponse is the envelope of every Smart Crop answer. The client returns its Data (a FaceCrop) and puts the rest in LastResponse.
func (FaceCropResponse) MarshalJSON ¶
func (v FaceCropResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceCropResponse) UnmarshalJSON ¶
func (v *FaceCropResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDedupe ¶
type FaceDedupe struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Duplicate bool `json:"duplicate,omitempty"`
MatchedID string `json:"matchedId,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceDedupeMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceDedupe is the answer of Duplicate Check.
func (FaceDedupe) MarshalJSON ¶
func (v FaceDedupe) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDedupe) UnmarshalJSON ¶
func (v *FaceDedupe) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDedupeMetadata ¶
type FaceDedupeMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceDedupeMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDedupeMetadata is the metadata member of FaceDedupe.
func (FaceDedupeMetadata) MarshalJSON ¶
func (v FaceDedupeMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDedupeMetadata) UnmarshalJSON ¶
func (v *FaceDedupeMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDedupeMetadataCtx ¶
type FaceDedupeMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDedupeMetadataCtx is the ctx member of FaceDedupeMetadata.
func (FaceDedupeMetadataCtx) MarshalJSON ¶
func (v FaceDedupeMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDedupeMetadataCtx) UnmarshalJSON ¶
func (v *FaceDedupeMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDedupeParams ¶
type FaceDedupeParams struct {
// New face. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Candidate Image `json:"candidate,omitempty"`
// Existing faces. 1 to 10 faces, each with your own id. Required.
Existing []FaceDedupeParamsExisting `json:"existing,omitempty" verisec:"list,id=id,label=face"`
// Threshold. A duplicate at or above this similarity.
//
// Default 0.8.
Threshold *float64 `json:"threshold,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceDedupeParams is the request of Duplicate Check: POST /v1/face/dedupe.
type FaceDedupeParamsExisting ¶
type FaceDedupeParamsExisting struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your id for this face (the SDKs fill in face-1, face-2, ... when left out).
ID *string `json:"id,omitempty"`
}
FaceDedupeParamsExisting is the existing member of FaceDedupeParams.
type FaceDedupeResponse ¶
type FaceDedupeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Duplicate Check.
Data FaceDedupe `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDedupeResponse is the envelope of every Duplicate Check answer. The client returns its Data (a FaceDedupe) and puts the rest in LastResponse.
func (FaceDedupeResponse) MarshalJSON ¶
func (v FaceDedupeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDedupeResponse) UnmarshalJSON ¶
func (v *FaceDedupeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDetect ¶
type FaceDetect struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
FaceCount float64 `json:"faceCount,omitempty"`
Faces []FaceDetectFace `json:"faces,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceDetectMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceDetect is the answer of Face Detect.
func (FaceDetect) MarshalJSON ¶
func (v FaceDetect) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDetect) UnmarshalJSON ¶
func (v *FaceDetect) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDetectFace ¶
type FaceDetectFace struct {
ROI []float64 `json:"roi,omitempty"`
RotationAngle float64 `json:"rotationAngle,omitempty"`
Landmarks [][]float64 `json:"landmarks,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDetectFace is the face member of FaceDetect.
func (FaceDetectFace) MarshalJSON ¶
func (v FaceDetectFace) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDetectFace) UnmarshalJSON ¶
func (v *FaceDetectFace) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDetectMetadata ¶
type FaceDetectMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceDetectMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDetectMetadata is the metadata member of FaceDetect.
func (FaceDetectMetadata) MarshalJSON ¶
func (v FaceDetectMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDetectMetadata) UnmarshalJSON ¶
func (v *FaceDetectMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDetectMetadataCtx ¶
type FaceDetectMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDetectMetadataCtx is the ctx member of FaceDetectMetadata.
func (FaceDetectMetadataCtx) MarshalJSON ¶
func (v FaceDetectMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDetectMetadataCtx) UnmarshalJSON ¶
func (v *FaceDetectMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceDetectParams ¶
type FaceDetectParams struct {
// Image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Only the central face. Off returns every face.
//
// Default false.
OnlyCentralFace *bool `json:"onlyCentralFace,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceDetectParams is the request of Face Detect: POST /v1/face/detect.
type FaceDetectResponse ¶
type FaceDetectResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Detect.
Data FaceDetect `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceDetectResponse is the envelope of every Face Detect answer. The client returns its Data (a FaceDetect) and puts the rest in LastResponse.
func (FaceDetectResponse) MarshalJSON ¶
func (v FaceDetectResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceDetectResponse) UnmarshalJSON ¶
func (v *FaceDetectResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceEmotion ¶
type FaceEmotion struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Faces []FaceEmotionFace `json:"faces,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceEmotionMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceEmotion is the answer of Emotion.
func (FaceEmotion) MarshalJSON ¶
func (v FaceEmotion) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceEmotion) UnmarshalJSON ¶
func (v *FaceEmotion) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceEmotionFace ¶
type FaceEmotionFace struct {
ROI []float64 `json:"roi,omitempty"`
Emotion string `json:"emotion,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceEmotionFace is the face member of FaceEmotion.
func (FaceEmotionFace) MarshalJSON ¶
func (v FaceEmotionFace) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceEmotionFace) UnmarshalJSON ¶
func (v *FaceEmotionFace) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceEmotionMetadata ¶
type FaceEmotionMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceEmotionMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceEmotionMetadata is the metadata member of FaceEmotion.
func (FaceEmotionMetadata) MarshalJSON ¶
func (v FaceEmotionMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceEmotionMetadata) UnmarshalJSON ¶
func (v *FaceEmotionMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceEmotionMetadataCtx ¶
type FaceEmotionMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceEmotionMetadataCtx is the ctx member of FaceEmotionMetadata.
func (FaceEmotionMetadataCtx) MarshalJSON ¶
func (v FaceEmotionMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceEmotionMetadataCtx) UnmarshalJSON ¶
func (v *FaceEmotionMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceEmotionParams ¶
type FaceEmotionParams struct {
// Face image. One image. Or send frames instead. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
Image Image `json:"image,omitempty"`
// Frames. 1 to 10 images of the same scene, in order.
Frames []Image `json:"frames,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceEmotionParams is the request of Emotion: POST /v1/face/emotion.
type FaceEmotionResponse ¶
type FaceEmotionResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Emotion.
Data FaceEmotion `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceEmotionResponse is the envelope of every Emotion answer. The client returns its Data (a FaceEmotion) and puts the rest in LastResponse.
func (FaceEmotionResponse) MarshalJSON ¶
func (v FaceEmotionResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceEmotionResponse) UnmarshalJSON ¶
func (v *FaceEmotionResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceLoginAuthenticate ¶
type FaceLoginAuthenticate struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Authenticated bool `json:"authenticated,omitempty"`
UserID any `json:"userId,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
Live bool `json:"live,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceLoginAuthenticateMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceLoginAuthenticate is the answer of Face Login.
func (FaceLoginAuthenticate) MarshalJSON ¶
func (v FaceLoginAuthenticate) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceLoginAuthenticate) UnmarshalJSON ¶
func (v *FaceLoginAuthenticate) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceLoginAuthenticateMetadata ¶
type FaceLoginAuthenticateMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceLoginAuthenticateMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceLoginAuthenticateMetadata is the metadata member of FaceLoginAuthenticate.
func (FaceLoginAuthenticateMetadata) MarshalJSON ¶
func (v FaceLoginAuthenticateMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceLoginAuthenticateMetadata) UnmarshalJSON ¶
func (v *FaceLoginAuthenticateMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceLoginAuthenticateMetadataCtx ¶
type FaceLoginAuthenticateMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceLoginAuthenticateMetadataCtx is the ctx member of FaceLoginAuthenticateMetadata.
func (FaceLoginAuthenticateMetadataCtx) MarshalJSON ¶
func (v FaceLoginAuthenticateMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceLoginAuthenticateMetadataCtx) UnmarshalJSON ¶
func (v *FaceLoginAuthenticateMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceLoginAuthenticateParams ¶
type FaceLoginAuthenticateParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Selfie Image `json:"selfie,omitempty"`
// Enrolled users. 1 to 10 faces, each with your own id. Required.
Gallery []FaceLoginAuthenticateParamsGallery `json:"gallery,omitempty" verisec:"list,id=id,label=face"`
// Threshold. Login at or above this similarity.
//
// Default 0.8.
Threshold *float64 `json:"threshold,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceLoginAuthenticateParams is the request of Face Login: POST /v1/auth/login.
type FaceLoginAuthenticateParamsGallery ¶
type FaceLoginAuthenticateParamsGallery struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your id for this face (the SDKs fill in face-1, face-2, ... when left out).
ID *string `json:"id,omitempty"`
}
FaceLoginAuthenticateParamsGallery is the gallery member of FaceLoginAuthenticateParams.
type FaceLoginAuthenticateResponse ¶
type FaceLoginAuthenticateResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Login.
Data FaceLoginAuthenticate `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceLoginAuthenticateResponse is the envelope of every Face Login answer. The client returns its Data (a FaceLoginAuthenticate) and puts the rest in LastResponse.
func (FaceLoginAuthenticateResponse) MarshalJSON ¶
func (v FaceLoginAuthenticateResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceLoginAuthenticateResponse) UnmarshalJSON ¶
func (v *FaceLoginAuthenticateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceLoginService ¶
type FaceLoginService struct {
// contains filtered or unexported fields
}
FaceLoginService holds the faceLogin APIs: Authenticate.
func (*FaceLoginService) Authenticate ¶
func (s *FaceLoginService) Authenticate(ctx context.Context, params *FaceLoginAuthenticateParams, opts ...RequestOption) (*FaceLoginAuthenticate, error)
Authenticate calls Face Login: POST /v1/auth/login.
Passwordless login: a live selfie searched against your enrolled users. Authenticated only when the face is live and matches someone above the threshold.
Price: 0.5 credits per successful call.
type FaceMatch ¶
type FaceMatch struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceMatch is the full result of Face Match: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type FaceMatchParams ¶
type FaceMatchParams struct {
// Images. Exactly two images. Required.
Images []FaceMatchParamsImage `json:"images,omitempty" verisec:"list,index=index,label=image"`
Crop *FaceMatchParamsCrop `json:"crop,omitempty"`
// Compare limit. A cap on comparisons per image type.
LimitComparePerImageTypes *int64 `json:"limitComparePerImageTypes,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceMatchParams is the request of Face Match: POST /v1/face/match.
type FaceMatchParamsCrop ¶
type FaceMatchParamsCrop struct {
// Aligned crop. Adds an aligned crop of every face.
//
// One of "" (No crop), 0 (3:4 portrait), 1 (4:5 portrait (standard)), 2 (2:3 portrait), 3 (1:1 square) or 4 (3:4 portrait, wider). Default "".
Type any `json:"type,omitempty"`
}
FaceMatchParamsCrop is the crop member of FaceMatchParams.
type FaceMatchParamsImage ¶
type FaceMatchParamsImage struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Data Image `json:"data,omitempty"`
// The position of this image in the list (the SDKs fill it in).
Index *int64 `json:"index,omitempty"`
// Source. What this image is: a live photo, a printed document portrait, the photo from the chip, or another source.
//
// One of 3 (Live photo), 1 (Printed (document)), 2 (Chip (RFID)) or 5 (External). Default 3.
Type *int64 `json:"type,omitempty"`
// Every face. On: every face in the image is compared. Off: only the main face.
//
// Default true.
DetectAll *bool `json:"detectAll,omitempty"`
// Liveness transaction. The id of a liveness check you already ran, to link this image to it.
LivenessTransactionID *string `json:"livenessTransactionId,omitempty"`
}
FaceMatchParamsImage is the image member of FaceMatchParams.
type FaceMatchResponse ¶
type FaceMatchResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Face Match: everything the check found. See the fields listed in the operation.
Data FaceMatch `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceMatchResponse is the envelope of every Face Match answer. The client returns its Data (a FaceMatch) and puts the rest in LastResponse.
func (FaceMatchResponse) MarshalJSON ¶
func (v FaceMatchResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceMatchResponse) UnmarshalJSON ¶
func (v *FaceMatchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FacePpe ¶
type FacePpe struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Faces []FacePpeFace `json:"faces,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FacePpeMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FacePpe is the answer of Mask & Glasses (PPE).
func (FacePpe) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*FacePpe) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FacePpeFace ¶
type FacePpeFace struct {
ROI []float64 `json:"roi,omitempty"`
MedicalMask string `json:"MedicalMask,omitempty"`
Glasses string `json:"Glasses,omitempty"`
HeadCovering string `json:"HeadCovering,omitempty"`
Headphones string `json:"Headphones,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FacePpeFace is the face member of FacePpe.
func (FacePpeFace) MarshalJSON ¶
func (v FacePpeFace) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FacePpeFace) UnmarshalJSON ¶
func (v *FacePpeFace) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FacePpeMetadata ¶
type FacePpeMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FacePpeMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FacePpeMetadata is the metadata member of FacePpe.
func (FacePpeMetadata) MarshalJSON ¶
func (v FacePpeMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FacePpeMetadata) UnmarshalJSON ¶
func (v *FacePpeMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FacePpeMetadataCtx ¶
type FacePpeMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FacePpeMetadataCtx is the ctx member of FacePpeMetadata.
func (FacePpeMetadataCtx) MarshalJSON ¶
func (v FacePpeMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FacePpeMetadataCtx) UnmarshalJSON ¶
func (v *FacePpeMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FacePpeParams ¶
type FacePpeParams struct {
// Face image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Items to check. Required.
Items []string `json:"items,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FacePpeParams is the request of Mask & Glasses (PPE): POST /v1/face/ppe.
type FacePpeResponse ¶
type FacePpeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Mask & Glasses (PPE).
Data FacePpe `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FacePpeResponse is the envelope of every Mask & Glasses (PPE) answer. The client returns its Data (a FacePpe) and puts the rest in LastResponse.
func (FacePpeResponse) MarshalJSON ¶
func (v FacePpeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FacePpeResponse) UnmarshalJSON ¶
func (v *FacePpeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceQuality ¶
type FaceQuality struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceQuality is the full result of Photo Quality: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type FaceQualityParams ¶
type FaceQualityParams struct {
// Portrait. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Standard.
//
// One of "QualityICAO" (ICAO passport photo), "QualityVisaSchengen" (Schengen visa), "QualityVisaUSA" (US visa) or "QualityFull" (Every check (Full)). Default "QualityICAO".
Scenario *string `json:"scenario,omitempty"`
// Only the central face.
//
// Default true.
OnlyCentralFace *bool `json:"onlyCentralFace,omitempty"`
Output *FaceQualityParamsOutput `json:"output,omitempty"`
// Your own checks. When you add checks, they replace the standard: exactly these run, with your ranges.
CustomChecks any `json:"customChecks,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceQualityParams is the request of Photo Quality: POST /v1/face/quality.
type FaceQualityParamsOutput ¶
type FaceQualityParamsOutput struct {
Crop *FaceQualityParamsOutputCrop `json:"crop,omitempty"`
// Crop background. Replaces the background of the crop.
//
// Default [255,255,255].
BackgroundColor []int64 `json:"backgroundColor,omitempty"`
}
FaceQualityParamsOutput is the output member of FaceQualityParams.
type FaceQualityParamsOutputCrop ¶
type FaceQualityParamsOutputCrop struct {
// Aligned crop.
//
// One of "" (No crop), 0 (3:4 portrait), 1 (4:5 portrait (standard)), 2 (2:3 portrait), 3 (1:1 square) or 4 (3:4 portrait, wider). Default 0.
Type any `json:"type,omitempty"`
}
FaceQualityParamsOutputCrop is the crop member of FaceQualityParamsOutput.
type FaceQualityResponse ¶
type FaceQualityResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Photo Quality: everything the check found. See the fields listed in the operation.
Data FaceQuality `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceQualityResponse is the envelope of every Photo Quality answer. The client returns its Data (a FaceQuality) and puts the rest in LastResponse.
func (FaceQualityResponse) MarshalJSON ¶
func (v FaceQualityResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceQualityResponse) UnmarshalJSON ¶
func (v *FaceQualityResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceRedact ¶
type FaceRedact struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
FaceCount float64 `json:"faceCount,omitempty"`
Image string `json:"image,omitempty"`
Boxes [][]float64 `json:"boxes,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceRedactMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceRedact is the answer of Face Redact.
func (FaceRedact) MarshalJSON ¶
func (v FaceRedact) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceRedact) UnmarshalJSON ¶
func (v *FaceRedact) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceRedactMetadata ¶
type FaceRedactMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceRedactMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceRedactMetadata is the metadata member of FaceRedact.
func (FaceRedactMetadata) MarshalJSON ¶
func (v FaceRedactMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceRedactMetadata) UnmarshalJSON ¶
func (v *FaceRedactMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceRedactMetadataCtx ¶
type FaceRedactMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceRedactMetadataCtx is the ctx member of FaceRedactMetadata.
func (FaceRedactMetadataCtx) MarshalJSON ¶
func (v FaceRedactMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceRedactMetadataCtx) UnmarshalJSON ¶
func (v *FaceRedactMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceRedactParams ¶
type FaceRedactParams struct {
// Image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// How to hide faces.
//
// One of "blur" (Blur), "pixelate" (Pixelate) or "box" (Black box). Default "blur".
Mode *string `json:"mode,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceRedactParams is the request of Face Redact: POST /v1/face/redact.
type FaceRedactResponse ¶
type FaceRedactResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Redact.
Data FaceRedact `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceRedactResponse is the envelope of every Face Redact answer. The client returns its Data (a FaceRedact) and puts the rest in LastResponse.
func (FaceRedactResponse) MarshalJSON ¶
func (v FaceRedactResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceRedactResponse) UnmarshalJSON ¶
func (v *FaceRedactResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSearch ¶
type FaceSearch struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Matches []FaceSearchMatch `json:"matches,omitempty"`
Best FaceSearchBest `json:"best,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceSearchMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceSearch is the answer of Face Search (1:N).
func (FaceSearch) MarshalJSON ¶
func (v FaceSearch) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSearch) UnmarshalJSON ¶
func (v *FaceSearch) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSearchBest ¶
type FaceSearchBest struct {
ID string `json:"id,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSearchBest is the best member of FaceSearch.
func (FaceSearchBest) MarshalJSON ¶
func (v FaceSearchBest) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSearchBest) UnmarshalJSON ¶
func (v *FaceSearchBest) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSearchMatch ¶
type FaceSearchMatch struct {
ID string `json:"id,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
Rank float64 `json:"rank,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSearchMatch is the match member of FaceSearch.
func (FaceSearchMatch) MarshalJSON ¶
func (v FaceSearchMatch) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSearchMatch) UnmarshalJSON ¶
func (v *FaceSearchMatch) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSearchMetadata ¶
type FaceSearchMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceSearchMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSearchMetadata is the metadata member of FaceSearch.
func (FaceSearchMetadata) MarshalJSON ¶
func (v FaceSearchMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSearchMetadata) UnmarshalJSON ¶
func (v *FaceSearchMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSearchMetadataCtx ¶
type FaceSearchMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSearchMetadataCtx is the ctx member of FaceSearchMetadata.
func (FaceSearchMetadataCtx) MarshalJSON ¶
func (v FaceSearchMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSearchMetadataCtx) UnmarshalJSON ¶
func (v *FaceSearchMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSearchParams ¶
type FaceSearchParams struct {
// Face to find. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Probe Image `json:"probe,omitempty"`
// Gallery. 1 to 10 faces, each with your own id. Required.
Gallery []FaceSearchParamsGallery `json:"gallery,omitempty" verisec:"list,id=id,label=face"`
// Top matches.
//
// Default 3.
TopK *int64 `json:"topK,omitempty"`
// Threshold. Only faces at or above this similarity are matches.
//
// Default 0.75.
Threshold *float64 `json:"threshold,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceSearchParams is the request of Face Search (1:N): POST /v1/face/search.
type FaceSearchParamsGallery ¶
type FaceSearchParamsGallery struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your id for this face (the SDKs fill in face-1, face-2, ... when left out).
ID *string `json:"id,omitempty"`
}
FaceSearchParamsGallery is the gallery member of FaceSearchParams.
type FaceSearchResponse ¶
type FaceSearchResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Search (1:N).
Data FaceSearch `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSearchResponse is the envelope of every Face Search (1:N) answer. The client returns its Data (a FaceSearch) and puts the rest in LastResponse.
func (FaceSearchResponse) MarshalJSON ¶
func (v FaceSearchResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSearchResponse) UnmarshalJSON ¶
func (v *FaceSearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceService ¶
type FaceService struct {
// contains filtered or unexported fields
}
FaceService holds the face APIs: Analyze, Detect, Count, Attributes, Ppe, Emotion, Crop, Redact, Match, Verify, Similarity, Search, Dedupe, Watchlist, Cluster, Age and Quality.
func (*FaceService) Age ¶
func (s *FaceService) Age(ctx context.Context, params *FaceAgeParams, opts ...RequestOption) (*FaceAge, error)
Age calls Age Estimation: POST /v1/face/age.
The age range of each face, its midpoint, and an aligned crop. The range is most exact with the crop on.
Price: 0.05 credits per successful call.
func (*FaceService) Analyze ¶
func (s *FaceService) Analyze(ctx context.Context, params *FaceAnalyzeParams, opts ...RequestOption) (*FaceAnalyze, error)
Analyze calls Face Analyze: POST /v1/face/analyze.
The all-in-one detection call. For every face it returns the box, the tilt, 5 landmarks, an aligned crop, the attributes you pick and the quality checks you define.
Price: 0.1 credits per successful call.
func (*FaceService) Attributes ¶
func (s *FaceService) Attributes(ctx context.Context, params *FaceAttributesParams, opts ...RequestOption) (*FaceAttributes, error)
Attributes calls Face Attributes: POST /v1/face/attributes.
The attributes you choose, per face. Age is a range; eyes and mouth are open/closed; emotion is a label; the rest are yes/no, each with a confidence.
Price: 0.1 credits per successful call.
func (*FaceService) Cluster ¶
func (s *FaceService) Cluster(ctx context.Context, params *FaceClusterParams, opts ...RequestOption) (*FaceCluster, error)
Cluster calls Face Cluster: POST /v1/face/cluster.
Groups faces by person. Every pair is compared, and faces are linked when they clear your threshold.
Price: 0.02 credits per successful call.
func (*FaceService) Count ¶
func (s *FaceService) Count(ctx context.Context, params *FaceCountParams, opts ...RequestOption) (*FaceCount, error)
Count calls Face Count: POST /v1/face/count.
Confirms an image holds exactly the number of faces you expect, for a capture gate.
Price: 0.02 credits per successful call.
func (*FaceService) Crop ¶
func (s *FaceService) Crop(ctx context.Context, params *FaceCropParams, opts ...RequestOption) (*FaceCrop, error)
Crop calls Smart Crop: POST /v1/face/crop.
An aligned, straightened crop of the face at the shape you choose (square for an avatar, 4:5 for a document).
Price: 0.02 credits per successful call.
func (*FaceService) Dedupe ¶
func (s *FaceService) Dedupe(ctx context.Context, params *FaceDedupeParams, opts ...RequestOption) (*FaceDedupe, error)
Dedupe calls Duplicate Check: POST /v1/face/dedupe.
Whether a new face already exists in your set: the closest existing face and if it clears the duplicate threshold.
Price: 0.02 credits per successful call.
func (*FaceService) Detect ¶
func (s *FaceService) Detect(ctx context.Context, params *FaceDetectParams, opts ...RequestOption) (*FaceDetect, error)
Detect calls Face Detect: POST /v1/face/detect.
Just the faces: each box, its tilt, 5 landmarks, and the count. No attributes, no quality.
Price: 0.02 credits per successful call.
func (*FaceService) Emotion ¶
func (s *FaceService) Emotion(ctx context.Context, params *FaceEmotionParams, opts ...RequestOption) (*FaceEmotion, error)
Emotion calls Emotion: POST /v1/face/emotion.
The dominant expression of each face. Send one image for per-face results, or a list of frames for a per-frame breakdown plus the overall dominant emotion.
Price: 0.02 credits per successful call.
func (*FaceService) Match ¶
func (s *FaceService) Match(ctx context.Context, params *FaceMatchParams, opts ...RequestOption) (*FaceMatch, error)
Match calls Face Match: POST /v1/face/match.
Compares the faces across two images: every face found in each, with a similarity for each pair. The 1:1 building block.
Price: 0.2 credits per successful call.
func (*FaceService) Ppe ¶
func (s *FaceService) Ppe(ctx context.Context, params *FacePpeParams, opts ...RequestOption) (*FacePpe, error)
Ppe calls Mask & Glasses (PPE): POST /v1/face/ppe.
Mask, glasses, head and forehead covering, headphones and occlusion, flattened so each item is one yes/no value per face.
Price: 0.02 credits per successful call.
func (*FaceService) Quality ¶
func (s *FaceService) Quality(ctx context.Context, params *FaceQualityParams, opts ...RequestOption) (*FaceQuality, error)
Quality calls Photo Quality: POST /v1/face/quality.
Scores a portrait against a standard (ICAO, Schengen, US visa, Full) or your own checks. Returns every check with its value, its range and pass/fail, plus group roll-ups and an optional crop.
Price: 0.02 credits per successful call.
func (*FaceService) Redact ¶
func (s *FaceService) Redact(ctx context.Context, params *FaceRedactParams, opts ...RequestOption) (*FaceRedact, error)
Redact calls Face Redact: POST /v1/face/redact.
The image back with every face hidden, blurred, pixelated or boxed out, plus where each face was.
Price: 0.02 credits per successful call.
func (*FaceService) Search ¶
func (s *FaceService) Search(ctx context.Context, params *FaceSearchParams, opts ...RequestOption) (*FaceSearch, error)
Search calls Face Search (1:N): POST /v1/face/search.
One face against a gallery you send. Returns the gallery faces at or above your threshold, highest similarity first.
Price: 0.3 credits per successful call.
Example ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
client, _ := verisec.New(os.Getenv("VERISEC_API_KEY"))
ctx := context.Background()
// entries hold their image; the index and ids are filled in when left out
_, _ = client.Face.Match(ctx, &verisec.FaceMatchParams{
Images: []verisec.FaceMatchParamsImage{
{Data: verisec.ImageFromPath("selfie.jpg")},
{Data: verisec.ImageFromPath("passport.jpg"), Type: verisec.Int(1)},
},
})
search, err := client.Face.Search(ctx, &verisec.FaceSearchParams{
Probe: verisec.ImageFromPath("probe.jpg"),
Gallery: []verisec.FaceSearchParamsGallery{{Image: verisec.ImageFromPath("a.jpg")}, {Image: verisec.ImageFromPath("b.jpg"), ID: verisec.String("user-42")}},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(search.Best, search.Matches)
}
Output:
func (*FaceService) Similarity ¶
func (s *FaceService) Similarity(ctx context.Context, params *FaceSimilarityParams, opts ...RequestOption) (*FaceSimilarity, error)
Similarity calls Similarity Score: POST /v1/face/similarity.
Only the raw numbers: similarity and distance between two faces. No threshold, no decision.
Price: 0.02 credits per successful call.
func (*FaceService) Verify ¶
func (s *FaceService) Verify(ctx context.Context, params *FaceVerifyParams, opts ...RequestOption) (*FaceVerify, error)
Verify calls Face Verify (1:1): POST /v1/face/verify.
A 1:1 decision: the similarity of two faces, and whether it clears your threshold.
Price: 0.2 credits per successful call.
Example ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
client, _ := verisec.New(os.Getenv("VERISEC_API_KEY"))
idPhoto, _ := os.ReadFile("id-photo.jpg")
result, err := client.Face.Verify(context.Background(), &verisec.FaceVerifyParams{
Image1: verisec.ImageFromPath("selfie.jpg"),
Image2: verisec.ImageFromBytes(idPhoto),
Threshold: verisec.Float(0.8),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Match, result.Similarity)
info := result.LastResponse
fmt.Println(info.RequestID, info.Warnings, info.LatencyMs, info.Status, info.Header.Get("Content-Type"))
}
Output:
func (*FaceService) Watchlist ¶
func (s *FaceService) Watchlist(ctx context.Context, params *FaceWatchlistParams, opts ...RequestOption) (*FaceWatchlist, error)
Watchlist calls Watchlist Screening: POST /v1/face/watchlist.
A face against your own labelled list (blocked, VIP, staff). Returns a hit and the matched entry with its label.
Price: 0.3 credits per successful call.
type FaceSimilarity ¶
type FaceSimilarity struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
Score float64 `json:"score,omitempty"`
Compared []FaceSimilarityCompared `json:"compared,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceSimilarityMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceSimilarity is the answer of Similarity Score.
func (FaceSimilarity) MarshalJSON ¶
func (v FaceSimilarity) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSimilarity) UnmarshalJSON ¶
func (v *FaceSimilarity) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSimilarityCompared ¶
type FaceSimilarityCompared struct {
Image string `json:"image,omitempty"`
ROI []float64 `json:"roi,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSimilarityCompared is the compared member of FaceSimilarity.
func (FaceSimilarityCompared) MarshalJSON ¶
func (v FaceSimilarityCompared) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSimilarityCompared) UnmarshalJSON ¶
func (v *FaceSimilarityCompared) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSimilarityMetadata ¶
type FaceSimilarityMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceSimilarityMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSimilarityMetadata is the metadata member of FaceSimilarity.
func (FaceSimilarityMetadata) MarshalJSON ¶
func (v FaceSimilarityMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSimilarityMetadata) UnmarshalJSON ¶
func (v *FaceSimilarityMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSimilarityMetadataCtx ¶
type FaceSimilarityMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSimilarityMetadataCtx is the ctx member of FaceSimilarityMetadata.
func (FaceSimilarityMetadataCtx) MarshalJSON ¶
func (v FaceSimilarityMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSimilarityMetadataCtx) UnmarshalJSON ¶
func (v *FaceSimilarityMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceSimilarityParams ¶
type FaceSimilarityParams struct {
// First face. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image1 Image `json:"image1,omitempty"`
// Second face. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image2 Image `json:"image2,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceSimilarityParams is the request of Similarity Score: POST /v1/face/similarity.
type FaceSimilarityResponse ¶
type FaceSimilarityResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Similarity Score.
Data FaceSimilarity `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceSimilarityResponse is the envelope of every Similarity Score answer. The client returns its Data (a FaceSimilarity) and puts the rest in LastResponse.
func (FaceSimilarityResponse) MarshalJSON ¶
func (v FaceSimilarityResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceSimilarityResponse) UnmarshalJSON ¶
func (v *FaceSimilarityResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceVerify ¶
type FaceVerify struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
Score float64 `json:"score,omitempty"`
Match bool `json:"match,omitempty"`
Threshold float64 `json:"threshold,omitempty"`
Compared []FaceVerifyCompared `json:"compared,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceVerifyMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceVerify is the answer of Face Verify (1:1).
func (FaceVerify) MarshalJSON ¶
func (v FaceVerify) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceVerify) UnmarshalJSON ¶
func (v *FaceVerify) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceVerifyCompared ¶
type FaceVerifyCompared struct {
Image string `json:"image,omitempty"`
ROI []float64 `json:"roi,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceVerifyCompared is the compared member of FaceVerify.
func (FaceVerifyCompared) MarshalJSON ¶
func (v FaceVerifyCompared) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceVerifyCompared) UnmarshalJSON ¶
func (v *FaceVerifyCompared) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceVerifyMetadata ¶
type FaceVerifyMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceVerifyMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceVerifyMetadata is the metadata member of FaceVerify.
func (FaceVerifyMetadata) MarshalJSON ¶
func (v FaceVerifyMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceVerifyMetadata) UnmarshalJSON ¶
func (v *FaceVerifyMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceVerifyMetadataCtx ¶
type FaceVerifyMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceVerifyMetadataCtx is the ctx member of FaceVerifyMetadata.
func (FaceVerifyMetadataCtx) MarshalJSON ¶
func (v FaceVerifyMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceVerifyMetadataCtx) UnmarshalJSON ¶
func (v *FaceVerifyMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceVerifyParams ¶
type FaceVerifyParams struct {
// First face. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image1 Image `json:"image1,omitempty"`
// Second face. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image2 Image `json:"image2,omitempty"`
// Threshold. match is true at or above this similarity.
//
// Default 0.75.
Threshold *float64 `json:"threshold,omitempty"`
// Liveness transaction. Links the first face to a passed liveness session.
LivenessTransactionID *string `json:"livenessTransactionId,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceVerifyParams is the request of Face Verify (1:1): POST /v1/face/verify.
type FaceVerifyResponse ¶
type FaceVerifyResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Face Verify (1:1).
Data FaceVerify `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceVerifyResponse is the envelope of every Face Verify (1:1) answer. The client returns its Data (a FaceVerify) and puts the rest in LastResponse.
func (FaceVerifyResponse) MarshalJSON ¶
func (v FaceVerifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceVerifyResponse) UnmarshalJSON ¶
func (v *FaceVerifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceWatchlist ¶
type FaceWatchlist struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Hit bool `json:"hit,omitempty"`
Entry FaceWatchlistEntry `json:"entry,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FaceWatchlistMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FaceWatchlist is the answer of Watchlist Screening.
func (FaceWatchlist) MarshalJSON ¶
func (v FaceWatchlist) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceWatchlist) UnmarshalJSON ¶
func (v *FaceWatchlist) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceWatchlistEntry ¶
type FaceWatchlistEntry struct {
ID string `json:"id,omitempty"`
Label string `json:"label,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceWatchlistEntry is the entry member of FaceWatchlist.
func (FaceWatchlistEntry) MarshalJSON ¶
func (v FaceWatchlistEntry) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceWatchlistEntry) UnmarshalJSON ¶
func (v *FaceWatchlistEntry) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceWatchlistMetadata ¶
type FaceWatchlistMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FaceWatchlistMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceWatchlistMetadata is the metadata member of FaceWatchlist.
func (FaceWatchlistMetadata) MarshalJSON ¶
func (v FaceWatchlistMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceWatchlistMetadata) UnmarshalJSON ¶
func (v *FaceWatchlistMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceWatchlistMetadataCtx ¶
type FaceWatchlistMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceWatchlistMetadataCtx is the ctx member of FaceWatchlistMetadata.
func (FaceWatchlistMetadataCtx) MarshalJSON ¶
func (v FaceWatchlistMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceWatchlistMetadataCtx) UnmarshalJSON ¶
func (v *FaceWatchlistMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FaceWatchlistParams ¶
type FaceWatchlistParams struct {
// Face to check. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Probe Image `json:"probe,omitempty"`
// Your list. 1 to 10 faces, each with your own id and a label. Required.
List []FaceWatchlistParamsList `json:"list,omitempty" verisec:"list,id=id,label=face"`
// Threshold. A hit at or above this similarity.
//
// Default 0.8.
Threshold *float64 `json:"threshold,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FaceWatchlistParams is the request of Watchlist Screening: POST /v1/face/watchlist.
type FaceWatchlistParamsList ¶
type FaceWatchlistParamsList struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your id for this face (the SDKs fill in face-1, face-2, ... when left out).
ID *string `json:"id,omitempty"`
// A label for this face.
Label *string `json:"label,omitempty"`
}
FaceWatchlistParamsList is the list member of FaceWatchlistParams.
type FaceWatchlistResponse ¶
type FaceWatchlistResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Watchlist Screening.
Data FaceWatchlist `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FaceWatchlistResponse is the envelope of every Watchlist Screening answer. The client returns its Data (a FaceWatchlist) and puts the rest in LastResponse.
func (FaceWatchlistResponse) MarshalJSON ¶
func (v FaceWatchlistResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FaceWatchlistResponse) UnmarshalJSON ¶
func (v *FaceWatchlistResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type File ¶
type File struct {
// Filename is sent with the image. FileFromPath uses the path's base name; an empty name is sent as "image".
Filename string
// ContentType is the image's media type. When empty, it is read from the first bytes: JPEG, PNG, BMP or
// WebP, else application/octet-stream.
ContentType string
// contains filtered or unexported fields
}
File is an image for the Financial reads (cheques and cards), uploaded as multipart/form-data in the part named image, exactly as given (never resized or re-encoded). Create one with FileFromPath, FileFromBytes or FileFromReader:
cheque, err := client.Cheques.Read(ctx, &verisec.ChequeReadParams{
Image: verisec.FileFromPath("cheque.jpg"),
})
The reads take JPG, PNG and BMP, up to 10 MB.
func FileFromBytes ¶
FileFromBytes uploads data under the given file name.
func FileFromPath ¶
FileFromPath uploads the file at path. The file is read when the call is made; an error reading it is returned by the call, before anything is sent.
type FraudService ¶
type FraudService struct {
// contains filtered or unexported fields
}
FraudService holds the fraud APIs: SignupCheck.
func (*FraudService) SignupCheck ¶
func (s *FraudService) SignupCheck(ctx context.Context, params *FraudSignupCheckParams, opts ...RequestOption) (*FraudSignupCheck, error)
SignupCheck calls Sign-up Fraud Check: POST /v1/fraud/signup-check.
At sign-up: is the face live, and has it signed up before? Blocks a duplicate (similarity 0.8+) or a non-live face.
Price: 0.5 credits per successful call.
type FraudSignupCheck ¶
type FraudSignupCheck struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Allow bool `json:"allow,omitempty"`
Reason string `json:"reason,omitempty"`
MatchedID string `json:"matchedId,omitempty"`
Live bool `json:"live,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata FraudSignupCheckMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
FraudSignupCheck is the answer of Sign-up Fraud Check.
func (FraudSignupCheck) MarshalJSON ¶
func (v FraudSignupCheck) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FraudSignupCheck) UnmarshalJSON ¶
func (v *FraudSignupCheck) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FraudSignupCheckMetadata ¶
type FraudSignupCheckMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx FraudSignupCheckMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FraudSignupCheckMetadata is the metadata member of FraudSignupCheck.
func (FraudSignupCheckMetadata) MarshalJSON ¶
func (v FraudSignupCheckMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FraudSignupCheckMetadata) UnmarshalJSON ¶
func (v *FraudSignupCheckMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FraudSignupCheckMetadataCtx ¶
type FraudSignupCheckMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FraudSignupCheckMetadataCtx is the ctx member of FraudSignupCheckMetadata.
func (FraudSignupCheckMetadataCtx) MarshalJSON ¶
func (v FraudSignupCheckMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FraudSignupCheckMetadataCtx) UnmarshalJSON ¶
func (v *FraudSignupCheckMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type FraudSignupCheckParams ¶
type FraudSignupCheckParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Selfie Image `json:"selfie,omitempty"`
// Existing users. 1 to 10 faces, each with your own id. Required.
Existing []FraudSignupCheckParamsExisting `json:"existing,omitempty" verisec:"list,id=id,label=face"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
FraudSignupCheckParams is the request of Sign-up Fraud Check: POST /v1/fraud/signup-check.
type FraudSignupCheckParamsExisting ¶
type FraudSignupCheckParamsExisting struct {
// The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your id for this face (the SDKs fill in face-1, face-2, ... when left out).
ID *string `json:"id,omitempty"`
}
FraudSignupCheckParamsExisting is the existing member of FraudSignupCheckParams.
type FraudSignupCheckResponse ¶
type FraudSignupCheckResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Sign-up Fraud Check.
Data FraudSignupCheck `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
FraudSignupCheckResponse is the envelope of every Sign-up Fraud Check answer. The client returns its Data (a FraudSignupCheck) and puts the rest in LastResponse.
func (FraudSignupCheckResponse) MarshalJSON ¶
func (v FraudSignupCheckResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*FraudSignupCheckResponse) UnmarshalJSON ¶
func (v *FraudSignupCheckResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityService ¶
type IdentityService struct {
// contains filtered or unexported fields
}
IdentityService holds the identity APIs: Verify.
func (*IdentityService) Verify ¶
func (s *IdentityService) Verify(ctx context.Context, params *IdentityVerifyParams, opts ...RequestOption) (*IdentityVerify, error)
Verify calls Identity Verification: POST /v1/identity/verify.
One call that runs liveness, a quality gate and a 1:1 match against your reference face, and returns each step plus a single verified verdict.
Price: 0.42 credits per successful call.
type IdentityVerify ¶
type IdentityVerify struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Verified bool `json:"verified,omitempty"`
Live bool `json:"live,omitempty"`
QualityOK bool `json:"qualityOk,omitempty"`
Similarity float64 `json:"similarity,omitempty"`
Steps IdentityVerifySteps `json:"steps,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata IdentityVerifyMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
IdentityVerify is the answer of Identity Verification.
func (IdentityVerify) MarshalJSON ¶
func (v IdentityVerify) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerify) UnmarshalJSON ¶
func (v *IdentityVerify) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifyMetadata ¶
type IdentityVerifyMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx IdentityVerifyMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifyMetadata is the metadata member of IdentityVerify.
func (IdentityVerifyMetadata) MarshalJSON ¶
func (v IdentityVerifyMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifyMetadata) UnmarshalJSON ¶
func (v *IdentityVerifyMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifyMetadataCtx ¶
type IdentityVerifyMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifyMetadataCtx is the ctx member of IdentityVerifyMetadata.
func (IdentityVerifyMetadataCtx) MarshalJSON ¶
func (v IdentityVerifyMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifyMetadataCtx) UnmarshalJSON ¶
func (v *IdentityVerifyMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifyParams ¶
type IdentityVerifyParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Selfie Image `json:"selfie,omitempty"`
// Reference face. For example the portrait from the ID document. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Reference Image `json:"reference,omitempty"`
// Quality checks.
//
// Default ["BlurLevel","OffGaze"].
MinQuality []string `json:"minQuality,omitempty"`
// Threshold. Match threshold.
//
// Default 0.8.
Threshold *float64 `json:"threshold,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
IdentityVerifyParams is the request of Identity Verification: POST /v1/identity/verify.
type IdentityVerifyResponse ¶
type IdentityVerifyResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Identity Verification.
Data IdentityVerify `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifyResponse is the envelope of every Identity Verification answer. The client returns its Data (a IdentityVerify) and puts the rest in LastResponse.
func (IdentityVerifyResponse) MarshalJSON ¶
func (v IdentityVerifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifyResponse) UnmarshalJSON ¶
func (v *IdentityVerifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifySteps ¶
type IdentityVerifySteps struct {
Liveness IdentityVerifyStepsLiveness `json:"liveness,omitempty"`
Quality IdentityVerifyStepsQuality `json:"quality,omitempty"`
Match IdentityVerifyStepsMatch `json:"match,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifySteps is the steps member of IdentityVerify.
func (IdentityVerifySteps) MarshalJSON ¶
func (v IdentityVerifySteps) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifySteps) UnmarshalJSON ¶
func (v *IdentityVerifySteps) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifyStepsLiveness ¶
type IdentityVerifyStepsLiveness struct {
Live bool `json:"live,omitempty"`
Status float64 `json:"status,omitempty"`
ReasonCode float64 `json:"reasonCode,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifyStepsLiveness is the liveness member of IdentityVerifySteps.
func (IdentityVerifyStepsLiveness) MarshalJSON ¶
func (v IdentityVerifyStepsLiveness) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifyStepsLiveness) UnmarshalJSON ¶
func (v *IdentityVerifyStepsLiveness) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifyStepsMatch ¶
type IdentityVerifyStepsMatch struct {
Similarity float64 `json:"similarity,omitempty"`
Score float64 `json:"score,omitempty"`
Match bool `json:"match,omitempty"`
Threshold float64 `json:"threshold,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifyStepsMatch is the match member of IdentityVerifySteps.
func (IdentityVerifyStepsMatch) MarshalJSON ¶
func (v IdentityVerifyStepsMatch) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifyStepsMatch) UnmarshalJSON ¶
func (v *IdentityVerifyStepsMatch) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IdentityVerifyStepsQuality ¶
type IdentityVerifyStepsQuality struct {
OK bool `json:"ok,omitempty"`
Failed []string `json:"failed,omitempty"`
Checked []string `json:"checked,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IdentityVerifyStepsQuality is the quality member of IdentityVerifySteps.
func (IdentityVerifyStepsQuality) MarshalJSON ¶
func (v IdentityVerifyStepsQuality) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IdentityVerifyStepsQuality) UnmarshalJSON ¶
func (v *IdentityVerifyStepsQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type Image ¶
type Image interface {
// contains filtered or unexported methods
}
Image is an image for a KYC API, sent as plain base64 inside the JSON body. Make one with ImageFromPath, ImageFromBytes, ImageFromReader or ImageFromBase64:
client.Face.Verify(ctx, &verisec.FaceVerifyParams{
Image1: verisec.ImageFromPath("selfie.jpg"),
Image2: verisec.ImageFromBytes(idPhoto),
})
A nil Image is not sent. The APIs read JPEG and PNG. An image that cannot be read (a missing file, a string that is not base64) fails the call before anything is sent, with an error naming the field.
func ImageFromBase64 ¶
ImageFromBase64 sends an image you already have as base64, plain or as a data: URI ("data:image/jpeg;base64,…"). The data: prefix and any whitespace are removed.
func ImageFromBytes ¶
ImageFromBytes sends the image bytes you already have.
func ImageFromPath ¶
ImageFromPath reads the image from a file when the call is made.
func ImageFromReader ¶
ImageFromReader sends what r holds. It is read to the end on first use and kept, so retries and later calls with the same Image send the same bytes.
type IpAnalyze ¶
type IpAnalyze struct {
IP string `json:"ip,omitempty"`
Version float64 `json:"version,omitempty"`
Private bool `json:"private,omitempty"`
Location IpAnalyzeLocation `json:"location,omitempty"`
Network IpAnalyzeNetwork `json:"network,omitempty"`
Anonymity IpAnalyzeAnonymity `json:"anonymity,omitempty"`
ListsUpdated string `json:"lists_updated,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
IpAnalyze is the answer of IP Anonymity.
func (IpAnalyze) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*IpAnalyze) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IpAnalyzeAnonymity ¶
type IpAnalyzeAnonymity struct {
Tor bool `json:"tor,omitempty"`
VPN bool `json:"vpn,omitempty"`
Datacenter bool `json:"datacenter,omitempty"`
CloudProvider any `json:"cloud_provider,omitempty"`
PrivateRelay bool `json:"private_relay,omitempty"`
RelayRegion any `json:"relay_region,omitempty"`
Blocklisted bool `json:"blocklisted,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IpAnalyzeAnonymity is the anonymity member of IpAnalyze.
func (IpAnalyzeAnonymity) MarshalJSON ¶
func (v IpAnalyzeAnonymity) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IpAnalyzeAnonymity) UnmarshalJSON ¶
func (v *IpAnalyzeAnonymity) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IpAnalyzeLocation ¶
type IpAnalyzeLocation struct {
Continent string `json:"continent,omitempty"`
CountryCode string `json:"country_code,omitempty"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
City string `json:"city,omitempty"`
Coordinates IpAnalyzeLocationCoordinates `json:"coordinates,omitempty"`
Timezones []string `json:"timezones,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IpAnalyzeLocation is the location member of IpAnalyze.
func (IpAnalyzeLocation) MarshalJSON ¶
func (v IpAnalyzeLocation) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IpAnalyzeLocation) UnmarshalJSON ¶
func (v *IpAnalyzeLocation) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IpAnalyzeLocationCoordinates ¶
type IpAnalyzeLocationCoordinates struct {
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IpAnalyzeLocationCoordinates is the coordinates member of IpAnalyzeLocation.
func (IpAnalyzeLocationCoordinates) MarshalJSON ¶
func (v IpAnalyzeLocationCoordinates) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IpAnalyzeLocationCoordinates) UnmarshalJSON ¶
func (v *IpAnalyzeLocationCoordinates) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IpAnalyzeNetwork ¶
type IpAnalyzeNetwork struct {
ASN float64 `json:"asn,omitempty"`
Organization string `json:"organization,omitempty"`
ConnectionType string `json:"connection_type,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IpAnalyzeNetwork is the network member of IpAnalyze.
func (IpAnalyzeNetwork) MarshalJSON ¶
func (v IpAnalyzeNetwork) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IpAnalyzeNetwork) UnmarshalJSON ¶
func (v *IpAnalyzeNetwork) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IpAnalyzeParams ¶
type IpAnalyzeParams struct {
// IP address. IPv4 or IPv6. Required.
IP string `json:"ip,omitempty"`
}
IpAnalyzeParams is the request of IP Anonymity: POST /v1/ip/analyze.
type IpAnalyzeResponse ¶
type IpAnalyzeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of IP Anonymity.
Data IpAnalyze `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
IpAnalyzeResponse is the envelope of every IP Anonymity answer. The client returns its Data (a IpAnalyze) and puts the rest in LastResponse.
func (IpAnalyzeResponse) MarshalJSON ¶
func (v IpAnalyzeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*IpAnalyzeResponse) UnmarshalJSON ¶
func (v *IpAnalyzeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type IpService ¶
type IpService struct {
// contains filtered or unexported fields
}
IpService holds the ip APIs: Analyze.
func (*IpService) Analyze ¶
func (s *IpService) Analyze(ctx context.Context, params *IpAnalyzeParams, opts ...RequestOption) (*IpAnalyze, error)
Analyze calls IP Anonymity: POST /v1/ip/analyze.
The fast answer from the platform's own lists only: Tor, VPN, data centre, cloud, private relay, blocklist and the network owner. No outside call, so it is quick.
Price: 0.06 credits per successful call.
type IssueCode ¶
type IssueCode = string
IssueCode is why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
type KioskPhoto ¶
type KioskPhoto struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Compliant bool `json:"compliant,omitempty"`
NonCompliant []any `json:"nonCompliant,omitempty"`
FixedImage string `json:"fixedImage,omitempty"`
PrintReady bool `json:"printReady,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata KioskPhotoMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
KioskPhoto is the answer of Photo Kiosk.
func (KioskPhoto) MarshalJSON ¶
func (v KioskPhoto) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*KioskPhoto) UnmarshalJSON ¶
func (v *KioskPhoto) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type KioskPhotoMetadata ¶
type KioskPhotoMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx KioskPhotoMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
KioskPhotoMetadata is the metadata member of KioskPhoto.
func (KioskPhotoMetadata) MarshalJSON ¶
func (v KioskPhotoMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*KioskPhotoMetadata) UnmarshalJSON ¶
func (v *KioskPhotoMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type KioskPhotoMetadataCtx ¶
type KioskPhotoMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
KioskPhotoMetadataCtx is the ctx member of KioskPhotoMetadata.
func (KioskPhotoMetadataCtx) MarshalJSON ¶
func (v KioskPhotoMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*KioskPhotoMetadataCtx) UnmarshalJSON ¶
func (v *KioskPhotoMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type KioskPhotoParams ¶
type KioskPhotoParams struct {
// Portrait. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Standard.
//
// One of "ICAO" (ICAO passport photo), "VisaSchengen" (Schengen visa), "VisaUSA" (US visa) or "Full" (Every check (Full)). Default "ICAO".
Standard *string `json:"standard,omitempty"`
// Shape.
//
// One of "3:4" (3:4), "4:5" (4:5), "2:3" (2:3) or "1:1" (1:1 square). Default "3:4".
Aspect *string `json:"aspect,omitempty"`
// Background.
//
// Default [255,255,255].
BackgroundColor []int64 `json:"backgroundColor,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
KioskPhotoParams is the request of Photo Kiosk: POST /v1/kiosk/photo.
type KioskPhotoResponse ¶
type KioskPhotoResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Photo Kiosk.
Data KioskPhoto `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
KioskPhotoResponse is the envelope of every Photo Kiosk answer. The client returns its Data (a KioskPhoto) and puts the rest in LastResponse.
func (KioskPhotoResponse) MarshalJSON ¶
func (v KioskPhotoResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*KioskPhotoResponse) UnmarshalJSON ¶
func (v *KioskPhotoResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type KioskService ¶
type KioskService struct {
// contains filtered or unexported fields
}
KioskService holds the kiosk APIs: Photo.
func (*KioskService) Photo ¶
func (s *KioskService) Photo(ctx context.Context, params *KioskPhotoParams, opts ...RequestOption) (*KioskPhoto, error)
Photo calls Photo Kiosk: POST /v1/kiosk/photo.
A passport/visa photo booth in one call: compliance against a standard, an auto-fixed version, and whether the fixed photo is ready to print.
Price: 0.06 credits per successful call.
type LivenessAntispoof ¶
type LivenessAntispoof struct {
Code float64 `json:"code,omitempty"`
Live bool `json:"live,omitempty"`
Reason string `json:"reason,omitempty"`
ReasonCode float64 `json:"reasonCode,omitempty"`
Category string `json:"category,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata LivenessAntispoofMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
LivenessAntispoof is the answer of Anti-spoof Reason.
func (LivenessAntispoof) MarshalJSON ¶
func (v LivenessAntispoof) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessAntispoof) UnmarshalJSON ¶
func (v *LivenessAntispoof) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessAntispoofMetadata ¶
type LivenessAntispoofMetadata struct {
ElapsedTime float64 `json:"elapsedTime,omitempty"`
ServerTime string `json:"serverTime,omitempty"`
Ctx LivenessAntispoofMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessAntispoofMetadata is the metadata member of LivenessAntispoof.
func (LivenessAntispoofMetadata) MarshalJSON ¶
func (v LivenessAntispoofMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessAntispoofMetadata) UnmarshalJSON ¶
func (v *LivenessAntispoofMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessAntispoofMetadataCtx ¶
type LivenessAntispoofMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessAntispoofMetadataCtx is the ctx member of LivenessAntispoofMetadata.
func (LivenessAntispoofMetadataCtx) MarshalJSON ¶
func (v LivenessAntispoofMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessAntispoofMetadataCtx) UnmarshalJSON ¶
func (v *LivenessAntispoofMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessAntispoofParams ¶
type LivenessAntispoofParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
LivenessAntispoofParams is the request of Anti-spoof Reason: POST /v1/liveness/antispoof.
type LivenessAntispoofResponse ¶
type LivenessAntispoofResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Anti-spoof Reason.
Data LivenessAntispoof `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessAntispoofResponse is the envelope of every Anti-spoof Reason answer. The client returns its Data (a LivenessAntispoof) and puts the rest in LastResponse.
func (LivenessAntispoofResponse) MarshalJSON ¶
func (v LivenessAntispoofResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessAntispoofResponse) UnmarshalJSON ¶
func (v *LivenessAntispoofResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessCheck ¶
type LivenessCheck struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
LivenessCheck is the full result of Liveness: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type LivenessCheckParams ¶
type LivenessCheckParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
LivenessCheckParams is the request of Liveness: POST /v1/liveness.
type LivenessCheckResponse ¶
type LivenessCheckResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Liveness: everything the check found. See the fields listed in the operation.
Data LivenessCheck `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessCheckResponse is the envelope of every Liveness answer. The client returns its Data (a LivenessCheck) and puts the rest in LastResponse.
func (LivenessCheckResponse) MarshalJSON ¶
func (v LivenessCheckResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessCheckResponse) UnmarshalJSON ¶
func (v *LivenessCheckResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessGate ¶
type LivenessGate struct {
Code float64 `json:"code,omitempty"`
Pass bool `json:"pass,omitempty"`
Status float64 `json:"status,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata LivenessGateMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
LivenessGate is the answer of Liveness Gate.
func (LivenessGate) MarshalJSON ¶
func (v LivenessGate) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessGate) UnmarshalJSON ¶
func (v *LivenessGate) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessGateMetadata ¶
type LivenessGateMetadata struct {
ElapsedTime float64 `json:"elapsedTime,omitempty"`
ServerTime string `json:"serverTime,omitempty"`
Ctx LivenessGateMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessGateMetadata is the metadata member of LivenessGate.
func (LivenessGateMetadata) MarshalJSON ¶
func (v LivenessGateMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessGateMetadata) UnmarshalJSON ¶
func (v *LivenessGateMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessGateMetadataCtx ¶
type LivenessGateMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessGateMetadataCtx is the ctx member of LivenessGateMetadata.
func (LivenessGateMetadataCtx) MarshalJSON ¶
func (v LivenessGateMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessGateMetadataCtx) UnmarshalJSON ¶
func (v *LivenessGateMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessGateParams ¶
type LivenessGateParams struct {
// Selfie. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Strict. Strict also requires a clean reason code.
//
// Default true.
Strict *bool `json:"strict,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
LivenessGateParams is the request of Liveness Gate: POST /v1/liveness/gate.
type LivenessGateResponse ¶
type LivenessGateResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Liveness Gate.
Data LivenessGate `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
LivenessGateResponse is the envelope of every Liveness Gate answer. The client returns its Data (a LivenessGate) and puts the rest in LastResponse.
func (LivenessGateResponse) MarshalJSON ¶
func (v LivenessGateResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*LivenessGateResponse) UnmarshalJSON ¶
func (v *LivenessGateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type LivenessService ¶
type LivenessService struct {
// contains filtered or unexported fields
}
LivenessService holds the liveness APIs: Check, Antispoof and Gate.
func (*LivenessService) Antispoof ¶
func (s *LivenessService) Antispoof(ctx context.Context, params *LivenessAntispoofParams, opts ...RequestOption) (*LivenessAntispoof, error)
Antispoof calls Anti-spoof Reason: POST /v1/liveness/antispoof.
The same check with the reason spelled out: whether it is live, the reason by name, and its category (a presentation attack or a capture problem).
Price: 0.2 credits per successful call.
func (*LivenessService) Check ¶
func (s *LivenessService) Check(ctx context.Context, params *LivenessCheckParams, opts ...RequestOption) (*LivenessCheck, error)
Check calls Liveness: POST /v1/liveness.
Passive liveness from one image. status 0 means live, 1 means not live or undetermined; code carries the reason; an age estimate comes free.
Price: 0.2 credits per successful call.
func (*LivenessService) Gate ¶
func (s *LivenessService) Gate(ctx context.Context, params *LivenessGateParams, opts ...RequestOption) (*LivenessGate, error)
Gate calls Liveness Gate: POST /v1/liveness/gate.
One pass/fail for a pipeline. Strict also requires a clean reason code, not just a live verdict.
Price: 0.2 credits per successful call.
type MicrField ¶
MicrField is one named MICR field in the reader format: a single key (the field name, for example `Routing`) and its value.
type MicrLine ¶
type MicrLine struct {
// Always `micr_line`.
Object string `json:"object,omitempty"`
// `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
Status ScanStatus `json:"status,omitempty"`
// Why a read is `partial` or `unreadable`: `no_micr_line`, `routing_checksum_failed`, `routing_prefix_invalid`, `layout_unrecognised`, `weak_characters`, `no_card`, `number_unreadable`, `luhn_failed`, `low_confidence`.
IssueCode IssueCode `json:"issue_code,omitempty"`
// Plain-words reason, when not `read`.
Issue string `json:"issue,omitempty"`
// How many MICR lines the photo has.
LinesFound int64 `json:"lines_found,omitempty"`
// How long the engine took, in milliseconds.
ProcessingMs int64 `json:"processing_ms,omitempty"`
// The strongest line.
Line MicrLineLine `json:"line,omitempty"`
// Each field by name; an empty value means this line does not carry it.
Fields []MicrNamedValue `json:"fields,omitempty"`
// Which fixed template named the line.
Template MicrTemplate `json:"template,omitempty"`
// An official national layout (whole-line match only).
Standard MicrStandardLayout `json:"standard,omitempty"`
// The ABA proof behind a US routing number.
Routing RoutingProof `json:"routing,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
MicrLine: Just the MICR line and its named fields.
func (MicrLine) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*MicrLine) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MicrLineLine ¶
type MicrLineLine struct {
Text string `json:"text,omitempty"`
Printed string `json:"printed,omitempty"`
// One of "E-13B" or "CMC-7".
Font string `json:"font,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
MinCharConfidence float64 `json:"min_char_confidence,omitempty"`
// Four corners x1,y1 … x4,y4, in image pixels.
Box []float64 `json:"box,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MicrLineLine is the strongest line.
func (MicrLineLine) MarshalJSON ¶
func (v MicrLineLine) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MicrLineLine) UnmarshalJSON ¶
func (v *MicrLineLine) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MicrNamedValue ¶
type MicrNamedValue struct {
// Field name, for example `Routing`.
Name string `json:"name,omitempty"`
// The value; empty when this line does not carry the field.
Value string `json:"value,omitempty"`
// Sub-fields, when the field has them.
Parts []MicrNamedValuePart `json:"parts,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MicrNamedValue is used in MicrZone.FieldList.
func (MicrNamedValue) MarshalJSON ¶
func (v MicrNamedValue) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MicrNamedValue) UnmarshalJSON ¶
func (v *MicrNamedValue) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MicrNamedValuePart ¶
type MicrNamedValuePart struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MicrNamedValuePart is the part member of MicrNamedValue.
func (MicrNamedValuePart) MarshalJSON ¶
func (v MicrNamedValuePart) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MicrNamedValuePart) UnmarshalJSON ¶
func (v *MicrNamedValuePart) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MicrStandardLayout ¶
type MicrStandardLayout struct {
// The standard, for example `ca_cpa_006` or `in_cts_2010`.
ID string `json:"id,omitempty"`
// The standard's name, for example `Canada (Payments Canada Standard 006)`.
Name string `json:"name,omitempty"`
// ISO 3166-1 alpha-2.
Country string `json:"country,omitempty"`
// The fields this line yielded.
Fields []MicrNamedValue `json:"fields,omitempty"`
// Every field of the standard, empty where the line did not yield it.
FieldList []MicrNamedValue `json:"field_list,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MicrStandardLayout is an official national layout (whole-line match only).
func (MicrStandardLayout) MarshalJSON ¶
func (v MicrStandardLayout) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MicrStandardLayout) UnmarshalJSON ¶
func (v *MicrStandardLayout) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MicrTemplate ¶
type MicrTemplate = string
MicrTemplate is which fixed template named the line.
One of "us_business", "us_personal", "br_cmc7" or "fr_cmc7".
type MicrZone ¶
type MicrZone struct {
// Position among the lines found, strongest first.
Index int64 `json:"index,omitempty"`
// As read, with the control symbols as letters (E-13B A-D, CMC-7 F-J).
Text string `json:"text,omitempty"`
// The engine's label for the line, for example `E-13B`.
Description string `json:"description,omitempty"`
// Every confidence the engine returned: zone-level values, then one per character.
Confidences []float64 `json:"confidences,omitempty"`
// The engine's class for the line.
Klass int64 `json:"klass,omitempty"`
// Skew of the line, in degrees.
Skew float64 `json:"skew,omitempty"`
// The engine's own box, verbatim (its spelling).
WarpedBox []float64 `json:"warpedBox,omitempty"`
// MICR font.
//
// One of "E-13B" or "CMC-7".
Font string `json:"font,omitempty"`
// The line with the printed E-13B glyphs (⑆ ⑇ ⑈ ⑉), CMC-7 symbols as bars.
Printed string `json:"printed,omitempty"`
// Summary confidence for the line, 0 to 100.
Confidence float64 `json:"confidence,omitempty"`
// One confidence (0 to 100) per character of `text`.
CharConfidences []float64 `json:"char_confidences,omitempty"`
// The weakest character's confidence.
MinCharConfidence float64 `json:"min_char_confidence,omitempty"`
// Four corners x1,y1 … x4,y4, rounded, in image pixels.
Box []float64 `json:"box,omitempty"`
// The groups the control symbols delimit.
Segments []string `json:"segments,omitempty"`
// Fields named as the reader names them; empty when no template fits.
Fields []MicrField `json:"fields,omitempty"`
// Every field the font can carry, empty where this line did not yield it.
FieldList []MicrNamedValue `json:"field_list,omitempty"`
// Which fixed template named the line.
Template MicrTemplate `json:"template,omitempty"`
// An official national layout (whole-line match only).
Standard MicrStandardLayout `json:"standard,omitempty"`
// The ABA proof behind a US routing number.
Routing RoutingProof `json:"routing,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MicrZone is one MICR line, exactly as the engine returns it, plus values derived from its text.
func (MicrZone) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*MicrZone) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParse ¶
type MrzParse struct {
Format string `json:"format,omitempty"`
Valid bool `json:"valid,omitempty"`
Expired bool `json:"expired,omitempty"`
Problems []any `json:"problems,omitempty"`
Parsed MrzParseParsed `json:"parsed,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
MrzParse is the answer of MRZ Parse.
func (MrzParse) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParse) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParams ¶
type MrzParseParams struct {
// MRZ lines. An ID card has 3 lines of 30 characters, a passport 2 lines of 44. Required.
Lines []string `json:"lines,omitempty"`
}
MrzParseParams is the request of MRZ Parse: POST /v1/mrz/parse.
type MrzParseParsed ¶
type MrzParseParsed struct {
Doc string `json:"doc,omitempty"`
Country string `json:"country,omitempty"`
Surname string `json:"surname,omitempty"`
GivenName string `json:"given_name,omitempty"`
DocNumber string `json:"doc_number,omitempty"`
Nationality string `json:"nationality,omitempty"`
BirthDate string `json:"birth_date,omitempty"`
Sex string `json:"sex,omitempty"`
Expiry string `json:"expiry,omitempty"`
PersonalNumber string `json:"personal_number,omitempty"`
CheckDigits MrzParseParsedCheckDigits `json:"check_digits,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsed is the parsed member of MrzParse.
func (MrzParseParsed) MarshalJSON ¶
func (v MrzParseParsed) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsed) UnmarshalJSON ¶
func (v *MrzParseParsed) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParsedCheckDigits ¶
type MrzParseParsedCheckDigits struct {
DocNumber MrzParseParsedCheckDigitsDocNumber `json:"doc_number,omitempty"`
BirthDate MrzParseParsedCheckDigitsBirthDate `json:"birth_date,omitempty"`
Expiry MrzParseParsedCheckDigitsExpiry `json:"expiry,omitempty"`
PersonalNumber MrzParseParsedCheckDigitsPersonalNumber `json:"personal_number,omitempty"`
Composite MrzParseParsedCheckDigitsComposite `json:"composite,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsedCheckDigits is the check_digits member of MrzParseParsed.
func (MrzParseParsedCheckDigits) MarshalJSON ¶
func (v MrzParseParsedCheckDigits) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsedCheckDigits) UnmarshalJSON ¶
func (v *MrzParseParsedCheckDigits) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParsedCheckDigitsBirthDate ¶
type MrzParseParsedCheckDigitsBirthDate struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsedCheckDigitsBirthDate is the birth_date member of MrzParseParsedCheckDigits.
func (MrzParseParsedCheckDigitsBirthDate) MarshalJSON ¶
func (v MrzParseParsedCheckDigitsBirthDate) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsedCheckDigitsBirthDate) UnmarshalJSON ¶
func (v *MrzParseParsedCheckDigitsBirthDate) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParsedCheckDigitsComposite ¶
type MrzParseParsedCheckDigitsComposite struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsedCheckDigitsComposite is the composite member of MrzParseParsedCheckDigits.
func (MrzParseParsedCheckDigitsComposite) MarshalJSON ¶
func (v MrzParseParsedCheckDigitsComposite) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsedCheckDigitsComposite) UnmarshalJSON ¶
func (v *MrzParseParsedCheckDigitsComposite) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParsedCheckDigitsDocNumber ¶
type MrzParseParsedCheckDigitsDocNumber struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsedCheckDigitsDocNumber is the doc_number member of MrzParseParsedCheckDigits.
func (MrzParseParsedCheckDigitsDocNumber) MarshalJSON ¶
func (v MrzParseParsedCheckDigitsDocNumber) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsedCheckDigitsDocNumber) UnmarshalJSON ¶
func (v *MrzParseParsedCheckDigitsDocNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParsedCheckDigitsExpiry ¶
type MrzParseParsedCheckDigitsExpiry struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsedCheckDigitsExpiry is the expiry member of MrzParseParsedCheckDigits.
func (MrzParseParsedCheckDigitsExpiry) MarshalJSON ¶
func (v MrzParseParsedCheckDigitsExpiry) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsedCheckDigitsExpiry) UnmarshalJSON ¶
func (v *MrzParseParsedCheckDigitsExpiry) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseParsedCheckDigitsPersonalNumber ¶
type MrzParseParsedCheckDigitsPersonalNumber struct {
Digit string `json:"digit,omitempty"`
OK bool `json:"ok,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseParsedCheckDigitsPersonalNumber is the personal_number member of MrzParseParsedCheckDigits.
func (MrzParseParsedCheckDigitsPersonalNumber) MarshalJSON ¶
func (v MrzParseParsedCheckDigitsPersonalNumber) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseParsedCheckDigitsPersonalNumber) UnmarshalJSON ¶
func (v *MrzParseParsedCheckDigitsPersonalNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzParseResponse ¶
type MrzParseResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of MRZ Parse.
Data MrzParse `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzParseResponse is the envelope of every MRZ Parse answer. The client returns its Data (a MrzParse) and puts the rest in LastResponse.
func (MrzParseResponse) MarshalJSON ¶
func (v MrzParseResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzParseResponse) UnmarshalJSON ¶
func (v *MrzParseResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzRead ¶
type MrzRead struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
MrzRead is the full result of MRZ Read: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type MrzReadParams ¶
type MrzReadParams struct {
// Document image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
}
MrzReadParams is the request of MRZ Read: POST /v1/mrz/read.
type MrzReadResponse ¶
type MrzReadResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of MRZ Read: everything the check found. See the fields listed in the operation.
Data MrzRead `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzReadResponse is the envelope of every MRZ Read answer. The client returns its Data (a MrzRead) and puts the rest in LastResponse.
func (MrzReadResponse) MarshalJSON ¶
func (v MrzReadResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzReadResponse) UnmarshalJSON ¶
func (v *MrzReadResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzRecognize ¶
type MrzRecognize struct {
Lines []string `json:"lines,omitempty"`
WarpedBox []float64 `json:"warped_box,omitempty"`
Confidence []float64 `json:"confidence,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
MrzRecognize is the answer of MRZ Recognize.
func (MrzRecognize) MarshalJSON ¶
func (v MrzRecognize) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzRecognize) UnmarshalJSON ¶
func (v *MrzRecognize) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzRecognizeParams ¶
type MrzRecognizeParams struct {
// Document image. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
}
MrzRecognizeParams is the request of MRZ Recognize: POST /v1/mrz/recognize.
type MrzRecognizeResponse ¶
type MrzRecognizeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of MRZ Recognize.
Data MrzRecognize `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
MrzRecognizeResponse is the envelope of every MRZ Recognize answer. The client returns its Data (a MrzRecognize) and puts the rest in LastResponse.
func (MrzRecognizeResponse) MarshalJSON ¶
func (v MrzRecognizeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*MrzRecognizeResponse) UnmarshalJSON ¶
func (v *MrzRecognizeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type MrzService ¶
type MrzService struct {
// contains filtered or unexported fields
}
MrzService holds the mrz APIs: Read, Recognize and Parse.
func (*MrzService) Parse ¶
func (s *MrzService) Parse(ctx context.Context, params *MrzParseParams, opts ...RequestOption) (*MrzParse, error)
Parse calls MRZ Parse: POST /v1/mrz/parse.
Parses MRZ lines you already have (no image): every field, every check digit recomputed, and a check that the dates are real.
Price: 0.002 credits per successful call.
func (*MrzService) Read ¶
func (s *MrzService) Read(ctx context.Context, params *MrzReadParams, opts ...RequestOption) (*MrzRead, error)
Read calls MRZ Read: POST /v1/mrz/read.
Finds the MRZ in an image, reads it, parses every field, and validates every check digit under ICAO 9303.
Price: 0.01 credits per successful call.
func (*MrzService) Recognize ¶
func (s *MrzService) Recognize(ctx context.Context, params *MrzRecognizeParams, opts ...RequestOption) (*MrzRecognize, error)
Recognize calls MRZ Recognize: POST /v1/mrz/recognize.
Only the MRZ lines, where they are, and how confident the read is. No parsing.
Price: 0.01 credits per successful call.
type OpenResult ¶
type OpenResult struct {
// Raw is the answer as decoded JSON: objects are map[string]any, arrays []any, numbers float64.
Raw map[string]any
// contains filtered or unexported fields
}
OpenResult is the result of a major API (x-verisec-tier: major in the spec: Face Match, Document Read, Sanctions Screening, …). Those engines return more than a fixed type could list, so their result is the engine's full answer as an open JSON object. Every such answer type embeds an OpenResult:
match, err := client.Face.Match(ctx, params)
results, _ := match.Get("results").([]any)
var mine struct {
Results []struct{ Similarity float64 `json:"similarity"` } `json:"results"`
}
err = match.Decode(&mine)
Example ¶
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
client, _ := verisec.New(os.Getenv("VERISEC_API_KEY"))
ctx := context.Background()
screening, err := client.Screening.Sanctions(ctx, &verisec.ScreeningSanctionsParams{Name: "Jane Example"})
if err != nil {
log.Fatal(err)
}
fmt.Println(screening.Get("summary"), screening.LastResponse.RequestID)
var hits struct {
Results []struct {
Name string `json:"name"`
Score float64 `json:"score"`
Match bool `json:"match"`
} `json:"results"`
}
if err := screening.Decode(&hits); err != nil {
log.Fatal(err)
}
doc, err := client.Documents.Read(ctx, &verisec.DocumentReadParams{
ImageFront: verisec.ImageFromPath("id-front.jpg"),
ImageBack: verisec.ImageFromPath("id-back.jpg"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(doc.Raw["data"])
}
Output:
func (OpenResult) Decode ¶
func (r OpenResult) Decode(v any) error
Decode fills v (a pointer to a struct or map of your own) from the result, as json.Unmarshal would.
func (OpenResult) Get ¶
func (r OpenResult) Get(key string) any
Get returns the top-level member key, or nil.
func (OpenResult) MarshalJSON ¶
func (r OpenResult) MarshalJSON() ([]byte, error)
MarshalJSON writes Raw.
func (*OpenResult) UnmarshalJSON ¶
func (r *OpenResult) UnmarshalJSON(data []byte) error
UnmarshalJSON keeps the object in Raw.
type OsintService ¶
type OsintService struct {
// contains filtered or unexported fields
}
OsintService holds the osint APIs: Username and Web.
func (*OsintService) Username ¶
func (s *OsintService) Username(ctx context.Context, params *OsintUsernameParams, opts ...RequestOption) (*OsintUsername, error)
Username calls Username Search: POST /v1/osint/username.
Public profiles that use a username, across hundreds of sites. Profiles whose page does not actually contain the name are dropped.
Price: 0.1 credits per successful call.
func (*OsintService) Web ¶
func (s *OsintService) Web(ctx context.Context, params *OsintWebParams, opts ...RequestOption) (*OsintWeb, error)
Web calls Adverse Media: POST /v1/osint/web.
Web pages that name a person or company, filtered to adverse news by default and tagged with risk topics.
Price: 0.1 credits per successful call.
type OsintUsername ¶
type OsintUsername struct {
Username string `json:"username,omitempty"`
Found float64 `json:"found,omitempty"`
Common bool `json:"common,omitempty"`
Profiles []OsintUsernameProfile `json:"profiles,omitempty"`
LeftOut float64 `json:"left_out,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
OsintUsername is the answer of Username Search.
func (OsintUsername) MarshalJSON ¶
func (v OsintUsername) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintUsername) UnmarshalJSON ¶
func (v *OsintUsername) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type OsintUsernameParams ¶
type OsintUsernameParams struct {
// Username. Required.
Username string `json:"username,omitempty"`
// Sites to check. The most visited sites first.
//
// Default 150.
Top *int64 `json:"top,omitempty"`
}
OsintUsernameParams is the request of Username Search: POST /v1/osint/username.
type OsintUsernameProfile ¶
type OsintUsernameProfile struct {
Site string `json:"site,omitempty"`
URL string `json:"url,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
OsintUsernameProfile is the profile member of OsintUsername.
func (OsintUsernameProfile) MarshalJSON ¶
func (v OsintUsernameProfile) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintUsernameProfile) UnmarshalJSON ¶
func (v *OsintUsernameProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type OsintUsernameResponse ¶
type OsintUsernameResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Username Search.
Data OsintUsername `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
OsintUsernameResponse is the envelope of every Username Search answer. The client returns its Data (a OsintUsername) and puts the rest in LastResponse.
func (OsintUsernameResponse) MarshalJSON ¶
func (v OsintUsernameResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintUsernameResponse) UnmarshalJSON ¶
func (v *OsintUsernameResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type OsintWeb ¶
type OsintWeb struct {
Query string `json:"query,omitempty"`
Mode string `json:"mode,omitempty"`
Complete bool `json:"complete,omitempty"`
Count float64 `json:"count,omitempty"`
Results []OsintWebResult `json:"results,omitempty"`
LeftOut OsintWebLeftOut `json:"left_out,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
OsintWeb is the answer of Adverse Media.
func (OsintWeb) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintWeb) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type OsintWebLeftOut ¶
type OsintWebLeftOut struct {
NotAboutThisName float64 `json:"not_about_this_name,omitempty"`
NotAdverse float64 `json:"not_adverse,omitempty"`
ListEntries float64 `json:"list_entries,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
OsintWebLeftOut is the left_out member of OsintWeb.
func (OsintWebLeftOut) MarshalJSON ¶
func (v OsintWebLeftOut) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintWebLeftOut) UnmarshalJSON ¶
func (v *OsintWebLeftOut) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type OsintWebParams ¶
type OsintWebParams struct {
// Name. Required.
Query string `json:"query,omitempty"`
// Show.
//
// One of "aml" (Adverse media only) or "all" (Everything about this name). Default "aml".
Mode *string `json:"mode,omitempty"`
}
OsintWebParams is the request of Adverse Media: POST /v1/osint/web.
type OsintWebResponse ¶
type OsintWebResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Adverse Media.
Data OsintWeb `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
OsintWebResponse is the envelope of every Adverse Media answer. The client returns its Data (a OsintWeb) and puts the rest in LastResponse.
func (OsintWebResponse) MarshalJSON ¶
func (v OsintWebResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintWebResponse) UnmarshalJSON ¶
func (v *OsintWebResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type OsintWebResult ¶
type OsintWebResult struct {
Title string `json:"title,omitempty"`
Site string `json:"site,omitempty"`
URL string `json:"url,omitempty"`
Date string `json:"date,omitempty"`
Topics []string `json:"topics,omitempty"`
Snippet string `json:"snippet,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
OsintWebResult is the result member of OsintWeb.
func (OsintWebResult) MarshalJSON ¶
func (v OsintWebResult) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*OsintWebResult) UnmarshalJSON ¶
func (v *OsintWebResult) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookup ¶
type PhoneLookup struct {
Phone string `json:"phone,omitempty"`
Valid bool `json:"valid,omitempty"`
Format PhoneLookupFormat `json:"format,omitempty"`
Country PhoneLookupCountry `json:"country,omitempty"`
Location any `json:"location,omitempty"`
Line PhoneLookupLine `json:"line,omitempty"`
Status string `json:"status,omitempty"`
SMSPumping PhoneLookupSmsPumping `json:"sms_pumping,omitempty"`
SimSwap PhoneLookupSimSwap `json:"sim_swap,omitempty"`
CallForwarding PhoneLookupCallForwarding `json:"call_forwarding,omitempty"`
Caller PhoneLookupCaller `json:"caller,omitempty"`
Risk PhoneLookupRisk `json:"risk,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhoneLookup is the answer of Phone Intelligence.
func (PhoneLookup) MarshalJSON ¶
func (v PhoneLookup) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookup) UnmarshalJSON ¶
func (v *PhoneLookup) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupCallForwarding ¶
type PhoneLookupCallForwarding struct {
Available bool `json:"available,omitempty"`
Reason string `json:"reason,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupCallForwarding is the call_forwarding member of PhoneLookup.
func (PhoneLookupCallForwarding) MarshalJSON ¶
func (v PhoneLookupCallForwarding) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupCallForwarding) UnmarshalJSON ¶
func (v *PhoneLookupCallForwarding) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupCaller ¶
type PhoneLookupCaller struct {
Available bool `json:"available,omitempty"`
Reason string `json:"reason,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupCaller is the caller member of PhoneLookup.
func (PhoneLookupCaller) MarshalJSON ¶
func (v PhoneLookupCaller) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupCaller) UnmarshalJSON ¶
func (v *PhoneLookupCaller) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupCountry ¶
type PhoneLookupCountry struct {
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
CallingCode string `json:"calling_code,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupCountry is the country member of PhoneLookup.
func (PhoneLookupCountry) MarshalJSON ¶
func (v PhoneLookupCountry) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupCountry) UnmarshalJSON ¶
func (v *PhoneLookupCountry) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupFormat ¶
type PhoneLookupFormat struct {
E164 string `json:"e164,omitempty"`
National string `json:"national,omitempty"`
International string `json:"international,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupFormat is the format member of PhoneLookup.
func (PhoneLookupFormat) MarshalJSON ¶
func (v PhoneLookupFormat) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupFormat) UnmarshalJSON ¶
func (v *PhoneLookupFormat) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupLine ¶
type PhoneLookupLine struct {
Type string `json:"type,omitempty"`
Carrier string `json:"carrier,omitempty"`
MCC string `json:"mcc,omitempty"`
MNC string `json:"mnc,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupLine is the line member of PhoneLookup.
func (PhoneLookupLine) MarshalJSON ¶
func (v PhoneLookupLine) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupLine) UnmarshalJSON ¶
func (v *PhoneLookupLine) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupParams ¶
type PhoneLookupParams struct {
// Phone. With its country code, for example +250788123456. Required.
Phone string `json:"phone,omitempty"`
// First name. With a name, the carrier is asked whether it belongs to that person (some countries only).
FirstName *string `json:"first_name,omitempty"`
// Last name.
LastName *string `json:"last_name,omitempty"`
// Date of birth. YYYY-MM-DD.
DateOfBirth *string `json:"date_of_birth,omitempty"`
// Country. ISO alpha-2, for example RW.
Country *string `json:"country,omitempty"`
}
PhoneLookupParams is the request of Phone Intelligence: POST /v1/phone/lookup.
type PhoneLookupResponse ¶
type PhoneLookupResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Phone Intelligence.
Data PhoneLookup `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupResponse is the envelope of every Phone Intelligence answer. The client returns its Data (a PhoneLookup) and puts the rest in LastResponse.
func (PhoneLookupResponse) MarshalJSON ¶
func (v PhoneLookupResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupResponse) UnmarshalJSON ¶
func (v *PhoneLookupResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupRisk ¶
type PhoneLookupRisk struct {
Level string `json:"level,omitempty"`
Reasons []any `json:"reasons,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupRisk is the risk member of PhoneLookup.
func (PhoneLookupRisk) MarshalJSON ¶
func (v PhoneLookupRisk) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupRisk) UnmarshalJSON ¶
func (v *PhoneLookupRisk) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupSimSwap ¶
type PhoneLookupSimSwap struct {
Available bool `json:"available,omitempty"`
Reason string `json:"reason,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupSimSwap is the sim_swap member of PhoneLookup.
func (PhoneLookupSimSwap) MarshalJSON ¶
func (v PhoneLookupSimSwap) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupSimSwap) UnmarshalJSON ¶
func (v *PhoneLookupSimSwap) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneLookupSmsPumping ¶
type PhoneLookupSmsPumping struct {
Score float64 `json:"score,omitempty"`
CarrierRisk string `json:"carrier_risk,omitempty"`
Blocked bool `json:"blocked,omitempty"`
BlockedOn any `json:"blocked_on,omitempty"`
BlockedLast3Months bool `json:"blocked_last_3_months,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneLookupSmsPumping is the sms_pumping member of PhoneLookup.
func (PhoneLookupSmsPumping) MarshalJSON ¶
func (v PhoneLookupSmsPumping) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneLookupSmsPumping) UnmarshalJSON ¶
func (v *PhoneLookupSmsPumping) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneOtpCheck ¶
type PhoneOtpCheck struct {
Status string `json:"status,omitempty"`
Valid bool `json:"valid,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhoneOtpCheck is the answer of Check Phone Code.
func (PhoneOtpCheck) MarshalJSON ¶
func (v PhoneOtpCheck) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneOtpCheck) UnmarshalJSON ¶
func (v *PhoneOtpCheck) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneOtpCheckParams ¶
type PhoneOtpCheckParams struct {
// Phone. Required.
Phone string `json:"phone,omitempty"`
// Code. Required.
Code string `json:"code,omitempty"`
}
PhoneOtpCheckParams is the request of Check Phone Code: POST /v1/phone/otp/check.
type PhoneOtpCheckResponse ¶
type PhoneOtpCheckResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Check Phone Code.
Data PhoneOtpCheck `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneOtpCheckResponse is the envelope of every Check Phone Code answer. The client returns its Data (a PhoneOtpCheck) and puts the rest in LastResponse.
func (PhoneOtpCheckResponse) MarshalJSON ¶
func (v PhoneOtpCheckResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneOtpCheckResponse) UnmarshalJSON ¶
func (v *PhoneOtpCheckResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneOtpSend ¶
type PhoneOtpSend struct {
Status string `json:"status,omitempty"`
To string `json:"to,omitempty"`
Channel string `json:"channel,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhoneOtpSend is the answer of Send Phone Code.
func (PhoneOtpSend) MarshalJSON ¶
func (v PhoneOtpSend) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneOtpSend) UnmarshalJSON ¶
func (v *PhoneOtpSend) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneOtpSendParams ¶
type PhoneOtpSendParams struct {
// Phone. A real SMS is sent to this number. Required.
Phone string `json:"phone,omitempty"`
}
PhoneOtpSendParams is the request of Send Phone Code: POST /v1/phone/otp/send.
type PhoneOtpSendResponse ¶
type PhoneOtpSendResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Send Phone Code.
Data PhoneOtpSend `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhoneOtpSendResponse is the envelope of every Send Phone Code answer. The client returns its Data (a PhoneOtpSend) and puts the rest in LastResponse.
func (PhoneOtpSendResponse) MarshalJSON ¶
func (v PhoneOtpSendResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhoneOtpSendResponse) UnmarshalJSON ¶
func (v *PhoneOtpSendResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhoneOtpService ¶
type PhoneOtpService struct {
// contains filtered or unexported fields
}
PhoneOtpService holds the phone.otp APIs: Send and Check.
func (*PhoneOtpService) Check ¶
func (s *PhoneOtpService) Check(ctx context.Context, params *PhoneOtpCheckParams, opts ...RequestOption) (*PhoneOtpCheck, error)
Check calls Check Phone Code: POST /v1/phone/otp/check.
Checks the code the person entered against the one that was sent.
Free: not charged.
func (*PhoneOtpService) Send ¶
func (s *PhoneOtpService) Send(ctx context.Context, params *PhoneOtpSendParams, opts ...RequestOption) (*PhoneOtpSend, error)
Send calls Send Phone Code: POST /v1/phone/otp/send.
Sends a one-time code by SMS to prove the person holds the number.
Price: 0.08 credits per successful call.
type PhoneService ¶
type PhoneService struct {
// Otp holds the phone.otp APIs: Send and Check.
Otp *PhoneOtpService
// contains filtered or unexported fields
}
PhoneService holds the phone APIs: Lookup and Otp (a resource).
func (*PhoneService) Lookup ¶
func (s *PhoneService) Lookup(ctx context.Context, params *PhoneLookupParams, opts ...RequestOption) (*PhoneLookup, error)
Lookup calls Phone Intelligence: POST /v1/phone/lookup.
Whether a number is valid and live, with its format, country, line type, carrier, SMS pumping risk, SIM swap and forwarding, and a risk level. With a name, the carrier is also asked whether the number belongs to that person.
Price: 0.08 credits per successful call.
type PhotoAutofix ¶
type PhotoAutofix struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Image string `json:"image,omitempty"`
Aspect string `json:"aspect,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata PhotoAutofixMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhotoAutofix is the answer of Photo Auto-fix.
func (PhotoAutofix) MarshalJSON ¶
func (v PhotoAutofix) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoAutofix) UnmarshalJSON ¶
func (v *PhotoAutofix) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoAutofixMetadata ¶
type PhotoAutofixMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx PhotoAutofixMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoAutofixMetadata is the metadata member of PhotoAutofix.
func (PhotoAutofixMetadata) MarshalJSON ¶
func (v PhotoAutofixMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoAutofixMetadata) UnmarshalJSON ¶
func (v *PhotoAutofixMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoAutofixMetadataCtx ¶
type PhotoAutofixMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoAutofixMetadataCtx is the ctx member of PhotoAutofixMetadata.
func (PhotoAutofixMetadataCtx) MarshalJSON ¶
func (v PhotoAutofixMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoAutofixMetadataCtx) UnmarshalJSON ¶
func (v *PhotoAutofixMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoAutofixParams ¶
type PhotoAutofixParams struct {
// Portrait. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Shape.
//
// One of "3:4" (3:4), "4:5" (4:5), "2:3" (2:3) or "1:1" (1:1 square). Default "3:4".
Aspect *string `json:"aspect,omitempty"`
// Background.
//
// Default [255,255,255].
BackgroundColor []int64 `json:"backgroundColor,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
PhotoAutofixParams is the request of Photo Auto-fix: POST /v1/photo/autofix.
type PhotoAutofixResponse ¶
type PhotoAutofixResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Photo Auto-fix.
Data PhotoAutofix `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoAutofixResponse is the envelope of every Photo Auto-fix answer. The client returns its Data (a PhotoAutofix) and puts the rest in LastResponse.
func (PhotoAutofixResponse) MarshalJSON ¶
func (v PhotoAutofixResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoAutofixResponse) UnmarshalJSON ¶
func (v *PhotoAutofixResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoBestFrame ¶
type PhotoBestFrame struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
BestIndex float64 `json:"bestIndex,omitempty"`
Ranking []PhotoBestFrameRanking `json:"ranking,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata PhotoBestFrameMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhotoBestFrame is the answer of Best Frame.
func (PhotoBestFrame) MarshalJSON ¶
func (v PhotoBestFrame) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoBestFrame) UnmarshalJSON ¶
func (v *PhotoBestFrame) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoBestFrameMetadata ¶
type PhotoBestFrameMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx PhotoBestFrameMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoBestFrameMetadata is the metadata member of PhotoBestFrame.
func (PhotoBestFrameMetadata) MarshalJSON ¶
func (v PhotoBestFrameMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoBestFrameMetadata) UnmarshalJSON ¶
func (v *PhotoBestFrameMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoBestFrameMetadataCtx ¶
type PhotoBestFrameMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoBestFrameMetadataCtx is the ctx member of PhotoBestFrameMetadata.
func (PhotoBestFrameMetadataCtx) MarshalJSON ¶
func (v PhotoBestFrameMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoBestFrameMetadataCtx) UnmarshalJSON ¶
func (v *PhotoBestFrameMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoBestFrameParams ¶
type PhotoBestFrameParams struct {
// Frames. 2 to 10 images of the same scene, in order. Required.
Frames []Image `json:"frames,omitempty"`
// Standard.
//
// One of "ICAO" (ICAO passport photo), "VisaSchengen" (Schengen visa), "VisaUSA" (US visa) or "Full" (Every check (Full)). Default "ICAO".
Standard *string `json:"standard,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
PhotoBestFrameParams is the request of Best Frame: POST /v1/photo/best-frame.
type PhotoBestFrameRanking ¶
type PhotoBestFrameRanking struct {
Index float64 `json:"index,omitempty"`
Compliant bool `json:"compliant,omitempty"`
FailedCount any `json:"failedCount,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoBestFrameRanking is the ranking member of PhotoBestFrame.
func (PhotoBestFrameRanking) MarshalJSON ¶
func (v PhotoBestFrameRanking) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoBestFrameRanking) UnmarshalJSON ¶
func (v *PhotoBestFrameRanking) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoBestFrameResponse ¶
type PhotoBestFrameResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Best Frame.
Data PhotoBestFrame `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoBestFrameResponse is the envelope of every Best Frame answer. The client returns its Data (a PhotoBestFrame) and puts the rest in LastResponse.
func (PhotoBestFrameResponse) MarshalJSON ¶
func (v PhotoBestFrameResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoBestFrameResponse) UnmarshalJSON ¶
func (v *PhotoBestFrameResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoCompliance ¶
type PhotoCompliance struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Compliant bool `json:"compliant,omitempty"`
NonCompliant []any `json:"nonCompliant,omitempty"`
Checks []PhotoComplianceCheck `json:"checks,omitempty"`
Standard string `json:"standard,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata PhotoComplianceMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhotoCompliance is the answer of Photo Compliance.
func (PhotoCompliance) MarshalJSON ¶
func (v PhotoCompliance) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoCompliance) UnmarshalJSON ¶
func (v *PhotoCompliance) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoComplianceCheck ¶
type PhotoComplianceCheck struct {
GroupID float64 `json:"groupId,omitempty"`
Name string `json:"name,omitempty"`
Range []float64 `json:"range,omitempty"`
Status float64 `json:"status,omitempty"`
Value float64 `json:"value,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoComplianceCheck is the check member of PhotoCompliance.
func (PhotoComplianceCheck) MarshalJSON ¶
func (v PhotoComplianceCheck) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoComplianceCheck) UnmarshalJSON ¶
func (v *PhotoComplianceCheck) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoComplianceMetadata ¶
type PhotoComplianceMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx PhotoComplianceMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoComplianceMetadata is the metadata member of PhotoCompliance.
func (PhotoComplianceMetadata) MarshalJSON ¶
func (v PhotoComplianceMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoComplianceMetadata) UnmarshalJSON ¶
func (v *PhotoComplianceMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoComplianceMetadataCtx ¶
type PhotoComplianceMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoComplianceMetadataCtx is the ctx member of PhotoComplianceMetadata.
func (PhotoComplianceMetadataCtx) MarshalJSON ¶
func (v PhotoComplianceMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoComplianceMetadataCtx) UnmarshalJSON ¶
func (v *PhotoComplianceMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoComplianceParams ¶
type PhotoComplianceParams struct {
// Portrait. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Standard.
//
// One of "ICAO" (ICAO passport photo), "VisaSchengen" (Schengen visa), "VisaUSA" (US visa) or "Full" (Every check (Full)). Default "ICAO".
Standard *string `json:"standard,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
PhotoComplianceParams is the request of Photo Compliance: POST /v1/photo/compliance.
type PhotoComplianceResponse ¶
type PhotoComplianceResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Photo Compliance.
Data PhotoCompliance `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoComplianceResponse is the envelope of every Photo Compliance answer. The client returns its Data (a PhotoCompliance) and puts the rest in LastResponse.
func (PhotoComplianceResponse) MarshalJSON ¶
func (v PhotoComplianceResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoComplianceResponse) UnmarshalJSON ¶
func (v *PhotoComplianceResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoGate ¶
type PhotoGate struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
OK bool `json:"ok,omitempty"`
Failed []any `json:"failed,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata PhotoGateMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhotoGate is the answer of Quality Gate.
func (PhotoGate) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoGate) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoGateMetadata ¶
type PhotoGateMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx PhotoGateMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoGateMetadata is the metadata member of PhotoGate.
func (PhotoGateMetadata) MarshalJSON ¶
func (v PhotoGateMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoGateMetadata) UnmarshalJSON ¶
func (v *PhotoGateMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoGateMetadataCtx ¶
type PhotoGateMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoGateMetadataCtx is the ctx member of PhotoGateMetadata.
func (PhotoGateMetadataCtx) MarshalJSON ¶
func (v PhotoGateMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoGateMetadataCtx) UnmarshalJSON ¶
func (v *PhotoGateMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoGateParams ¶
type PhotoGateParams struct {
// Photo. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Required checks. Required.
Require []string `json:"require,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
PhotoGateParams is the request of Quality Gate: POST /v1/photo/gate.
type PhotoGateResponse ¶
type PhotoGateResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Quality Gate.
Data PhotoGate `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoGateResponse is the envelope of every Quality Gate answer. The client returns its Data (a PhotoGate) and puts the rest in LastResponse.
func (PhotoGateResponse) MarshalJSON ¶
func (v PhotoGateResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoGateResponse) UnmarshalJSON ¶
func (v *PhotoGateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoPolicy ¶
type PhotoPolicy struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Pass bool `json:"pass,omitempty"`
Failed []any `json:"failed,omitempty"`
Checks []PhotoPolicyCheck `json:"checks,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata PhotoPolicyMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
PhotoPolicy is the answer of Photo Policy.
func (PhotoPolicy) MarshalJSON ¶
func (v PhotoPolicy) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoPolicy) UnmarshalJSON ¶
func (v *PhotoPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoPolicyCheck ¶
type PhotoPolicyCheck struct {
Name string `json:"name,omitempty"`
Range []float64 `json:"range,omitempty"`
Value float64 `json:"value,omitempty"`
Status float64 `json:"status,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoPolicyCheck is the check member of PhotoPolicy.
func (PhotoPolicyCheck) MarshalJSON ¶
func (v PhotoPolicyCheck) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoPolicyCheck) UnmarshalJSON ¶
func (v *PhotoPolicyCheck) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoPolicyMetadata ¶
type PhotoPolicyMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx PhotoPolicyMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoPolicyMetadata is the metadata member of PhotoPolicy.
func (PhotoPolicyMetadata) MarshalJSON ¶
func (v PhotoPolicyMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoPolicyMetadata) UnmarshalJSON ¶
func (v *PhotoPolicyMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoPolicyMetadataCtx ¶
type PhotoPolicyMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoPolicyMetadataCtx is the ctx member of PhotoPolicyMetadata.
func (PhotoPolicyMetadataCtx) MarshalJSON ¶
func (v PhotoPolicyMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoPolicyMetadataCtx) UnmarshalJSON ¶
func (v *PhotoPolicyMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoPolicyParams ¶
type PhotoPolicyParams struct {
// Portrait. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Image Image `json:"image,omitempty"`
// Your checks. Required.
Policy []any `json:"policy,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
PhotoPolicyParams is the request of Photo Policy: POST /v1/photo/policy.
type PhotoPolicyResponse ¶
type PhotoPolicyResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Photo Policy.
Data PhotoPolicy `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
PhotoPolicyResponse is the envelope of every Photo Policy answer. The client returns its Data (a PhotoPolicy) and puts the rest in LastResponse.
func (PhotoPolicyResponse) MarshalJSON ¶
func (v PhotoPolicyResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*PhotoPolicyResponse) UnmarshalJSON ¶
func (v *PhotoPolicyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type PhotoService ¶
type PhotoService struct {
// contains filtered or unexported fields
}
PhotoService holds the photo APIs: Compliance, Policy, Gate, Autofix and BestFrame.
func (*PhotoService) Autofix ¶
func (s *PhotoService) Autofix(ctx context.Context, params *PhotoAutofixParams, opts ...RequestOption) (*PhotoAutofix, error)
Autofix calls Photo Auto-fix: POST /v1/photo/autofix.
The portrait cropped to the shape you need, with the background replaced by your colour.
Price: 0.02 credits per successful call.
func (*PhotoService) BestFrame ¶
func (s *PhotoService) BestFrame(ctx context.Context, params *PhotoBestFrameParams, opts ...RequestOption) (*PhotoBestFrame, error)
BestFrame calls Best Frame: POST /v1/photo/best-frame.
Picks the most compliant of several frames against a standard, and shows how every frame ranked.
Price: 0.02 credits per successful call.
func (*PhotoService) Compliance ¶
func (s *PhotoService) Compliance(ctx context.Context, params *PhotoComplianceParams, opts ...RequestOption) (*PhotoCompliance, error)
Compliance calls Photo Compliance: POST /v1/photo/compliance.
A pass/fail against one named passport or visa photo standard, with the list of failed checks.
Price: 0.02 credits per successful call.
func (*PhotoService) Gate ¶
func (s *PhotoService) Gate(ctx context.Context, params *PhotoGateParams, opts ...RequestOption) (*PhotoGate, error)
Gate calls Quality Gate: POST /v1/photo/gate.
A fast good-enough answer. Only the checks you require run, at their standard ranges, so it returns one ok and the list of any that failed.
Price: 0.02 credits per successful call.
func (*PhotoService) Policy ¶
func (s *PhotoService) Policy(ctx context.Context, params *PhotoPolicyParams, opts ...RequestOption) (*PhotoPolicy, error)
Policy calls Photo Policy: POST /v1/photo/policy.
Your own checks with your own ranges. Exactly the checks you send run, nothing else.
Price: 0.02 credits per successful call.
type ProctorCheck ¶
type ProctorCheck struct {
Code float64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
OK bool `json:"ok,omitempty"`
Live bool `json:"live,omitempty"`
FaceCount float64 `json:"faceCount,omitempty"`
OffGaze float64 `json:"offGaze,omitempty"`
LookingAway bool `json:"lookingAway,omitempty"`
MaskWorn bool `json:"maskWorn,omitempty"`
ElapsedTime float64 `json:"elapsedTime,omitempty"`
Metadata ProctorCheckMetadata `json:"metadata,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ProctorCheck is the answer of Proctoring Check.
func (ProctorCheck) MarshalJSON ¶
func (v ProctorCheck) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ProctorCheck) UnmarshalJSON ¶
func (v *ProctorCheck) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ProctorCheckMetadata ¶
type ProctorCheckMetadata struct {
ServerTime string `json:"serverTime,omitempty"`
Ctx ProctorCheckMetadataCtx `json:"ctx,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ProctorCheckMetadata is the metadata member of ProctorCheck.
func (ProctorCheckMetadata) MarshalJSON ¶
func (v ProctorCheckMetadata) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ProctorCheckMetadata) UnmarshalJSON ¶
func (v *ProctorCheckMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ProctorCheckMetadataCtx ¶
type ProctorCheckMetadataCtx struct {
UserIP string `json:"userIp,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ProctorCheckMetadataCtx is the ctx member of ProctorCheckMetadata.
func (ProctorCheckMetadataCtx) MarshalJSON ¶
func (v ProctorCheckMetadataCtx) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ProctorCheckMetadataCtx) UnmarshalJSON ¶
func (v *ProctorCheckMetadataCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ProctorCheckParams ¶
type ProctorCheckParams struct {
// Webcam frame. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes. Required.
Frame Image `json:"frame,omitempty"`
// Tag. Any text you want echoed back in the response.
Tag *string `json:"tag,omitempty"`
}
ProctorCheckParams is the request of Proctoring Check: POST /v1/proctor/check.
type ProctorCheckResponse ¶
type ProctorCheckResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Proctoring Check.
Data ProctorCheck `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ProctorCheckResponse is the envelope of every Proctoring Check answer. The client returns its Data (a ProctorCheck) and puts the rest in LastResponse.
func (ProctorCheckResponse) MarshalJSON ¶
func (v ProctorCheckResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ProctorCheckResponse) UnmarshalJSON ¶
func (v *ProctorCheckResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ProctorService ¶
type ProctorService struct {
// contains filtered or unexported fields
}
ProctorService holds the proctor APIs: Check.
func (*ProctorService) Check ¶
func (s *ProctorService) Check(ctx context.Context, params *ProctorCheckParams, opts ...RequestOption) (*ProctorCheck, error)
Check calls Proctoring Check: POST /v1/proctor/check.
One webcam frame judged for exam proctoring: live, exactly one face, looking at the screen, and no mask.
Price: 0.26 credits per successful call.
type ProofOfAddressAnalyze ¶
type ProofOfAddressAnalyze struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ProofOfAddressAnalyze is the full result of Proof of Address: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type ProofOfAddressAnalyzeParams ¶
type ProofOfAddressAnalyzeParams struct {
// Address document. Encrypted in your browser; the API takes the token of the stored document. A document token from the vault. Required.
DocumentToken string `json:"document_token,omitempty"`
// File name.
Filename *string `json:"filename,omitempty"`
Expected *ProofOfAddressAnalyzeParamsExpected `json:"expected,omitempty"`
}
ProofOfAddressAnalyzeParams is the request of Proof of Address: POST /v1/poa/analyze.
type ProofOfAddressAnalyzeParamsExpected ¶
type ProofOfAddressAnalyzeParamsExpected struct {
// Expected name.
Name *string `json:"name,omitempty"`
// Expected address.
Address *string `json:"address,omitempty"`
// Expected country. ISO alpha-2, for example RW.
Country *string `json:"country,omitempty"`
}
ProofOfAddressAnalyzeParamsExpected is the expected member of ProofOfAddressAnalyzeParams.
type ProofOfAddressAnalyzeResponse ¶
type ProofOfAddressAnalyzeResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Proof of Address: everything the check found. See the fields listed in the operation.
Data ProofOfAddressAnalyze `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ProofOfAddressAnalyzeResponse is the envelope of every Proof of Address answer. The client returns its Data (a ProofOfAddressAnalyze) and puts the rest in LastResponse.
func (ProofOfAddressAnalyzeResponse) MarshalJSON ¶
func (v ProofOfAddressAnalyzeResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ProofOfAddressAnalyzeResponse) UnmarshalJSON ¶
func (v *ProofOfAddressAnalyzeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ProofOfAddressService ¶
type ProofOfAddressService struct {
// contains filtered or unexported fields
}
ProofOfAddressService holds the proofOfAddress APIs: Analyze.
func (*ProofOfAddressService) Analyze ¶
func (s *ProofOfAddressService) Analyze(ctx context.Context, params *ProofOfAddressAnalyzeParams, opts ...RequestOption) (*ProofOfAddressAnalyze, error)
Analyze calls Proof of Address: POST /v1/poa/analyze.
Reads a proof-of-address document (utility bill, bank statement, letter) and checks it against the name, address and country you expect, with a recency and integrity check.
Price: 0.4 credits per successful call.
type RequestOption ¶
type RequestOption func(*requestConfig)
A RequestOption changes one call. Pass request options after a method's other arguments:
client.Cheques.Read(ctx, params, verisec.WithRequestTimeout(5*time.Minute))
func WithExtraField ¶
func WithExtraField(name string, value any) RequestOption
WithExtraField sends a parameter the params type has no field for, such as one the API added after this version of the library: a member of the JSON body (sent as given; it replaces a field of the same name), a form field of an upload, or a query parameter of a GET.
func WithHeader ¶
func WithHeader(key, value string) RequestOption
WithHeader adds a header to this call. It can replace Accept, User-Agent and X-VeriSec-Source, but not Authorization or Content-Type.
func WithRequestMaxRetries ¶
func WithRequestMaxRetries(n int) RequestOption
WithRequestMaxRetries sets how many times this call may be sent again, overriding the client's WithMaxRetries. 0 turns retries off.
func WithRequestTimeout ¶
func WithRequestTimeout(d time.Duration) RequestOption
WithRequestTimeout sets how long each attempt of this call may take, overriding the client's WithTimeout.
type ResolvedCurrency ¶
type ResolvedCurrency struct {
Code string `json:"code,omitempty"`
NumericCode string `json:"numeric_code,omitempty"`
Name string `json:"name,omitempty"`
Symbol string `json:"symbol,omitempty"`
LocalSymbol string `json:"local_symbol,omitempty"`
MinorUnits string `json:"minor_units,omitempty"`
EnglishNameCLDR string `json:"english_name_cldr,omitempty"`
USDPerUnit any `json:"usd_per_unit,omitempty"`
UnitsPerUSD any `json:"units_per_usd,omitempty"`
WikidataID string `json:"wikidata_id,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ResolvedCurrency is a full currency record (ISO 4217 + CLDR).
func (ResolvedCurrency) MarshalJSON ¶
func (v ResolvedCurrency) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ResolvedCurrency) UnmarshalJSON ¶
func (v *ResolvedCurrency) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ResponseInfo ¶
type ResponseInfo struct {
// Status is the HTTP status code.
Status int
// Header holds the response headers.
Header http.Header
// RequestID identifies the call. Quote it when you contact support.
RequestID string
// Warnings are notes about a KYC result that are not errors.
Warnings []string
// LatencyMs is how long a KYC check took on the server, in milliseconds (0 when the answer does not say).
LatencyMs float64
}
ResponseInfo is where an answer came from. Every result has it in its LastResponse field.
type RoutingProof ¶
type RoutingProof struct {
// True only when the checksum and the prefix both hold.
Valid bool `json:"valid,omitempty"`
// The ABA check digit holds.
ChecksumPass bool `json:"checksum_pass,omitempty"`
// The ninth digit as read. Absent when the number is not nine digits.
CheckDigit int64 `json:"check_digit,omitempty"`
// The digit the first eight imply. An audit value, not a correction.
ExpectedCheckDigit int64 `json:"expected_check_digit,omitempty"`
// The first two digits are an assigned Federal Reserve routing symbol.
PrefixValid bool `json:"prefix_valid,omitempty"`
// Institution type from the routing number's prefix.
InstitutionType RoutingType `json:"institution_type,omitempty"`
// The Federal Reserve district, when valid.
FederalReserveDistrict string `json:"federal_reserve_district,omitempty"`
// Why it is not valid.
//
// One of "not_nine_digits", "check_digit_mismatch" or "prefix_not_assigned".
Reason string `json:"reason,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
RoutingProof is the ABA proof behind a US routing number.
func (RoutingProof) MarshalJSON ¶
func (v RoutingProof) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*RoutingProof) UnmarshalJSON ¶
func (v *RoutingProof) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type RoutingType ¶
type RoutingType = string
RoutingType: Institution type from the routing number's prefix.
One of "bank", "thrift", "electronic", "government" or "travellers_cheque".
type ScanSource ¶
type ScanSource = string
ScanSource is where the call came from, as shown in the console's logs.
One of "api", "sdk" or "playground".
type ScanStatus ¶
type ScanStatus = string
ScanStatus: `partial`: read, but something a caller relies on is missing or failed a check (`issue_code` says what). `unreadable`: nothing to read.
One of "read", "partial" or "unreadable".
type ScreeningCrypto ¶
type ScreeningCrypto struct {
Checked float64 `json:"checked,omitempty"`
Counts ScreeningCryptoCounts `json:"counts,omitempty"`
Results []ScreeningCryptoResult `json:"results,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ScreeningCrypto is the answer of Wallet Screening.
func (ScreeningCrypto) MarshalJSON ¶
func (v ScreeningCrypto) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningCrypto) UnmarshalJSON ¶
func (v *ScreeningCrypto) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningCryptoCounts ¶
type ScreeningCryptoCounts struct {
High float64 `json:"high,omitempty"`
Medium float64 `json:"medium,omitempty"`
Low float64 `json:"low,omitempty"`
NoRecord float64 `json:"no_record,omitempty"`
Unreadable float64 `json:"unreadable,omitempty"`
InvalidAddress float64 `json:"invalid_address,omitempty"`
Unrecognised float64 `json:"unrecognised,omitempty"`
DisputedListing float64 `json:"disputed_listing,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningCryptoCounts is the counts member of ScreeningCrypto.
func (ScreeningCryptoCounts) MarshalJSON ¶
func (v ScreeningCryptoCounts) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningCryptoCounts) UnmarshalJSON ¶
func (v *ScreeningCryptoCounts) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningCryptoParams ¶
type ScreeningCryptoParams struct {
// Wallet addresses. One per line, up to 100. Required.
Addresses []string `json:"addresses,omitempty"`
}
ScreeningCryptoParams is the request of Wallet Screening: POST /v1/screen/crypto.
type ScreeningCryptoResponse ¶
type ScreeningCryptoResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The answer of Wallet Screening.
Data ScreeningCrypto `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningCryptoResponse is the envelope of every Wallet Screening answer. The client returns its Data (a ScreeningCrypto) and puts the rest in LastResponse.
func (ScreeningCryptoResponse) MarshalJSON ¶
func (v ScreeningCryptoResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningCryptoResponse) UnmarshalJSON ¶
func (v *ScreeningCryptoResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningCryptoResult ¶
type ScreeningCryptoResult struct {
Address string `json:"address,omitempty"`
Network any `json:"network,omitempty"`
ValidFormat any `json:"valid_format,omitempty"`
ChecksumOK any `json:"checksum_ok,omitempty"`
FormatNote string `json:"format_note,omitempty"`
Verdict string `json:"verdict,omitempty"`
Risk string `json:"risk,omitempty"`
Summary any `json:"summary,omitempty"`
Flags []any `json:"flags,omitempty"`
Listings []ScreeningCryptoResultListing `json:"listings,omitempty"`
DisputedBy []any `json:"disputed_by,omitempty"`
Schemes []any `json:"schemes,omitempty"`
Labels []ScreeningCryptoResultLabel `json:"labels,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningCryptoResult is the result member of ScreeningCrypto.
func (ScreeningCryptoResult) MarshalJSON ¶
func (v ScreeningCryptoResult) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningCryptoResult) UnmarshalJSON ¶
func (v *ScreeningCryptoResult) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningCryptoResultLabel ¶
type ScreeningCryptoResultLabel struct {
Network string `json:"network,omitempty"`
Label string `json:"label,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningCryptoResultLabel is the label member of ScreeningCryptoResult.
func (ScreeningCryptoResultLabel) MarshalJSON ¶
func (v ScreeningCryptoResultLabel) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningCryptoResultLabel) UnmarshalJSON ¶
func (v *ScreeningCryptoResultLabel) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningCryptoResultListing ¶
type ScreeningCryptoResultListing struct {
Network string `json:"network,omitempty"`
Categories []string `json:"categories,omitempty"`
RiskClass string `json:"risk_class,omitempty"`
Subcategory any `json:"subcategory,omitempty"`
VictimContract bool `json:"victim_contract,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningCryptoResultListing is the listing member of ScreeningCryptoResult.
func (ScreeningCryptoResultListing) MarshalJSON ¶
func (v ScreeningCryptoResultListing) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningCryptoResultListing) UnmarshalJSON ¶
func (v *ScreeningCryptoResultListing) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningIp ¶
type ScreeningIp struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ScreeningIp is the full result of IP Risk: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type ScreeningIpParams ¶
type ScreeningIpParams struct {
// IP address. IPv4 or IPv6. Required.
IP string `json:"ip,omitempty"`
}
ScreeningIpParams is the request of IP Risk: POST /v1/screen/ip.
type ScreeningIpResponse ¶
type ScreeningIpResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of IP Risk: everything the check found. See the fields listed in the operation.
Data ScreeningIp `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningIpResponse is the envelope of every IP Risk answer. The client returns its Data (a ScreeningIp) and puts the rest in LastResponse.
func (ScreeningIpResponse) MarshalJSON ¶
func (v ScreeningIpResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningIpResponse) UnmarshalJSON ¶
func (v *ScreeningIpResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningSanctions ¶
type ScreeningSanctions struct {
OpenResult
// LastResponse is the response the result came from: status, headers, request id, warnings and latency.
LastResponse *ResponseInfo `json:"-"`
}
ScreeningSanctions is the full result of Sanctions & PEP Screening: everything the check found. See the fields listed in the operation.
It is an open result, the engine's full answer: read it with Get, Raw or Decode (see OpenResult).
type ScreeningSanctionsParams ¶
type ScreeningSanctionsParams struct {
// Name. Required.
Name string `json:"name,omitempty"`
// Type.
//
// One of "Person" (Person), "Company" (Company), "Organization" (Organization) or "LegalEntity" (Any entity). Default "Person".
Schema *string `json:"schema,omitempty"`
// Date of birth. YYYY, YYYY-MM or YYYY-MM-DD. People only.
BirthDate *string `json:"birth_date,omitempty"`
// Countries. Up to 5 ISO alpha-2 codes (nationality for a person, country for a company).
Countries []string `json:"countries,omitempty"`
// ID numbers. Up to 5: passport, national ID, tax or registration numbers.
IDNumbers []string `json:"id_numbers,omitempty"`
// Results.
//
// Default 10.
Limit *int64 `json:"limit,omitempty"`
}
ScreeningSanctionsParams is the request of Sanctions & PEP Screening: POST /v1/screen/sanctions.
type ScreeningSanctionsResponse ¶
type ScreeningSanctionsResponse struct {
// true: the result is in `data`.
OK bool `json:"ok,omitempty"`
RequestID string `json:"request_id,omitempty"`
// How long the check took, in milliseconds.
LatencyMs float64 `json:"latency_ms,omitempty"`
// The full result of Sanctions & PEP Screening: everything the check found. See the fields listed in the operation.
Data ScreeningSanctions `json:"data,omitempty"`
Warnings []string `json:"warnings,omitempty"`
// Empty on success.
Error any `json:"error,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
ScreeningSanctionsResponse is the envelope of every Sanctions & PEP Screening answer. The client returns its Data (a ScreeningSanctions) and puts the rest in LastResponse.
func (ScreeningSanctionsResponse) MarshalJSON ¶
func (v ScreeningSanctionsResponse) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*ScreeningSanctionsResponse) UnmarshalJSON ¶
func (v *ScreeningSanctionsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type ScreeningService ¶
type ScreeningService struct {
// contains filtered or unexported fields
}
ScreeningService holds the screening APIs: Ip, Sanctions and Crypto.
func (*ScreeningService) Crypto ¶
func (s *ScreeningService) Crypto(ctx context.Context, params *ScreeningCryptoParams, opts ...RequestOption) (*ScreeningCrypto, error)
Crypto calls Wallet Screening: POST /v1/screen/crypto.
A verdict and a risk level for up to 100 wallet addresses, on any supported network, from sanctions and illicit-activity data.
Price: 0.1 credits per successful call.
func (*ScreeningService) Ip ¶
func (s *ScreeningService) Ip(ctx context.Context, params *ScreeningIpParams, opts ...RequestOption) (*ScreeningIp, error)
Ip calls IP Risk: POST /v1/screen/ip.
Where an IP address is, who runs it, whether it hides the user (VPN, proxy, Tor, data centre), its abuse reports, and a risk level with reasons.
Price: 0.06 credits per successful call.
func (*ScreeningService) Sanctions ¶
func (s *ScreeningService) Sanctions(ctx context.Context, params *ScreeningSanctionsParams, opts ...RequestOption) (*ScreeningSanctions, error)
Sanctions calls Sanctions & PEP Screening: POST /v1/screen/sanctions.
Screens a person or company against sanctions, politically exposed person and crime lists. Every detail you give, name, date of birth, nationality, ID number, is scored together, and each result explains why it matched.
Price: 0.8 credits per successful call.
type SignatureVerificationError ¶
type SignatureVerificationError struct {
// Message says which check failed.
Message string
}
SignatureVerificationError means a webhook delivery did not verify: a header is missing or malformed, no signature matches the payload and the secret, or the timestamp is outside the tolerance.
func (*SignatureVerificationError) Error ¶
func (e *SignatureVerificationError) Error() string
Error returns the message.
type TextBoxes ¶
type TextBoxes struct {
// Image width in pixels.
Width int64 `json:"width,omitempty"`
// Image height in pixels.
Height int64 `json:"height,omitempty"`
// Every text region found.
Boxes []TextBoxesBox `json:"boxes,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
TextBoxes: Every text box on the image, for drawing only (no text).
func (TextBoxes) MarshalJSON ¶
MarshalJSON writes the fields, then the members kept in Extra.
func (*TextBoxes) UnmarshalJSON ¶
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type TextBoxesBox ¶
type TextBoxesBox struct {
// Four corners x1,y1 … x4,y4, in image pixels.
Box []float64 `json:"box,omitempty"`
// Detection score, 0 to 1.
Score float64 `json:"score,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
TextBoxesBox is the box member of TextBoxes.
func (TextBoxesBox) MarshalJSON ¶
func (v TextBoxesBox) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*TextBoxesBox) UnmarshalJSON ¶
func (v *TextBoxesBox) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionField ¶
type VisionField struct {
// Index of the text box this field kept.
SourceID int64 `json:"source_id,omitempty"`
// Field type: `payee`, `courtesy_amount`, `legal_amount`, `date`, `drawer`, `bank_name`, `memo`, `cheque_number`, `signature`.
Type string `json:"type,omitempty"`
// The value, corrected.
Value string `json:"value,omitempty"`
// Confidence, 0 to 1.
Confidence float64 `json:"confidence,omitempty"`
// Checked against the detector's text.
Verified bool `json:"verified,omitempty"`
// The polygon (4 points) the field kept.
Box [][]float64 `json:"box,omitempty"`
// What the text detector read there.
DetectorText string `json:"detector_text,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionField is one field the vision reader returned.
func (VisionField) MarshalJSON ¶
func (v VisionField) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionField) UnmarshalJSON ¶
func (v *VisionField) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResult ¶
type VisionResult struct {
// Every field read, with its box.
Fields []VisionField `json:"fields,omitempty"`
Amount VisionResultAmount `json:"amount,omitempty"`
Currency VisionResultCurrency `json:"currency,omitempty"`
Date VisionResultDate `json:"date,omitempty"`
// Who the cheque is paid to.
Payee string `json:"payee,omitempty"`
// The account holder printed on the cheque.
Drawer *VisionResultDrawer `json:"drawer,omitempty"`
Bank VisionResultBank `json:"bank,omitempty"`
ChequeNumberPrinted string `json:"cheque_number_printed,omitempty"`
AccountNumberPrinted string `json:"account_number_printed,omitempty"`
Memo string `json:"memo,omitempty"`
// The printed pay line.
PayWording string `json:"pay_wording,omitempty"`
Crossing VisionResultCrossing `json:"crossing,omitempty"`
Signature VisionResultSignature `json:"signature,omitempty"`
ChequeType string `json:"cheque_type,omitempty"`
// ISO 639-1 language of the face.
Language string `json:"language,omitempty"`
// Country the face suggests, ISO 3166-1 alpha-2.
RegionGuess string `json:"region_guess,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResult is what is written on the cheque's face. The engine may add keys; they are kept.
func (VisionResult) MarshalJSON ¶
func (v VisionResult) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResult) UnmarshalJSON ¶
func (v *VisionResult) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultAmount ¶
type VisionResultAmount struct {
// The amount box, as written.
Figures string `json:"figures,omitempty"`
// The amount in words, as written.
Words string `json:"words,omitempty"`
Numeric float64 `json:"numeric,omitempty"`
Fraction string `json:"fraction,omitempty"`
// Words and figures say the same amount.
Agreement bool `json:"agreement,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultAmount is the amount member of VisionResult.
func (VisionResultAmount) MarshalJSON ¶
func (v VisionResultAmount) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultAmount) UnmarshalJSON ¶
func (v *VisionResultAmount) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultBank ¶
type VisionResultBank struct {
Name string `json:"name,omitempty"`
Country string `json:"country,omitempty"`
Branch string `json:"branch,omitempty"`
Address string `json:"address,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultBank is the bank member of VisionResult.
func (VisionResultBank) MarshalJSON ¶
func (v VisionResultBank) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultBank) UnmarshalJSON ¶
func (v *VisionResultBank) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultCrossing ¶
type VisionResultCrossing struct {
Present bool `json:"present,omitempty"`
Type string `json:"type,omitempty"`
Text string `json:"text,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultCrossing is the crossing member of VisionResult.
func (VisionResultCrossing) MarshalJSON ¶
func (v VisionResultCrossing) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultCrossing) UnmarshalJSON ¶
func (v *VisionResultCrossing) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultCurrency ¶
type VisionResultCurrency struct {
Code string `json:"code,omitempty"`
Symbol string `json:"symbol,omitempty"`
Source string `json:"source,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultCurrency is the currency member of VisionResult.
func (VisionResultCurrency) MarshalJSON ¶
func (v VisionResultCurrency) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultCurrency) UnmarshalJSON ¶
func (v *VisionResultCurrency) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultDate ¶
type VisionResultDate struct {
Raw string `json:"raw,omitempty"`
ISO string `json:"iso,omitempty"`
Format string `json:"format,omitempty"`
Ambiguous bool `json:"ambiguous,omitempty"`
PostDated bool `json:"post_dated,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultDate is the date member of VisionResult.
func (VisionResultDate) MarshalJSON ¶
func (v VisionResultDate) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultDate) UnmarshalJSON ¶
func (v *VisionResultDate) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultDrawer ¶
type VisionResultDrawer struct {
Name string `json:"name,omitempty"`
Address string `json:"address,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultDrawer is the account holder printed on the cheque.
func (VisionResultDrawer) MarshalJSON ¶
func (v VisionResultDrawer) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultDrawer) UnmarshalJSON ¶
func (v *VisionResultDrawer) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type VisionResultSignature ¶
type VisionResultSignature struct {
Present bool `json:"present,omitempty"`
Count int64 `json:"count,omitempty"`
// Extra holds the members that have no field above, or whose JSON type differs from the spec.
Extra map[string]any `json:"-"`
}
VisionResultSignature is the signature member of VisionResult.
func (VisionResultSignature) MarshalJSON ¶
func (v VisionResultSignature) MarshalJSON() ([]byte, error)
MarshalJSON writes the fields, then the members kept in Extra.
func (*VisionResultSignature) UnmarshalJSON ¶
func (v *VisionResultSignature) UnmarshalJSON(data []byte) error
UnmarshalJSON reads the known members into their fields and keeps the others in Extra.
type WebhookEvent ¶
type WebhookEvent struct {
// Type is what happened, such as "verification.completed", "verification.declined", "aml.hit" or
// "credits.low".
Type string `json:"type"`
// Timestamp is when it happened (ISO 8601).
Timestamp string `json:"timestamp"`
// Environment is "test" or "live".
Environment string `json:"environment"`
// Data holds the event's details, as decoded JSON.
Data map[string]any `json:"data"`
}
WebhookEvent is the body of a webhook delivery.
func ConstructEvent ¶
func ConstructEvent(payload []byte, headers http.Header, secret string, tolerance ...time.Duration) (*WebhookEvent, error)
ConstructEvent verifies a delivery with VerifySignature, then parses its body:
func handle(w http.ResponseWriter, r *http.Request) {
payload, _ := io.ReadAll(r.Body)
event, err := verisec.ConstructEvent(payload, r.Header, os.Getenv("VERISEC_WEBHOOK_SECRET"))
if err != nil {
http.Error(w, "bad signature", http.StatusBadRequest)
return
}
if event.Type == "verification.completed" { /* event.Data */ }
}
Example ¶
package main
import (
"fmt"
"io"
"net/http"
"os"
"github.com/mosesmmoisebidth/verisec-go"
)
func main() {
http.HandleFunc("/webhooks/verisec", func(w http.ResponseWriter, r *http.Request) {
payload, _ := io.ReadAll(r.Body)
event, err := verisec.ConstructEvent(payload, r.Header, os.Getenv("VERISEC_WEBHOOK_SECRET"))
if err != nil {
http.Error(w, "bad signature", http.StatusBadRequest)
return
}
if event.Type == "verification.completed" {
fmt.Println(event.Data["decision"])
}
w.WriteHeader(http.StatusOK)
})
}
Output:
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
quickstart
command
Command quickstart makes three real calls: an MRZ parse, a BIN lookup and, given two photos, a face verify.
|
Command quickstart makes three real calls: an MRZ parse, a BIN lookup and, given two photos, a face verify. |
|
internal
|
|
|
gen
command
Command gen writes types.go and resources.go from the VeriSec OpenAPI spec: one Go type per component schema (plus the inline objects and the query parameters of the GET operations), the Client with one service per resource, and one method per operation.
|
Command gen writes types.go and resources.go from the VeriSec OpenAPI spec: one Go type per component schema (plus the inline objects and the query parameters of the GET operations), the Client with one service per resource, and one method per operation. |