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.
Files changed (234) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +25 -0
  3. data/LICENSE +21 -0
  4. data/README.md +277 -0
  5. data/lib/didit/authentication/base64_url.rb +34 -0
  6. data/lib/didit/authentication/cache.rb +201 -0
  7. data/lib/didit/authentication/http.rb +150 -0
  8. data/lib/didit/authentication/issuer.rb +115 -0
  9. data/lib/didit/authentication/jws.rb +231 -0
  10. data/lib/didit/authentication/key_set.rb +89 -0
  11. data/lib/didit/authentication/pkce.rb +64 -0
  12. data/lib/didit/authentication/types.rb +175 -0
  13. data/lib/didit/authentication.rb +546 -0
  14. data/lib/didit/client.rb +211 -0
  15. data/lib/didit/errors.rb +153 -0
  16. data/lib/didit/file_part.rb +85 -0
  17. data/lib/didit/internal/config.rb +94 -0
  18. data/lib/didit/internal/errors.rb +83 -0
  19. data/lib/didit/internal/log.rb +41 -0
  20. data/lib/didit/internal/multipart.rb +60 -0
  21. data/lib/didit/internal/request.rb +322 -0
  22. data/lib/didit/internal/transport.rb +198 -0
  23. data/lib/didit/internal/util.rb +76 -0
  24. data/lib/didit/internal.rb +15 -0
  25. data/lib/didit/model.rb +199 -0
  26. data/lib/didit/page.rb +130 -0
  27. data/lib/didit/raw_response.rb +57 -0
  28. data/lib/didit/resource.rb +15 -0
  29. data/lib/didit/resources/account.rb +309 -0
  30. data/lib/didit/resources/address_validation.rb +73 -0
  31. data/lib/didit/resources/age_estimation.rb +110 -0
  32. data/lib/didit/resources/aml.rb +166 -0
  33. data/lib/didit/resources/aml_monitoring.rb +30 -0
  34. data/lib/didit/resources/analytics.rb +87 -0
  35. data/lib/didit/resources/bank.rb +65 -0
  36. data/lib/didit/resources/billing.rb +61 -0
  37. data/lib/didit/resources/biometric_templates.rb +234 -0
  38. data/lib/didit/resources/blocklist.rb +130 -0
  39. data/lib/didit/resources/business_sessions.rb +29 -0
  40. data/lib/didit/resources/businesses.rb +471 -0
  41. data/lib/didit/resources/cases.rb +2116 -0
  42. data/lib/didit/resources/customization.rb +153 -0
  43. data/lib/didit/resources/database_validation.rb +327 -0
  44. data/lib/didit/resources/document_ai.rb +145 -0
  45. data/lib/didit/resources/email.rb +254 -0
  46. data/lib/didit/resources/face_match.rb +103 -0
  47. data/lib/didit/resources/face_search.rb +103 -0
  48. data/lib/didit/resources/fraud_checks.rb +130 -0
  49. data/lib/didit/resources/id_verification.rb +163 -0
  50. data/lib/didit/resources/id_wallets.rb +1468 -0
  51. data/lib/didit/resources/investigator.rb +419 -0
  52. data/lib/didit/resources/ip.rb +68 -0
  53. data/lib/didit/resources/kyb.rb +256 -0
  54. data/lib/didit/resources/lists.rb +332 -0
  55. data/lib/didit/resources/monitoring_events.rb +466 -0
  56. data/lib/didit/resources/networks.rb +427 -0
  57. data/lib/didit/resources/passive_liveness.rb +103 -0
  58. data/lib/didit/resources/phone.rb +271 -0
  59. data/lib/didit/resources/pricing.rb +40 -0
  60. data/lib/didit/resources/proof_of_address.rb +167 -0
  61. data/lib/didit/resources/questionnaires.rb +170 -0
  62. data/lib/didit/resources/regulatory_reports.rb +314 -0
  63. data/lib/didit/resources/report_templates.rb +146 -0
  64. data/lib/didit/resources/sessions.rb +2820 -0
  65. data/lib/didit/resources/transactions.rb +981 -0
  66. data/lib/didit/resources/travel_rule.rb +1202 -0
  67. data/lib/didit/resources/users.rb +521 -0
  68. data/lib/didit/resources/wallet_screening.rb +190 -0
  69. data/lib/didit/resources/webhooks.rb +396 -0
  70. data/lib/didit/resources/workflows.rb +214 -0
  71. data/lib/didit/resources.rb +263 -0
  72. data/lib/didit/types/account.rb +11 -0
  73. data/lib/didit/types/account_components.rb +105 -0
  74. data/lib/didit/types/address_validation.rb +8 -0
  75. data/lib/didit/types/age_estimation.rb +89 -0
  76. data/lib/didit/types/aml.rb +193 -0
  77. data/lib/didit/types/aml_monitoring.rb +73 -0
  78. data/lib/didit/types/analytics.rb +62 -0
  79. data/lib/didit/types/bank.rb +8 -0
  80. data/lib/didit/types/billing.rb +18 -0
  81. data/lib/didit/types/biometric_templates.rb +292 -0
  82. data/lib/didit/types/blocklist.rb +31 -0
  83. data/lib/didit/types/businesses.rb +45 -0
  84. data/lib/didit/types/cases.rb +368 -0
  85. data/lib/didit/types/components.rb +12206 -0
  86. data/lib/didit/types/customization.rb +8 -0
  87. data/lib/didit/types/database_validation.rb +177 -0
  88. data/lib/didit/types/document_ai.rb +135 -0
  89. data/lib/didit/types/email.rb +116 -0
  90. data/lib/didit/types/face_match.rb +93 -0
  91. data/lib/didit/types/face_search.rb +129 -0
  92. data/lib/didit/types/fraud_checks.rb +8 -0
  93. data/lib/didit/types/id_verification.rb +231 -0
  94. data/lib/didit/types/id_wallets.rb +8 -0
  95. data/lib/didit/types/investigator.rb +221 -0
  96. data/lib/didit/types/ip.rb +8 -0
  97. data/lib/didit/types/kyb.rb +1391 -0
  98. data/lib/didit/types/lists.rb +111 -0
  99. data/lib/didit/types/monitoring_events.rb +235 -0
  100. data/lib/didit/types/networks.rb +120 -0
  101. data/lib/didit/types/passive_liveness.rb +95 -0
  102. data/lib/didit/types/phone.rb +69 -0
  103. data/lib/didit/types/proof_of_address.rb +166 -0
  104. data/lib/didit/types/questionnaires.rb +29 -0
  105. data/lib/didit/types/regulatory_reports.rb +100 -0
  106. data/lib/didit/types/report_templates.rb +41 -0
  107. data/lib/didit/types/sessions.rb +1441 -0
  108. data/lib/didit/types/transactions.rb +245 -0
  109. data/lib/didit/types/travel_rule.rb +168 -0
  110. data/lib/didit/types/users.rb +180 -0
  111. data/lib/didit/types/wallet_screening.rb +49 -0
  112. data/lib/didit/types/webhooks.rb +355 -0
  113. data/lib/didit/types/workflows.rb +32 -0
  114. data/lib/didit/types.rb +1681 -0
  115. data/lib/didit/version.rb +5 -0
  116. data/lib/didit/webhooks/canonical_json.rb +187 -0
  117. data/lib/didit/webhooks/client_methods.rb +23 -0
  118. data/lib/didit/webhooks/events.rb +221 -0
  119. data/lib/didit/webhooks/headers.rb +83 -0
  120. data/lib/didit/webhooks/verifier.rb +260 -0
  121. data/lib/didit/webhooks.rb +99 -0
  122. data/lib/didit-sdk.rb +4 -0
  123. data/lib/didit.rb +31 -0
  124. data/sig/didit/authentication/base64_url.rbs +10 -0
  125. data/sig/didit/authentication/cache.rbs +60 -0
  126. data/sig/didit/authentication/http.rbs +37 -0
  127. data/sig/didit/authentication/issuer.rbs +17 -0
  128. data/sig/didit/authentication/jws.rbs +41 -0
  129. data/sig/didit/authentication/jwt.rbs +14 -0
  130. data/sig/didit/authentication/key_set.rbs +25 -0
  131. data/sig/didit/authentication/pkce.rbs +20 -0
  132. data/sig/didit/authentication/types.rbs +114 -0
  133. data/sig/didit/authentication.rbs +81 -0
  134. data/sig/didit/client.rbs +61 -0
  135. data/sig/didit/errors.rbs +80 -0
  136. data/sig/didit/file_part.rbs +19 -0
  137. data/sig/didit/internal.rbs +199 -0
  138. data/sig/didit/model.rbs +42 -0
  139. data/sig/didit/page.rbs +34 -0
  140. data/sig/didit/raw_response.rbs +20 -0
  141. data/sig/didit/resource.rbs +8 -0
  142. data/sig/didit/resources/account.rbs +23 -0
  143. data/sig/didit/resources/address_validation.rbs +9 -0
  144. data/sig/didit/resources/age_estimation.rbs +9 -0
  145. data/sig/didit/resources/aml.rbs +10 -0
  146. data/sig/didit/resources/aml_monitoring.rbs +9 -0
  147. data/sig/didit/resources/analytics.rbs +9 -0
  148. data/sig/didit/resources/bank.rbs +9 -0
  149. data/sig/didit/resources/billing.rbs +10 -0
  150. data/sig/didit/resources/biometric_templates.rbs +13 -0
  151. data/sig/didit/resources/blocklist.rbs +11 -0
  152. data/sig/didit/resources/business_sessions.rbs +9 -0
  153. data/sig/didit/resources/businesses.rbs +22 -0
  154. data/sig/didit/resources/cases.rbs +103 -0
  155. data/sig/didit/resources/customization.rbs +10 -0
  156. data/sig/didit/resources/database_validation.rbs +9 -0
  157. data/sig/didit/resources/document_ai.rbs +9 -0
  158. data/sig/didit/resources/email.rbs +11 -0
  159. data/sig/didit/resources/face_match.rbs +9 -0
  160. data/sig/didit/resources/face_search.rbs +9 -0
  161. data/sig/didit/resources/fraud_checks.rbs +11 -0
  162. data/sig/didit/resources/id_verification.rbs +9 -0
  163. data/sig/didit/resources/id_wallets.rbs +37 -0
  164. data/sig/didit/resources/investigator.rbs +23 -0
  165. data/sig/didit/resources/ip.rbs +9 -0
  166. data/sig/didit/resources/kyb.rbs +12 -0
  167. data/sig/didit/resources/lists.rbs +20 -0
  168. data/sig/didit/resources/monitoring_events.rbs +16 -0
  169. data/sig/didit/resources/networks.rbs +25 -0
  170. data/sig/didit/resources/passive_liveness.rbs +9 -0
  171. data/sig/didit/resources/phone.rbs +11 -0
  172. data/sig/didit/resources/pricing.rbs +9 -0
  173. data/sig/didit/resources/proof_of_address.rbs +9 -0
  174. data/sig/didit/resources/questionnaires.rbs +13 -0
  175. data/sig/didit/resources/regulatory_reports.rbs +16 -0
  176. data/sig/didit/resources/report_templates.rbs +13 -0
  177. data/sig/didit/resources/sessions.rbs +78 -0
  178. data/sig/didit/resources/transactions.rbs +43 -0
  179. data/sig/didit/resources/travel_rule.rbs +62 -0
  180. data/sig/didit/resources/users.rbs +21 -0
  181. data/sig/didit/resources/wallet_screening.rbs +11 -0
  182. data/sig/didit/resources/webhooks.rbs +23 -0
  183. data/sig/didit/resources/workflows.rbs +13 -0
  184. data/sig/didit/resources.rbs +50 -0
  185. data/sig/didit/types/account.rbs +22 -0
  186. data/sig/didit/types/account_components.rbs +94 -0
  187. data/sig/didit/types/address_validation.rbs +7 -0
  188. data/sig/didit/types/age_estimation.rbs +80 -0
  189. data/sig/didit/types/aml.rbs +174 -0
  190. data/sig/didit/types/aml_monitoring.rbs +67 -0
  191. data/sig/didit/types/analytics.rbs +57 -0
  192. data/sig/didit/types/bank.rbs +9 -0
  193. data/sig/didit/types/billing.rbs +19 -0
  194. data/sig/didit/types/biometric_templates.rbs +268 -0
  195. data/sig/didit/types/blocklist.rbs +33 -0
  196. data/sig/didit/types/businesses.rbs +54 -0
  197. data/sig/didit/types/cases.rbs +414 -0
  198. data/sig/didit/types/components.rbs +10920 -0
  199. data/sig/didit/types/customization.rbs +7 -0
  200. data/sig/didit/types/database_validation.rbs +152 -0
  201. data/sig/didit/types/document_ai.rbs +123 -0
  202. data/sig/didit/types/email.rbs +112 -0
  203. data/sig/didit/types/face_match.rbs +86 -0
  204. data/sig/didit/types/face_search.rbs +112 -0
  205. data/sig/didit/types/fraud_checks.rbs +9 -0
  206. data/sig/didit/types/id_verification.rbs +196 -0
  207. data/sig/didit/types/id_wallets.rbs +55 -0
  208. data/sig/didit/types/investigator.rbs +212 -0
  209. data/sig/didit/types/ip.rbs +7 -0
  210. data/sig/didit/types/kyb.rbs +1254 -0
  211. data/sig/didit/types/lists.rbs +106 -0
  212. data/sig/didit/types/monitoring_events.rbs +234 -0
  213. data/sig/didit/types/networks.rbs +113 -0
  214. data/sig/didit/types/passive_liveness.rbs +87 -0
  215. data/sig/didit/types/phone.rbs +65 -0
  216. data/sig/didit/types/proof_of_address.rbs +144 -0
  217. data/sig/didit/types/questionnaires.rbs +30 -0
  218. data/sig/didit/types/regulatory_reports.rbs +101 -0
  219. data/sig/didit/types/report_templates.rbs +42 -0
  220. data/sig/didit/types/sessions.rbs +1349 -0
  221. data/sig/didit/types/transactions.rbs +273 -0
  222. data/sig/didit/types/travel_rule.rbs +188 -0
  223. data/sig/didit/types/users.rbs +181 -0
  224. data/sig/didit/types/wallet_screening.rbs +40 -0
  225. data/sig/didit/types/webhooks.rbs +311 -0
  226. data/sig/didit/types/workflows.rbs +30 -0
  227. data/sig/didit/webhooks/canonical_json.rbs +25 -0
  228. data/sig/didit/webhooks/client_methods.rbs +11 -0
  229. data/sig/didit/webhooks/events.rbs +125 -0
  230. data/sig/didit/webhooks/headers.rbs +22 -0
  231. data/sig/didit/webhooks/verifier.rbs +54 -0
  232. data/sig/didit/webhooks.rbs +37 -0
  233. data/sig/didit.rbs +20 -0
  234. metadata +300 -0
