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,471 @@
|
|
|
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 +businesses+ resource.
|
|
7
|
+
class Businesses < Didit::Resource
|
|
8
|
+
# Batch delete businesses
|
|
9
|
+
#
|
|
10
|
+
# **Permanently delete** businesses - this cannot be undone. For blocking prefer [Update Business
|
|
11
|
+
# Status](#patch-/v3/businesses/-vendor_data-/update-status/) with `BLOCKED`.
|
|
12
|
+
#
|
|
13
|
+
# **Filed regulatory reports:** if the selected data is in a finalized regulatory report, the whole request is
|
|
14
|
+
# refused with `409` and nothing is deleted. The body uses `code: in_filed_report` and names each report with
|
|
15
|
+
# `uuid`, `report_number`, `report_type` and `case_uuid`. Delete the reports, then repeat the request.
|
|
16
|
+
#
|
|
17
|
+
# +POST /v3/businesses/delete/+
|
|
18
|
+
#
|
|
19
|
+
# @param vendor_data_list [Array<String>] Your own identifiers to delete, matched exactly as sent.
|
|
20
|
+
# @param didit_internal_id_list [Array<String>] Didit's internal UUIDs (`didit_internal_id`) to delete.
|
|
21
|
+
# @param delete_all [Boolean] If `true`, deletes every business in the application. Cannot be combined with the
|
|
22
|
+
# list selectors.
|
|
23
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
24
|
+
# @return [Didit::Types::BusinessesBatchDeleteResponse]
|
|
25
|
+
def batch_delete(vendor_data_list: OMIT, didit_internal_id_list: OMIT, delete_all: OMIT, request_options: nil)
|
|
26
|
+
@client.request(
|
|
27
|
+
:post,
|
|
28
|
+
"/v3/businesses/delete/",
|
|
29
|
+
body: {
|
|
30
|
+
"vendor_data_list" => vendor_data_list,
|
|
31
|
+
"didit_internal_id_list" => didit_internal_id_list,
|
|
32
|
+
"delete_all" => delete_all
|
|
33
|
+
},
|
|
34
|
+
response: Types::BusinessesBatchDeleteResponse,
|
|
35
|
+
request_options: request_options
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Create business
|
|
40
|
+
#
|
|
41
|
+
# Pre-create a [business](/entities/businesses) *without* a KYB session. All fields are optional, but you should
|
|
42
|
+
# always send `vendor_data` - without it the record cannot be linked to sessions or transactions. When provided,
|
|
43
|
+
# `vendor_data` must be unique among non-deleted businesses (exact match; conflicts return 400). Not idempotent.
|
|
44
|
+
#
|
|
45
|
+
# +POST /v3/businesses/create/+
|
|
46
|
+
#
|
|
47
|
+
# @param vendor_data [String, nil] Your unique identifier for this business (free-form string, NOT a UUID).
|
|
48
|
+
# Optional but strongly recommended. When provided, must be unique among non-deleted businesses for the
|
|
49
|
+
# application; matched exactly as sent.
|
|
50
|
+
# @param display_name [String, nil] Friendly display name shown in the console (takes precedence over
|
|
51
|
+
# `legal_name` for UI display).
|
|
52
|
+
# @param legal_name [String, nil] Official legal name of the company.
|
|
53
|
+
# @param registration_number [String, nil] Company registration or incorporation number.
|
|
54
|
+
# @param country_code [String, nil] Country of incorporation (ISO 3166-1 alpha-2, e.g. `GB`, `US`).
|
|
55
|
+
# @param status [String] Initial lifecycle status. Defaults to `ACTIVE`.
|
|
56
|
+
# @param metadata [Hash, nil] Arbitrary JSON object you attach to the business. Defaults to `{}`.
|
|
57
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
58
|
+
# @return [Didit::Types::BusinessDetailItem]
|
|
59
|
+
def create(
|
|
60
|
+
vendor_data: OMIT,
|
|
61
|
+
display_name: OMIT,
|
|
62
|
+
legal_name: OMIT,
|
|
63
|
+
registration_number: OMIT,
|
|
64
|
+
country_code: OMIT,
|
|
65
|
+
status: OMIT,
|
|
66
|
+
metadata: OMIT,
|
|
67
|
+
request_options: nil
|
|
68
|
+
)
|
|
69
|
+
@client.request(
|
|
70
|
+
:post,
|
|
71
|
+
"/v3/businesses/create/",
|
|
72
|
+
body: {
|
|
73
|
+
"vendor_data" => vendor_data,
|
|
74
|
+
"display_name" => display_name,
|
|
75
|
+
"legal_name" => legal_name,
|
|
76
|
+
"registration_number" => registration_number,
|
|
77
|
+
"country_code" => country_code,
|
|
78
|
+
"status" => status,
|
|
79
|
+
"metadata" => metadata
|
|
80
|
+
},
|
|
81
|
+
response: Types::BusinessDetailItem,
|
|
82
|
+
request_options: request_options
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Download a business session PDF report
|
|
87
|
+
#
|
|
88
|
+
# Render the PDF report of one Business Verification (KYB) session: company registry data, key people and
|
|
89
|
+
# beneficial owners, documents, AML results and the other workflow features, plus the session's tags and review
|
|
90
|
+
# activity. With white-label customization on, the report carries your logo and privacy policy URL. The body is
|
|
91
|
+
# the PDF itself (`application/pdf`), not JSON.
|
|
92
|
+
#
|
|
93
|
+
# The session must be `Approved`, `Declined` or `In Review`; any other status returns `403`, so wait for the
|
|
94
|
+
# `status.updated` [webhook](https://docs.didit.me/integration/webhooks) first. The report is rendered on every
|
|
95
|
+
# call and nothing is billed, so store the file instead of fetching it repeatedly. `GET
|
|
96
|
+
# /v3/session/{sessionId}/generate-pdf/` renders the same kind of report by session ID alone.
|
|
97
|
+
#
|
|
98
|
+
# A PDF report counts as media: a scoped API key needs `businesses: read` and `media: read`, and a key limited
|
|
99
|
+
# to some workflows or to approved sessions cannot call it.
|
|
100
|
+
#
|
|
101
|
+
# +GET /v3/organization/{organization_id}/application/{application_id}/businesses/{business_session_id}/pdf/+
|
|
102
|
+
#
|
|
103
|
+
# @param business_session_id [String] `session_id` of the Business Verification (KYB) session, as returned when
|
|
104
|
+
# the session was created. A session of another application returns `404`.
|
|
105
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
106
|
+
# @return [String, nil] the body bytes, or nil when a block receives the chunks
|
|
107
|
+
def generate_session_pdf(business_session_id, request_options: nil, &block)
|
|
108
|
+
@client.request(
|
|
109
|
+
:get,
|
|
110
|
+
"/v3/organization/{organization_id}/application/{application_id}/businesses/{business_session_id}/pdf/",
|
|
111
|
+
path_params: { "business_session_id" => business_session_id },
|
|
112
|
+
scope: :application,
|
|
113
|
+
response: :binary,
|
|
114
|
+
accept: "application/pdf, application/json",
|
|
115
|
+
request_options: request_options, &block
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# List businesses
|
|
120
|
+
#
|
|
121
|
+
# List [businesses](/entities/businesses) Didit assembles from KYB sessions sharing the same `vendor_data`
|
|
122
|
+
# (free-form string, NOT a UUID), plus businesses created via the API. Paginated, ordered by `last_session_at`
|
|
123
|
+
# desc. This endpoint does not support filtering or search parameters - fetch pages and filter client-side.
|
|
124
|
+
#
|
|
125
|
+
# +GET /v3/businesses/+
|
|
126
|
+
#
|
|
127
|
+
# @param limit [Integer] Page size. Defaults to 50 when omitted. There is no enforced maximum, but keep pages
|
|
128
|
+
# small for latency.
|
|
129
|
+
# @param offset [Integer] Zero-based offset of the first record to return. Prefer following the `next` URL from
|
|
130
|
+
# the previous page over computing this by hand.
|
|
131
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
132
|
+
# @return [Didit::Page<Didit::Types::BusinessListItem>]
|
|
133
|
+
def list(limit: OMIT, offset: OMIT, request_options: nil)
|
|
134
|
+
@client.request(
|
|
135
|
+
:get,
|
|
136
|
+
"/v3/businesses/",
|
|
137
|
+
query: {
|
|
138
|
+
"limit" => limit,
|
|
139
|
+
"offset" => offset
|
|
140
|
+
},
|
|
141
|
+
page: Types::BusinessListItem,
|
|
142
|
+
request_options: request_options
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# List networks for a business
|
|
147
|
+
#
|
|
148
|
+
# List the networks a vendor business belongs to.
|
|
149
|
+
#
|
|
150
|
+
# +GET /v3/organization/{organization_id}/application/{application_id}/businesses/{vendor_business_uuid}/networks/+
|
|
151
|
+
#
|
|
152
|
+
# @param vendor_business_uuid [String] Vendor business UUID.
|
|
153
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
154
|
+
# @return [Didit::Types::EntityNetworkMembershipList]
|
|
155
|
+
def list_networks(vendor_business_uuid, request_options: nil)
|
|
156
|
+
@client.request(
|
|
157
|
+
:get,
|
|
158
|
+
"/v3/organization/{organization_id}/application/{application_id}/businesses/{vendor_business_uuid}/networks/",
|
|
159
|
+
path_params: { "vendor_business_uuid" => vendor_business_uuid },
|
|
160
|
+
scope: :application,
|
|
161
|
+
response: Types::EntityNetworkMembershipList,
|
|
162
|
+
request_options: request_options
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Get business
|
|
167
|
+
#
|
|
168
|
+
# Fetch one [business](/entities/businesses) by `vendor_data` (exact match). Adds `metadata` and `updated_at` to
|
|
169
|
+
# the list view. Deleted businesses return 404.
|
|
170
|
+
#
|
|
171
|
+
# +GET /v3/businesses/{vendor_data}/+
|
|
172
|
+
#
|
|
173
|
+
# @param vendor_data [String] Your unique identifier for the business - a free-form string (NOT a UUID), matched
|
|
174
|
+
# exactly as sent.
|
|
175
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
176
|
+
# @return [Didit::Types::BusinessDetailItem]
|
|
177
|
+
def retrieve(vendor_data, request_options: nil)
|
|
178
|
+
@client.request(
|
|
179
|
+
:get,
|
|
180
|
+
"/v3/businesses/{vendor_data}/",
|
|
181
|
+
path_params: { "vendor_data" => vendor_data },
|
|
182
|
+
response: Types::BusinessDetailItem,
|
|
183
|
+
request_options: request_options
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Get AML ongoing monitoring job
|
|
188
|
+
#
|
|
189
|
+
# Progress and per-outcome counters of a monitoring toggle job. Poll every couple of seconds while status is
|
|
190
|
+
# PENDING or PROCESSING.
|
|
191
|
+
#
|
|
192
|
+
# +GET /v3/organization/{organization_id}/application/{application_id}/vendor-businesses/toggle-ongoing-monitoring/{job_id}/+
|
|
193
|
+
#
|
|
194
|
+
# @param job_id [String] Monitoring job UUID returned by the toggle endpoint.
|
|
195
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
196
|
+
# @return [Didit::Types::OngoingMonitoringJob]
|
|
197
|
+
def retrieve_ongoing_monitoring_job(job_id, request_options: nil)
|
|
198
|
+
@client.request(
|
|
199
|
+
:get,
|
|
200
|
+
"/v3/organization/{organization_id}/application/{application_id}/vendor-businesses/toggle-ongoing-monitoring/{job_id}/",
|
|
201
|
+
path_params: { "job_id" => job_id },
|
|
202
|
+
scope: :application,
|
|
203
|
+
response: Types::OngoingMonitoringJob,
|
|
204
|
+
request_options: request_options
|
|
205
|
+
)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Get AML ongoing monitoring job
|
|
209
|
+
#
|
|
210
|
+
# Progress and per-outcome counters of a monitoring toggle job. Poll every couple of seconds while status is
|
|
211
|
+
# PENDING or PROCESSING.
|
|
212
|
+
#
|
|
213
|
+
# +GET /v3/organization/{organization_id}/application/{application_id}/businesses/toggle-ongoing-monitoring/{job_id}/+
|
|
214
|
+
#
|
|
215
|
+
# @param job_id [String] Monitoring job UUID returned by the toggle endpoint.
|
|
216
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
217
|
+
# @return [Didit::Types::OngoingMonitoringJob]
|
|
218
|
+
def retrieve_session_ongoing_monitoring_job(job_id, request_options: nil)
|
|
219
|
+
@client.request(
|
|
220
|
+
:get,
|
|
221
|
+
"/v3/organization/{organization_id}/application/{application_id}/businesses/toggle-ongoing-monitoring/{job_id}/",
|
|
222
|
+
path_params: { "job_id" => job_id },
|
|
223
|
+
scope: :application,
|
|
224
|
+
response: Types::OngoingMonitoringJob,
|
|
225
|
+
request_options: request_options
|
|
226
|
+
)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Enable or disable AML ongoing monitoring for businesses
|
|
230
|
+
#
|
|
231
|
+
# Turns AML ongoing monitoring on or off for the selected businesses, with the same semantics as the Business
|
|
232
|
+
# Console. Exactly one monitored AML screening is kept per business, so a profile that verified several times is
|
|
233
|
+
# monitored and billed once; disabling turns monitoring off across all of the profile's screenings. Businesses
|
|
234
|
+
# without any AML screening are screened first (billed as a regular AML screening) when they have the legal or
|
|
235
|
+
# display name needed; otherwise they are reported as `skipped_no_identity_data`.
|
|
236
|
+
#
|
|
237
|
+
# Set `estimate_only: true` to preview counts and costs without writing anything. Selections of 20 profiles or
|
|
238
|
+
# fewer resolve inline and return `200` with the completed job; larger selections return `202` and run in the
|
|
239
|
+
# background - poll [Get AML monitoring job](#get-/v3/aml-monitoring/jobs/-job_id-/) with the returned `job_id`.
|
|
240
|
+
# Enabling is refused with `403` when the organization balance does not cover the estimate. Identifiers that
|
|
241
|
+
# match nothing are listed in `unmatched` and never fail the request: a selection that matches nothing completes
|
|
242
|
+
# as an empty job (`total` 0), the same convention as the batch delete endpoints.
|
|
243
|
+
#
|
|
244
|
+
# +POST /v3/businesses/aml-monitoring/+
|
|
245
|
+
#
|
|
246
|
+
# @param is_enabled [Boolean] true to enable monitoring, false to disable it.
|
|
247
|
+
# @param estimate_only [Boolean] When true, returns the cost estimate and performs no writes - no screening, no
|
|
248
|
+
# billing, no job.
|
|
249
|
+
# @param vendor_data_list [Array<String>] Your own identifiers of the businesses to toggle, matched exactly as
|
|
250
|
+
# sent.
|
|
251
|
+
# @param didit_internal_id_list [Array<String>] Didit internal ids of the businesses to toggle - the
|
|
252
|
+
# `didit_internal_id` returned by the create, get and list endpoints.
|
|
253
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
254
|
+
# @return [Didit::Types::AMLMonitoringToggleResult, Didit::Types::AMLMonitoringJob]
|
|
255
|
+
def set_aml_monitoring(
|
|
256
|
+
is_enabled:,
|
|
257
|
+
estimate_only: OMIT,
|
|
258
|
+
vendor_data_list: OMIT,
|
|
259
|
+
didit_internal_id_list: OMIT,
|
|
260
|
+
request_options: nil
|
|
261
|
+
)
|
|
262
|
+
@client.request(
|
|
263
|
+
:post,
|
|
264
|
+
"/v3/businesses/aml-monitoring/",
|
|
265
|
+
body: {
|
|
266
|
+
"is_enabled" => is_enabled,
|
|
267
|
+
"estimate_only" => estimate_only,
|
|
268
|
+
"vendor_data_list" => vendor_data_list,
|
|
269
|
+
"didit_internal_id_list" => didit_internal_id_list
|
|
270
|
+
},
|
|
271
|
+
response: { 200 => Types::AMLMonitoringToggleResult, 202 => Types::AMLMonitoringJob },
|
|
272
|
+
request_options: request_options
|
|
273
|
+
)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Toggle AML ongoing monitoring for businesses
|
|
277
|
+
#
|
|
278
|
+
# Business-level equivalent of the user toggle: one monitored AML screening per business, with businesses
|
|
279
|
+
# lacking any AML screening screened first (company entity). Same estimate_only, inline fast-path and async job
|
|
280
|
+
# contract.
|
|
281
|
+
#
|
|
282
|
+
# +PATCH /v3/organization/{organization_id}/application/{application_id}/vendor-businesses/toggle-ongoing-monitoring/+
|
|
283
|
+
#
|
|
284
|
+
# @param is_enabled [Boolean] true to enable monitoring, false to disable it.
|
|
285
|
+
# @param estimate_only [Boolean] When true, returns the cost estimate and performs no writes.
|
|
286
|
+
# @param update_all [Boolean] Apply to every entity of the application (scoped by the filter_* params when
|
|
287
|
+
# present).
|
|
288
|
+
# @param filter_search [String]
|
|
289
|
+
# @param filter_status [Array<String>]
|
|
290
|
+
# @param filter_country [String]
|
|
291
|
+
# @param filter_date_from [Date, String]
|
|
292
|
+
# @param filter_date_to [Date, String]
|
|
293
|
+
# @param didit_internal_id_list [Array<String>] Entities to toggle. Required unless update_all is true.
|
|
294
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
295
|
+
# @return [Didit::Types::OngoingMonitoringToggleResult, Didit::Types::OngoingMonitoringJob]
|
|
296
|
+
def set_ongoing_monitoring(
|
|
297
|
+
is_enabled:,
|
|
298
|
+
estimate_only: OMIT,
|
|
299
|
+
update_all: OMIT,
|
|
300
|
+
filter_search: OMIT,
|
|
301
|
+
filter_status: OMIT,
|
|
302
|
+
filter_country: OMIT,
|
|
303
|
+
filter_date_from: OMIT,
|
|
304
|
+
filter_date_to: OMIT,
|
|
305
|
+
didit_internal_id_list: OMIT,
|
|
306
|
+
request_options: nil
|
|
307
|
+
)
|
|
308
|
+
@client.request(
|
|
309
|
+
:patch,
|
|
310
|
+
"/v3/organization/{organization_id}/application/{application_id}/vendor-businesses/toggle-ongoing-monitoring/",
|
|
311
|
+
body: {
|
|
312
|
+
"is_enabled" => is_enabled,
|
|
313
|
+
"estimate_only" => estimate_only,
|
|
314
|
+
"update_all" => update_all,
|
|
315
|
+
"filter_search" => filter_search,
|
|
316
|
+
"filter_status" => filter_status,
|
|
317
|
+
"filter_country" => filter_country,
|
|
318
|
+
"filter_date_from" => filter_date_from,
|
|
319
|
+
"filter_date_to" => filter_date_to,
|
|
320
|
+
"didit_internal_id_list" => didit_internal_id_list
|
|
321
|
+
},
|
|
322
|
+
scope: :application,
|
|
323
|
+
response: { 200 => Types::OngoingMonitoringToggleResult, 202 => Types::OngoingMonitoringJob },
|
|
324
|
+
request_options: request_options
|
|
325
|
+
)
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Toggle AML ongoing monitoring for business sessions
|
|
329
|
+
#
|
|
330
|
+
# Session-level toggle for KYB verifications, addressed by session number. Sessions without an AML screening get
|
|
331
|
+
# one created and attached to the session itself. Same estimate_only, inline fast-path and async job contract as
|
|
332
|
+
# the user-level endpoints. Replaces the legacy synchronous behavior that skipped sessions without an AML
|
|
333
|
+
# screening.
|
|
334
|
+
#
|
|
335
|
+
# +PATCH /v3/organization/{organization_id}/application/{application_id}/businesses/toggle-ongoing-monitoring/+
|
|
336
|
+
#
|
|
337
|
+
# @param is_enabled [Boolean] true to enable monitoring, false to disable it.
|
|
338
|
+
# @param estimate_only [Boolean] When true, returns the cost estimate and performs no writes.
|
|
339
|
+
# @param update_all [Boolean] Apply to every entity of the application (scoped by the filter_* params when
|
|
340
|
+
# present).
|
|
341
|
+
# @param filter_search [String]
|
|
342
|
+
# @param filter_status [Array<String>]
|
|
343
|
+
# @param filter_country [String]
|
|
344
|
+
# @param filter_date_from [Date, String]
|
|
345
|
+
# @param filter_date_to [Date, String]
|
|
346
|
+
# @param session_numbers [Array<String>] Business session numbers to toggle. Required unless update_all (or the
|
|
347
|
+
# legacy toggle_all alias) is true.
|
|
348
|
+
# @param toggle_all [Boolean] Legacy alias of update_all.
|
|
349
|
+
# @param filter_workflow_id [String]
|
|
350
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
351
|
+
# @return [Didit::Types::OngoingMonitoringToggleResult, Didit::Types::OngoingMonitoringJob]
|
|
352
|
+
def set_session_ongoing_monitoring(
|
|
353
|
+
is_enabled:,
|
|
354
|
+
estimate_only: OMIT,
|
|
355
|
+
update_all: OMIT,
|
|
356
|
+
filter_search: OMIT,
|
|
357
|
+
filter_status: OMIT,
|
|
358
|
+
filter_country: OMIT,
|
|
359
|
+
filter_date_from: OMIT,
|
|
360
|
+
filter_date_to: OMIT,
|
|
361
|
+
session_numbers: OMIT,
|
|
362
|
+
toggle_all: OMIT,
|
|
363
|
+
filter_workflow_id: OMIT,
|
|
364
|
+
request_options: nil
|
|
365
|
+
)
|
|
366
|
+
@client.request(
|
|
367
|
+
:patch,
|
|
368
|
+
"/v3/organization/{organization_id}/application/{application_id}/businesses/toggle-ongoing-monitoring/",
|
|
369
|
+
body: {
|
|
370
|
+
"is_enabled" => is_enabled,
|
|
371
|
+
"estimate_only" => estimate_only,
|
|
372
|
+
"update_all" => update_all,
|
|
373
|
+
"filter_search" => filter_search,
|
|
374
|
+
"filter_status" => filter_status,
|
|
375
|
+
"filter_country" => filter_country,
|
|
376
|
+
"filter_date_from" => filter_date_from,
|
|
377
|
+
"filter_date_to" => filter_date_to,
|
|
378
|
+
"session_numbers" => session_numbers,
|
|
379
|
+
"toggle_all" => toggle_all,
|
|
380
|
+
"filter_workflow_id" => filter_workflow_id
|
|
381
|
+
},
|
|
382
|
+
scope: :application,
|
|
383
|
+
response: { 200 => Types::OngoingMonitoringToggleResult, 202 => Types::OngoingMonitoringJob },
|
|
384
|
+
request_options: request_options
|
|
385
|
+
)
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# Update business
|
|
389
|
+
#
|
|
390
|
+
# Partial update of a business: `display_name`, `legal_name`, `registration_number`, `country_code`, `status`,
|
|
391
|
+
# `metadata`. `metadata` fully replaces. Setting `status` to `BLOCKED` adds the `vendor_data` to the system
|
|
392
|
+
# blocklist; moving away from `BLOCKED` removes that entry. Every edit is recorded in the company's activity: a
|
|
393
|
+
# status change with the optional `reason`, and a change to `display_name`, `legal_name`, `registration_number`,
|
|
394
|
+
# `country_code` or `metadata` as a profile update.
|
|
395
|
+
#
|
|
396
|
+
# +PATCH /v3/businesses/{vendor_data}/+
|
|
397
|
+
#
|
|
398
|
+
# @param vendor_data [String] Your unique identifier for the business (free-form string, NOT a UUID).
|
|
399
|
+
# @param display_name [String, nil] Friendly display name shown in the console (takes precedence over
|
|
400
|
+
# `legal_name` for UI display).
|
|
401
|
+
# @param legal_name [String, nil] Official legal name from registry or manual entry.
|
|
402
|
+
# @param registration_number [String, nil] Company registration or incorporation number.
|
|
403
|
+
# @param country_code [String, nil] Country of incorporation (ISO 3166-1 alpha-2, e.g. `GB`, `US`).
|
|
404
|
+
# @param status [String] Business lifecycle status. Setting `BLOCKED` automatically adds the `vendor_data` to
|
|
405
|
+
# the system blocklist; flipping away from `BLOCKED` removes that blocklist entry.
|
|
406
|
+
# @param metadata [Hash, nil] Arbitrary JSON object you attach to the business. **Fully replaces** the existing
|
|
407
|
+
# metadata on update - merge client-side if you only want to add keys.
|
|
408
|
+
# @param reason [String, nil] Why the status changed. Recorded on the status-change entry of the company's
|
|
409
|
+
# **Activity** in the Business Console, only when the status actually changes. Webhooks do not carry it.
|
|
410
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
411
|
+
# @return [Didit::Types::BusinessDetailItem]
|
|
412
|
+
def update(
|
|
413
|
+
vendor_data,
|
|
414
|
+
display_name: OMIT,
|
|
415
|
+
legal_name: OMIT,
|
|
416
|
+
registration_number: OMIT,
|
|
417
|
+
country_code: OMIT,
|
|
418
|
+
status: OMIT,
|
|
419
|
+
metadata: OMIT,
|
|
420
|
+
reason: OMIT,
|
|
421
|
+
request_options: nil
|
|
422
|
+
)
|
|
423
|
+
@client.request(
|
|
424
|
+
:patch,
|
|
425
|
+
"/v3/businesses/{vendor_data}/",
|
|
426
|
+
path_params: { "vendor_data" => vendor_data },
|
|
427
|
+
body: {
|
|
428
|
+
"display_name" => display_name,
|
|
429
|
+
"legal_name" => legal_name,
|
|
430
|
+
"registration_number" => registration_number,
|
|
431
|
+
"country_code" => country_code,
|
|
432
|
+
"status" => status,
|
|
433
|
+
"metadata" => metadata,
|
|
434
|
+
"reason" => reason
|
|
435
|
+
},
|
|
436
|
+
response: Types::BusinessDetailItem,
|
|
437
|
+
request_options: request_options
|
|
438
|
+
)
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
# Update business status
|
|
442
|
+
#
|
|
443
|
+
# Flip only the lifecycle `status` of a business: `ACTIVE`, `FLAGGED` or `BLOCKED` (not session statuses).
|
|
444
|
+
# `BLOCKED` adds the `vendor_data` to the system blocklist; moving away from `BLOCKED` removes that entry. Each
|
|
445
|
+
# change is recorded in the company's activity, with the optional `reason`. Sending the current status changes
|
|
446
|
+
# nothing and records no `reason`. The `business.status.updated` webhook does not carry `reason`.
|
|
447
|
+
#
|
|
448
|
+
# +PATCH /v3/businesses/{vendor_data}/update-status/+
|
|
449
|
+
#
|
|
450
|
+
# @param vendor_data [String] Your unique identifier for the business (free-form string, NOT a UUID).
|
|
451
|
+
# @param status [String] New lifecycle status. `BLOCKED` also adds the `vendor_data` to the system blocklist.
|
|
452
|
+
# @param reason [String, nil] Why the status changed. Recorded on the status-change entry of the company's
|
|
453
|
+
# **Activity** in the Business Console, only when the status actually changes. Webhooks do not carry it.
|
|
454
|
+
# @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
|
|
455
|
+
# @return [Didit::Types::BusinessDetailItem]
|
|
456
|
+
def update_status(vendor_data, status:, reason: OMIT, request_options: nil)
|
|
457
|
+
@client.request(
|
|
458
|
+
:patch,
|
|
459
|
+
"/v3/businesses/{vendor_data}/update-status/",
|
|
460
|
+
path_params: { "vendor_data" => vendor_data },
|
|
461
|
+
body: {
|
|
462
|
+
"status" => status,
|
|
463
|
+
"reason" => reason
|
|
464
|
+
},
|
|
465
|
+
response: Types::BusinessDetailItem,
|
|
466
|
+
request_options: request_options
|
|
467
|
+
)
|
|
468
|
+
end
|
|
469
|
+
end
|
|
470
|
+
end
|
|
471
|
+
end
|