didit-sdk 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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +25 -0
- data/LICENSE +21 -0
- data/README.md +277 -0
- data/lib/didit/authentication/base64_url.rb +34 -0
- data/lib/didit/authentication/cache.rb +201 -0
- data/lib/didit/authentication/http.rb +150 -0
- data/lib/didit/authentication/issuer.rb +115 -0
- data/lib/didit/authentication/jws.rb +231 -0
- data/lib/didit/authentication/key_set.rb +89 -0
- data/lib/didit/authentication/pkce.rb +64 -0
- data/lib/didit/authentication/types.rb +175 -0
- data/lib/didit/authentication.rb +546 -0
- data/lib/didit/client.rb +211 -0
- data/lib/didit/errors.rb +153 -0
- data/lib/didit/file_part.rb +85 -0
- data/lib/didit/internal/config.rb +94 -0
- data/lib/didit/internal/errors.rb +83 -0
- data/lib/didit/internal/log.rb +41 -0
- data/lib/didit/internal/multipart.rb +60 -0
- data/lib/didit/internal/request.rb +322 -0
- data/lib/didit/internal/transport.rb +198 -0
- data/lib/didit/internal/util.rb +76 -0
- data/lib/didit/internal.rb +15 -0
- data/lib/didit/model.rb +199 -0
- data/lib/didit/page.rb +130 -0
- data/lib/didit/raw_response.rb +57 -0
- data/lib/didit/resource.rb +15 -0
- data/lib/didit/resources/account.rb +309 -0
- data/lib/didit/resources/address_validation.rb +73 -0
- data/lib/didit/resources/age_estimation.rb +110 -0
- data/lib/didit/resources/aml.rb +166 -0
- data/lib/didit/resources/aml_monitoring.rb +30 -0
- data/lib/didit/resources/analytics.rb +87 -0
- data/lib/didit/resources/bank.rb +65 -0
- data/lib/didit/resources/billing.rb +61 -0
- data/lib/didit/resources/biometric_templates.rb +234 -0
- data/lib/didit/resources/blocklist.rb +130 -0
- data/lib/didit/resources/business_sessions.rb +29 -0
- data/lib/didit/resources/businesses.rb +471 -0
- data/lib/didit/resources/cases.rb +2116 -0
- data/lib/didit/resources/customization.rb +153 -0
- data/lib/didit/resources/database_validation.rb +327 -0
- data/lib/didit/resources/document_ai.rb +145 -0
- data/lib/didit/resources/email.rb +254 -0
- data/lib/didit/resources/face_match.rb +103 -0
- data/lib/didit/resources/face_search.rb +103 -0
- data/lib/didit/resources/fraud_checks.rb +130 -0
- data/lib/didit/resources/id_verification.rb +163 -0
- data/lib/didit/resources/id_wallets.rb +1468 -0
- data/lib/didit/resources/investigator.rb +419 -0
- data/lib/didit/resources/ip.rb +68 -0
- data/lib/didit/resources/kyb.rb +256 -0
- data/lib/didit/resources/lists.rb +332 -0
- data/lib/didit/resources/monitoring_events.rb +466 -0
- data/lib/didit/resources/networks.rb +427 -0
- data/lib/didit/resources/passive_liveness.rb +103 -0
- data/lib/didit/resources/phone.rb +271 -0
- data/lib/didit/resources/pricing.rb +40 -0
- data/lib/didit/resources/proof_of_address.rb +167 -0
- data/lib/didit/resources/questionnaires.rb +170 -0
- data/lib/didit/resources/regulatory_reports.rb +314 -0
- data/lib/didit/resources/report_templates.rb +146 -0
- data/lib/didit/resources/sessions.rb +2820 -0
- data/lib/didit/resources/transactions.rb +981 -0
- data/lib/didit/resources/travel_rule.rb +1202 -0
- data/lib/didit/resources/users.rb +521 -0
- data/lib/didit/resources/wallet_screening.rb +190 -0
- data/lib/didit/resources/webhooks.rb +396 -0
- data/lib/didit/resources/workflows.rb +214 -0
- data/lib/didit/resources.rb +263 -0
- data/lib/didit/types/account.rb +11 -0
- data/lib/didit/types/account_components.rb +105 -0
- data/lib/didit/types/address_validation.rb +8 -0
- data/lib/didit/types/age_estimation.rb +89 -0
- data/lib/didit/types/aml.rb +193 -0
- data/lib/didit/types/aml_monitoring.rb +73 -0
- data/lib/didit/types/analytics.rb +62 -0
- data/lib/didit/types/bank.rb +8 -0
- data/lib/didit/types/billing.rb +18 -0
- data/lib/didit/types/biometric_templates.rb +292 -0
- data/lib/didit/types/blocklist.rb +31 -0
- data/lib/didit/types/businesses.rb +45 -0
- data/lib/didit/types/cases.rb +368 -0
- data/lib/didit/types/components.rb +12206 -0
- data/lib/didit/types/customization.rb +8 -0
- data/lib/didit/types/database_validation.rb +177 -0
- data/lib/didit/types/document_ai.rb +135 -0
- data/lib/didit/types/email.rb +116 -0
- data/lib/didit/types/face_match.rb +93 -0
- data/lib/didit/types/face_search.rb +129 -0
- data/lib/didit/types/fraud_checks.rb +8 -0
- data/lib/didit/types/id_verification.rb +231 -0
- data/lib/didit/types/id_wallets.rb +8 -0
- data/lib/didit/types/investigator.rb +221 -0
- data/lib/didit/types/ip.rb +8 -0
- data/lib/didit/types/kyb.rb +1391 -0
- data/lib/didit/types/lists.rb +111 -0
- data/lib/didit/types/monitoring_events.rb +235 -0
- data/lib/didit/types/networks.rb +120 -0
- data/lib/didit/types/passive_liveness.rb +95 -0
- data/lib/didit/types/phone.rb +69 -0
- data/lib/didit/types/proof_of_address.rb +166 -0
- data/lib/didit/types/questionnaires.rb +29 -0
- data/lib/didit/types/regulatory_reports.rb +100 -0
- data/lib/didit/types/report_templates.rb +41 -0
- data/lib/didit/types/sessions.rb +1441 -0
- data/lib/didit/types/transactions.rb +245 -0
- data/lib/didit/types/travel_rule.rb +168 -0
- data/lib/didit/types/users.rb +180 -0
- data/lib/didit/types/wallet_screening.rb +49 -0
- data/lib/didit/types/webhooks.rb +355 -0
- data/lib/didit/types/workflows.rb +32 -0
- data/lib/didit/types.rb +1681 -0
- data/lib/didit/version.rb +5 -0
- data/lib/didit/webhooks/canonical_json.rb +187 -0
- data/lib/didit/webhooks/client_methods.rb +23 -0
- data/lib/didit/webhooks/events.rb +221 -0
- data/lib/didit/webhooks/headers.rb +83 -0
- data/lib/didit/webhooks/verifier.rb +260 -0
- data/lib/didit/webhooks.rb +99 -0
- data/lib/didit-sdk.rb +4 -0
- data/lib/didit.rb +31 -0
- data/sig/didit/authentication/base64_url.rbs +10 -0
- data/sig/didit/authentication/cache.rbs +60 -0
- data/sig/didit/authentication/http.rbs +37 -0
- data/sig/didit/authentication/issuer.rbs +17 -0
- data/sig/didit/authentication/jws.rbs +41 -0
- data/sig/didit/authentication/jwt.rbs +14 -0
- data/sig/didit/authentication/key_set.rbs +25 -0
- data/sig/didit/authentication/pkce.rbs +20 -0
- data/sig/didit/authentication/types.rbs +114 -0
- data/sig/didit/authentication.rbs +81 -0
- data/sig/didit/client.rbs +61 -0
- data/sig/didit/errors.rbs +80 -0
- data/sig/didit/file_part.rbs +19 -0
- data/sig/didit/internal.rbs +199 -0
- data/sig/didit/model.rbs +42 -0
- data/sig/didit/page.rbs +34 -0
- data/sig/didit/raw_response.rbs +20 -0
- data/sig/didit/resource.rbs +8 -0
- data/sig/didit/resources/account.rbs +23 -0
- data/sig/didit/resources/address_validation.rbs +9 -0
- data/sig/didit/resources/age_estimation.rbs +9 -0
- data/sig/didit/resources/aml.rbs +10 -0
- data/sig/didit/resources/aml_monitoring.rbs +9 -0
- data/sig/didit/resources/analytics.rbs +9 -0
- data/sig/didit/resources/bank.rbs +9 -0
- data/sig/didit/resources/billing.rbs +10 -0
- data/sig/didit/resources/biometric_templates.rbs +13 -0
- data/sig/didit/resources/blocklist.rbs +11 -0
- data/sig/didit/resources/business_sessions.rbs +9 -0
- data/sig/didit/resources/businesses.rbs +22 -0
- data/sig/didit/resources/cases.rbs +103 -0
- data/sig/didit/resources/customization.rbs +10 -0
- data/sig/didit/resources/database_validation.rbs +9 -0
- data/sig/didit/resources/document_ai.rbs +9 -0
- data/sig/didit/resources/email.rbs +11 -0
- data/sig/didit/resources/face_match.rbs +9 -0
- data/sig/didit/resources/face_search.rbs +9 -0
- data/sig/didit/resources/fraud_checks.rbs +11 -0
- data/sig/didit/resources/id_verification.rbs +9 -0
- data/sig/didit/resources/id_wallets.rbs +37 -0
- data/sig/didit/resources/investigator.rbs +23 -0
- data/sig/didit/resources/ip.rbs +9 -0
- data/sig/didit/resources/kyb.rbs +12 -0
- data/sig/didit/resources/lists.rbs +20 -0
- data/sig/didit/resources/monitoring_events.rbs +16 -0
- data/sig/didit/resources/networks.rbs +25 -0
- data/sig/didit/resources/passive_liveness.rbs +9 -0
- data/sig/didit/resources/phone.rbs +11 -0
- data/sig/didit/resources/pricing.rbs +9 -0
- data/sig/didit/resources/proof_of_address.rbs +9 -0
- data/sig/didit/resources/questionnaires.rbs +13 -0
- data/sig/didit/resources/regulatory_reports.rbs +16 -0
- data/sig/didit/resources/report_templates.rbs +13 -0
- data/sig/didit/resources/sessions.rbs +78 -0
- data/sig/didit/resources/transactions.rbs +43 -0
- data/sig/didit/resources/travel_rule.rbs +62 -0
- data/sig/didit/resources/users.rbs +21 -0
- data/sig/didit/resources/wallet_screening.rbs +11 -0
- data/sig/didit/resources/webhooks.rbs +23 -0
- data/sig/didit/resources/workflows.rbs +13 -0
- data/sig/didit/resources.rbs +50 -0
- data/sig/didit/types/account.rbs +22 -0
- data/sig/didit/types/account_components.rbs +94 -0
- data/sig/didit/types/address_validation.rbs +7 -0
- data/sig/didit/types/age_estimation.rbs +80 -0
- data/sig/didit/types/aml.rbs +174 -0
- data/sig/didit/types/aml_monitoring.rbs +67 -0
- data/sig/didit/types/analytics.rbs +57 -0
- data/sig/didit/types/bank.rbs +9 -0
- data/sig/didit/types/billing.rbs +19 -0
- data/sig/didit/types/biometric_templates.rbs +268 -0
- data/sig/didit/types/blocklist.rbs +33 -0
- data/sig/didit/types/businesses.rbs +54 -0
- data/sig/didit/types/cases.rbs +414 -0
- data/sig/didit/types/components.rbs +10920 -0
- data/sig/didit/types/customization.rbs +7 -0
- data/sig/didit/types/database_validation.rbs +152 -0
- data/sig/didit/types/document_ai.rbs +123 -0
- data/sig/didit/types/email.rbs +112 -0
- data/sig/didit/types/face_match.rbs +86 -0
- data/sig/didit/types/face_search.rbs +112 -0
- data/sig/didit/types/fraud_checks.rbs +9 -0
- data/sig/didit/types/id_verification.rbs +196 -0
- data/sig/didit/types/id_wallets.rbs +55 -0
- data/sig/didit/types/investigator.rbs +212 -0
- data/sig/didit/types/ip.rbs +7 -0
- data/sig/didit/types/kyb.rbs +1254 -0
- data/sig/didit/types/lists.rbs +106 -0
- data/sig/didit/types/monitoring_events.rbs +234 -0
- data/sig/didit/types/networks.rbs +113 -0
- data/sig/didit/types/passive_liveness.rbs +87 -0
- data/sig/didit/types/phone.rbs +65 -0
- data/sig/didit/types/proof_of_address.rbs +144 -0
- data/sig/didit/types/questionnaires.rbs +30 -0
- data/sig/didit/types/regulatory_reports.rbs +101 -0
- data/sig/didit/types/report_templates.rbs +42 -0
- data/sig/didit/types/sessions.rbs +1349 -0
- data/sig/didit/types/transactions.rbs +273 -0
- data/sig/didit/types/travel_rule.rbs +188 -0
- data/sig/didit/types/users.rbs +181 -0
- data/sig/didit/types/wallet_screening.rbs +40 -0
- data/sig/didit/types/webhooks.rbs +311 -0
- data/sig/didit/types/workflows.rbs +30 -0
- data/sig/didit/webhooks/canonical_json.rbs +25 -0
- data/sig/didit/webhooks/client_methods.rbs +11 -0
- data/sig/didit/webhooks/events.rbs +125 -0
- data/sig/didit/webhooks/headers.rbs +22 -0
- data/sig/didit/webhooks/verifier.rbs +54 -0
- data/sig/didit/webhooks.rbs +37 -0
- data/sig/didit.rbs +20 -0
- metadata +300 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Code generated by codegen from openapi/*.json. DO NOT EDIT.
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Didit
|
|
5
|
+
module Resources
|
|
6
|
+
# The +phone+ resource.
|
|
7
|
+
class Phone < Didit::Resource
|
|
8
|
+
# Risk-score a phone number
|
|
9
|
+
#
|
|
10
|
+
# Resolve a phone number and return carrier, line-type, porting, disposable-number, cross-session match, and
|
|
11
|
+
# normalized risk-intelligence signals without sending an OTP. The endpoint creates an API session and returns
|
|
12
|
+
# its id as `request_id`.
|
|
13
|
+
#
|
|
14
|
+
# **Decision.** The top-level `status` mirrors `phone.status`. It is normally `Approved`; the risk evaluation
|
|
15
|
+
# can produce `In Review` or `Declined`.
|
|
16
|
+
#
|
|
17
|
+
# **Compatibility aliases.** Live responses expose the normalized intelligence object as both
|
|
18
|
+
# `phone.phone_intelligence` and `phone.enrichment`. The values are identical. New integrations can read
|
|
19
|
+
# `phone.enrichment`. Both keys are absent when no usable intelligence data was returned.
|
|
20
|
+
#
|
|
21
|
+
# **Billing.** Live calls use Phone Risk API pricing. The request is billable once the lookup starts, even when
|
|
22
|
+
# some best-effort fields are unavailable.
|
|
23
|
+
#
|
|
24
|
+
# **Sandbox.** Sandbox keys validate the request and return deterministic approved data without sending an OTP,
|
|
25
|
+
# consuming credits, creating a session, or contributing to Networks.
|
|
26
|
+
#
|
|
27
|
+
# **Authentication.** Send your application's API key in `x-api-key`. Missing or invalid credentials return
|
|
28
|
+
# `403` - this API never returns `401`.
|
|
29
|
+
#
|
|
30
|
+
# **Rate limit.** Shared write budget of 300 requests per minute per API key across all POST/PATCH/DELETE
|
|
31
|
+
# endpoints.
|
|
32
|
+
#
|
|
33
|
+
# **Social footprint.** Set `enable_social` to `true` to add a `phone_social` block: the online platforms this
|
|
34
|
+
# number is registered on, with per-category counts and any profile details available. `profiles_registered: 0`
|
|
35
|
+
# means the platforms were checked and the number was found on none of them - a valid, billable answer. The
|
|
36
|
+
# block is absent when the add-on was not requested or the check could not be completed, and it is not billed in
|
|
37
|
+
# that case. Billing adds one `phone_social` unit per request on top of this endpoint's own price.
|
|
38
|
+
#
|
|
39
|
+
# +POST /v3/phone/risk/+
|
|
40
|
+
#
|
|
41
|
+
# @param phone_number [String] Phone number to score. It is validated and normalized to E.164.
|
|
42
|
+
# @param country_code [String] Optional ISO 3166-1 alpha-2 or alpha-3 country hint for intelligence coverage.
|
|
43
|
+
# @param signals [Hash] Optional device and network context observed by your application. All fields are
|
|
44
|
+
# optional. Passing them feeds cross-session match detection in Networks.
|
|
45
|
+
# @param vendor_data [String] Your stable reference for this request. Stored on the API session and echoed in
|
|
46
|
+
# the response.
|
|
47
|
+
# @param metadata [Hash, nil] Your non-sensitive JSON metadata. Stored on the API session and echoed in the
|
|
48
|
+
# response.
|
|
49
|
+
# @param enable_social [Boolean] When true, also look up the social footprint of the number - the messaging,
|
|
50
|
+
# social, e-commerce and professional platforms it is registered on. Billed as one `phone_social` unit per
|
|
51
|
+
# request in addition to this endpoint's own price.
|
|
52
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
53
|
+
# @return [Didit::Types::PhoneRiskResponse]
|
|
54
|
+
def assess_risk(
|
|
55
|
+
phone_number:,
|
|
56
|
+
country_code: OMIT,
|
|
57
|
+
signals: OMIT,
|
|
58
|
+
vendor_data: OMIT,
|
|
59
|
+
metadata: OMIT,
|
|
60
|
+
enable_social: OMIT,
|
|
61
|
+
request_options: nil
|
|
62
|
+
)
|
|
63
|
+
@client.request(
|
|
64
|
+
:post,
|
|
65
|
+
"/v3/phone/risk/",
|
|
66
|
+
body: {
|
|
67
|
+
"phone_number" => phone_number,
|
|
68
|
+
"country_code" => country_code,
|
|
69
|
+
"signals" => signals,
|
|
70
|
+
"vendor_data" => vendor_data,
|
|
71
|
+
"metadata" => metadata,
|
|
72
|
+
"enable_social" => enable_social
|
|
73
|
+
},
|
|
74
|
+
response: Types::PhoneRiskResponse,
|
|
75
|
+
request_options: request_options
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Check Phone Code
|
|
80
|
+
#
|
|
81
|
+
# Verify the OTP delivered by [`POST /v3/phone/send/`](/standalone-apis/phone-send) and get the final
|
|
82
|
+
# verification result plus phone intelligence: carrier name and line type, virtual (VoIP) and disposable flags,
|
|
83
|
+
# and duplicate usage of the number across your sessions.
|
|
84
|
+
#
|
|
85
|
+
# **How the check finds the verification.** Matching is by your application plus the E.164 `phone_number` -
|
|
86
|
+
# `request_id` is not an input. The most recent pending verification created within the last **5 minutes** is
|
|
87
|
+
# checked. If there is none (never sent, already finalized, or older than 5 minutes) the endpoint returns `200`
|
|
88
|
+
# with `status: "Expired or Not Found"`.
|
|
89
|
+
#
|
|
90
|
+
# **Attempt budget.** Each verification allows **3 code attempts**. The first two wrong codes return `status:
|
|
91
|
+
# "Failed"` with the attempts remaining and `phone: null`; the third wrong code finalizes the verification as
|
|
92
|
+
# `Declined` with a `VERIFICATION_CODE_ATTEMPTS_EXCEEDED` warning and returns the full phone report.
|
|
93
|
+
#
|
|
94
|
+
# **Outcomes.** `Approved` - correct code and no declining risk. `Declined` - terminal: the code was correct but
|
|
95
|
+
# a declining risk matched (a `DECLINE` action below, a blocklisted or high-risk number), or the attempt budget
|
|
96
|
+
# was exhausted. `Failed` - wrong code, attempts remaining. `Expired or Not Found` - nothing to check. On
|
|
97
|
+
# `Approved`/`Declined` the `request_id` equals the send's `request_id` (the session id) and `phone` carries the
|
|
98
|
+
# full report (`carrier`, `is_virtual`, `is_disposable`, `warnings`, `lifecycle`, `matches`); on `Failed` and
|
|
99
|
+
# `Expired or Not Found` the `request_id` is a one-off random UUID.
|
|
100
|
+
#
|
|
101
|
+
# **Risk actions.** `duplicated_phone_number_action`, `disposable_number_action`, and `voip_number_action`
|
|
102
|
+
# decide what happens when the corresponding risk is detected on a correct code: `DECLINE` flips the final
|
|
103
|
+
# status to `Declined`; `NO_ACTION` (default) records the risk in `phone.warnings` without affecting the status.
|
|
104
|
+
#
|
|
105
|
+
# **Billing.** Checks are free - delivery is billed on the send side (see [Phone Verification
|
|
106
|
+
# Pricing](/getting-started/phone-verification-pricing)).
|
|
107
|
+
#
|
|
108
|
+
# **Session persistence.** A finalized check updates the session created by the send (visible in the Business
|
|
109
|
+
# Console, queryable via `GET /v3/session/{sessionId}/decision/`) and fires a `status.updated` webhook.
|
|
110
|
+
#
|
|
111
|
+
# **Sandbox.** Sandbox API keys skip all processing: any well-formed code (4-8 digits, `123456` included)
|
|
112
|
+
# returns a static `Approved` payload with a simplified flat `phone` object (`status`, `phone_number`,
|
|
113
|
+
# `country_code`, `carrier_name`, `line_type`, `flags`); malformed input still returns `400`. Nothing is
|
|
114
|
+
# persisted.
|
|
115
|
+
#
|
|
116
|
+
# **Authentication.** Send your application's API key in the `x-api-key` header. Missing or invalid credentials
|
|
117
|
+
# return `403` (`{"detail": "You do not have permission to perform this action."}`) - this API never returns
|
|
118
|
+
# `401`.
|
|
119
|
+
#
|
|
120
|
+
# **Rate limits.** Shared write budget of 300 requests/min per API key, plus the upstream anti-abuse cap of 4
|
|
121
|
+
# attempts per number per hour; exceeding either returns `429`.
|
|
122
|
+
#
|
|
123
|
+
# **Social footprint.** Set `enable_social` to `true` to add a `phone_social` block: the online platforms this
|
|
124
|
+
# number is registered on, with per-category counts and any profile details available. `profiles_registered: 0`
|
|
125
|
+
# means the platforms were checked and the number was found on none of them - a valid, billable answer. The
|
|
126
|
+
# block is absent when the add-on was not requested or the check could not be completed, and it is not billed in
|
|
127
|
+
# that case. Billing adds one `phone_social` unit per request on top of this endpoint's own price.
|
|
128
|
+
#
|
|
129
|
+
# +POST /v3/phone/check/+
|
|
130
|
+
#
|
|
131
|
+
# @param phone_number [String] The same phone number used in the matching [`POST
|
|
132
|
+
# /v3/phone/send/`](/standalone-apis/phone-send) call, in E.164 format. This is what links the check to the
|
|
133
|
+
# send.
|
|
134
|
+
# @param code [String] The OTP the end user received. Must be 4-8 numeric digits - anything else returns `400`
|
|
135
|
+
# without consuming an attempt. A well-formed but wrong code returns `200` with `status: "Failed"` and consumes
|
|
136
|
+
# one of the 3 attempts.
|
|
137
|
+
# @param duplicated_phone_number_action [String] What to do when the same number was already used by a different
|
|
138
|
+
# user (different `vendor_data`) of your application. `DECLINE` flips the final `status` to `Declined`;
|
|
139
|
+
# `NO_ACTION` records the risk in `phone.warnings` and fills `phone.matches`.
|
|
140
|
+
# @param disposable_number_action [String] What to do when the carrier lookup flags the number as a
|
|
141
|
+
# temporary/burner line (`phone.is_disposable`). `DECLINE` flips the final `status` to `Declined`; `NO_ACTION`
|
|
142
|
+
# records the risk in `phone.warnings`.
|
|
143
|
+
# @param voip_number_action [String] What to do when the carrier lookup reports a virtual line type - `voip`,
|
|
144
|
+
# `isp`, or `vpn` (`phone.is_virtual`). `DECLINE` flips the final `status` to `Declined`; `NO_ACTION` records
|
|
145
|
+
# the risk in `phone.warnings`.
|
|
146
|
+
# @param enable_social [Boolean] When true, also look up the social footprint of the number - the messaging,
|
|
147
|
+
# social, e-commerce and professional platforms it is registered on. Billed as one `phone_social` unit per
|
|
148
|
+
# request in addition to this endpoint's own price.
|
|
149
|
+
# @param phone_no_social_presence_action [String] Action when the social footprint check finds the number
|
|
150
|
+
# registered on none of the platforms it covers. Only NO_ACTION and DECLINE are accepted on this endpoint;
|
|
151
|
+
# REVIEW is available on the workflow configuration key of the same name.
|
|
152
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
153
|
+
# @return [Didit::Types::PhoneVerificationCheckResponse]
|
|
154
|
+
def check_code(
|
|
155
|
+
phone_number:,
|
|
156
|
+
code:,
|
|
157
|
+
duplicated_phone_number_action: OMIT,
|
|
158
|
+
disposable_number_action: OMIT,
|
|
159
|
+
voip_number_action: OMIT,
|
|
160
|
+
enable_social: OMIT,
|
|
161
|
+
phone_no_social_presence_action: OMIT,
|
|
162
|
+
request_options: nil
|
|
163
|
+
)
|
|
164
|
+
@client.request(
|
|
165
|
+
:post,
|
|
166
|
+
"/v3/phone/check/",
|
|
167
|
+
body: {
|
|
168
|
+
"phone_number" => phone_number,
|
|
169
|
+
"code" => code,
|
|
170
|
+
"duplicated_phone_number_action" => duplicated_phone_number_action,
|
|
171
|
+
"disposable_number_action" => disposable_number_action,
|
|
172
|
+
"voip_number_action" => voip_number_action,
|
|
173
|
+
"enable_social" => enable_social,
|
|
174
|
+
"phone_no_social_presence_action" => phone_no_social_presence_action
|
|
175
|
+
},
|
|
176
|
+
response: Types::PhoneVerificationCheckResponse,
|
|
177
|
+
request_options: request_options
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Send Phone Code
|
|
182
|
+
#
|
|
183
|
+
# Send a one-time passcode (OTP) to a phone number over WhatsApp, SMS, or another supported channel, then verify
|
|
184
|
+
# it with [`POST /v3/phone/check/`](/standalone-apis/phone-check).
|
|
185
|
+
#
|
|
186
|
+
# **How send and check pair up.** Verification state is keyed by your application plus the E.164 `phone_number`
|
|
187
|
+
# - the check call does not take `request_id`. Each new send creates a pending verification that lives for **5
|
|
188
|
+
# minutes**: call the check with the same number and the code the user received before the window closes.
|
|
189
|
+
# Calling send again for the same number while a verification is pending re-sends a code for that same
|
|
190
|
+
# verification (`status: "Retry"`, same `request_id`). At most one retry is attached this way (two sends total);
|
|
191
|
+
# a further send starts a fresh verification with a new `request_id`. The 5-minute window is measured from the
|
|
192
|
+
# first send and is not extended by retries.
|
|
193
|
+
#
|
|
194
|
+
# **Delivery channels.** `options.preferred_channel` selects the channel (`whatsapp` by default; `sms`,
|
|
195
|
+
# `telegram`, `voice`, `rcs`, `viber`, and `zalo` are also supported). When the preferred channel is unavailable
|
|
196
|
+
# for the destination country or number, delivery automatically falls back to SMS - the send still reports
|
|
197
|
+
# `Success`, and the channel actually used is reported by the check response (`phone.verification_method` and
|
|
198
|
+
# the `lifecycle` events).
|
|
199
|
+
#
|
|
200
|
+
# **Branding.** SMS codes carry your application's SMS sender name, set in the Business Console, at no extra
|
|
201
|
+
# cost. Pass `options.sms_sender_name` to sign one code with another name, or
|
|
202
|
+
# `options.use_white_label_customization: true` to fall back to your white-label public name when no sender name
|
|
203
|
+
# is set. WhatsApp codes use a fixed message; connect your own WhatsApp Business number in the Business Console
|
|
204
|
+
# to send them from your business name and number, billed at the Didit fee only.
|
|
205
|
+
#
|
|
206
|
+
# **Send statuses.** `Success` - OTP sent for a new verification; `Retry` - OTP re-sent for the pending
|
|
207
|
+
# verification; `Blocked` - the anti-fraud layer refused to send (see `reason`, e.g. `repeated_attempts`,
|
|
208
|
+
# `suspicious`, `spam`). A `Blocked` send immediately finalizes the verification as `Declined` with a high-risk
|
|
209
|
+
# warning, so a follow-up check returns `Expired or Not Found`.
|
|
210
|
+
#
|
|
211
|
+
# **Billing.** The price depends on the destination country and the channel that actually delivers the message -
|
|
212
|
+
# see [Phone Verification Pricing](/getting-started/phone-verification-pricing). Only `Blocked` sends are
|
|
213
|
+
# guaranteed free: any other unbilled send attempt is charged at verification finalization or expiration, even
|
|
214
|
+
# if delivery was never confirmed or the delivery provider reported the message undeliverable. Checks are always
|
|
215
|
+
# free. As an anti-abuse measure, phone verification is disabled until your organization's first top-up (`403`).
|
|
216
|
+
#
|
|
217
|
+
# **Session persistence.** Every new verification is persisted as an API-type session: `request_id` is a real
|
|
218
|
+
# session id you can pass to `GET /v3/session/{sessionId}/decision/`, the verification appears in the Business
|
|
219
|
+
# Console, and `status.updated` webhooks fire as it progresses.
|
|
220
|
+
#
|
|
221
|
+
# **Sandbox.** Sandbox API keys skip delivery and billing: after request validation (malformed input still
|
|
222
|
+
# returns `400`), the endpoint returns a static `Success` payload with a random `request_id`; no message is sent
|
|
223
|
+
# and nothing is persisted. Use code `123456` on the sandbox check.
|
|
224
|
+
#
|
|
225
|
+
# **Authentication.** Send your application's API key in the `x-api-key` header. Missing or invalid credentials
|
|
226
|
+
# return `403` (`{"detail": "You do not have permission to perform this action."}`) - this API never returns
|
|
227
|
+
# `401`.
|
|
228
|
+
#
|
|
229
|
+
# **Rate limits.** Shared write budget of 300 requests/min per API key across all POST/PATCH/DELETE endpoints,
|
|
230
|
+
# plus an anti-abuse cap of 4 send attempts per phone number per hour; exceeding either returns `429`.
|
|
231
|
+
#
|
|
232
|
+
# +POST /v3/phone/send/+
|
|
233
|
+
#
|
|
234
|
+
# @param phone_number [String] Recipient phone number in E.164 format - leading `+` and country code (e.g.,
|
|
235
|
+
# `+14155552671`). Numbers are validated and normalized to E.164; unparseable or invalid numbers return `400`
|
|
236
|
+
# with a `phone_number` field error.
|
|
237
|
+
# @param options [Hash] OTP delivery options. All fields are optional.
|
|
238
|
+
# @param signals [Hash] Optional device and network signals about the end user, forwarded to the anti-fraud
|
|
239
|
+
# layer to improve detection of abusive or automated traffic. All fields are optional.
|
|
240
|
+
# @param vendor_data [String] Optional caller-controlled identifier (your internal user id, an email, a UUID,
|
|
241
|
+
# etc.) persisted on the session and echoed back in the send response, the matching check response, webhooks,
|
|
242
|
+
# and the Business Console. Use it to correlate Didit's `request_id` with your user record.
|
|
243
|
+
# @param metadata [Hash, nil] Optional free-form JSON object persisted on the session and echoed back in the
|
|
244
|
+
# send response, the matching check response, webhooks, and the Business Console.
|
|
245
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
246
|
+
# @return [Didit::Types::PhoneVerificationSendResponse]
|
|
247
|
+
def send_code(
|
|
248
|
+
phone_number:,
|
|
249
|
+
options: OMIT,
|
|
250
|
+
signals: OMIT,
|
|
251
|
+
vendor_data: OMIT,
|
|
252
|
+
metadata: OMIT,
|
|
253
|
+
request_options: nil
|
|
254
|
+
)
|
|
255
|
+
@client.request(
|
|
256
|
+
:post,
|
|
257
|
+
"/v3/phone/send/",
|
|
258
|
+
body: {
|
|
259
|
+
"phone_number" => phone_number,
|
|
260
|
+
"options" => options,
|
|
261
|
+
"signals" => signals,
|
|
262
|
+
"vendor_data" => vendor_data,
|
|
263
|
+
"metadata" => metadata
|
|
264
|
+
},
|
|
265
|
+
response: Types::PhoneVerificationSendResponse,
|
|
266
|
+
request_options: request_options
|
|
267
|
+
)
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Code generated by codegen from openapi/*.json. DO NOT EDIT.
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Didit
|
|
5
|
+
module Resources
|
|
6
|
+
# The +pricing+ resource.
|
|
7
|
+
class Pricing < Didit::Resource
|
|
8
|
+
# Get bank verification prices (public, unauthenticated)
|
|
9
|
+
#
|
|
10
|
+
# Returns the list price of each Bank Verification method in every country: bank sign-in with its balance and
|
|
11
|
+
# transactions add-ons, and the account check. Use it to quote a bank step before you build a workflow, or to
|
|
12
|
+
# show bank prices in your own product.
|
|
13
|
+
#
|
|
14
|
+
# Public: send no auth header. The response contains no organization data and is the same for every caller. It
|
|
15
|
+
# is cached publicly for one hour and carries an `ETag`, so send `If-None-Match` to get a `304 Not Modified`
|
|
16
|
+
# when nothing changed.
|
|
17
|
+
#
|
|
18
|
+
# A method is `available` only where Didit serves it in production today, and its `price_usd` is `null`
|
|
19
|
+
# everywhere else, so the feed never shows a price you cannot buy. `available: false` covers a country with no
|
|
20
|
+
# approved price, a method the country does not support, and a route that is not switched on yet.
|
|
21
|
+
#
|
|
22
|
+
# These are list prices before your plan discount. Your plan discount applies to the whole bank price, and a
|
|
23
|
+
# negotiated or contract price replaces the list price for your organization.
|
|
24
|
+
#
|
|
25
|
+
# +GET /v3/organization/bank-verification-pricing/+
|
|
26
|
+
#
|
|
27
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
28
|
+
# @return [Didit::Types::BankVerificationPricing]
|
|
29
|
+
def bank_verification(request_options: nil)
|
|
30
|
+
@client.request(
|
|
31
|
+
:get,
|
|
32
|
+
"/v3/organization/bank-verification-pricing/",
|
|
33
|
+
auth: :none,
|
|
34
|
+
response: Types::BankVerificationPricing,
|
|
35
|
+
request_options: request_options
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Code generated by codegen from openapi/*.json. DO NOT EDIT.
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Didit
|
|
5
|
+
module Resources
|
|
6
|
+
# The +proof_of_address+ resource.
|
|
7
|
+
class ProofOfAddress < Didit::Resource
|
|
8
|
+
# Proof of Address (document OCR + address checks)
|
|
9
|
+
#
|
|
10
|
+
# Extract and validate a Proof of Address document - utility bills, bank statements, and government-issued
|
|
11
|
+
# documents - in one call. Returns the issuer, issue/expiry dates, the holder name, the raw and parsed/geocoded
|
|
12
|
+
# address, an `Approved`/`Declined` `status`, and a `warnings` list explaining every issue found.
|
|
13
|
+
#
|
|
14
|
+
# **Latency.** Extraction is LLM-based: typical calls take **5-15 seconds**, multi-page PDFs up to **~30
|
|
15
|
+
# seconds**. Configure a client timeout of **at least 45 seconds** and do not retry before the call completes.
|
|
16
|
+
#
|
|
17
|
+
# **How it works.** The document (image or PDF, up to 15 MB; encrypted PDFs require `document_password`) is
|
|
18
|
+
# classified into a document type and subtype (e.g. `UTILITY_BILL` / `WATER_BILL`), and the issuer, dates,
|
|
19
|
+
# holder name, and address are extracted with LLM-based extraction. The address is parsed and geocoded into
|
|
20
|
+
# `poa_parsed_address`. PDF/EXIF forensics screen for tampering - modification after digital signing, known PDF
|
|
21
|
+
# editors, overlay-text manipulation, suspicious re-exports - surfacing `SUSPECTED_DOCUMENT_MANIPULATION` or
|
|
22
|
+
# `DOCUMENT_METADATA_MISMATCH`. Document age is validated against `poa_document_age_months`, and the language
|
|
23
|
+
# against `poa_languages_allowed`. If you pass `expected_address`, `expected_country`, or
|
|
24
|
+
# `expected_first_name`/`expected_last_name`, the extracted values are cross-checked and mismatches are flagged.
|
|
25
|
+
#
|
|
26
|
+
# **Decision logic.** `status` is `Approved` unless at least one warning resolves to a decline. Hard failures
|
|
27
|
+
# always decline: `MISSING_ADDRESS_INFORMATION`, `POA_DOCUMENT_EXPIRED`, `INVALID_DOCUMENT_TYPE`,
|
|
28
|
+
# `UNABLE_TO_VALIDATE_DOCUMENT_AGE`, plus `UNABLE_TO_EXTRACT_ISSUE_DATE` and `POA_NAME_NOT_DETECTED` (not
|
|
29
|
+
# configurable on this endpoint). Five risk groups are configurable per request via the `poa_*_action` options
|
|
30
|
+
# (`DECLINE` or `NO_ACTION`, all defaulting to `DECLINE`). `POA_DOCUMENT_NOT_SUPPORTED_FOR_APPLICATION` and
|
|
31
|
+
# `UNPARSABLE_OR_INVALID_ADDRESS` are informational on this endpoint and never decline. A document that cannot
|
|
32
|
+
# be processed at all returns `400`; a readable but problematic document returns `200` with `status: "Declined"`
|
|
33
|
+
# - always inspect `poa.status` and `poa.warnings`, not just the HTTP code.
|
|
34
|
+
#
|
|
35
|
+
# **Billing.** Each `200` response consumes one Proof of Address API credit (paid from your plan credit or
|
|
36
|
+
# top-up balance). When the organization's balance cannot cover the call, the endpoint returns `403` with the
|
|
37
|
+
# not-enough-credits error before any document processing.
|
|
38
|
+
#
|
|
39
|
+
# **Session persistence (`save_api_request`, default `true`).** When `true`, the call is persisted as an
|
|
40
|
+
# API-type session: it appears in the Business Console, the uploaded document is stored, the returned
|
|
41
|
+
# `request_id` is a real session id you can pass to `GET /v3/session/{sessionId}/decision/` (the decision
|
|
42
|
+
# additionally exposes `document_file` and the `document_metadata` forensics, which this response omits), and a
|
|
43
|
+
# `status.updated` webhook is emitted. When `false`, nothing is stored and `request_id` is a one-off correlation
|
|
44
|
+
# UUID that cannot be looked up later.
|
|
45
|
+
#
|
|
46
|
+
# **Sandbox.** Sandbox API keys skip all processing and billing: after request validation (malformed input still
|
|
47
|
+
# returns `400`), the endpoint returns a static `Approved` mock payload (a fictional "Sandbox Power Co."
|
|
48
|
+
# electricity bill), no session is persisted, and no credits are consumed.
|
|
49
|
+
#
|
|
50
|
+
# **Authentication.** Send your application's API key in the `x-api-key` header. Missing or invalid credentials
|
|
51
|
+
# return `403` (`{"detail": "You do not have permission to perform this action."}`) - this API never returns
|
|
52
|
+
# `401`.
|
|
53
|
+
#
|
|
54
|
+
# **Rate limit.** Shared write budget of 300 requests/min per API key across all POST/PATCH/DELETE endpoints;
|
|
55
|
+
# exceeding it returns `429`.
|
|
56
|
+
#
|
|
57
|
+
# Note: `FUTURE_ISSUE_DATE` and `POOR_DOCUMENT_QUALITY` exist in workflow sessions but are never produced by
|
|
58
|
+
# this standalone endpoint - a future-dated document is not auto-declined here.
|
|
59
|
+
#
|
|
60
|
+
# +POST /v3/poa/+
|
|
61
|
+
#
|
|
62
|
+
# @param document [Pathname, IO, String, Didit::FilePart] The Proof of Address document. Allowed extensions:
|
|
63
|
+
# `tiff`, `jpg`, `jpeg`, `png`, `pdf`, `webp`. Maximum upload size: **15 MB** (larger files are rejected with
|
|
64
|
+
# `400`). Multi-page PDFs are supported (expect higher latency); encrypted PDFs require `document_password`.
|
|
65
|
+
# Images are automatically compressed before processing.
|
|
66
|
+
# @param document_password [String] Password to decrypt `document` when it is an encrypted PDF. Sending an
|
|
67
|
+
# encrypted PDF without (or with a wrong) password returns `400`.
|
|
68
|
+
# @param expected_address [String] Address to verify against the document. It is geocoded and compared with the
|
|
69
|
+
# extracted address; a mismatch (or an expected address that cannot be geocoded/verified) adds
|
|
70
|
+
# `ADDRESS_MISMATCH_WITH_PROVIDED`, governed by `poa_address_mismatch_action`. The geocoded form is echoed back
|
|
71
|
+
# in `expected_details_formatted_address` / `expected_details_parsed_address`.
|
|
72
|
+
# @param expected_country [String] Country to verify against the document (ISO 3166-1 code, e.g. `ARG` or `AR`).
|
|
73
|
+
# A mismatch with the document's country adds `POA_COUNTRY_MISMATCH_WITH_PROVIDED`, governed by
|
|
74
|
+
# `poa_address_mismatch_action`.
|
|
75
|
+
# @param expected_first_name [String] First name to verify against `name_on_document` (fuzzy match,
|
|
76
|
+
# transliteration-aware). A score below the match threshold adds `NAME_MISMATCH_WITH_PROVIDED`, governed by
|
|
77
|
+
# `poa_address_mismatch_action`.
|
|
78
|
+
# @param expected_last_name [String] Last name to verify against `name_on_document`, combined with
|
|
79
|
+
# `expected_first_name` for the match score.
|
|
80
|
+
# @param poa_languages_allowed [String] Comma-separated list of accepted document languages as ISO 639-1 codes
|
|
81
|
+
# (e.g. `en,es,fr`). When omitted or blank, **all 51 supported languages** are accepted. A document in a
|
|
82
|
+
# language outside the list adds `UNSUPPORTED_DOCUMENT_LANGUAGE` (governed by
|
|
83
|
+
# `poa_unsupported_language_action`); an unknown code in the list returns `400` with the full set of supported
|
|
84
|
+
# codes.
|
|
85
|
+
# @param poa_document_age_months [String] Comma-separated `key:value` pairs setting the maximum document age in
|
|
86
|
+
# months per document type - keys: `utility_bill`, `bank_statement`, `government_issued_document`,
|
|
87
|
+
# `other_poa_document`; values: `1`-`120`, or `-1` for unlimited (no age check). Defaults when omitted:
|
|
88
|
+
# `utility_bill:3,bank_statement:3,government_issued_document:12,other_poa_document:12`. A document older than
|
|
89
|
+
# its limit declines wi...
|
|
90
|
+
# @param poa_name_mismatch_action [String] Accepted but **currently not applied** - name-mismatch warnings
|
|
91
|
+
# (`NAME_MISMATCH_WITH_PROVIDED`) follow `poa_address_mismatch_action` instead. Set
|
|
92
|
+
# `poa_address_mismatch_action` to control both name and address mismatch behavior.
|
|
93
|
+
# @param poa_document_issues_action [String] What to do on file-integrity problems - in practice only
|
|
94
|
+
# `DOCUMENT_METADATA_MISMATCH` is produced by this endpoint.
|
|
95
|
+
# @param poa_document_authenticity_action [String] What to do when document manipulation is suspected
|
|
96
|
+
# (`SUSPECTED_DOCUMENT_MANIPULATION`) - e.g. the PDF was modified after digital signing, processed by a known
|
|
97
|
+
# PDF editor, shows overlay-text manipulation, or has inconsistent EXIF dates.
|
|
98
|
+
# @param poa_unsupported_language_action [String] What to do when the document language is outside
|
|
99
|
+
# `poa_languages_allowed` (`UNSUPPORTED_DOCUMENT_LANGUAGE`).
|
|
100
|
+
# @param poa_address_mismatch_action [String] What to do when the extracted details disagree with the
|
|
101
|
+
# `expected_*` fields: `ADDRESS_MISMATCH_WITH_PROVIDED`, `NAME_MISMATCH_WITH_PROVIDED`, and
|
|
102
|
+
# `POA_COUNTRY_MISMATCH_WITH_PROVIDED` all follow this action.
|
|
103
|
+
# @param poa_issuer_not_identified_action [String] What to do when no issuing company/organization can be
|
|
104
|
+
# identified on the document (`ISSUER_NOT_IDENTIFIED`).
|
|
105
|
+
# @param save_api_request [Boolean] When `true` (default), persists the call as an API-type session - visible in
|
|
106
|
+
# the Business Console, retrievable via `GET /v3/session/{sessionId}/decision/` using the returned `request_id`,
|
|
107
|
+
# announced through a `status.updated` webhook, and with the uploaded document stored. When `false`, nothing is
|
|
108
|
+
# stored and `request_id` is a transient UUID for response correlation only.
|
|
109
|
+
# @param vendor_data [String] Optional opaque string (your internal user id, email, UUID…) stored on the
|
|
110
|
+
# persisted session and echoed back in the response. Use it to correlate API calls with your own records and to
|
|
111
|
+
# filter sessions later.
|
|
112
|
+
# @param metadata [Hash] Optional JSON object stored with the session (when `save_api_request=true`) and echoed
|
|
113
|
+
# back in the response. In multipart requests, send it as a JSON-encoded string field (e.g.
|
|
114
|
+
# `metadata={"flow":"onboarding"}`) - it is parsed into an object.
|
|
115
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
116
|
+
# @return [Didit::Types::ProofOfAddressVerifyResponse]
|
|
117
|
+
def verify(
|
|
118
|
+
document:,
|
|
119
|
+
document_password: OMIT,
|
|
120
|
+
expected_address: OMIT,
|
|
121
|
+
expected_country: OMIT,
|
|
122
|
+
expected_first_name: OMIT,
|
|
123
|
+
expected_last_name: OMIT,
|
|
124
|
+
poa_languages_allowed: OMIT,
|
|
125
|
+
poa_document_age_months: OMIT,
|
|
126
|
+
poa_name_mismatch_action: OMIT,
|
|
127
|
+
poa_document_issues_action: OMIT,
|
|
128
|
+
poa_document_authenticity_action: OMIT,
|
|
129
|
+
poa_unsupported_language_action: OMIT,
|
|
130
|
+
poa_address_mismatch_action: OMIT,
|
|
131
|
+
poa_issuer_not_identified_action: OMIT,
|
|
132
|
+
save_api_request: OMIT,
|
|
133
|
+
vendor_data: OMIT,
|
|
134
|
+
metadata: OMIT,
|
|
135
|
+
request_options: nil
|
|
136
|
+
)
|
|
137
|
+
@client.request(
|
|
138
|
+
:post,
|
|
139
|
+
"/v3/poa/",
|
|
140
|
+
body: {
|
|
141
|
+
"document" => document,
|
|
142
|
+
"document_password" => document_password,
|
|
143
|
+
"expected_address" => expected_address,
|
|
144
|
+
"expected_country" => expected_country,
|
|
145
|
+
"expected_first_name" => expected_first_name,
|
|
146
|
+
"expected_last_name" => expected_last_name,
|
|
147
|
+
"poa_languages_allowed" => poa_languages_allowed,
|
|
148
|
+
"poa_document_age_months" => poa_document_age_months,
|
|
149
|
+
"poa_name_mismatch_action" => poa_name_mismatch_action,
|
|
150
|
+
"poa_document_issues_action" => poa_document_issues_action,
|
|
151
|
+
"poa_document_authenticity_action" => poa_document_authenticity_action,
|
|
152
|
+
"poa_unsupported_language_action" => poa_unsupported_language_action,
|
|
153
|
+
"poa_address_mismatch_action" => poa_address_mismatch_action,
|
|
154
|
+
"poa_issuer_not_identified_action" => poa_issuer_not_identified_action,
|
|
155
|
+
"save_api_request" => save_api_request,
|
|
156
|
+
"vendor_data" => vendor_data,
|
|
157
|
+
"metadata" => metadata
|
|
158
|
+
},
|
|
159
|
+
encoding: :multipart,
|
|
160
|
+
file_fields: %w[document],
|
|
161
|
+
response: Types::ProofOfAddressVerifyResponse,
|
|
162
|
+
request_options: request_options
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Code generated by codegen from openapi/*.json. DO NOT EDIT.
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Didit
|
|
5
|
+
module Resources
|
|
6
|
+
# The +questionnaires+ resource.
|
|
7
|
+
class Questionnaires < Didit::Resource
|
|
8
|
+
# Create questionnaire
|
|
9
|
+
#
|
|
10
|
+
# Create a simple linear questionnaire. Send `form_elements` in display order; branching and repeatable groups
|
|
11
|
+
# require the Console. Defaults to `published` v1.
|
|
12
|
+
#
|
|
13
|
+
# +POST /v3/questionnaires/+
|
|
14
|
+
#
|
|
15
|
+
# @param title [String] Internal name for the questionnaire.
|
|
16
|
+
# @param languages [Array<String>] Languages included in every label. Must include `en`.
|
|
17
|
+
# @param form_elements [Array<Hash>] Questions in the exact order users should see them. Branching and
|
|
18
|
+
# conditional fields are not supported.
|
|
19
|
+
# @param description [String, nil]
|
|
20
|
+
# @param default_language [String] Default language. Must be included in `languages`.
|
|
21
|
+
# @param is_active [Boolean]
|
|
22
|
+
# @param status [String] Omit this field to create a published questionnaire ready for workflows.
|
|
23
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
24
|
+
# @return [Didit::Types::QuestionnaireDetail]
|
|
25
|
+
def create(
|
|
26
|
+
title:,
|
|
27
|
+
languages:,
|
|
28
|
+
form_elements:,
|
|
29
|
+
description: OMIT,
|
|
30
|
+
default_language: OMIT,
|
|
31
|
+
is_active: OMIT,
|
|
32
|
+
status: OMIT,
|
|
33
|
+
request_options: nil
|
|
34
|
+
)
|
|
35
|
+
@client.request(
|
|
36
|
+
:post,
|
|
37
|
+
"/v3/questionnaires/",
|
|
38
|
+
body: {
|
|
39
|
+
"title" => title,
|
|
40
|
+
"languages" => languages,
|
|
41
|
+
"form_elements" => form_elements,
|
|
42
|
+
"description" => description,
|
|
43
|
+
"default_language" => default_language,
|
|
44
|
+
"is_active" => is_active,
|
|
45
|
+
"status" => status
|
|
46
|
+
},
|
|
47
|
+
response: Types::QuestionnaireDetail,
|
|
48
|
+
request_options: request_options
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Delete questionnaire
|
|
53
|
+
#
|
|
54
|
+
# Permanently delete one questionnaire version (no undo). Stored questionnaire responses linked to this version
|
|
55
|
+
# are deleted with it, and sessions referencing it lose the link; other versions in the same group are not
|
|
56
|
+
# deleted. Workflows that referenced it keep running but the questionnaire step can no longer load it.
|
|
57
|
+
#
|
|
58
|
+
# +DELETE /v3/questionnaires/{questionnaire_uuid}/+
|
|
59
|
+
#
|
|
60
|
+
# @param questionnaire_uuid [String] Per-version UUID of the questionnaire to delete.
|
|
61
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
62
|
+
# @return [nil]
|
|
63
|
+
def delete(questionnaire_uuid, request_options: nil)
|
|
64
|
+
@client.request(
|
|
65
|
+
:delete,
|
|
66
|
+
"/v3/questionnaires/{questionnaire_uuid}/",
|
|
67
|
+
path_params: { "questionnaire_uuid" => questionnaire_uuid },
|
|
68
|
+
request_options: request_options
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# List questionnaires
|
|
73
|
+
#
|
|
74
|
+
# List your questionnaires, newest first, in a limit/offset pagination envelope (`{count, next, previous,
|
|
75
|
+
# results}`, default page size 50). Each row is one version; `questionnaire_group_id` is the stable group ID
|
|
76
|
+
# resolved to the latest `published` version.
|
|
77
|
+
#
|
|
78
|
+
# +GET /v3/questionnaires/+
|
|
79
|
+
#
|
|
80
|
+
# @param limit [Integer] Page size (number of questionnaires per page).
|
|
81
|
+
# @param offset [Integer] Number of rows to skip before the first returned questionnaire.
|
|
82
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
83
|
+
# @return [Didit::Page<Didit::Types::QuestionnaireListItem>]
|
|
84
|
+
def list(limit: OMIT, offset: OMIT, request_options: nil)
|
|
85
|
+
@client.request(
|
|
86
|
+
:get,
|
|
87
|
+
"/v3/questionnaires/",
|
|
88
|
+
query: {
|
|
89
|
+
"limit" => limit,
|
|
90
|
+
"offset" => offset
|
|
91
|
+
},
|
|
92
|
+
page: Types::QuestionnaireListItem,
|
|
93
|
+
request_options: request_options
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Get questionnaire
|
|
98
|
+
#
|
|
99
|
+
# Fetch full questionnaire detail for one version by `questionnaire_uuid`: title, `languages`, canonical
|
|
100
|
+
# `graph`, derived `sections`, and version metadata.
|
|
101
|
+
#
|
|
102
|
+
# +GET /v3/questionnaires/{questionnaire_uuid}/+
|
|
103
|
+
#
|
|
104
|
+
# @param questionnaire_uuid [String] Per-version UUID of the questionnaire (the `uuid` value returned by the
|
|
105
|
+
# list endpoint, also returned as `questionnaire_id` on detail endpoints).
|
|
106
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
107
|
+
# @return [Didit::Types::QuestionnaireDetail]
|
|
108
|
+
def retrieve(questionnaire_uuid, request_options: nil)
|
|
109
|
+
@client.request(
|
|
110
|
+
:get,
|
|
111
|
+
"/v3/questionnaires/{questionnaire_uuid}/",
|
|
112
|
+
path_params: { "questionnaire_uuid" => questionnaire_uuid },
|
|
113
|
+
response: Types::QuestionnaireDetail,
|
|
114
|
+
request_options: request_options
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Update questionnaire
|
|
119
|
+
#
|
|
120
|
+
# Update a questionnaire. Versioning depends on the `status` field you send and the current state of the
|
|
121
|
+
# version: (1) no `status` on a **published** version → the published version is updated in place (same
|
|
122
|
+
# `questionnaire_id`, same `version`); (2) no `status` on a **draft** → the draft is updated and immediately
|
|
123
|
+
# published; (3) `status: "published"` on a **published** version → a NEW published version is created under the
|
|
124
|
+
# same `questionnaire_group_id` (new `questionnaire_id`, `version` + 1) and returned, and any existing draft in
|
|
125
|
+
# the group is deleted; (4) `status: "draft"` keeps a draft as a draft (autosave) but is rejected with 400 on a
|
|
126
|
+
# published version (`"Cannot revert a published version to draft."`).
|
|
127
|
+
#
|
|
128
|
+
# +PATCH /v3/questionnaires/{questionnaire_uuid}/+
|
|
129
|
+
#
|
|
130
|
+
# @param questionnaire_uuid [String] Per-version UUID of the questionnaire to update.
|
|
131
|
+
# @param title [String]
|
|
132
|
+
# @param description [String, nil]
|
|
133
|
+
# @param languages [Array<String>]
|
|
134
|
+
# @param default_language [String]
|
|
135
|
+
# @param is_active [Boolean]
|
|
136
|
+
# @param status [String]
|
|
137
|
+
# @param form_elements [Array<Hash>] If provided, this replaces the full linear question list.
|
|
138
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
139
|
+
# @return [Didit::Types::QuestionnaireDetail]
|
|
140
|
+
def update(
|
|
141
|
+
questionnaire_uuid,
|
|
142
|
+
title: OMIT,
|
|
143
|
+
description: OMIT,
|
|
144
|
+
languages: OMIT,
|
|
145
|
+
default_language: OMIT,
|
|
146
|
+
is_active: OMIT,
|
|
147
|
+
status: OMIT,
|
|
148
|
+
form_elements: OMIT,
|
|
149
|
+
request_options: nil
|
|
150
|
+
)
|
|
151
|
+
@client.request(
|
|
152
|
+
:patch,
|
|
153
|
+
"/v3/questionnaires/{questionnaire_uuid}/",
|
|
154
|
+
path_params: { "questionnaire_uuid" => questionnaire_uuid },
|
|
155
|
+
body: {
|
|
156
|
+
"title" => title,
|
|
157
|
+
"description" => description,
|
|
158
|
+
"languages" => languages,
|
|
159
|
+
"default_language" => default_language,
|
|
160
|
+
"is_active" => is_active,
|
|
161
|
+
"status" => status,
|
|
162
|
+
"form_elements" => form_elements
|
|
163
|
+
},
|
|
164
|
+
response: Types::QuestionnaireDetail,
|
|
165
|
+
request_options: request_options
|
|
166
|
+
)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|