@@ -0,0 +1,30 @@
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 +aml_monitoring+ resource.
7
+ class AmlMonitoring < Didit::Resource
8
+ # Get AML ongoing monitoring job
9
+ #
10
+ # Status, outcome counters and per-record results of a monitoring toggle job started from `POST
11
+ # /v3/users/aml-monitoring/` or `POST /v3/businesses/aml-monitoring/`. Poll every couple of seconds while
12
+ # `status` is `PENDING` or `PROCESSING`; `results` is complete once it is `COMPLETED`.
13
+ #
14
+ # +GET /v3/aml-monitoring/jobs/{job_id}/+
15
+ #
16
+ # @param job_id [String] The `job_id` returned by the toggle endpoint.
17
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
18
+ # @return [Didit::Types::AmlMonitoringRetrieveJobResponse]
19
+ def retrieve_job(job_id, request_options: nil)
20
+ @client.request(
21
+ :get,
22
+ "/v3/aml-monitoring/jobs/{job_id}/",
23
+ path_params: { "job_id" => job_id },
24
+ response: Types::AmlMonitoringRetrieveJobResponse,
25
+ request_options: request_options
26
+ )
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,87 @@
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 +analytics+ resource.
7
+ class Analytics < Didit::Resource
8
+ # Get application analytics
9
+ #
10
+ # Read the numbers behind the Business Console [analytics dashboard](https://docs.didit.me/console/analytics)
11
+ # for a date range. Without `scope` and `widget_keys` the response is the user verification (KYC) summary
12
+ # (`ApplicationAnalyticsSummary`): daily session counts, status totals, conversion rate, the same figures for
13
+ # the preceding period of equal length, locations, demographics, devices, workflow funnels, active verification
14
+ # time, resubmissions, warnings and time series. With `scope` or `widget_keys` it is the widgets of one
15
+ # dashboard tab (`ApplicationAnalyticsWidgetResponse`): `kyc`, `kyb`, `transactions` or `home`.
16
+ #
17
+ # Session counts are by session creation date (UTC) and reflect each session's current status. They come from
18
+ # daily rollups refreshed in the background, so the newest activity can take a short while to appear. Invalid
19
+ # workflow IDs and versions are ignored rather than rejected. Nothing is billed.
20
+ #
21
+ # Only a full-access API key can call this endpoint: every scoped key gets `403`, whatever access it holds, and
22
+ # so does a key of another application. See [API keys](https://docs.didit.me/console/api-keys).
23
+ #
24
+ # +GET /v3/organization/{organization_id}/application/{application_id}/analytics/+
25
+ #
26
+ # @param start_date [Date, String] First day of the range, `YYYY-MM-DD`, inclusive (UTC). Send it together with
27
+ # `end_date`: when either is missing, both are ignored and the range runs from 30 days before today through
28
+ # today.
29
+ # @param end_date [Date, String] Last day of the range, `YYYY-MM-DD`, inclusive (UTC). A future date counts as
30
+ # today. The range may not exceed 730 days.
31
+ # @param scope [String] Dashboard tab to return widgets for (case-insensitive). Omit it, together with
32
+ # `widget_keys`, for the KYC summary. Sending only `widget_keys` implies `kyc`. `home` accepts any KYC, KYB or
33
+ # transaction widget and defaults to the application's saved home layout.
34
+ # @param widget_keys [String] Comma-separated widget keys, answered in this order. Keys the scope does not
35
+ # accept are dropped; when none is left you get the scope's defaults. KYC: `kyc_sessions_volume`,
36
+ # `kyc_warning_insights`, `kyc_id_locations`, `kyc_ip_locations`, `kyc_workflow_funnel`,
37
+ # `kyc_average_verification_time`, `kyc_conversion_rate`, `kyc_conversion_by_country`,
38
+ # `kyc_resubmission_insights`, `kyc_original_status_dist...
39
+ # @param workflow_ids [String] Comma-separated workflow IDs. Limits the KYC summary and the KYC and KYB widgets
40
+ # to those workflows. Values that are not UUIDs are ignored; when none is valid the filter is dropped. The
41
+ # summary also accepts `workflow_id`.
42
+ # @param versions [String] Comma-separated workflow version numbers. Applies only together with `workflow_ids`;
43
+ # values that are not whole numbers are ignored. `version` is accepted as an alias.
44
+ # @param branch_path_ids [String] Comma-separated branch path IDs. Applies only together with `workflow_ids`,
45
+ # and only to KYC figures. Figures are currently recorded only for `default` (all paths combined), so any other
46
+ # value returns empty figures. `branch_path_id` is accepted as an alias.
47
+ # @param tag [String] Transaction widgets only: comma-separated tag UUIDs or tag names.
48
+ # @param transaction_type [String] Transaction widgets only: comma-separated transaction categories.
49
+ # @param action_type [String] Transaction widgets only: comma-separated action types (case-insensitive).
50
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
51
+ # @return [Didit::Types::AnalyticsRetrieveResponse]
52
+ def retrieve(
53
+ start_date: OMIT,
54
+ end_date: OMIT,
55
+ scope: OMIT,
56
+ widget_keys: OMIT,
57
+ workflow_ids: OMIT,
58
+ versions: OMIT,
59
+ branch_path_ids: OMIT,
60
+ tag: OMIT,
61
+ transaction_type: OMIT,
62
+ action_type: OMIT,
63
+ request_options: nil
64
+ )
65
+ @client.request(
66
+ :get,
67
+ "/v3/organization/{organization_id}/application/{application_id}/analytics/",
68
+ query: {
69
+ "start_date" => start_date,
70
+ "end_date" => end_date,
71
+ "scope" => scope,
72
+ "widget_keys" => widget_keys,
73
+ "workflow_ids" => workflow_ids,
74
+ "versions" => versions,
75
+ "branch_path_ids" => branch_path_ids,
76
+ "tag" => tag,
77
+ "transaction_type" => transaction_type,
78
+ "action_type" => action_type
79
+ },
80
+ scope: :application,
81
+ response: Types::AnalyticsRetrieveResponse,
82
+ request_options: request_options
83
+ )
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,65 @@
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 +bank+ resource.
7
+ class Bank < Didit::Resource
8
+ # Check a bank account
9
+ #
10
+ # Check that a bank account belongs to the person or company you name, before you send money to it. No session
11
+ # and no sign-in: send the name and the account, read the result. It is the [account
12
+ # check](/core-technology/bank-verification/account-check) of the Bank Verification step, run from your backend.
13
+ #
14
+ # **What you send.** The account's `country` (ISO 3166-1 alpha-3), the `account` the way that country writes it,
15
+ # and the `holder` name: `full_name` for a person or `business_name` for a company. A business name checks a
16
+ # business account.
17
+ #
18
+ # **What you get back.** `result` is `match`, `close_match`, `no_match` or `cannot_verify`. On a `close_match`,
19
+ # `holder_name` is the name the bank holds the account under, when the bank returned it. `account` comes back
20
+ # masked to its last 4 characters.
21
+ #
22
+ # **Billing.** Each check the bank answers is billed once at the Account check price of the account's country,
23
+ # whatever the result: a `no_match`, an account that does not exist and a `cannot_verify` are billed too. A
24
+ # request answered with an error is never billed.
25
+ #
26
+ # **Every request is a new check.** There is no idempotency key and no endpoint to read a check back, so a
27
+ # retried request runs, and is billed, again. Store the response.
28
+ #
29
+ # **Sandbox.** A sandbox key calls no bank and is charged nothing. The last 4 characters of the IBAN, else of
30
+ # the account number, choose the answer: `0001` a `close_match` with a `holder_name`, `0002` a `close_match`
31
+ # without one, `0003` and `0006` a `no_match`, `0004` `cannot_verify`, `0005` a `503` and `0009` a `400`. Any
32
+ # other ending is a `match`.
33
+ #
34
+ # **API keys.** A scoped API key needs write access to sessions.
35
+ #
36
+ # +POST /v3/bank/account-check/+
37
+ #
38
+ # @param country [String] The account's country, as an ISO 3166-1 alpha-3 code, for example `GBR`. Lowercase is
39
+ # accepted.
40
+ # @param account [Hash] The account the way its country writes it: an `iban`, or an `account_number` with the
41
+ # bank or branch code the country needs (`sort_code`, `routing_number`, `transit_institution`, `bsb`, `ifsc`,
42
+ # `bank_code` or `bic`). Mexico takes a `clabe` and Argentina a `cbu_cvu`, which already name the bank. A
43
+ # business account adds a `registration_id` where the country asks for one. Spaces, dashes and dots are...
44
+ # @param holder [Hash] The name the account is checked against. Send exactly one of `full_name` and
45
+ # `business_name`.
46
+ # @param vendor_data [String, nil] Your own reference for this check, returned unchanged.
47
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
48
+ # @return [Didit::Types::BankAccountCheckResponse]
49
+ def account_check(country:, account:, holder:, vendor_data: OMIT, request_options: nil)
50
+ @client.request(
51
+ :post,
52
+ "/v3/bank/account-check/",
53
+ body: {
54
+ "country" => country,
55
+ "account" => account,
56
+ "holder" => holder,
57
+ "vendor_data" => vendor_data
58
+ },
59
+ response: Types::BankAccountCheckResponse,
60
+ request_options: request_options
61
+ )
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,61 @@
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 +billing+ resource.
7
+ class Billing < Didit::Resource
8
+ # Get credit balance
9
+ #
10
+ # Get current pre-paid credit balance in USD (organization-wide) plus auto-refill config. Amounts are decimal
11
+ # strings - parse with a decimal library.
12
+ #
13
+ # +GET /v3/billing/balance/+
14
+ #
15
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
16
+ # @return [Didit::Types::BillingRetrieveBalanceResponse]
17
+ def retrieve_balance(request_options: nil)
18
+ @client.request(
19
+ :get,
20
+ "/v3/billing/balance/",
21
+ response: Types::BillingRetrieveBalanceResponse,
22
+ request_options: request_options
23
+ )
24
+ end
25
+
26
+ # Top up credits
27
+ #
28
+ # Add credits via a hosted Stripe Checkout session (**\$50 to \$10,000** per top-up). Top-ups are available on
29
+ # the Free, Growth and Scale plans, added at face value with no discount or bonus, and last 12 months;
30
+ # Enterprise annual contracts cannot top up. Redirect the customer to the returned `checkout_session_url`.
31
+ #
32
+ # +POST /v3/billing/top-up/+
33
+ #
34
+ # @param amount_in_dollars [Numeric] Amount to charge, in USD. **Must be from 50 to 10,000.** The balance
35
+ # receives the same amount, with no discount or bonus. Tax is added automatically at checkout based on the
36
+ # customer's billing address.
37
+ # @param success_url [String] URL the hosted checkout redirects the customer to after a successful payment.
38
+ # Currently defaults to `https://console.didit.me`. Pass a working URL explicitly; the default host is
39
+ # unavailable. Append the literal placeholder `{CHECKOUT_SESSION_ID}` if you want the hosted checkout to
40
+ # substitute the session ID.
41
+ # @param cancel_url [String] URL the hosted checkout redirects the customer to when they abort or close the
42
+ # Checkout window. Currently defaults to `https://console.didit.me`. Pass a working URL explicitly; the default
43
+ # host is unavailable.
44
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
45
+ # @return [Didit::Types::BillingTopUpResponse]
46
+ def top_up(amount_in_dollars:, success_url: OMIT, cancel_url: OMIT, request_options: nil)
47
+ @client.request(
48
+ :post,
49
+ "/v3/billing/top-up/",
50
+ body: {
51
+ "amount_in_dollars" => amount_in_dollars,
52
+ "success_url" => success_url,
53
+ "cancel_url" => cancel_url
54
+ },
55
+ response: Types::BillingTopUpResponse,
56
+ request_options: request_options
57
+ )
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,234 @@
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 +biometric_templates+ resource.
7
+ class BiometricTemplates < Didit::Resource
8
+ # Bulk purge retained biometric templates
9
+ #
10
+ # An opted-in application keeps one separately managed, image-free face biometric template anchored to the User
11
+ # when a session is deleted (see `DELETE /v3/session/{sessionId}/delete/`). Templates are biometric data with a
12
+ # finite `expires_at`; they never contain images, session data, or identity fields, and they are purged on User
13
+ # deletion, privacy erasure, expiry, or an explicit purge. These endpoints accept application API keys
14
+ # (`x-api-key`) only; Business Console user tokens are rejected with `403`.
15
+ #
16
+ # Purges many templates in one call, by explicit id list or with `delete_all: true` optionally narrowed by the
17
+ # same filters as the list endpoint. Templates are purged one by one and each result reports `purged` or
18
+ # `already_purged`. If a biometric store is unavailable the call returns `503` at the first failing template:
19
+ # templates purged earlier in the request stay purged, the failing one moves to `purge_failed` (already excluded
20
+ # from matching), and repeating the request finishes the job.
21
+ #
22
+ # **`delete_all: true` without filters purges every biometric template in the application and cannot be
23
+ # undone.** Run the count endpoint with the same filters first.
24
+ #
25
+ # +POST /v3/biometric-templates/delete/+
26
+ #
27
+ # @param template_uuids [Array<String>] Templates to purge. Required unless `delete_all` is `true`. Already
28
+ # purged ids are reported as `already_purged`.
29
+ # @param delete_all [Boolean] When `true`, purges every template matching the filters below (all of the
30
+ # application's templates when no filter is given). `template_uuids` is ignored. Irreversible.
31
+ # @param vendor_data [String] Only with `delete_all`: case-insensitive substring match on the owning User's
32
+ # `vendor_data`.
33
+ # @param vendor_user_uuid [String] Only with `delete_all`: exact match on the owning User.
34
+ # @param status [String] Only with `delete_all`.
35
+ # @param source_type [String] Only with `delete_all`.
36
+ # @param retained_from [Time, String] Only with `delete_all`.
37
+ # @param retained_to [Time, String] Only with `delete_all`. Must not be earlier than `retained_from`.
38
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
39
+ # @return [Didit::Types::BiometricTemplatesBatchDeleteResponse]
40
+ def batch_delete(
41
+ template_uuids: OMIT,
42
+ delete_all: OMIT,
43
+ vendor_data: OMIT,
44
+ vendor_user_uuid: OMIT,
45
+ status: OMIT,
46
+ source_type: OMIT,
47
+ retained_from: OMIT,
48
+ retained_to: OMIT,
49
+ request_options: nil
50
+ )
51
+ @client.request(
52
+ :post,
53
+ "/v3/biometric-templates/delete/",
54
+ body: {
55
+ "template_uuids" => template_uuids,
56
+ "delete_all" => delete_all,
57
+ "vendor_data" => vendor_data,
58
+ "vendor_user_uuid" => vendor_user_uuid,
59
+ "status" => status,
60
+ "source_type" => source_type,
61
+ "retained_from" => retained_from,
62
+ "retained_to" => retained_to
63
+ },
64
+ response: Types::BiometricTemplatesBatchDeleteResponse,
65
+ request_options: request_options
66
+ )
67
+ end
68
+
69
+ # Count retained biometric templates
70
+ #
71
+ # An opted-in application keeps one separately managed, image-free face biometric template anchored to the User
72
+ # when a session is deleted (see `DELETE /v3/session/{sessionId}/delete/`). Templates are biometric data with a
73
+ # finite `expires_at`; they never contain images, session data, or identity fields, and they are purged on User
74
+ # deletion, privacy erasure, expiry, or an explicit purge. These endpoints accept application API keys
75
+ # (`x-api-key`) only; Business Console user tokens are rejected with `403`.
76
+ #
77
+ # Returns the number of templates matching the same filters as the list endpoint. Use it to check what a
78
+ # filtered bulk purge with `delete_all: true` would touch.
79
+ #
80
+ # +GET /v3/biometric-templates/count/+
81
+ #
82
+ # @param vendor_data [String] Case-insensitive substring match on the owning User's current `vendor_data`.
83
+ # @param vendor_user_uuid [String] Exact match on the owning User.
84
+ # @param status [String] Lifecycle status. Purged templates are never listed.
85
+ # @param source_type [String] How the template was created.
86
+ # @param retained_from [Time, String] Templates retained at or after this time.
87
+ # @param retained_to [Time, String] Templates retained at or before this time. Must not be earlier than
88
+ # `retained_from` (`400`).
89
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
90
+ # @return [Didit::Types::BiometricTemplatesCountResponse]
91
+ def count(
92
+ vendor_data: OMIT,
93
+ vendor_user_uuid: OMIT,
94
+ status: OMIT,
95
+ source_type: OMIT,
96
+ retained_from: OMIT,
97
+ retained_to: OMIT,
98
+ request_options: nil
99
+ )
100
+ @client.request(
101
+ :get,
102
+ "/v3/biometric-templates/count/",
103
+ query: {
104
+ "vendor_data" => vendor_data,
105
+ "vendor_user_uuid" => vendor_user_uuid,
106
+ "status" => status,
107
+ "source_type" => source_type,
108
+ "retained_from" => retained_from,
109
+ "retained_to" => retained_to
110
+ },
111
+ response: Types::BiometricTemplatesCountResponse,
112
+ request_options: request_options
113
+ )
114
+ end
115
+
116
+ # Purge a retained biometric template
117
+ #
118
+ # An opted-in application keeps one separately managed, image-free face biometric template anchored to the User
119
+ # when a session is deleted (see `DELETE /v3/session/{sessionId}/delete/`). Templates are biometric data with a
120
+ # finite `expires_at`; they never contain images, session data, or identity fields, and they are purged on User
121
+ # deletion, privacy erasure, expiry, or an explicit purge. These endpoints accept application API keys
122
+ # (`x-api-key`) only; Business Console user tokens are rejected with `403`.
123
+ #
124
+ # Purges one template: it is removed from every kind of matching and the stored template is deleted.
125
+ # Irreversible and recorded on the audit trail with the acting principal.
126
+ #
127
+ # **Retry semantics:** Didit deletes the stored template first and only then marks the template purged. If a
128
+ # biometric store is unavailable the call returns `503`, the template moves to `status: purge_failed` and is
129
+ # already excluded from matching; repeat the same call to finish. Repeating a purge of an already purged
130
+ # template returns `already_purged`.
131
+ #
132
+ # Templates are also purged by `POST /v3/users/delete/` for the owning User, by any deletion of that User's
133
+ # sessions with `deletion_instruction: privacy_erasure`, and automatically at `expires_at`.
134
+ #
135
+ # +DELETE /v3/biometric-templates/{template_uuid}/+
136
+ #
137
+ # @param template_uuid [String] Template id, as returned in `biometric_template_uuid` by the session deletion
138
+ # endpoints, `biometric_template_id` on a Face Search match, or the list endpoint.
139
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
140
+ # @return [Didit::Types::BiometricTemplatesDeleteResponse]
141
+ def delete(template_uuid, request_options: nil)
142
+ @client.request(
143
+ :delete,
144
+ "/v3/biometric-templates/{template_uuid}/",
145
+ path_params: { "template_uuid" => template_uuid },
146
+ response: Types::BiometricTemplatesDeleteResponse,
147
+ request_options: request_options
148
+ )
149
+ end
150
+
151
+ # List retained biometric templates
152
+ #
153
+ # An opted-in application keeps one separately managed, image-free face biometric template anchored to the User
154
+ # when a session is deleted (see `DELETE /v3/session/{sessionId}/delete/`). Templates are biometric data with a
155
+ # finite `expires_at`; they never contain images, session data, or identity fields, and they are purged on User
156
+ # deletion, privacy erasure, expiry, or an explicit purge. These endpoints accept application API keys
157
+ # (`x-api-key`) only; Business Console user tokens are rejected with `403`.
158
+ #
159
+ # Returns a paginated list of the templates the application currently holds. Purged templates are not listed.
160
+ #
161
+ # +GET /v3/biometric-templates/+
162
+ #
163
+ # @param vendor_data [String] Case-insensitive substring match on the owning User's current `vendor_data`.
164
+ # @param vendor_user_uuid [String] Exact match on the owning User.
165
+ # @param status [String] Lifecycle status. Purged templates are never listed.
166
+ # @param source_type [String] How the template was created.
167
+ # @param retained_from [Time, String] Templates retained at or after this time.
168
+ # @param retained_to [Time, String] Templates retained at or before this time. Must not be earlier than
169
+ # `retained_from` (`400`).
170
+ # @param ordering [String] Sort order.
171
+ # @param limit [Integer] Page size.
172
+ # @param offset [Integer] Pagination offset.
173
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
174
+ # @return [Didit::Page<Didit::Types::BiometricTemplatesListResponseResults>]
175
+ def list(
176
+ vendor_data: OMIT,
177
+ vendor_user_uuid: OMIT,
178
+ status: OMIT,
179
+ source_type: OMIT,
180
+ retained_from: OMIT,
181
+ retained_to: OMIT,
182
+ ordering: OMIT,
183
+ limit: OMIT,
184
+ offset: OMIT,
185
+ request_options: nil
186
+ )
187
+ @client.request(
188
+ :get,
189
+ "/v3/biometric-templates/",
190
+ query: {
191
+ "vendor_data" => vendor_data,
192
+ "vendor_user_uuid" => vendor_user_uuid,
193
+ "status" => status,
194
+ "source_type" => source_type,
195
+ "retained_from" => retained_from,
196
+ "retained_to" => retained_to,
197
+ "ordering" => ordering,
198
+ "limit" => limit,
199
+ "offset" => offset
200
+ },
201
+ page: Types::BiometricTemplatesListResponseResults,
202
+ request_options: request_options
203
+ )
204
+ end
205
+
206
+ # Get a retained biometric template
207
+ #
208
+ # An opted-in application keeps one separately managed, image-free face biometric template anchored to the User
209
+ # when a session is deleted (see `DELETE /v3/session/{sessionId}/delete/`). Templates are biometric data with a
210
+ # finite `expires_at`; they never contain images, session data, or identity fields, and they are purged on User
211
+ # deletion, privacy erasure, expiry, or an explicit purge. These endpoints accept application API keys
212
+ # (`x-api-key`) only; Business Console user tokens are rejected with `403`.
213
+ #
214
+ # Returns one template. The response never includes an image, a vector, the deleted session's id, or identity
215
+ # data.
216
+ #
217
+ # +GET /v3/biometric-templates/{template_uuid}/+
218
+ #
219
+ # @param template_uuid [String] Template id, as returned in `biometric_template_uuid` by the session deletion
220
+ # endpoints, `biometric_template_id` on a Face Search match, or the list endpoint.
221
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
222
+ # @return [Didit::Types::BiometricTemplatesRetrieveResponse]
223
+ def retrieve(template_uuid, request_options: nil)
224
+ @client.request(
225
+ :get,
226
+ "/v3/biometric-templates/{template_uuid}/",
227
+ path_params: { "template_uuid" => template_uuid },
228
+ response: Types::BiometricTemplatesRetrieveResponse,
229
+ request_options: request_options
230
+ )
231
+ end
232
+ end
233
+ end
234
+ end
@@ -0,0 +1,130 @@
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 +blocklist+ resource.
7
+ class Blocklist < Didit::Resource
8
+ # Add session items to the blocklist
9
+ #
10
+ # Blocklists the face, identity document, phone number or email address of one person verification session of
11
+ # the application. For each selected type, Didit takes the session's most recent record, flags it as blocklisted
12
+ # and adds an entry linked to the session to the matching system blocklist (`added_by: "api"`), so new sessions
13
+ # with a matching face, document number, phone number or email address are declined. Every selected item is
14
+ # checked first, so if one is missing nothing is blocklisted; repeating the call for an item already listed
15
+ # keeps its single entry and refreshes `blocklisted_at`. The session itself and sessions that already finished
16
+ # are not changed. A scoped API key needs `workflows: write`.
17
+ #
18
+ # +POST /v3/blocklist/add/+
19
+ #
20
+ # @param session_id [String] A person verification session of your application. Deleted sessions are refused.
21
+ # @param blocklist_face [Boolean] Blocklist the session's face.
22
+ # @param blocklist_document [Boolean] Blocklist the session's identity document. The document needs its issuing
23
+ # state, document type, document number and full name.
24
+ # @param blocklist_phone [Boolean] Blocklist the session's phone number.
25
+ # @param blocklist_email [Boolean] Blocklist the session's email address.
26
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
27
+ # @return [Didit::Types::BlocklistAddResponse]
28
+ def add(
29
+ session_id:,
30
+ blocklist_face: OMIT,
31
+ blocklist_document: OMIT,
32
+ blocklist_phone: OMIT,
33
+ blocklist_email: OMIT,
34
+ request_options: nil
35
+ )
36
+ @client.request(
37
+ :post,
38
+ "/v3/blocklist/add/",
39
+ body: {
40
+ "session_id" => session_id,
41
+ "blocklist_face" => blocklist_face,
42
+ "blocklist_document" => blocklist_document,
43
+ "blocklist_phone" => blocklist_phone,
44
+ "blocklist_email" => blocklist_email
45
+ },
46
+ response: Types::BlocklistAddResponse,
47
+ request_options: request_options
48
+ )
49
+ end
50
+
51
+ # List blocklisted items
52
+ #
53
+ # Returns one paginated feed of the faces, identity documents, phone numbers and email addresses of the
54
+ # application's verification sessions that are currently blocklisted, newest `blocklisted_at` first; filter with
55
+ # `item_type`. Items of deleted sessions are not included. The feed covers records blocklisted from a session
56
+ # (with [Add session items to the blocklist](https://docs.didit.me/management-api/blocklist/add), from the
57
+ # console, or by a list entry created from a session); values added to a list by hand, uploaded faces, faces
58
+ # from a document-capture selfie and the other entry types are read with [List list
59
+ # entries](https://docs.didit.me/management-api/lists/list-entries). `face_image` and `front_image` are
60
+ # short-lived signed URLs, and a scoped API key without `media: read` receives `null`. A scoped API key needs
61
+ # `workflows: read`.
62
+ #
63
+ # +GET /v3/blocklist/+
64
+ #
65
+ # @param item_type [String] Only items of this type. When omitted, every type is returned.
66
+ # @param limit [Integer] Page size. Defaults to 50. A value above 1000000 returns `400`; zero, a negative or a
67
+ # non-numeric value falls back to 50.
68
+ # @param offset [Integer] Zero-based index of the first item to return. Prefer following `next`. A value above
69
+ # 1000000 returns `400`; a negative or non-numeric value falls back to 0.
70
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
71
+ # @return [Didit::Page<Didit::Types::BlocklistedItem>]
72
+ def list(item_type: OMIT, limit: OMIT, offset: OMIT, request_options: nil)
73
+ @client.request(
74
+ :get,
75
+ "/v3/blocklist/",
76
+ query: {
77
+ "item_type" => item_type,
78
+ "limit" => limit,
79
+ "offset" => offset
80
+ },
81
+ page: Types::BlocklistedItem,
82
+ request_options: request_options
83
+ )
84
+ end
85
+
86
+ # Remove session items from the blocklist
87
+ #
88
+ # Lifts the block on the face, identity document, phone number or email address of one person verification
89
+ # session of the application. For each selected type, Didit takes the session's most recent record, clears its
90
+ # blocklisted flag and deletes the system blocklist entries created from that record, so it no longer declines
91
+ # new sessions. Entries added to a list by value are not touched: find them with [List list
92
+ # entries](https://docs.didit.me/management-api/lists/list-entries) and delete them with [Delete a list
93
+ # entry](https://docs.didit.me/management-api/lists/delete-entry). Unblocking a record that is not blocklisted
94
+ # succeeds and changes nothing, and sessions that already finished are not changed. A scoped API key needs
95
+ # `workflows: write`.
96
+ #
97
+ # +POST /v3/blocklist/remove/+
98
+ #
99
+ # @param session_id [String] A person verification session of your application. Deleted sessions are refused.
100
+ # @param unblock_face [Boolean] Lift the block on the session's face.
101
+ # @param unblock_document [Boolean] Lift the block on the session's identity document.
102
+ # @param unblock_phone [Boolean] Lift the block on the session's phone number.
103
+ # @param unblock_email [Boolean] Lift the block on the session's email address.
104
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
105
+ # @return [Didit::Types::BlocklistRemoveResponse]
106
+ def remove(
107
+ session_id:,
108
+ unblock_face: OMIT,
109
+ unblock_document: OMIT,
110
+ unblock_phone: OMIT,
111
+ unblock_email: OMIT,
112
+ request_options: nil
113
+ )
114
+ @client.request(
115
+ :post,
116
+ "/v3/blocklist/remove/",
117
+ body: {
118
+ "session_id" => session_id,
119
+ "unblock_face" => unblock_face,
120
+ "unblock_document" => unblock_document,
121
+ "unblock_phone" => unblock_phone,
122
+ "unblock_email" => unblock_email
123
+ },
124
+ response: Types::BlocklistRemoveResponse,
125
+ request_options: request_options
126
+ )
127
+ end
128
+ end
129
+ end
130
+ end
@@ -0,0 +1,29 @@
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 +business_sessions+ resource.
7
+ class BusinessSessions < Didit::Resource
8
+ # List networks for a business session
9
+ #
10
+ # List the networks the business session's vendor business belongs to.
11
+ #
12
+ # +GET /v3/organization/{organization_id}/application/{application_id}/business-sessions/{business_session_id}/networks/+
13
+ #
14
+ # @param business_session_id [String] Business session UUID.
15
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
16
+ # @return [Didit::Types::EntityNetworkMembershipList]
17
+ def list_networks(business_session_id, request_options: nil)
18
+ @client.request(
19
+ :get,
20
+ "/v3/organization/{organization_id}/application/{application_id}/business-sessions/{business_session_id}/networks/",
21
+ path_params: { "business_session_id" => business_session_id },
22
+ scope: :application,
23
+ response: Types::EntityNetworkMembershipList,
24
+ request_options: request_options
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end