verisec 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1800 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by script/generate from spec/openapi.json. Do not edit by hand.
4
+
5
+ module VeriSec
6
+ class Client
7
+ # `client.face`: `face.analyze`, `face.detect`, `face.count`, `face.attributes`, `face.ppe`,
8
+ # `face.emotion`, `face.crop`, `face.redact`, `face.match`, `face.verify`, `face.similarity`,
9
+ # `face.search`, `face.dedupe`, `face.watchlist`, `face.cluster`, `face.age`, `face.quality` (Face).
10
+ #
11
+ # @return [VeriSec::Resources::Face]
12
+ attr_reader :face
13
+
14
+ # `client.age`: `age.verify`, `age.verifyLive` (Face).
15
+ #
16
+ # @return [VeriSec::Resources::Age]
17
+ attr_reader :age
18
+
19
+ # `client.photo`: `photo.compliance`, `photo.policy`, `photo.gate`, `photo.autofix`, `photo.bestFrame`
20
+ # (Face).
21
+ #
22
+ # @return [VeriSec::Resources::Photo]
23
+ attr_reader :photo
24
+
25
+ # `client.liveness`: `liveness.check`, `liveness.antispoof`, `liveness.gate` (Face).
26
+ #
27
+ # @return [VeriSec::Resources::Liveness]
28
+ attr_reader :liveness
29
+
30
+ # `client.identity`: `identity.verify` (Face workflows).
31
+ #
32
+ # @return [VeriSec::Resources::Identity]
33
+ attr_reader :identity
34
+
35
+ # `client.face_login`: `faceLogin.authenticate` (Face workflows).
36
+ #
37
+ # @return [VeriSec::Resources::FaceLogin]
38
+ attr_reader :face_login
39
+
40
+ # `client.fraud`: `fraud.signupCheck` (Face workflows).
41
+ #
42
+ # @return [VeriSec::Resources::Fraud]
43
+ attr_reader :fraud
44
+
45
+ # `client.proctor`: `proctor.check` (Face workflows).
46
+ #
47
+ # @return [VeriSec::Resources::Proctor]
48
+ attr_reader :proctor
49
+
50
+ # `client.age_gate`: `ageGate.checkout` (Face workflows).
51
+ #
52
+ # @return [VeriSec::Resources::AgeGate]
53
+ attr_reader :age_gate
54
+
55
+ # `client.kiosk`: `kiosk.photo` (Face workflows).
56
+ #
57
+ # @return [VeriSec::Resources::Kiosk]
58
+ attr_reader :kiosk
59
+
60
+ # `client.documents`: `documents.read`, `documents.classify`, `documents.mrz`, `documents.portrait`,
61
+ # `documents.authenticity`, `documents.fields` (Document).
62
+ #
63
+ # @return [VeriSec::Resources::Documents]
64
+ attr_reader :documents
65
+
66
+ # `client.proof_of_address`: `proofOfAddress.analyze` (Document).
67
+ #
68
+ # @return [VeriSec::Resources::ProofOfAddress]
69
+ attr_reader :proof_of_address
70
+
71
+ # `client.mrz`: `mrz.read`, `mrz.recognize`, `mrz.parse` (MRZ).
72
+ #
73
+ # @return [VeriSec::Resources::Mrz]
74
+ attr_reader :mrz
75
+
76
+ # `client.email`: `email.verify`, `email.footprint` (Contact & risk).
77
+ #
78
+ # @return [VeriSec::Resources::Email]
79
+ attr_reader :email
80
+
81
+ # `client.osint`: `osint.username`, `osint.web` (Contact & risk).
82
+ #
83
+ # @return [VeriSec::Resources::Osint]
84
+ attr_reader :osint
85
+
86
+ # `client.phone`: `phone.lookup`, `phone.otp.send`, `phone.otp.check` (Contact & risk).
87
+ #
88
+ # @return [VeriSec::Resources::Phone]
89
+ attr_reader :phone
90
+
91
+ # `client.screening`: `screening.ip`, `screening.sanctions`, `screening.crypto` (Contact & risk).
92
+ #
93
+ # @return [VeriSec::Resources::Screening]
94
+ attr_reader :screening
95
+
96
+ # `client.ip`: `ip.analyze` (Contact & risk).
97
+ #
98
+ # @return [VeriSec::Resources::Ip]
99
+ attr_reader :ip
100
+
101
+ # `client.contact`: `contact.dossier` (Contact & risk).
102
+ #
103
+ # @return [VeriSec::Resources::Contact]
104
+ attr_reader :contact
105
+
106
+ # `client.cheques`: `cheques.read`, `cheques.micr`, `cheques.micrLine`, `cheques.amount`, `cheques.date`,
107
+ # `cheques.parties`, `cheques.bank` (Cheques).
108
+ #
109
+ # @return [VeriSec::Resources::Cheques]
110
+ attr_reader :cheques
111
+
112
+ # `client.banks`: `banks.lookup` (Banks).
113
+ #
114
+ # @return [VeriSec::Resources::Banks]
115
+ attr_reader :banks
116
+
117
+ # `client.cards`: `cards.read`, `cards.number`, `cards.expiry`, `cards.check`, `cards.fingerprint`
118
+ # (Cards).
119
+ #
120
+ # @return [VeriSec::Resources::Cards]
121
+ attr_reader :cards
122
+
123
+ # `client.bin`: `bin.lookup` (BIN).
124
+ #
125
+ # @return [VeriSec::Resources::Bin]
126
+ attr_reader :bin
127
+
128
+ private
129
+
130
+ def build_resources
131
+ @face = Resources::Face.new(@transport)
132
+ @age = Resources::Age.new(@transport)
133
+ @photo = Resources::Photo.new(@transport)
134
+ @liveness = Resources::Liveness.new(@transport)
135
+ @identity = Resources::Identity.new(@transport)
136
+ @face_login = Resources::FaceLogin.new(@transport)
137
+ @fraud = Resources::Fraud.new(@transport)
138
+ @proctor = Resources::Proctor.new(@transport)
139
+ @age_gate = Resources::AgeGate.new(@transport)
140
+ @kiosk = Resources::Kiosk.new(@transport)
141
+ @documents = Resources::Documents.new(@transport)
142
+ @proof_of_address = Resources::ProofOfAddress.new(@transport)
143
+ @mrz = Resources::Mrz.new(@transport)
144
+ @email = Resources::Email.new(@transport)
145
+ @osint = Resources::Osint.new(@transport)
146
+ @phone = Resources::Phone.new(@transport)
147
+ @screening = Resources::Screening.new(@transport)
148
+ @ip = Resources::Ip.new(@transport)
149
+ @contact = Resources::Contact.new(@transport)
150
+ @cheques = Resources::Cheques.new(@transport)
151
+ @banks = Resources::Banks.new(@transport)
152
+ @cards = Resources::Cards.new(@transport)
153
+ @bin = Resources::Bin.new(@transport)
154
+ end
155
+ end
156
+
157
+ module Resources
158
+ # `client.face`: `face.analyze`, `face.detect`, `face.count`, `face.attributes`, `face.ppe`,
159
+ # `face.emotion`, `face.crop`, `face.redact`, `face.match`, `face.verify`, `face.similarity`,
160
+ # `face.search`, `face.dedupe`, `face.watchlist`, `face.cluster`, `face.age`, `face.quality` (Face).
161
+ class Face < Resource
162
+ # Face Analyze: `POST /v1/face/analyze`.
163
+ #
164
+ # The all-in-one detection call. For every face it returns the box, the tilt, 5 landmarks, an aligned
165
+ # crop, the attributes you pick and the quality checks you define.
166
+ #
167
+ # Price: 0.1 credits per successful call.
168
+ #
169
+ # @param params [Hash] the request fields (FaceAnalyzeParams), under the API's names
170
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Face image. The image as
171
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
172
+ # @option params [Boolean] :onlyCentralFace Only the central face. Off returns every face in the image.
173
+ # (default false)
174
+ # @option params [Hash] :crop Keys: `type` [String, Integer] (one of "", 0, 1, 2, 3, 4; default 1)
175
+ # Aligned crop. An aligned crop of each face at this shape.
176
+ # @option params [Array<String>] :attributes Attributes to return. Any of the 13 attributes. (default
177
+ # ["Age", "EyeRight", "EyeLeft", "Mouth", "Emotion", "Smile", "Glasses", "HeadCovering",
178
+ # "ForeheadCovering", "MedicalMask", "Occlusion", "StrongMakeup", "Headphones"])
179
+ # @option params [Array<Object>] :qualityChecks Your quality checks. A check passes when its value is
180
+ # within your range. (default [{"name"=>"Yaw", "range"=>[-5, 5]}, {"name"=>"BlurLevel", "range"=>[0,
181
+ # 0.15]}])
182
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
183
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
184
+ # @return [VeriSec::Types::FaceAnalyze] the answer's `data`; `last_response` has the status, headers,
185
+ # request id, warnings and latency
186
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
187
+ # @raise [VeriSec::APIConnectionError] when no answer came back
188
+ def analyze(request_options: nil, **params)
189
+ _json(:post, "/v1/face/analyze", params, Types::FaceAnalyze, envelope: :data,
190
+ images: { fields: ["image"] }, request_options: request_options)
191
+ end
192
+
193
+ # Face Detect: `POST /v1/face/detect`.
194
+ #
195
+ # Just the faces: each box, its tilt, 5 landmarks, and the count. No attributes, no quality.
196
+ #
197
+ # Price: 0.02 credits per successful call.
198
+ #
199
+ # @param params [Hash] the request fields (FaceDetectParams), under the API's names
200
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Image. The image as base64
201
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
202
+ # @option params [Boolean] :onlyCentralFace Only the central face. Off returns every face. (default
203
+ # false)
204
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
205
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
206
+ # @return [VeriSec::Types::FaceDetect] the answer's `data`; `last_response` has the status, headers,
207
+ # request id, warnings and latency
208
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
209
+ # @raise [VeriSec::APIConnectionError] when no answer came back
210
+ def detect(request_options: nil, **params)
211
+ _json(:post, "/v1/face/detect", params, Types::FaceDetect, envelope: :data,
212
+ images: { fields: ["image"] }, request_options: request_options)
213
+ end
214
+
215
+ # Face Count: `POST /v1/face/count`.
216
+ #
217
+ # Confirms an image holds exactly the number of faces you expect, for a capture gate.
218
+ #
219
+ # Price: 0.02 credits per successful call.
220
+ #
221
+ # @param params [Hash] the request fields (FaceCountParams), under the API's names
222
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Image. The image as base64
223
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
224
+ # @option params [Integer] :expected Expected faces. ok is true only when the count equals this.
225
+ # (default 1; 0 to 100)
226
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
227
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
228
+ # @return [VeriSec::Types::FaceCount] the answer's `data`; `last_response` has the status, headers,
229
+ # request id, warnings and latency
230
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
231
+ # @raise [VeriSec::APIConnectionError] when no answer came back
232
+ def count(request_options: nil, **params)
233
+ _json(:post, "/v1/face/count", params, Types::FaceCount, envelope: :data,
234
+ images: { fields: ["image"] }, request_options: request_options)
235
+ end
236
+
237
+ # Face Attributes: `POST /v1/face/attributes`.
238
+ #
239
+ # The attributes you choose, per face. Age is a range; eyes and mouth are open/closed; emotion is a
240
+ # label; the rest are yes/no, each with a confidence.
241
+ #
242
+ # Price: 0.1 credits per successful call.
243
+ #
244
+ # @param params [Hash] the request fields (FaceAttributesParams), under the API's names
245
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Face image. The image as
246
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
247
+ # @option params [Array<String>] :attributes (required) Attributes to return.
248
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
249
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
250
+ # @return [VeriSec::Types::FaceAttributes] the answer's `data`; `last_response` has the status, headers,
251
+ # request id, warnings and latency
252
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
253
+ # @raise [VeriSec::APIConnectionError] when no answer came back
254
+ def attributes(request_options: nil, **params)
255
+ _json(:post, "/v1/face/attributes", params, Types::FaceAttributes, envelope: :data,
256
+ images: { fields: ["image"] }, request_options: request_options)
257
+ end
258
+
259
+ # Mask & Glasses (PPE): `POST /v1/face/ppe`.
260
+ #
261
+ # Mask, glasses, head and forehead covering, headphones and occlusion, flattened so each item is one
262
+ # yes/no value per face.
263
+ #
264
+ # Price: 0.02 credits per successful call.
265
+ #
266
+ # @param params [Hash] the request fields (FacePpeParams), under the API's names
267
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Face image. The image as
268
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
269
+ # @option params [Array<String>] :items (required) Items to check.
270
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
271
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
272
+ # @return [VeriSec::Types::FacePpe] the answer's `data`; `last_response` has the status, headers,
273
+ # request id, warnings and latency
274
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
275
+ # @raise [VeriSec::APIConnectionError] when no answer came back
276
+ def ppe(request_options: nil, **params)
277
+ _json(:post, "/v1/face/ppe", params, Types::FacePpe, envelope: :data, images: { fields: ["image"] },
278
+ request_options: request_options)
279
+ end
280
+
281
+ # Emotion: `POST /v1/face/emotion`.
282
+ #
283
+ # The dominant expression of each face. Send one image for per-face results, or a list of frames for a
284
+ # per-frame breakdown plus the overall dominant emotion.
285
+ #
286
+ # Price: 0.02 credits per successful call.
287
+ #
288
+ # @param params [Hash] the request fields (FaceEmotionParams), under the API's names
289
+ # @option params [String, Pathname, IO, VeriSec::Image] :image Face image. One image. Or send frames
290
+ # instead. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
291
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :frames Frames. 1 to 10 images of
292
+ # the same scene, in order. (each entry an image)
293
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
294
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
295
+ # @return [VeriSec::Types::FaceEmotion] the answer's `data`; `last_response` has the status, headers,
296
+ # request id, warnings and latency
297
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
298
+ # @raise [VeriSec::APIConnectionError] when no answer came back
299
+ def emotion(request_options: nil, **params)
300
+ _json(:post, "/v1/face/emotion", params, Types::FaceEmotion, envelope: :data,
301
+ images: { fields: ["image"], lists: [{ name: "frames", item_label: "frame" }] },
302
+ request_options: request_options)
303
+ end
304
+
305
+ # Smart Crop: `POST /v1/face/crop`.
306
+ #
307
+ # An aligned, straightened crop of the face at the shape you choose (square for an avatar, 4:5 for a
308
+ # document).
309
+ #
310
+ # Price: 0.02 credits per successful call.
311
+ #
312
+ # @param params [Hash] the request fields (FaceCropParams), under the API's names
313
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Image. The image as base64
314
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
315
+ # @option params [Integer] :type Crop shape. (one of 0, 1, 2, 3, 4; default 3)
316
+ # @option params [Boolean] :onlyCentralFace Only the central face. (default true)
317
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
318
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
319
+ # @return [VeriSec::Types::FaceCrop] the answer's `data`; `last_response` has the status, headers,
320
+ # request id, warnings and latency
321
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
322
+ # @raise [VeriSec::APIConnectionError] when no answer came back
323
+ def crop(request_options: nil, **params)
324
+ _json(:post, "/v1/face/crop", params, Types::FaceCrop, envelope: :data, images: { fields: ["image"] },
325
+ request_options: request_options)
326
+ end
327
+
328
+ # Face Redact: `POST /v1/face/redact`.
329
+ #
330
+ # The image back with every face hidden, blurred, pixelated or boxed out, plus where each face was.
331
+ #
332
+ # Price: 0.02 credits per successful call.
333
+ #
334
+ # @param params [Hash] the request fields (FaceRedactParams), under the API's names
335
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Image. The image as base64
336
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
337
+ # @option params [String] :mode How to hide faces. (one of "blur", "pixelate", "box"; default "blur")
338
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
339
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
340
+ # @return [VeriSec::Types::FaceRedact] the answer's `data`; `last_response` has the status, headers,
341
+ # request id, warnings and latency
342
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
343
+ # @raise [VeriSec::APIConnectionError] when no answer came back
344
+ def redact(request_options: nil, **params)
345
+ _json(:post, "/v1/face/redact", params, Types::FaceRedact, envelope: :data,
346
+ images: { fields: ["image"] }, request_options: request_options)
347
+ end
348
+
349
+ # Face Match: `POST /v1/face/match`.
350
+ #
351
+ # Compares the faces across two images: every face found in each, with a similarity for each pair. The
352
+ # 1:1 building block.
353
+ #
354
+ # Price: 0.2 credits per successful call.
355
+ #
356
+ # @param params [Hash] the request fields (FaceMatchParams), under the API's names
357
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :images (required) Images. Exactly
358
+ # two images. (exactly 2 items; each entry an image or a Hash with `data`; `index` is filled in)
359
+ # @option params [Hash] :crop Keys: `type` [String, Integer] (one of "", 0, 1, 2, 3, 4; default "")
360
+ # Aligned crop. Adds an aligned crop of every face.
361
+ # @option params [Integer] :limitComparePerImageTypes Compare limit. A cap on comparisons per image
362
+ # type. (1 to 10)
363
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
364
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
365
+ # @return [VeriSec::Types::FaceMatch] the answer's `data`; `last_response` has the status, headers,
366
+ # request id, warnings and latency
367
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
368
+ # @raise [VeriSec::APIConnectionError] when no answer came back
369
+ def match(request_options: nil, **params)
370
+ _json(:post, "/v1/face/match", params, Types::FaceMatch, envelope: :data,
371
+ images: { lists: [{ name: "images", image_key: "data", index_key: "index", item_label: "image" }] },
372
+ request_options: request_options)
373
+ end
374
+
375
+ # Face Verify (1:1): `POST /v1/face/verify`.
376
+ #
377
+ # A 1:1 decision: the similarity of two faces, and whether it clears your threshold.
378
+ #
379
+ # Price: 0.2 credits per successful call.
380
+ #
381
+ # @param params [Hash] the request fields (FaceVerifyParams), under the API's names
382
+ # @option params [String, Pathname, IO, VeriSec::Image] :image1 (required) First face. The image as
383
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
384
+ # @option params [String, Pathname, IO, VeriSec::Image] :image2 (required) Second face. The image as
385
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
386
+ # @option params [Numeric] :threshold Threshold. match is true at or above this similarity. (default
387
+ # 0.75; 0 to 1)
388
+ # @option params [String] :livenessTransactionId Liveness transaction. Links the first face to a passed
389
+ # liveness session.
390
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
391
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
392
+ # @return [VeriSec::Types::FaceVerify] the answer's `data`; `last_response` has the status, headers,
393
+ # request id, warnings and latency
394
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
395
+ # @raise [VeriSec::APIConnectionError] when no answer came back
396
+ def verify(request_options: nil, **params)
397
+ _json(:post, "/v1/face/verify", params, Types::FaceVerify, envelope: :data,
398
+ images: { fields: ["image1", "image2"] }, request_options: request_options)
399
+ end
400
+
401
+ # Similarity Score: `POST /v1/face/similarity`.
402
+ #
403
+ # Only the raw numbers: similarity and distance between two faces. No threshold, no decision.
404
+ #
405
+ # Price: 0.02 credits per successful call.
406
+ #
407
+ # @param params [Hash] the request fields (FaceSimilarityParams), under the API's names
408
+ # @option params [String, Pathname, IO, VeriSec::Image] :image1 (required) First face. The image as
409
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
410
+ # @option params [String, Pathname, IO, VeriSec::Image] :image2 (required) Second face. The image as
411
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
412
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
413
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
414
+ # @return [VeriSec::Types::FaceSimilarity] the answer's `data`; `last_response` has the status, headers,
415
+ # request id, warnings and latency
416
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
417
+ # @raise [VeriSec::APIConnectionError] when no answer came back
418
+ def similarity(request_options: nil, **params)
419
+ _json(:post, "/v1/face/similarity", params, Types::FaceSimilarity, envelope: :data,
420
+ images: { fields: ["image1", "image2"] }, request_options: request_options)
421
+ end
422
+
423
+ # Face Search (1:N): `POST /v1/face/search`.
424
+ #
425
+ # One face against a gallery you send. Returns the gallery faces at or above your threshold, highest
426
+ # similarity first.
427
+ #
428
+ # Price: 0.3 credits per successful call.
429
+ #
430
+ # @param params [Hash] the request fields (FaceSearchParams), under the API's names
431
+ # @option params [String, Pathname, IO, VeriSec::Image] :probe (required) Face to find. The image as
432
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
433
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :gallery (required) Gallery. 1 to
434
+ # 10 faces, each with your own id. (1 to 10 items; each entry an image or a Hash with `image`; `id`
435
+ # defaults to "face-1", …)
436
+ # @option params [Integer] :topK Top matches. (default 3; 1 to 10)
437
+ # @option params [Numeric] :threshold Threshold. Only faces at or above this similarity are matches.
438
+ # (default 0.75; 0 to 1)
439
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
440
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
441
+ # @return [VeriSec::Types::FaceSearch] the answer's `data`; `last_response` has the status, headers,
442
+ # request id, warnings and latency
443
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
444
+ # @raise [VeriSec::APIConnectionError] when no answer came back
445
+ def search(request_options: nil, **params)
446
+ _json(:post, "/v1/face/search", params, Types::FaceSearch, envelope: :data,
447
+ images: { fields: ["probe"], lists: [{ name: "gallery", image_key: "image", id_key: "id", item_label: "face" }] },
448
+ request_options: request_options)
449
+ end
450
+
451
+ # Duplicate Check: `POST /v1/face/dedupe`.
452
+ #
453
+ # Whether a new face already exists in your set: the closest existing face and if it clears the
454
+ # duplicate threshold.
455
+ #
456
+ # Price: 0.02 credits per successful call.
457
+ #
458
+ # @param params [Hash] the request fields (FaceDedupeParams), under the API's names
459
+ # @option params [String, Pathname, IO, VeriSec::Image] :candidate (required) New face. The image as
460
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
461
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :existing (required) Existing
462
+ # faces. 1 to 10 faces, each with your own id. (1 to 10 items; each entry an image or a Hash with
463
+ # `image`; `id` defaults to "face-1", …)
464
+ # @option params [Numeric] :threshold Threshold. A duplicate at or above this similarity. (default 0.8;
465
+ # 0 to 1)
466
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
467
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
468
+ # @return [VeriSec::Types::FaceDedupe] the answer's `data`; `last_response` has the status, headers,
469
+ # request id, warnings and latency
470
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
471
+ # @raise [VeriSec::APIConnectionError] when no answer came back
472
+ def dedupe(request_options: nil, **params)
473
+ _json(:post, "/v1/face/dedupe", params, Types::FaceDedupe, envelope: :data,
474
+ images: { fields: ["candidate"], lists: [{ name: "existing", image_key: "image", id_key: "id", item_label: "face" }] },
475
+ request_options: request_options)
476
+ end
477
+
478
+ # Watchlist Screening: `POST /v1/face/watchlist`.
479
+ #
480
+ # A face against your own labelled list (blocked, VIP, staff). Returns a hit and the matched entry with
481
+ # its label.
482
+ #
483
+ # Price: 0.3 credits per successful call.
484
+ #
485
+ # @param params [Hash] the request fields (FaceWatchlistParams), under the API's names
486
+ # @option params [String, Pathname, IO, VeriSec::Image] :probe (required) Face to check. The image as
487
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
488
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :list (required) Your list. 1 to 10
489
+ # faces, each with your own id and a label. (1 to 10 items; each entry an image or a Hash with
490
+ # `image`; `id` defaults to "face-1", …)
491
+ # @option params [Numeric] :threshold Threshold. A hit at or above this similarity. (default 0.8; 0 to
492
+ # 1)
493
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
494
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
495
+ # @return [VeriSec::Types::FaceWatchlist] the answer's `data`; `last_response` has the status, headers,
496
+ # request id, warnings and latency
497
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
498
+ # @raise [VeriSec::APIConnectionError] when no answer came back
499
+ def watchlist(request_options: nil, **params)
500
+ _json(:post, "/v1/face/watchlist", params, Types::FaceWatchlist, envelope: :data,
501
+ images: { fields: ["probe"], lists: [{ name: "list", image_key: "image", id_key: "id", item_label: "face" }] },
502
+ request_options: request_options)
503
+ end
504
+
505
+ # Face Cluster: `POST /v1/face/cluster`.
506
+ #
507
+ # Groups faces by person. Every pair is compared, and faces are linked when they clear your threshold.
508
+ #
509
+ # Price: 0.02 credits per successful call.
510
+ #
511
+ # @param params [Hash] the request fields (FaceClusterParams), under the API's names
512
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :faces (required) Faces. 2 to 8
513
+ # faces, each with your own id. (2 to 8 items; each entry an image or a Hash with `image`; `id`
514
+ # defaults to "face-1", …)
515
+ # @option params [Numeric] :threshold Threshold. Two faces join a group at or above this similarity.
516
+ # (default 0.75; 0 to 1)
517
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
518
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
519
+ # @return [VeriSec::Types::FaceCluster] the answer's `data`; `last_response` has the status, headers,
520
+ # request id, warnings and latency
521
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
522
+ # @raise [VeriSec::APIConnectionError] when no answer came back
523
+ def cluster(request_options: nil, **params)
524
+ _json(:post, "/v1/face/cluster", params, Types::FaceCluster, envelope: :data,
525
+ images: { lists: [{ name: "faces", image_key: "image", id_key: "id", item_label: "face" }] },
526
+ request_options: request_options)
527
+ end
528
+
529
+ # Age Estimation: `POST /v1/face/age`.
530
+ #
531
+ # The age range of each face, its midpoint, and an aligned crop. The range is most exact with the crop
532
+ # on.
533
+ #
534
+ # Price: 0.05 credits per successful call.
535
+ #
536
+ # @param params [Hash] the request fields (FaceAgeParams), under the API's names
537
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Face image. The image as
538
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
539
+ # @option params [Boolean] :onlyCentralFace Only the central face. (default false)
540
+ # @option params [Hash] :crop Keys: `type` [String, Integer] (one of "", 0, 1, 2, 3, 4; default 1)
541
+ # Aligned crop. Recommended: the range is most exact with a crop.
542
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
543
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
544
+ # @return [VeriSec::Types::FaceAge] the answer's `data`; `last_response` has the status, headers,
545
+ # request id, warnings and latency
546
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
547
+ # @raise [VeriSec::APIConnectionError] when no answer came back
548
+ def age(request_options: nil, **params)
549
+ _json(:post, "/v1/face/age", params, Types::FaceAge, envelope: :data, images: { fields: ["image"] },
550
+ request_options: request_options)
551
+ end
552
+
553
+ # Photo Quality: `POST /v1/face/quality`.
554
+ #
555
+ # Scores a portrait against a standard (ICAO, Schengen, US visa, Full) or your own checks. Returns every
556
+ # check with its value, its range and pass/fail, plus group roll-ups and an optional crop.
557
+ #
558
+ # Price: 0.02 credits per successful call.
559
+ #
560
+ # @param params [Hash] the request fields (FaceQualityParams), under the API's names
561
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Portrait. The image as base64
562
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
563
+ # @option params [String] :scenario Standard. (one of "QualityICAO", "QualityVisaSchengen",
564
+ # "QualityVisaUSA", "QualityFull"; default "QualityICAO")
565
+ # @option params [Boolean] :onlyCentralFace Only the central face. (default true)
566
+ # @option params [Hash] :output Keys: `crop` [Hash]; `backgroundColor` [Array<Integer>] (default [255,
567
+ # 255, 255]) Crop background. Replaces the background of the crop.
568
+ # @option params [Object] :customChecks Your own checks. When you add checks, they replace the standard:
569
+ # exactly these run, with your ranges.
570
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
571
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
572
+ # @return [VeriSec::Types::FaceQuality] the answer's `data`; `last_response` has the status, headers,
573
+ # request id, warnings and latency
574
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
575
+ # @raise [VeriSec::APIConnectionError] when no answer came back
576
+ def quality(request_options: nil, **params)
577
+ _json(:post, "/v1/face/quality", params, Types::FaceQuality, envelope: :data,
578
+ images: { fields: ["image"] }, request_options: request_options)
579
+ end
580
+ end
581
+
582
+ # `client.age`: `age.verify`, `age.verifyLive` (Face).
583
+ class Age < Resource
584
+ # Age Check: `POST /v1/age/verify`.
585
+ #
586
+ # An age gate: pass or fail against a minimum age, deciding on the lower end of the range (strict) or
587
+ # the midpoint.
588
+ #
589
+ # Price: 0.05 credits per successful call.
590
+ #
591
+ # @param params [Hash] the request fields (AgeVerifyParams), under the API's names
592
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Face image. The image as
593
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
594
+ # @option params [Integer] :minAge Minimum age. (default 18; 0 to 120)
595
+ # @option params [String] :policy Decide on. (one of "lowerBound", "midpoint"; default "lowerBound")
596
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
597
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
598
+ # @return [VeriSec::Types::AgeVerify] the answer's `data`; `last_response` has the status, headers,
599
+ # request id, warnings and latency
600
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
601
+ # @raise [VeriSec::APIConnectionError] when no answer came back
602
+ def verify(request_options: nil, **params)
603
+ _json(:post, "/v1/age/verify", params, Types::AgeVerify, envelope: :data,
604
+ images: { fields: ["image"] }, request_options: request_options)
605
+ end
606
+
607
+ # Age Check + Liveness: `POST /v1/age/verify-live`.
608
+ #
609
+ # The age gate plus liveness: allowed only when the person is old enough AND the face is live.
610
+ #
611
+ # Price: 0.25 credits per successful call.
612
+ #
613
+ # @param params [Hash] the request fields (AgeVerifyLiveParams), under the API's names
614
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Face image. The image as
615
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
616
+ # @option params [Integer] :minAge Minimum age. (default 21; 0 to 120)
617
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
618
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
619
+ # @return [VeriSec::Types::AgeVerifyLive] the answer's `data`; `last_response` has the status, headers,
620
+ # request id, warnings and latency
621
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
622
+ # @raise [VeriSec::APIConnectionError] when no answer came back
623
+ def verify_live(request_options: nil, **params)
624
+ _json(:post, "/v1/age/verify-live", params, Types::AgeVerifyLive, envelope: :data,
625
+ images: { fields: ["image"] }, request_options: request_options)
626
+ end
627
+ end
628
+
629
+ # `client.photo`: `photo.compliance`, `photo.policy`, `photo.gate`, `photo.autofix`, `photo.bestFrame`
630
+ # (Face).
631
+ class Photo < Resource
632
+ # Photo Compliance: `POST /v1/photo/compliance`.
633
+ #
634
+ # A pass/fail against one named passport or visa photo standard, with the list of failed checks.
635
+ #
636
+ # Price: 0.02 credits per successful call.
637
+ #
638
+ # @param params [Hash] the request fields (PhotoComplianceParams), under the API's names
639
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Portrait. The image as base64
640
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
641
+ # @option params [String] :standard Standard. (one of "ICAO", "VisaSchengen", "VisaUSA", "Full"; default
642
+ # "ICAO")
643
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
644
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
645
+ # @return [VeriSec::Types::PhotoCompliance] the answer's `data`; `last_response` has the status,
646
+ # headers, request id, warnings and latency
647
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
648
+ # @raise [VeriSec::APIConnectionError] when no answer came back
649
+ def compliance(request_options: nil, **params)
650
+ _json(:post, "/v1/photo/compliance", params, Types::PhotoCompliance, envelope: :data,
651
+ images: { fields: ["image"] }, request_options: request_options)
652
+ end
653
+
654
+ # Photo Policy: `POST /v1/photo/policy`.
655
+ #
656
+ # Your own checks with your own ranges. Exactly the checks you send run, nothing else.
657
+ #
658
+ # Price: 0.02 credits per successful call.
659
+ #
660
+ # @param params [Hash] the request fields (PhotoPolicyParams), under the API's names
661
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Portrait. The image as base64
662
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
663
+ # @option params [Array<Object>] :policy (required) Your checks.
664
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
665
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
666
+ # @return [VeriSec::Types::PhotoPolicy] the answer's `data`; `last_response` has the status, headers,
667
+ # request id, warnings and latency
668
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
669
+ # @raise [VeriSec::APIConnectionError] when no answer came back
670
+ def policy(request_options: nil, **params)
671
+ _json(:post, "/v1/photo/policy", params, Types::PhotoPolicy, envelope: :data,
672
+ images: { fields: ["image"] }, request_options: request_options)
673
+ end
674
+
675
+ # Quality Gate: `POST /v1/photo/gate`.
676
+ #
677
+ # A fast good-enough answer. Only the checks you require run, at their standard ranges, so it returns
678
+ # one ok and the list of any that failed.
679
+ #
680
+ # Price: 0.02 credits per successful call.
681
+ #
682
+ # @param params [Hash] the request fields (PhotoGateParams), under the API's names
683
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Photo. The image as base64
684
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
685
+ # @option params [Array<String>] :require (required) Required checks.
686
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
687
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
688
+ # @return [VeriSec::Types::PhotoGate] the answer's `data`; `last_response` has the status, headers,
689
+ # request id, warnings and latency
690
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
691
+ # @raise [VeriSec::APIConnectionError] when no answer came back
692
+ def gate(request_options: nil, **params)
693
+ _json(:post, "/v1/photo/gate", params, Types::PhotoGate, envelope: :data,
694
+ images: { fields: ["image"] }, request_options: request_options)
695
+ end
696
+
697
+ # Photo Auto-fix: `POST /v1/photo/autofix`.
698
+ #
699
+ # The portrait cropped to the shape you need, with the background replaced by your colour.
700
+ #
701
+ # Price: 0.02 credits per successful call.
702
+ #
703
+ # @param params [Hash] the request fields (PhotoAutofixParams), under the API's names
704
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Portrait. The image as base64
705
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
706
+ # @option params [String] :aspect Shape. (one of "3:4", "4:5", "2:3", "1:1"; default "3:4")
707
+ # @option params [Array<Integer>] :backgroundColor Background. (default [255, 255, 255]; exactly 3
708
+ # items)
709
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
710
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
711
+ # @return [VeriSec::Types::PhotoAutofix] the answer's `data`; `last_response` has the status, headers,
712
+ # request id, warnings and latency
713
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
714
+ # @raise [VeriSec::APIConnectionError] when no answer came back
715
+ def autofix(request_options: nil, **params)
716
+ _json(:post, "/v1/photo/autofix", params, Types::PhotoAutofix, envelope: :data,
717
+ images: { fields: ["image"] }, request_options: request_options)
718
+ end
719
+
720
+ # Best Frame: `POST /v1/photo/best-frame`.
721
+ #
722
+ # Picks the most compliant of several frames against a standard, and shows how every frame ranked.
723
+ #
724
+ # Price: 0.02 credits per successful call.
725
+ #
726
+ # @param params [Hash] the request fields (PhotoBestFrameParams), under the API's names
727
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :frames (required) Frames. 2 to 10
728
+ # images of the same scene, in order. (2 to 10 items; each entry an image)
729
+ # @option params [String] :standard Standard. (one of "ICAO", "VisaSchengen", "VisaUSA", "Full"; default
730
+ # "ICAO")
731
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
732
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
733
+ # @return [VeriSec::Types::PhotoBestFrame] the answer's `data`; `last_response` has the status, headers,
734
+ # request id, warnings and latency
735
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
736
+ # @raise [VeriSec::APIConnectionError] when no answer came back
737
+ def best_frame(request_options: nil, **params)
738
+ _json(:post, "/v1/photo/best-frame", params, Types::PhotoBestFrame, envelope: :data,
739
+ images: { lists: [{ name: "frames", item_label: "frame" }] }, request_options: request_options)
740
+ end
741
+ end
742
+
743
+ # `client.liveness`: `liveness.check`, `liveness.antispoof`, `liveness.gate` (Face).
744
+ class Liveness < Resource
745
+ # Liveness: `POST /v1/liveness`.
746
+ #
747
+ # Passive liveness from one image. status 0 means live, 1 means not live or undetermined; code carries
748
+ # the reason; an age estimate comes free.
749
+ #
750
+ # Price: 0.2 credits per successful call.
751
+ #
752
+ # @param params [Hash] the request fields (LivenessCheckParams), under the API's names
753
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Selfie. The image as base64
754
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
755
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
756
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
757
+ # @return [VeriSec::Types::LivenessCheck] the answer's `data`; `last_response` has the status, headers,
758
+ # request id, warnings and latency
759
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
760
+ # @raise [VeriSec::APIConnectionError] when no answer came back
761
+ def check(request_options: nil, **params)
762
+ _json(:post, "/v1/liveness", params, Types::LivenessCheck, envelope: :data,
763
+ images: { fields: ["image"] }, request_options: request_options)
764
+ end
765
+
766
+ # Anti-spoof Reason: `POST /v1/liveness/antispoof`.
767
+ #
768
+ # The same check with the reason spelled out: whether it is live, the reason by name, and its category
769
+ # (a presentation attack or a capture problem).
770
+ #
771
+ # Price: 0.2 credits per successful call.
772
+ #
773
+ # @param params [Hash] the request fields (LivenessAntispoofParams), under the API's names
774
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Selfie. The image as base64
775
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
776
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
777
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
778
+ # @return [VeriSec::Types::LivenessAntispoof] the answer's `data`; `last_response` has the status,
779
+ # headers, request id, warnings and latency
780
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
781
+ # @raise [VeriSec::APIConnectionError] when no answer came back
782
+ def antispoof(request_options: nil, **params)
783
+ _json(:post, "/v1/liveness/antispoof", params, Types::LivenessAntispoof, envelope: :data,
784
+ images: { fields: ["image"] }, request_options: request_options)
785
+ end
786
+
787
+ # Liveness Gate: `POST /v1/liveness/gate`.
788
+ #
789
+ # One pass/fail for a pipeline. Strict also requires a clean reason code, not just a live verdict.
790
+ #
791
+ # Price: 0.2 credits per successful call.
792
+ #
793
+ # @param params [Hash] the request fields (LivenessGateParams), under the API's names
794
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Selfie. The image as base64
795
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
796
+ # @option params [Boolean] :strict Strict. Strict also requires a clean reason code. (default true)
797
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
798
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
799
+ # @return [VeriSec::Types::LivenessGate] the answer's `data`; `last_response` has the status, headers,
800
+ # request id, warnings and latency
801
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
802
+ # @raise [VeriSec::APIConnectionError] when no answer came back
803
+ def gate(request_options: nil, **params)
804
+ _json(:post, "/v1/liveness/gate", params, Types::LivenessGate, envelope: :data,
805
+ images: { fields: ["image"] }, request_options: request_options)
806
+ end
807
+ end
808
+
809
+ # `client.identity`: `identity.verify` (Face workflows).
810
+ class Identity < Resource
811
+ # Identity Verification: `POST /v1/identity/verify`.
812
+ #
813
+ # One call that runs liveness, a quality gate and a 1:1 match against your reference face, and returns
814
+ # each step plus a single verified verdict.
815
+ #
816
+ # Price: 0.42 credits per successful call.
817
+ #
818
+ # @param params [Hash] the request fields (IdentityVerifyParams), under the API's names
819
+ # @option params [String, Pathname, IO, VeriSec::Image] :selfie (required) Selfie. The image as base64
820
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
821
+ # @option params [String, Pathname, IO, VeriSec::Image] :reference (required) Reference face. For
822
+ # example the portrait from the ID document. The image as base64 (JPEG or PNG). The SDKs also take a
823
+ # file path or the file bytes.
824
+ # @option params [Array<String>] :minQuality Quality checks. (default ["BlurLevel", "OffGaze"])
825
+ # @option params [Numeric] :threshold Threshold. Match threshold. (default 0.8; 0 to 1)
826
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
827
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
828
+ # @return [VeriSec::Types::IdentityVerify] the answer's `data`; `last_response` has the status, headers,
829
+ # request id, warnings and latency
830
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
831
+ # @raise [VeriSec::APIConnectionError] when no answer came back
832
+ def verify(request_options: nil, **params)
833
+ _json(:post, "/v1/identity/verify", params, Types::IdentityVerify, envelope: :data,
834
+ images: { fields: ["selfie", "reference"] }, request_options: request_options)
835
+ end
836
+ end
837
+
838
+ # `client.face_login`: `faceLogin.authenticate` (Face workflows).
839
+ class FaceLogin < Resource
840
+ # Face Login: `POST /v1/auth/login`.
841
+ #
842
+ # Passwordless login: a live selfie searched against your enrolled users. Authenticated only when the
843
+ # face is live and matches someone above the threshold.
844
+ #
845
+ # Price: 0.5 credits per successful call.
846
+ #
847
+ # @param params [Hash] the request fields (FaceLoginAuthenticateParams), under the API's names
848
+ # @option params [String, Pathname, IO, VeriSec::Image] :selfie (required) Selfie. The image as base64
849
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
850
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :gallery (required) Enrolled users.
851
+ # 1 to 10 faces, each with your own id. (1 to 10 items; each entry an image or a Hash with `image`;
852
+ # `id` defaults to "face-1", …)
853
+ # @option params [Numeric] :threshold Threshold. Login at or above this similarity. (default 0.8; 0 to
854
+ # 1)
855
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
856
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
857
+ # @return [VeriSec::Types::FaceLoginAuthenticate] the answer's `data`; `last_response` has the status,
858
+ # headers, request id, warnings and latency
859
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
860
+ # @raise [VeriSec::APIConnectionError] when no answer came back
861
+ def authenticate(request_options: nil, **params)
862
+ _json(:post, "/v1/auth/login", params, Types::FaceLoginAuthenticate, envelope: :data,
863
+ images: { fields: ["selfie"], lists: [{ name: "gallery", image_key: "image", id_key: "id", item_label: "face" }] },
864
+ request_options: request_options)
865
+ end
866
+ end
867
+
868
+ # `client.fraud`: `fraud.signupCheck` (Face workflows).
869
+ class Fraud < Resource
870
+ # Sign-up Fraud Check: `POST /v1/fraud/signup-check`.
871
+ #
872
+ # At sign-up: is the face live, and has it signed up before? Blocks a duplicate (similarity 0.8+) or a
873
+ # non-live face.
874
+ #
875
+ # Price: 0.5 credits per successful call.
876
+ #
877
+ # @param params [Hash] the request fields (FraudSignupCheckParams), under the API's names
878
+ # @option params [String, Pathname, IO, VeriSec::Image] :selfie (required) Selfie. The image as base64
879
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
880
+ # @option params [Array<String, Pathname, IO, VeriSec::Image, Hash>] :existing (required) Existing
881
+ # users. 1 to 10 faces, each with your own id. (1 to 10 items; each entry an image or a Hash with
882
+ # `image`; `id` defaults to "face-1", …)
883
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
884
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
885
+ # @return [VeriSec::Types::FraudSignupCheck] the answer's `data`; `last_response` has the status,
886
+ # headers, request id, warnings and latency
887
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
888
+ # @raise [VeriSec::APIConnectionError] when no answer came back
889
+ def signup_check(request_options: nil, **params)
890
+ _json(:post, "/v1/fraud/signup-check", params, Types::FraudSignupCheck, envelope: :data,
891
+ images: { fields: ["selfie"], lists: [{ name: "existing", image_key: "image", id_key: "id", item_label: "face" }] },
892
+ request_options: request_options)
893
+ end
894
+ end
895
+
896
+ # `client.proctor`: `proctor.check` (Face workflows).
897
+ class Proctor < Resource
898
+ # Proctoring Check: `POST /v1/proctor/check`.
899
+ #
900
+ # One webcam frame judged for exam proctoring: live, exactly one face, looking at the screen, and no
901
+ # mask.
902
+ #
903
+ # Price: 0.26 credits per successful call.
904
+ #
905
+ # @param params [Hash] the request fields (ProctorCheckParams), under the API's names
906
+ # @option params [String, Pathname, IO, VeriSec::Image] :frame (required) Webcam frame. The image as
907
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
908
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
909
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
910
+ # @return [VeriSec::Types::ProctorCheck] the answer's `data`; `last_response` has the status, headers,
911
+ # request id, warnings and latency
912
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
913
+ # @raise [VeriSec::APIConnectionError] when no answer came back
914
+ def check(request_options: nil, **params)
915
+ _json(:post, "/v1/proctor/check", params, Types::ProctorCheck, envelope: :data,
916
+ images: { fields: ["frame"] }, request_options: request_options)
917
+ end
918
+ end
919
+
920
+ # `client.age_gate`: `ageGate.checkout` (Face workflows).
921
+ class AgeGate < Resource
922
+ # Age-gated Checkout: `POST /v1/age-gate/checkout`.
923
+ #
924
+ # Age and liveness together for an age-restricted sale: allowed only when old enough and live.
925
+ #
926
+ # Price: 0.25 credits per successful call.
927
+ #
928
+ # @param params [Hash] the request fields (AgeGateCheckoutParams), under the API's names
929
+ # @option params [String, Pathname, IO, VeriSec::Image] :selfie (required) Selfie. The image as base64
930
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
931
+ # @option params [Integer] :minAge Minimum age. (default 18; 0 to 120)
932
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
933
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
934
+ # @return [VeriSec::Types::AgeGateCheckout] the answer's `data`; `last_response` has the status,
935
+ # headers, request id, warnings and latency
936
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
937
+ # @raise [VeriSec::APIConnectionError] when no answer came back
938
+ def checkout(request_options: nil, **params)
939
+ _json(:post, "/v1/age-gate/checkout", params, Types::AgeGateCheckout, envelope: :data,
940
+ images: { fields: ["selfie"] }, request_options: request_options)
941
+ end
942
+ end
943
+
944
+ # `client.kiosk`: `kiosk.photo` (Face workflows).
945
+ class Kiosk < Resource
946
+ # Photo Kiosk: `POST /v1/kiosk/photo`.
947
+ #
948
+ # A passport/visa photo booth in one call: compliance against a standard, an auto-fixed version, and
949
+ # whether the fixed photo is ready to print.
950
+ #
951
+ # Price: 0.06 credits per successful call.
952
+ #
953
+ # @param params [Hash] the request fields (KioskPhotoParams), under the API's names
954
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Portrait. The image as base64
955
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
956
+ # @option params [String] :standard Standard. (one of "ICAO", "VisaSchengen", "VisaUSA", "Full"; default
957
+ # "ICAO")
958
+ # @option params [String] :aspect Shape. (one of "3:4", "4:5", "2:3", "1:1"; default "3:4")
959
+ # @option params [Array<Integer>] :backgroundColor Background. (default [255, 255, 255]; exactly 3
960
+ # items)
961
+ # @option params [String] :tag Tag. Any text you want echoed back in the response.
962
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
963
+ # @return [VeriSec::Types::KioskPhoto] the answer's `data`; `last_response` has the status, headers,
964
+ # request id, warnings and latency
965
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
966
+ # @raise [VeriSec::APIConnectionError] when no answer came back
967
+ def photo(request_options: nil, **params)
968
+ _json(:post, "/v1/kiosk/photo", params, Types::KioskPhoto, envelope: :data,
969
+ images: { fields: ["image"] }, request_options: request_options)
970
+ end
971
+ end
972
+
973
+ # `client.documents`: `documents.read`, `documents.classify`, `documents.mrz`, `documents.portrait`,
974
+ # `documents.authenticity`, `documents.fields` (Document).
975
+ class Documents < Resource
976
+ # Document Read: `POST /v1/idv/read`.
977
+ #
978
+ # The full read of an ID document. Returns every container the reader produced, type, printed and MRZ
979
+ # fields, portrait, security and image-quality checks, under data.ContainerList. An optional hint says
980
+ # whether the document matches what you expected.
981
+ #
982
+ # Price: 0.35 credits per successful call.
983
+ #
984
+ # @param params [Hash] the request fields (DocumentReadParams), under the API's names
985
+ # @option params [String, Pathname, IO, VeriSec::Image] :image_front (required) Document front. The
986
+ # image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
987
+ # @option params [String, Pathname, IO, VeriSec::Image] :image_back Document back. The reverse side,
988
+ # when it carries data. The image as base64 (JPEG or PNG). The SDKs also take a file path or the file
989
+ # bytes.
990
+ # @option params [String] :scenario Scenario. (one of "FullProcess", "FullAuth", "Barcode", "Mrz";
991
+ # default "FullProcess")
992
+ # @option params [Hash] :doc_hint Keys: `country` [String] Expected country. ISO code, for example RW or
993
+ # RWA.; `type` [String] (one of "", "passport", "national_id", "driving_licence", "residence_permit";
994
+ # default "") Expected type.
995
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
996
+ # @return [VeriSec::Types::DocumentRead] the answer's `data`; `last_response` has the status, headers,
997
+ # request id, warnings and latency
998
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
999
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1000
+ def read(request_options: nil, **params)
1001
+ _json(:post, "/v1/idv/read", params, Types::DocumentRead, envelope: :data,
1002
+ images: { fields: ["image_front", "image_back"] }, request_options: request_options)
1003
+ end
1004
+
1005
+ # Document Classify: `POST /v1/idv/classify`.
1006
+ #
1007
+ # Just the identity of the document: its name, category, issuing country, year and a confidence.
1008
+ #
1009
+ # Price: 0.02 credits per successful call.
1010
+ #
1011
+ # @param params [Hash] the request fields (DocumentClassifyParams), under the API's names
1012
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Document. The image as base64
1013
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
1014
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1015
+ # @return [VeriSec::Types::DocumentClassify] the answer's `data`; `last_response` has the status,
1016
+ # headers, request id, warnings and latency
1017
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1018
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1019
+ def classify(request_options: nil, **params)
1020
+ _json(:post, "/v1/idv/classify", params, Types::DocumentClassify, envelope: :data,
1021
+ images: { fields: ["image"] }, request_options: request_options)
1022
+ end
1023
+
1024
+ # Document MRZ: `POST /v1/idv/mrz`.
1025
+ #
1026
+ # The MRZ read from the document: the raw lines, the parsed fields, and every check digit recomputed
1027
+ # under ICAO 9303 (the same rule for every country).
1028
+ #
1029
+ # Price: 0.06 credits per successful call.
1030
+ #
1031
+ # @param params [Hash] the request fields (DocumentMrzParams), under the API's names
1032
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Document page with the MRZ.
1033
+ # The image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
1034
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1035
+ # @return [VeriSec::Types::DocumentMrz] the answer's `data`; `last_response` has the status, headers,
1036
+ # request id, warnings and latency
1037
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1038
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1039
+ def mrz(request_options: nil, **params)
1040
+ _json(:post, "/v1/idv/mrz", params, Types::DocumentMrz, envelope: :data,
1041
+ images: { fields: ["image"] }, request_options: request_options)
1042
+ end
1043
+
1044
+ # Document Portrait: `POST /v1/idv/portrait`.
1045
+ #
1046
+ # The portrait cut from the document, and a one-time reference you can pass straight to Face Verify or
1047
+ # Face Match as image1.
1048
+ #
1049
+ # Price: 0.02 credits per successful call.
1050
+ #
1051
+ # @param params [Hash] the request fields (DocumentPortraitParams), under the API's names
1052
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Document. The image as base64
1053
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
1054
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1055
+ # @return [VeriSec::Types::DocumentPortrait] the answer's `data`; `last_response` has the status,
1056
+ # headers, request id, warnings and latency
1057
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1058
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1059
+ def portrait(request_options: nil, **params)
1060
+ _json(:post, "/v1/idv/portrait", params, Types::DocumentPortrait, envelope: :data,
1061
+ images: { fields: ["image"] }, request_options: request_options)
1062
+ end
1063
+
1064
+ # Document Authenticity: `POST /v1/idv/authenticity`.
1065
+ #
1066
+ # The document's checks and the capture's image quality. Each item is pass, fail or not_checked, with
1067
+ # one overall verdict.
1068
+ #
1069
+ # Price: 0.25 credits per successful call.
1070
+ #
1071
+ # @param params [Hash] the request fields (DocumentAuthenticityParams), under the API's names
1072
+ # @option params [String, Pathname, IO, VeriSec::Image] :image_front (required) Document front. The
1073
+ # image as base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
1074
+ # @option params [String, Pathname, IO, VeriSec::Image] :image_back Document back. The image as base64
1075
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
1076
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1077
+ # @return [VeriSec::Types::DocumentAuthenticity] the answer's `data`; `last_response` has the status,
1078
+ # headers, request id, warnings and latency
1079
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1080
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1081
+ def authenticity(request_options: nil, **params)
1082
+ _json(:post, "/v1/idv/authenticity", params, Types::DocumentAuthenticity, envelope: :data,
1083
+ images: { fields: ["image_front", "image_back"] }, request_options: request_options)
1084
+ end
1085
+
1086
+ # Document Fields: `POST /v1/idv/fields`.
1087
+ #
1088
+ # Which fields were read, from which sources, whether each is valid, and whether the sources agree.
1089
+ # Values are masked, so it is safe to log.
1090
+ #
1091
+ # Price: 0.02 credits per successful call.
1092
+ #
1093
+ # @param params [Hash] the request fields (DocumentFieldsParams), under the API's names
1094
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Document. The image as base64
1095
+ # (JPEG or PNG). The SDKs also take a file path or the file bytes.
1096
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1097
+ # @return [VeriSec::Types::DocumentFields] the answer's `data`; `last_response` has the status, headers,
1098
+ # request id, warnings and latency
1099
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1100
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1101
+ def fields(request_options: nil, **params)
1102
+ _json(:post, "/v1/idv/fields", params, Types::DocumentFields, envelope: :data,
1103
+ images: { fields: ["image"] }, request_options: request_options)
1104
+ end
1105
+ end
1106
+
1107
+ # `client.proof_of_address`: `proofOfAddress.analyze` (Document).
1108
+ class ProofOfAddress < Resource
1109
+ # Proof of Address: `POST /v1/poa/analyze`.
1110
+ #
1111
+ # Reads a proof-of-address document (utility bill, bank statement, letter) and checks it against the
1112
+ # name, address and country you expect, with a recency and integrity check.
1113
+ #
1114
+ # Price: 0.4 credits per successful call.
1115
+ #
1116
+ # @param params [Hash] the request fields (ProofOfAddressAnalyzeParams), under the API's names
1117
+ # @option params [String] :document_token (required) Address document. Encrypted in your browser; the
1118
+ # API takes the token of the stored document. A document token from the vault. (passed as it is)
1119
+ # @option params [String] :filename File name.
1120
+ # @option params [Hash] :expected Keys: `name` [String] Expected name.; `address` [String] Expected
1121
+ # address.; `country` [String] Expected country. ISO alpha-2, for example RW.
1122
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1123
+ # @return [VeriSec::Types::ProofOfAddressAnalyze] the answer's `data`; `last_response` has the status,
1124
+ # headers, request id, warnings and latency
1125
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1126
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1127
+ def analyze(request_options: nil, **params)
1128
+ _json(:post, "/v1/poa/analyze", params, Types::ProofOfAddressAnalyze, envelope: :data,
1129
+ request_options: request_options)
1130
+ end
1131
+ end
1132
+
1133
+ # `client.mrz`: `mrz.read`, `mrz.recognize`, `mrz.parse` (MRZ).
1134
+ class Mrz < Resource
1135
+ # MRZ Read: `POST /v1/mrz/read`.
1136
+ #
1137
+ # Finds the MRZ in an image, reads it, parses every field, and validates every check digit under ICAO
1138
+ # 9303.
1139
+ #
1140
+ # Price: 0.01 credits per successful call.
1141
+ #
1142
+ # @param params [Hash] the request fields (MrzReadParams), under the API's names
1143
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Document image. The image as
1144
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
1145
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1146
+ # @return [VeriSec::Types::MrzRead] the answer's `data`; `last_response` has the status, headers,
1147
+ # request id, warnings and latency
1148
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1149
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1150
+ def read(request_options: nil, **params)
1151
+ _json(:post, "/v1/mrz/read", params, Types::MrzRead, envelope: :data, images: { fields: ["image"] },
1152
+ request_options: request_options)
1153
+ end
1154
+
1155
+ # MRZ Recognize: `POST /v1/mrz/recognize`.
1156
+ #
1157
+ # Only the MRZ lines, where they are, and how confident the read is. No parsing.
1158
+ #
1159
+ # Price: 0.01 credits per successful call.
1160
+ #
1161
+ # @param params [Hash] the request fields (MrzRecognizeParams), under the API's names
1162
+ # @option params [String, Pathname, IO, VeriSec::Image] :image (required) Document image. The image as
1163
+ # base64 (JPEG or PNG). The SDKs also take a file path or the file bytes.
1164
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1165
+ # @return [VeriSec::Types::MrzRecognize] the answer's `data`; `last_response` has the status, headers,
1166
+ # request id, warnings and latency
1167
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1168
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1169
+ def recognize(request_options: nil, **params)
1170
+ _json(:post, "/v1/mrz/recognize", params, Types::MrzRecognize, envelope: :data,
1171
+ images: { fields: ["image"] }, request_options: request_options)
1172
+ end
1173
+
1174
+ # MRZ Parse: `POST /v1/mrz/parse`.
1175
+ #
1176
+ # Parses MRZ lines you already have (no image): every field, every check digit recomputed, and a check
1177
+ # that the dates are real.
1178
+ #
1179
+ # Price: 0.002 credits per successful call.
1180
+ #
1181
+ # @param params [Hash] the request fields (MrzParseParams), under the API's names
1182
+ # @option params [Array<String>] :lines (required) MRZ lines. An ID card has 3 lines of 30 characters, a
1183
+ # passport 2 lines of 44.
1184
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1185
+ # @return [VeriSec::Types::MrzParse] the answer's `data`; `last_response` has the status, headers,
1186
+ # request id, warnings and latency
1187
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1188
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1189
+ def parse(request_options: nil, **params)
1190
+ _json(:post, "/v1/mrz/parse", params, Types::MrzParse, envelope: :data,
1191
+ request_options: request_options)
1192
+ end
1193
+ end
1194
+
1195
+ # `client.email`: `email.verify`, `email.footprint` (Contact & risk).
1196
+ class Email < Resource
1197
+ # Email Risk: `POST /v1/email/verify`.
1198
+ #
1199
+ # Whether an address can receive mail and whether the mailbox exists, flagging temporary inboxes and
1200
+ # typos, with a risk level and the reasons behind it.
1201
+ #
1202
+ # Price: 0.05 credits per successful call.
1203
+ #
1204
+ # @param params [Hash] the request fields (EmailVerifyParams), under the API's names
1205
+ # @option params [String] :email (required) Email.
1206
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1207
+ # @return [VeriSec::Types::EmailVerify] the answer's `data`; `last_response` has the status, headers,
1208
+ # request id, warnings and latency
1209
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1210
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1211
+ def verify(request_options: nil, **params)
1212
+ _json(:post, "/v1/email/verify", params, Types::EmailVerify, envelope: :data,
1213
+ request_options: request_options)
1214
+ end
1215
+
1216
+ # Email Accounts: `POST /v1/email/footprint`.
1217
+ #
1218
+ # The sites where an email address has an account, found through each site's sign-up and recovery forms.
1219
+ #
1220
+ # Price: 0.1 credits per successful call.
1221
+ #
1222
+ # @param params [Hash] the request fields (EmailFootprintParams), under the API's names
1223
+ # @option params [String] :email (required) Email.
1224
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1225
+ # @return [VeriSec::Types::EmailFootprint] the answer's `data`; `last_response` has the status, headers,
1226
+ # request id, warnings and latency
1227
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1228
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1229
+ def footprint(request_options: nil, **params)
1230
+ _json(:post, "/v1/email/footprint", params, Types::EmailFootprint, envelope: :data,
1231
+ request_options: request_options)
1232
+ end
1233
+ end
1234
+
1235
+ # `client.osint`: `osint.username`, `osint.web` (Contact & risk).
1236
+ class Osint < Resource
1237
+ # Username Search: `POST /v1/osint/username`.
1238
+ #
1239
+ # Public profiles that use a username, across hundreds of sites. Profiles whose page does not actually
1240
+ # contain the name are dropped.
1241
+ #
1242
+ # Price: 0.1 credits per successful call.
1243
+ #
1244
+ # @param params [Hash] the request fields (OsintUsernameParams), under the API's names
1245
+ # @option params [String] :username (required) Username.
1246
+ # @option params [Integer] :top Sites to check. The most visited sites first. (default 150; 10 to 500)
1247
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1248
+ # @return [VeriSec::Types::OsintUsername] the answer's `data`; `last_response` has the status, headers,
1249
+ # request id, warnings and latency
1250
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1251
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1252
+ def username(request_options: nil, **params)
1253
+ _json(:post, "/v1/osint/username", params, Types::OsintUsername, envelope: :data,
1254
+ request_options: request_options)
1255
+ end
1256
+
1257
+ # Adverse Media: `POST /v1/osint/web`.
1258
+ #
1259
+ # Web pages that name a person or company, filtered to adverse news by default and tagged with risk
1260
+ # topics.
1261
+ #
1262
+ # Price: 0.1 credits per successful call.
1263
+ #
1264
+ # @param params [Hash] the request fields (OsintWebParams), under the API's names
1265
+ # @option params [String] :query (required) Name.
1266
+ # @option params [String] :mode Show. (one of "aml", "all"; default "aml")
1267
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1268
+ # @return [VeriSec::Types::OsintWeb] the answer's `data`; `last_response` has the status, headers,
1269
+ # request id, warnings and latency
1270
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1271
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1272
+ def web(request_options: nil, **params)
1273
+ _json(:post, "/v1/osint/web", params, Types::OsintWeb, envelope: :data,
1274
+ request_options: request_options)
1275
+ end
1276
+ end
1277
+
1278
+ # `client.phone`: `phone.lookup`, `phone.otp.send`, `phone.otp.check` (Contact & risk).
1279
+ class Phone < Resource
1280
+ # @return [VeriSec::Resources::PhoneOtp]
1281
+ attr_reader :otp
1282
+
1283
+ # @api private
1284
+ def initialize(transport)
1285
+ super
1286
+ @otp = PhoneOtp.new(transport)
1287
+ end
1288
+
1289
+ # Phone Intelligence: `POST /v1/phone/lookup`.
1290
+ #
1291
+ # Whether a number is valid and live, with its format, country, line type, carrier, SMS pumping risk,
1292
+ # SIM swap and forwarding, and a risk level. With a name, the carrier is also asked whether the number
1293
+ # belongs to that person.
1294
+ #
1295
+ # Price: 0.08 credits per successful call.
1296
+ #
1297
+ # @param params [Hash] the request fields (PhoneLookupParams), under the API's names
1298
+ # @option params [String] :phone (required) Phone. With its country code, for example +250788123456.
1299
+ # @option params [String] :first_name First name. With a name, the carrier is asked whether it belongs
1300
+ # to that person (some countries only).
1301
+ # @option params [String] :last_name Last name.
1302
+ # @option params [String] :date_of_birth Date of birth. YYYY-MM-DD.
1303
+ # @option params [String] :country Country. ISO alpha-2, for example RW.
1304
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1305
+ # @return [VeriSec::Types::PhoneLookup] the answer's `data`; `last_response` has the status, headers,
1306
+ # request id, warnings and latency
1307
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1308
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1309
+ def lookup(request_options: nil, **params)
1310
+ _json(:post, "/v1/phone/lookup", params, Types::PhoneLookup, envelope: :data,
1311
+ request_options: request_options)
1312
+ end
1313
+ end
1314
+
1315
+ # `client.phone.otp`: `phone.otp.send`, `phone.otp.check` (Contact & risk).
1316
+ class PhoneOtp < Resource
1317
+ # Send Phone Code: `POST /v1/phone/otp/send`.
1318
+ #
1319
+ # Sends a one-time code by SMS to prove the person holds the number.
1320
+ #
1321
+ # Price: 0.08 credits per successful call.
1322
+ #
1323
+ # @param params [Hash] the request fields (PhoneOtpSendParams), under the API's names
1324
+ # @option params [String] :phone (required) Phone. A real SMS is sent to this number.
1325
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1326
+ # @return [VeriSec::Types::PhoneOtpSend] the answer's `data`; `last_response` has the status, headers,
1327
+ # request id, warnings and latency
1328
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1329
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1330
+ def send(request_options: nil, **params)
1331
+ _json(:post, "/v1/phone/otp/send", params, Types::PhoneOtpSend, envelope: :data,
1332
+ request_options: request_options)
1333
+ end
1334
+
1335
+ # Check Phone Code: `POST /v1/phone/otp/check`.
1336
+ #
1337
+ # Checks the code the person entered against the one that was sent.
1338
+ #
1339
+ # Free: not charged.
1340
+ #
1341
+ # @param params [Hash] the request fields (PhoneOtpCheckParams), under the API's names
1342
+ # @option params [String] :phone (required) Phone.
1343
+ # @option params [String] :code (required) Code.
1344
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1345
+ # @return [VeriSec::Types::PhoneOtpCheck] the answer's `data`; `last_response` has the status, headers,
1346
+ # request id, warnings and latency
1347
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1348
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1349
+ def check(request_options: nil, **params)
1350
+ _json(:post, "/v1/phone/otp/check", params, Types::PhoneOtpCheck, envelope: :data,
1351
+ request_options: request_options)
1352
+ end
1353
+ end
1354
+
1355
+ # `client.screening`: `screening.ip`, `screening.sanctions`, `screening.crypto` (Contact & risk).
1356
+ class Screening < Resource
1357
+ # IP Risk: `POST /v1/screen/ip`.
1358
+ #
1359
+ # Where an IP address is, who runs it, whether it hides the user (VPN, proxy, Tor, data centre), its
1360
+ # abuse reports, and a risk level with reasons.
1361
+ #
1362
+ # Price: 0.06 credits per successful call.
1363
+ #
1364
+ # @param params [Hash] the request fields (ScreeningIpParams), under the API's names
1365
+ # @option params [String] :ip (required) IP address. IPv4 or IPv6.
1366
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1367
+ # @return [VeriSec::Types::ScreeningIp] the answer's `data`; `last_response` has the status, headers,
1368
+ # request id, warnings and latency
1369
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1370
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1371
+ def ip(request_options: nil, **params)
1372
+ _json(:post, "/v1/screen/ip", params, Types::ScreeningIp, envelope: :data,
1373
+ request_options: request_options)
1374
+ end
1375
+
1376
+ # Sanctions & PEP Screening: `POST /v1/screen/sanctions`.
1377
+ #
1378
+ # Screens a person or company against sanctions, politically exposed person and crime lists. Every
1379
+ # detail you give, name, date of birth, nationality, ID number, is scored together, and each result
1380
+ # explains why it matched.
1381
+ #
1382
+ # Price: 0.8 credits per successful call.
1383
+ #
1384
+ # @param params [Hash] the request fields (ScreeningSanctionsParams), under the API's names
1385
+ # @option params [String] :name (required) Name.
1386
+ # @option params [String] :schema Type. (one of "Person", "Company", "Organization", "LegalEntity";
1387
+ # default "Person")
1388
+ # @option params [String] :birth_date Date of birth. YYYY, YYYY-MM or YYYY-MM-DD. People only.
1389
+ # @option params [Array<String>] :countries Countries. Up to 5 ISO alpha-2 codes (nationality for a
1390
+ # person, country for a company).
1391
+ # @option params [Array<String>] :id_numbers ID numbers. Up to 5: passport, national ID, tax or
1392
+ # registration numbers.
1393
+ # @option params [Integer] :limit Results. (default 10; 1 to 50)
1394
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1395
+ # @return [VeriSec::Types::ScreeningSanctions] the answer's `data`; `last_response` has the status,
1396
+ # headers, request id, warnings and latency
1397
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1398
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1399
+ def sanctions(request_options: nil, **params)
1400
+ _json(:post, "/v1/screen/sanctions", params, Types::ScreeningSanctions, envelope: :data,
1401
+ request_options: request_options)
1402
+ end
1403
+
1404
+ # Wallet Screening: `POST /v1/screen/crypto`.
1405
+ #
1406
+ # A verdict and a risk level for up to 100 wallet addresses, on any supported network, from sanctions
1407
+ # and illicit-activity data.
1408
+ #
1409
+ # Price: 0.1 credits per successful call.
1410
+ #
1411
+ # @param params [Hash] the request fields (ScreeningCryptoParams), under the API's names
1412
+ # @option params [Array<String>] :addresses (required) Wallet addresses. One per line, up to 100.
1413
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1414
+ # @return [VeriSec::Types::ScreeningCrypto] the answer's `data`; `last_response` has the status,
1415
+ # headers, request id, warnings and latency
1416
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1417
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1418
+ def crypto(request_options: nil, **params)
1419
+ _json(:post, "/v1/screen/crypto", params, Types::ScreeningCrypto, envelope: :data,
1420
+ request_options: request_options)
1421
+ end
1422
+ end
1423
+
1424
+ # `client.ip`: `ip.analyze` (Contact & risk).
1425
+ class Ip < Resource
1426
+ # IP Anonymity: `POST /v1/ip/analyze`.
1427
+ #
1428
+ # The fast answer from the platform's own lists only: Tor, VPN, data centre, cloud, private relay,
1429
+ # blocklist and the network owner. No outside call, so it is quick.
1430
+ #
1431
+ # Price: 0.06 credits per successful call.
1432
+ #
1433
+ # @param params [Hash] the request fields (IpAnalyzeParams), under the API's names
1434
+ # @option params [String] :ip (required) IP address. IPv4 or IPv6.
1435
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1436
+ # @return [VeriSec::Types::IpAnalyze] the answer's `data`; `last_response` has the status, headers,
1437
+ # request id, warnings and latency
1438
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1439
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1440
+ def analyze(request_options: nil, **params)
1441
+ _json(:post, "/v1/ip/analyze", params, Types::IpAnalyze, envelope: :data,
1442
+ request_options: request_options)
1443
+ end
1444
+ end
1445
+
1446
+ # `client.contact`: `contact.dossier` (Contact & risk).
1447
+ class Contact < Resource
1448
+ # Contact Dossier: `POST /v1/verify/contact`.
1449
+ #
1450
+ # Everything in one call: email, phone, IP, sanctions screening and wallet, each part in exactly the
1451
+ # same shape as its own API. The slower checks (accounts, username, adverse media) are opt-in.
1452
+ #
1453
+ # Price: 1.39 credits per successful call.
1454
+ #
1455
+ # @param params [Hash] the request fields (ContactDossierParams), under the API's names
1456
+ # @option params [String] :email Email.
1457
+ # @option params [String] :phone Phone. With its country code.
1458
+ # @option params [String] :name Name.
1459
+ # @option params [String] :dob Date of birth. YYYY-MM-DD.
1460
+ # @option params [String] :country Country. ISO alpha-2.
1461
+ # @option params [String] :ip IP address.
1462
+ # @option params [String] :wallet Wallet address.
1463
+ # @option params [Array<String>] :include Slower checks. Each adds up to a few minutes. (default [])
1464
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1465
+ # @return [VeriSec::Types::ContactDossier] the answer's `data`; `last_response` has the status, headers,
1466
+ # request id, warnings and latency
1467
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1468
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1469
+ def dossier(request_options: nil, **params)
1470
+ _json(:post, "/v1/verify/contact", params, Types::ContactDossier, envelope: :data,
1471
+ request_options: request_options)
1472
+ end
1473
+ end
1474
+
1475
+ # `client.cheques`: `cheques.read`, `cheques.micr`, `cheques.micrLine`, `cheques.amount`, `cheques.date`,
1476
+ # `cheques.parties`, `cheques.bank` (Cheques).
1477
+ class Cheques < Resource
1478
+ # Read a whole cheque: `POST /v2/cheques/read`.
1479
+ #
1480
+ # Reads everything on a cheque in one call: the MICR line with its named fields, what is written on the
1481
+ # face (payee, amount in figures and words, date, drawer, bank, crossing, signature), the bank matched
1482
+ # in the directory, and the country and currency. A photo with several cheques returns each in
1483
+ # `cheques`. The read and the photo are kept in the scan history.
1484
+ #
1485
+ # Price: 0.05 credits per successful call.
1486
+ #
1487
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1488
+ # "SDK").
1489
+ #
1490
+ # @param params [Hash] the form fields (ChequeReadParams), under the API's names
1491
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1492
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1493
+ # @option params [String] :format The MICR font. `auto` finds it. (one of "auto", "e13b", "cmc7";
1494
+ # default "auto")
1495
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1496
+ # @return [VeriSec::Types::ChequeDeepRead] the answer; `last_response` has the status, headers, request
1497
+ # id
1498
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1499
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1500
+ def read(request_options: nil, **params)
1501
+ _upload(:post, "/v2/cheques/read", params, Types::ChequeDeepRead, operation: "cheques.read",
1502
+ envelope: :object, request_options: request_options)
1503
+ end
1504
+
1505
+ # Read a cheque's MICR line: `POST /v2/cheques/micr`.
1506
+ #
1507
+ # Finds and reads every MICR code line on a cheque (E-13B or CMC-7) and names its fields: the layout
1508
+ # template for the layout, a national standard when one applies (Canada, India), and the US
1509
+ # routing-number proof. The read and the photo are kept in the scan history.
1510
+ #
1511
+ # Price: 0.02 credits per successful call.
1512
+ #
1513
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1514
+ # "SDK").
1515
+ #
1516
+ # @param params [Hash] the form fields (ChequeMicrParams), under the API's names
1517
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1518
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1519
+ # @option params [String] :format The MICR font. `auto` finds it. (one of "auto", "e13b", "cmc7";
1520
+ # default "auto")
1521
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1522
+ # @return [VeriSec::Types::ChequeResponse] the answer; `last_response` has the status, headers, request
1523
+ # id
1524
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1525
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1526
+ def micr(request_options: nil, **params)
1527
+ _upload(:post, "/v2/cheques/micr", params, Types::ChequeResponse, operation: "cheques.micr",
1528
+ envelope: :object, request_options: request_options)
1529
+ end
1530
+
1531
+ # Read just the MICR line: `POST /v2/cheques/micr-line`.
1532
+ #
1533
+ # Reads the strongest MICR line with the same engine and naming as the full reads and returns a small
1534
+ # response: the line, its named fields, its layout and confidence. Nothing is stored.
1535
+ #
1536
+ # Price: 0.02 credits per successful call.
1537
+ #
1538
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1539
+ # "SDK").
1540
+ #
1541
+ # @param params [Hash] the form fields (ChequeMicrLineParams), under the API's names
1542
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1543
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1544
+ # @option params [String] :format The MICR font. `auto` finds it. (one of "auto", "e13b", "cmc7";
1545
+ # default "auto")
1546
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1547
+ # @return [VeriSec::Types::MicrLine] the answer; `last_response` has the status, headers, request id
1548
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1549
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1550
+ def micr_line(request_options: nil, **params)
1551
+ _upload(:post, "/v2/cheques/micr-line", params, Types::MicrLine, operation: "cheques.micrLine",
1552
+ envelope: :object, request_options: request_options)
1553
+ end
1554
+
1555
+ # Read a cheque's amount: `POST /v2/cheques/amount`.
1556
+ #
1557
+ # Reads the amount in figures and in words, turns it into a number, says whether the two agree, and
1558
+ # resolves the currency. Nothing is stored.
1559
+ #
1560
+ # Price: 0.02 credits per successful call.
1561
+ #
1562
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1563
+ # "SDK").
1564
+ #
1565
+ # @param params [Hash] the form fields (ChequeAmountParams), under the API's names
1566
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1567
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1568
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1569
+ # @return [VeriSec::Types::ChequeAmount] the answer; `last_response` has the status, headers, request id
1570
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1571
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1572
+ def amount(request_options: nil, **params)
1573
+ _upload(:post, "/v2/cheques/amount", params, Types::ChequeAmount, operation: "cheques.amount",
1574
+ envelope: :object, request_options: request_options)
1575
+ end
1576
+
1577
+ # Read a cheque's date: `POST /v2/cheques/date`.
1578
+ #
1579
+ # Reads the cheque's date as written and as YYYY-MM-DD, with its age in days (negative when post-dated).
1580
+ # Nothing is stored.
1581
+ #
1582
+ # Price: 0.02 credits per successful call.
1583
+ #
1584
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1585
+ # "SDK").
1586
+ #
1587
+ # @param params [Hash] the form fields (ChequeDateParams), under the API's names
1588
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1589
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1590
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1591
+ # @return [VeriSec::Types::ChequeDate] the answer; `last_response` has the status, headers, request id
1592
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1593
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1594
+ def date(request_options: nil, **params)
1595
+ _upload(:post, "/v2/cheques/date", params, Types::ChequeDate, operation: "cheques.date",
1596
+ envelope: :object, request_options: request_options)
1597
+ end
1598
+
1599
+ # Read a cheque's payee and drawer: `POST /v2/cheques/parties`.
1600
+ #
1601
+ # Reads who the cheque is paid to (the name after Pay) and whose account pays it (the account holder
1602
+ # printed on the cheque). Nothing is stored.
1603
+ #
1604
+ # Price: 0.02 credits per successful call.
1605
+ #
1606
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1607
+ # "SDK").
1608
+ #
1609
+ # @param params [Hash] the form fields (ChequePartiesParams), under the API's names
1610
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1611
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1612
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1613
+ # @return [VeriSec::Types::ChequeParties] the answer; `last_response` has the status, headers, request
1614
+ # id
1615
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1616
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1617
+ def parties(request_options: nil, **params)
1618
+ _upload(:post, "/v2/cheques/parties", params, Types::ChequeParties, operation: "cheques.parties",
1619
+ envelope: :object, request_options: request_options)
1620
+ end
1621
+
1622
+ # Read a cheque's bank: `POST /v2/cheques/bank`.
1623
+ #
1624
+ # Reads the bank printed on the cheque and matches it in the directory of about 75,000 banks. A bank not
1625
+ # in the directory is never forced onto another: `bank` is left out. Nothing is stored.
1626
+ #
1627
+ # Price: 0.02 credits per successful call.
1628
+ #
1629
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1630
+ # "SDK").
1631
+ #
1632
+ # @param params [Hash] the form fields (ChequeBankParams), under the API's names
1633
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The cheque photo: JPG, PNG
1634
+ # or BMP, up to 10 MB. Read exactly as uploaded, never resized.
1635
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1636
+ # @return [VeriSec::Types::ChequeBank] the answer; `last_response` has the status, headers, request id
1637
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1638
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1639
+ def bank(request_options: nil, **params)
1640
+ _upload(:post, "/v2/cheques/bank", params, Types::ChequeBank, operation: "cheques.bank",
1641
+ envelope: :object, request_options: request_options)
1642
+ end
1643
+ end
1644
+
1645
+ # `client.banks`: `banks.lookup` (Banks).
1646
+ class Banks < Resource
1647
+ # Look up a bank: `GET /v2/banks`.
1648
+ #
1649
+ # Finds a bank in the directory by BIC, or by name (best with the country). Trust `bank` when `verified`
1650
+ # is true; otherwise look at `alternatives`. Send `name` or `bic`; neither answers `400 missing_query`.
1651
+ #
1652
+ # Price: 0.002 credits per successful call.
1653
+ #
1654
+ # @param params [Hash] the query parameters (BankLookupParams)
1655
+ # @option params [String] :name The bank's name, as you have it.
1656
+ # @option params [String] :country ISO 3166-1 alpha-2. Narrows a name search.
1657
+ # @option params [String] :bic BIC / SWIFT code, 8 or 11 characters. When given, the name is not needed.
1658
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1659
+ # @return [VeriSec::Types::BankLookup] the answer; `last_response` has the status, headers, request id
1660
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1661
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1662
+ def lookup(request_options: nil, **params)
1663
+ _call(:get, "/v2/banks", Types::BankLookup, query: params, envelope: :object,
1664
+ request_options: request_options)
1665
+ end
1666
+ end
1667
+
1668
+ # `client.cards`: `cards.read`, `cards.number`, `cards.expiry`, `cards.check`, `cards.fingerprint`
1669
+ # (Cards).
1670
+ class Cards < Resource
1671
+ # Read a payment card: `POST /v2/cards/read`.
1672
+ #
1673
+ # Reads every card in a photo: number, expiry and holder with their confidences, the checks (Luhn,
1674
+ # length for the network, expiry), the BIN record and the issuer in the bank directory. The full number
1675
+ # is in this response only; the stored copy keeps the first six and last four digits, and the photo is
1676
+ # never stored.
1677
+ #
1678
+ # Price: 0.03 credits per successful call.
1679
+ #
1680
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1681
+ # "SDK").
1682
+ #
1683
+ # @param params [Hash] the form fields (CardReadParams), under the API's names
1684
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The card photo: JPG, PNG
1685
+ # or BMP, up to 10 MB. The photo is never stored.
1686
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1687
+ # @return [VeriSec::Types::CardResponse] the answer; `last_response` has the status, headers, request id
1688
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1689
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1690
+ def read(request_options: nil, **params)
1691
+ _upload(:post, "/v2/cards/read", params, Types::CardResponse, operation: "cards.read",
1692
+ envelope: :object, request_options: request_options)
1693
+ end
1694
+
1695
+ # Read a card number: `POST /v2/cards/number`.
1696
+ #
1697
+ # Reads the card number from a photo, with its network and checks. Nothing is stored.
1698
+ #
1699
+ # Price: 0.02 credits per successful call.
1700
+ #
1701
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1702
+ # "SDK").
1703
+ #
1704
+ # @param params [Hash] the form fields (CardNumberParams), under the API's names
1705
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The card photo: JPG, PNG
1706
+ # or BMP, up to 10 MB. The photo is never stored.
1707
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1708
+ # @return [VeriSec::Types::CardNumber] the answer; `last_response` has the status, headers, request id
1709
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1710
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1711
+ def number(request_options: nil, **params)
1712
+ _upload(:post, "/v2/cards/number", params, Types::CardNumber, operation: "cards.number",
1713
+ envelope: :object, request_options: request_options)
1714
+ end
1715
+
1716
+ # Read a card's expiry date: `POST /v2/cards/expiry`.
1717
+ #
1718
+ # Reads the expiry date from a card photo and works out whether the card has expired and how many days
1719
+ # it has left. Nothing is stored.
1720
+ #
1721
+ # Price: 0.02 credits per successful call.
1722
+ #
1723
+ # Sends the image as multipart/form-data with `X-VeriSec-Source: sdk` (the console files the scan under
1724
+ # "SDK").
1725
+ #
1726
+ # @param params [Hash] the form fields (CardExpiryParams), under the API's names
1727
+ # @option params [String, Pathname, IO, VeriSec::FileInput] :image (required) The card photo: JPG, PNG
1728
+ # or BMP, up to 10 MB. The photo is never stored.
1729
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1730
+ # @return [VeriSec::Types::CardExpiry] the answer; `last_response` has the status, headers, request id
1731
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1732
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1733
+ def expiry(request_options: nil, **params)
1734
+ _upload(:post, "/v2/cards/expiry", params, Types::CardExpiry, operation: "cards.expiry",
1735
+ envelope: :object, request_options: request_options)
1736
+ end
1737
+
1738
+ # Check a card number: `POST /v2/cards/check`.
1739
+ #
1740
+ # Checks a typed card number, for example from a checkout form: the Luhn checksum, a length that fits
1741
+ # the network, the expiry when sent, and the BIN record. Accept the card when `scheme_valid` is true and
1742
+ # `expired` is not. Only the first six and last four digits come back; nothing is stored.
1743
+ #
1744
+ # Price: 0.002 credits per successful call.
1745
+ #
1746
+ # @param params [Hash] the request fields (CardCheckParams), under the API's names
1747
+ # @option params [String] :number (required) 12 to 19 digits; spaces are ignored. Never stored.
1748
+ # @option params [String] :expiry MM/YY.
1749
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1750
+ # @return [VeriSec::Types::CardCheck] the answer; `last_response` has the status, headers, request id
1751
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1752
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1753
+ def check(request_options: nil, **params)
1754
+ _json(:post, "/v2/cards/check", params, Types::CardCheck, envelope: :object,
1755
+ request_options: request_options)
1756
+ end
1757
+
1758
+ # Fingerprint a card number: `POST /v2/cards/fingerprint`.
1759
+ #
1760
+ # Turns a card number into a fingerprint: always the same for the same card, and impossible to turn back
1761
+ # into the number. Store it to recognise a card you have seen before; a card read from a photo carries
1762
+ # the same fingerprint.
1763
+ #
1764
+ # Price: 0.002 credits per successful call.
1765
+ #
1766
+ # @param params [Hash] the request fields (CardFingerprintParams), under the API's names
1767
+ # @option params [String] :number (required) 12 to 19 digits; spaces are ignored. Never stored.
1768
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1769
+ # @return [VeriSec::Types::CardFingerprint] the answer; `last_response` has the status, headers, request
1770
+ # id
1771
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1772
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1773
+ def fingerprint(request_options: nil, **params)
1774
+ _json(:post, "/v2/cards/fingerprint", params, Types::CardFingerprint, envelope: :object,
1775
+ request_options: request_options)
1776
+ end
1777
+ end
1778
+
1779
+ # `client.bin`: `bin.lookup` (BIN).
1780
+ class Bin < Resource
1781
+ # Look up a BIN: `GET /v2/bin/{digits}`.
1782
+ #
1783
+ # Looks up the first 6 to 8 digits of a card: network, type, level, funding, issuer, country with its
1784
+ # flag, currency, and the issuer's record in the bank directory. Fewer than 6 digits answer `400
1785
+ # bin_too_short`; a BIN not in the tables `404 bin_not_found`.
1786
+ #
1787
+ # Price: 0.002 credits per successful call.
1788
+ #
1789
+ # @param digits [String] The first 6 to 8 digits of the card number.
1790
+ # @param request_options [Hash, nil] `timeout:`, `max_retries:`, `headers:` for this call
1791
+ # @return [VeriSec::Types::BinRecord] the answer; `last_response` has the status, headers, request id
1792
+ # @raise [VeriSec::APIError] when the API refuses the call (see the subclasses)
1793
+ # @raise [VeriSec::APIConnectionError] when no answer came back
1794
+ def lookup(digits, request_options: nil)
1795
+ _call(:get, "/v2/bin/#{_segment(digits, "digits")}", Types::BinRecord, envelope: :object,
1796
+ request_options: request_options)
1797
+ end
1798
+ end
1799
+ end
1800
+ end