Class: Zernio::PhoneNumbersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/phone_numbers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PhoneNumbersApi

Returns a new instance of PhoneNumbersApi.



19
20
21
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_phone_number_port_in(id, opts = {}) ⇒ CancelPhoneNumberPortIn200Response

Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier). Only orders that haven't ported can be cancelled; a completed port is a normal number release instead. The carrier may report cancel-pending briefly while the losing carrier acknowledges; it settles to cancelled.

Parameters:

  • id (String)

    Porting order ID (from the port-in list).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 27

def cancel_phone_number_port_in(id, opts = {})
  data, _status_code, _headers = cancel_phone_number_port_in_with_http_info(id, opts)
  data
end

#cancel_phone_number_port_in_with_http_info(id, opts = {}) ⇒ Array<(CancelPhoneNumberPortIn200Response, Integer, Hash)>

Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier). Only orders that haven't ported can be cancelled; a completed port is a normal number release instead. The carrier may report `cancel-pending` briefly while the losing carrier acknowledges; it settles to `cancelled`.

Parameters:

  • id (String)

    Porting order ID (from the port-in list).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 37

def cancel_phone_number_port_in_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.cancel_phone_number_port_in ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.cancel_phone_number_port_in"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CancelPhoneNumberPortIn200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.cancel_phone_number_port_in",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#cancel_phone_number_port_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_phone_number_availability(country, opts = {}) ⇒ CheckPhoneNumberAvailability200Response

Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - addressConstraint: geo → the registered address MUST be in one of the returned areas (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - addressConstraint: country → any in-country address works. - addressConstraint: none → field-only / instant country, no address. Call this before starting the KYC form for regulated countries.

Parameters:

  • country (String)

    ISO-2 country code.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Check a specific offered type (stock and address constraints are per type). Omitted = the country's default type.

Returns:



91
92
93
94
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 91

def check_phone_number_availability(country, opts = {})
  data, _status_code, _headers = check_phone_number_availability_with_http_info(country, opts)
  data
end

#check_phone_number_availability_with_http_info(country, opts = {}) ⇒ Array<(CheckPhoneNumberAvailability200Response, Integer, Hash)>

Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - `addressConstraint: geo` → the registered address MUST be in one of the returned `areas` (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - `addressConstraint: country` → any in-country address works. - `addressConstraint: none` → field-only / instant country, no address. Call this before starting the KYC form for regulated countries.

Parameters:

  • country (String)

    ISO-2 country code.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Check a specific offered type (stock and address constraints are per type). Omitted = the country's default type.

Returns:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 102

def check_phone_number_availability_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.check_phone_number_availability ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.check_phone_number_availability"
  end
  allowable_values = ["local", "mobile", "national", "toll_free"]
  if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type'])
    fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/availability'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CheckPhoneNumberAvailability200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.check_phone_number_availability",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#check_phone_number_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#check_phone_number_portability(check_phone_number_portability_request, opts = {}) ⇒ CheckPhoneNumberPortability200Response

Check portability Pre-flight portability check: whether each number can be ported in and whether it qualifies for FastPort, BEFORE the user commits to a port order (LOA, invoice, service address). Read-only; creates no order and bills nothing.

Parameters:

Returns:



161
162
163
164
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 161

def check_phone_number_portability(check_phone_number_portability_request, opts = {})
  data, _status_code, _headers = check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts)
  data
end

#check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {}) ⇒ Array<(CheckPhoneNumberPortability200Response, Integer, Hash)>

Check portability Pre-flight portability check: whether each number can be ported in and whether it qualifies for FastPort, BEFORE the user commits to a port order (LOA, invoice, service address). Read-only; creates no order and bills nothing.

Parameters:

Returns:



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 171

def check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.check_phone_number_portability ...'
  end
  # verify the required parameter 'check_phone_number_portability_request' is set
  if @api_client.config.client_side_validation && check_phone_number_portability_request.nil?
    fail ArgumentError, "Missing the required parameter 'check_phone_number_portability_request' when calling PhoneNumbersApi.check_phone_number_portability"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/check'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(check_phone_number_portability_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CheckPhoneNumberPortability200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.check_phone_number_portability",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#check_phone_number_portability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login — useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. White-label the page with branding (your company name, logo, brand color). Supply redirect_url to send the end customer back to your own site after a successful submit (completion params are appended — see below). Listen for the whatsapp.number.kyc_submitted webhook to react when the form is completed.

Parameters:

Returns:



229
230
231
232
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 229

def create_phone_number_kyc_link(create_phone_number_kyc_link_request, opts = {})
  data, _status_code, _headers = create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts)
  data
end

Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login — useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. White-label the page with `branding` (your company name, logo, brand color). Supply `redirect_url` to send the end customer back to your own site after a successful submit (completion params are appended — see below). Listen for the `whatsapp.number.kyc_submitted` webhook to react when the form is completed.

Parameters:

Returns:



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 239

def create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_kyc_link ...'
  end
  # verify the required parameter 'create_phone_number_kyc_link_request' is set
  if @api_client.config.client_side_validation && create_phone_number_kyc_link_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_number_kyc_link_request' when calling PhoneNumbersApi.create_phone_number_kyc_link"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/share'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_kyc_link_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreatePhoneNumberKycLink200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.create_phone_number_kyc_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_kyc_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_phone_number_port_in(create_phone_number_port_in_request, opts = {}) ⇒ CreatePhoneNumberPortIn201Response

Port numbers in Submit a port-in for one or more existing numbers from another carrier. Creates the carrier order(s), attaches the end-user (current account) info plus the LOA and invoice documents, and submits to the losing carrier. The transfer PIN is forwarded to the carrier and never stored. Ported numbers arrive voice-ready (and SMS-ready where the order supports messaging). Run the portability check (POST /v1/phone-numbers/port-in/check) and upload the two documents (POST /v1/phone-numbers/port-in/documents) first. The carrier may split the numbers into several orders (by country, number type, losing carrier); orders carries per-order results, and a partial failure still returns 201 with the failed orders' error set (they stay as cancellable drafts).

Parameters:

Returns:



297
298
299
300
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 297

def create_phone_number_port_in(create_phone_number_port_in_request, opts = {})
  data, _status_code, _headers = create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts)
  data
end

#create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {}) ⇒ Array<(CreatePhoneNumberPortIn201Response, Integer, Hash)>

Port numbers in Submit a port-in for one or more existing numbers from another carrier. Creates the carrier order(s), attaches the end-user (current account) info plus the LOA and invoice documents, and submits to the losing carrier. The transfer PIN is forwarded to the carrier and never stored. Ported numbers arrive voice-ready (and SMS-ready where the order supports messaging). Run the portability check (POST /v1/phone-numbers/port-in/check) and upload the two documents (POST /v1/phone-numbers/port-in/documents) first. The carrier may split the numbers into several orders (by country, number type, losing carrier); `orders` carries per-order results, and a partial failure still returns 201 with the failed orders' `error` set (they stay as cancellable drafts).

Parameters:

Returns:



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 307

def create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_port_in ...'
  end
  # verify the required parameter 'create_phone_number_port_in_request' is set
  if @api_client.config.client_side_validation && create_phone_number_port_in_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_number_port_in_request' when calling PhoneNumbersApi.create_phone_number_port_in"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_port_in_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreatePhoneNumberPortIn201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.create_phone_number_port_in",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_port_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number(id, opts = {}) ⇒ GetPhoneNumber200Response

Get phone number Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, onfidoVerificationUrl appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



365
366
367
368
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 365

def get_phone_number(id, opts = {})
  data, _status_code, _headers = get_phone_number_with_http_info(id, opts)
  data
end

#get_phone_number_kyc_form(country, opts = {}) ⇒ GetPhoneNumberKycForm200Response

Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.

Parameters:

  • country (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Requirements and reuse eligibility are per (country, type). Omitted = the country's default type. Pass the same value on the POST.

Returns:



429
430
431
432
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 429

def get_phone_number_kyc_form(country, opts = {})
  data, _status_code, _headers = get_phone_number_kyc_form_with_http_info(country, opts)
  data
end

#get_phone_number_kyc_form_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberKycForm200Response, Integer, Hash)>

Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.

Parameters:

  • country (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Requirements and reuse eligibility are per (country, type). Omitted = the country's default type. Pass the same value on the POST.

Returns:



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 440

def get_phone_number_kyc_form_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_kyc_form ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.get_phone_number_kyc_form"
  end
  allowable_values = ["local", "mobile", "national", "toll_free"]
  if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type'])
    fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumberKycForm200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number_kyc_form",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_kyc_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number_remediation(id, opts = {}) ⇒ GetPhoneNumberRemediation200Response

Get declined requirements For a number in regulatory_declined, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes just those — Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.

Parameters:

  • id (String)

    Phone number record ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



499
500
501
502
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 499

def get_phone_number_remediation(id, opts = {})
  data, _status_code, _headers = get_phone_number_remediation_with_http_info(id, opts)
  data
end

#get_phone_number_remediation_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberRemediation200Response, Integer, Hash)>

Get declined requirements For a number in `regulatory_declined`, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes just those — Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.

Parameters:

  • id (String)

    Phone number record ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 509

def get_phone_number_remediation_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_remediation ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number_remediation"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumberRemediation200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number_remediation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_remediation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_phone_number_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumber200Response, Integer, Hash)>

Get phone number Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, `onfidoVerificationUrl` appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetPhoneNumber200Response, Integer, Hash)>)

    GetPhoneNumber200Response data, response status code and response headers



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 375

def get_phone_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.get_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_phone_number_countries(opts = {}) ⇒ ListPhoneNumberCountries200Response

List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound). Drives the country picker. Tier-4 countries appear only when enabled.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



561
562
563
564
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 561

def list_phone_number_countries(opts = {})
  data, _status_code, _headers = list_phone_number_countries_with_http_info(opts)
  data
end

#list_phone_number_countries_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberCountries200Response, Integer, Hash)>

List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound). Drives the country picker. Tier-4 countries appear only when enabled.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 570

def list_phone_number_countries_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_countries ...'
  end
  # resource path
  local_var_path = '/v1/phone-numbers/countries'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPhoneNumberCountries200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.list_phone_number_countries",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_countries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_phone_number_port_ins(opts = {}) ⇒ ListPhoneNumberPortIns200Response

List port-in orders Your porting orders, newest first (max 50). Poll this for port progress: pending, confirmed FOC date, exception reason, or ported.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



618
619
620
621
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 618

def list_phone_number_port_ins(opts = {})
  data, _status_code, _headers = list_phone_number_port_ins_with_http_info(opts)
  data
end

#list_phone_number_port_ins_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberPortIns200Response, Integer, Hash)>

List port-in orders Your porting orders, newest first (max 50). Poll this for port progress: pending, confirmed FOC date, exception reason, or ported.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 627

def list_phone_number_port_ins_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_port_ins ...'
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPhoneNumberPortIns200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.list_phone_number_port_ins",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_port_ins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_phone_numbers(opts = {}) ⇒ ListPhoneNumbers200Response

List phone numbers List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate connected array; they are not billed and have no provisioning lifecycle.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by status (by default excludes released numbers). NOTE: `status=pending_regulatory` returns the &quot;provisioning&quot; view — numbers still in review PLUS recently-declined (last 30 days) ones, so a failed registration surfaces (with `regulatoryDeclineReason`) instead of silently disappearing. Declined numbers can be re-submitted via POST /v1/phone-numbers/id/remediate. `verifying` is the short-lived state after the number is provisioned on our side while WhatsApp confirms the activation code; the number is not billed until it reaches `active`.

  • :profile_id (String)

    Filter by profile

Returns:



677
678
679
680
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 677

def list_phone_numbers(opts = {})
  data, _status_code, _headers = list_phone_numbers_with_http_info(opts)
  data
end

#list_phone_numbers_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumbers200Response, Integer, Hash)>

List phone numbers List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate `connected` array; they are not billed and have no provisioning lifecycle.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by status (by default excludes released numbers). NOTE: `status=pending_regulatory` returns the &quot;provisioning&quot; view — numbers still in review PLUS recently-declined (last 30 days) ones, so a failed registration surfaces (with `regulatoryDeclineReason`) instead of silently disappearing. Declined numbers can be re-submitted via POST /v1/phone-numbers/id/remediate. `verifying` is the short-lived state after the number is provisioned on our side while WhatsApp confirms the activation code; the number is not billed until it reaches `active`.

  • :profile_id (String)

    Filter by profile

Returns:

  • (Array<(ListPhoneNumbers200Response, Integer, Hash)>)

    ListPhoneNumbers200Response data, response status code and response headers



688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 688

def list_phone_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_numbers ...'
  end
  allowable_values = ["provisioning", "verifying", "pending_payment", "pending_regulatory", "regulatory_declined", "active", "suspended", "releasing", "released"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListPhoneNumbers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.list_phone_numbers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#purchase_phone_number(purchase_phone_number_request, opts = {}) ⇒ PurchasePhoneNumber200Response

Purchase phone number Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns 402 PAYMENT_REQUIRED; a regulated country returns 202 with status: \"kyc_required\" and a kycUrl. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.

Parameters:

Returns:



743
744
745
746
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 743

def purchase_phone_number(purchase_phone_number_request, opts = {})
  data, _status_code, _headers = purchase_phone_number_with_http_info(purchase_phone_number_request, opts)
  data
end

#purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {}) ⇒ Array<(PurchasePhoneNumber200Response, Integer, Hash)>

Purchase phone number Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: &quot;kyc_required&quot;` and a `kycUrl`. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.

Parameters:

Returns:



753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 753

def purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.purchase_phone_number ...'
  end
  # verify the required parameter 'purchase_phone_number_request' is set
  if @api_client.config.client_side_validation && purchase_phone_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'purchase_phone_number_request' when calling PhoneNumbersApi.purchase_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/purchase'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(purchase_phone_number_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PurchasePhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.purchase_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#purchase_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#release_phone_number(id, opts = {}) ⇒ ReleasePhoneNumber200Response

Release phone number Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp social account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



811
812
813
814
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 811

def release_phone_number(id, opts = {})
  data, _status_code, _headers = release_phone_number_with_http_info(id, opts)
  data
end

#release_phone_number_with_http_info(id, opts = {}) ⇒ Array<(ReleasePhoneNumber200Response, Integer, Hash)>

Release phone number Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp social account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released

Parameters:

  • id (String)

    Phone number record ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 821

def release_phone_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.release_phone_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.release_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ReleasePhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.release_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#release_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remediate_phone_number(id, remediate_phone_number_request, opts = {}) ⇒ RemediatePhoneNumber200Response

Resubmit a declined number Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes regulatory_declinedpending_regulatory. No new number and no new billing. Body shape matches the KYC submit (values / documents / address) — send only the corrected fields.

Parameters:

Returns:



875
876
877
878
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 875

def remediate_phone_number(id, remediate_phone_number_request, opts = {})
  data, _status_code, _headers = remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts)
  data
end

#remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {}) ⇒ Array<(RemediatePhoneNumber200Response, Integer, Hash)>

Resubmit a declined number Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes `regulatory_declined` → `pending_regulatory`. No new number and no new billing. Body shape matches the KYC submit (values / documents / address) — send only the corrected fields.

Parameters:

Returns:



886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 886

def remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.remediate_phone_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.remediate_phone_number"
  end
  # verify the required parameter 'remediate_phone_number_request' is set
  if @api_client.config.client_side_validation && remediate_phone_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'remediate_phone_number_request' when calling PhoneNumbersApi.remediate_phone_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(remediate_phone_number_request)

  # return_type
  return_type = opts[:debug_return_type] || 'RemediatePhoneNumber200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.remediate_phone_number",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#remediate_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {}) ⇒ ReviewPhoneNumberKycPacket200Response

Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans). Non-blocking: advisories are warnings, submitting anyway is always allowed, and any review failure degrades to an empty list.

Parameters:

Returns:



948
949
950
951
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 948

def review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {})
  data, _status_code, _headers = review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts)
  data
end

#review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {}) ⇒ Array<(ReviewPhoneNumberKycPacket200Response, Integer, Hash)>

Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans). Non-blocking: advisories are warnings, submitting anyway is always allowed, and any review failure degrades to an empty list.

Parameters:

Returns:



958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 958

def review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.review_phone_number_kyc_packet ...'
  end
  # verify the required parameter 'review_phone_number_kyc_packet_request' is set
  if @api_client.config.client_side_validation && review_phone_number_kyc_packet_request.nil?
    fail ArgumentError, "Missing the required parameter 'review_phone_number_kyc_packet_request' when calling PhoneNumbersApi.review_phone_number_kyc_packet"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/review-packet'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(review_phone_number_kyc_packet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ReviewPhoneNumberKycPacket200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.review_phone_number_kyc_packet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#review_phone_number_kyc_packet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_available_phone_numbers(opts = {}) ⇒ SearchAvailablePhoneNumbers200Response

Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass sms=true to only see numbers that can also text (SMS support is per-number, not per-country).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String) — default: default to 'US'
  • :type (String)

    Number type; defaults to the country's WhatsApp-safe type

  • :prefix (String)

    Area code

  • :locality (String)

    City

  • :contains (String)

    Pattern to match within the number

  • :sms (Boolean)

    true narrows the pool to SMS-capable numbers. Each result still carries its full `features` list for per-number capability badging.

  • :limit (Integer) — default: default to 20

Returns:



1022
1023
1024
1025
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1022

def search_available_phone_numbers(opts = {})
  data, _status_code, _headers = search_available_phone_numbers_with_http_info(opts)
  data
end

#search_available_phone_numbers_with_http_info(opts = {}) ⇒ Array<(SearchAvailablePhoneNumbers200Response, Integer, Hash)>

Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String) — default: default to 'US'
  • :type (String)

    Number type; defaults to the country's WhatsApp-safe type

  • :prefix (String)

    Area code

  • :locality (String)

    City

  • :contains (String)

    Pattern to match within the number

  • :sms (Boolean)

    true narrows the pool to SMS-capable numbers. Each result still carries its full `features` list for per-number capability badging.

  • :limit (Integer) — default: default to 20

Returns:



1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1038

def search_available_phone_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.search_available_phone_numbers ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PhoneNumbersApi.search_available_phone_numbers, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/v1/phone-numbers/available'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
  query_params[:'locality'] = opts[:'locality'] if !opts[:'locality'].nil?
  query_params[:'contains'] = opts[:'contains'] if !opts[:'contains'].nil?
  query_params[:'sms'] = opts[:'sms'] if !opts[:'sms'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SearchAvailablePhoneNumbers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.search_available_phone_numbers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#search_available_phone_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {}) ⇒ SubmitPhoneNumberKyc200Response

Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via submissionId. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/phone-numbers/id/remediate. Before submitting, call GET /v1/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in — otherwise the submission can pass review yet never be assignable a number.

Parameters:

Returns:



1098
1099
1100
1101
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1098

def submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {})
  data, _status_code, _headers = submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts)
  data
end

#submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {}) ⇒ Array<(SubmitPhoneNumberKyc200Response, Integer, Hash)>

Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via `submissionId`. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/phone-numbers/id/remediate. Before submitting, call GET /v1/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in — otherwise the submission can pass review yet never be assignable a number.

Parameters:

Returns:



1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1108

def submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.submit_phone_number_kyc ...'
  end
  # verify the required parameter 'submit_phone_number_kyc_request' is set
  if @api_client.config.client_side_validation && submit_phone_number_kyc_request.nil?
    fail ArgumentError, "Missing the required parameter 'submit_phone_number_kyc_request' when calling PhoneNumbersApi.submit_phone_number_kyc"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_phone_number_kyc_request)

  # return_type
  return_type = opts[:debug_return_type] || 'SubmitPhoneNumberKyc200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.submit_phone_number_kyc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#submit_phone_number_kyc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_phone_number_kyc_document(x_filename, body, opts = {}) ⇒ UploadPhoneNumberKycDocument200Response

Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via documents[].documentId. Send the RAW file bytes as the request body (not base64); put the filename in the X-Filename header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.

Parameters:

  • x_filename (String)

    URL-encoded original filename.

  • body (File)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1167
1168
1169
1170
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1167

def upload_phone_number_kyc_document(x_filename, body, opts = {})
  data, _status_code, _headers = upload_phone_number_kyc_document_with_http_info(x_filename, body, opts)
  data
end

#upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {}) ⇒ Array<(UploadPhoneNumberKycDocument200Response, Integer, Hash)>

Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via `documents.documentId`. Send the RAW file bytes as the request body (not base64); put the filename in the `X-Filename` header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.

Parameters:

  • x_filename (String)

    URL-encoded original filename.

  • body (File)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1178

def upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.upload_phone_number_kyc_document ...'
  end
  # verify the required parameter 'x_filename' is set
  if @api_client.config.client_side_validation && x_filename.nil?
    fail ArgumentError, "Missing the required parameter 'x_filename' when calling PhoneNumbersApi.upload_phone_number_kyc_document"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling PhoneNumbersApi.upload_phone_number_kyc_document"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/upload-document'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/octet-stream'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Filename'] = x_filename

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'UploadPhoneNumberKycDocument200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.upload_phone_number_kyc_document",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#upload_phone_number_kyc_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_phone_number_port_in_document(file, opts = {}) ⇒ UploadPhoneNumberPortInDocument200Response

Upload a porting document Upload ONE porting document (the signed LOA or a recent carrier invoice) and get back its documentId, which the port-in create request takes as loaDocumentId / invoiceDocumentId. PDF, JPEG, or PNG, 10MB max.

Parameters:

  • file (File)

    The document (PDF/JPEG/PNG, 10MB max).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :kind (String)

    Informational; used for the stored filename.

Returns:



1242
1243
1244
1245
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1242

def upload_phone_number_port_in_document(file, opts = {})
  data, _status_code, _headers = upload_phone_number_port_in_document_with_http_info(file, opts)
  data
end

#upload_phone_number_port_in_document_with_http_info(file, opts = {}) ⇒ Array<(UploadPhoneNumberPortInDocument200Response, Integer, Hash)>

Upload a porting document Upload ONE porting document (the signed LOA or a recent carrier invoice) and get back its `documentId`, which the port-in create request takes as `loaDocumentId` / `invoiceDocumentId`. PDF, JPEG, or PNG, 10MB max.

Parameters:

  • file (File)

    The document (PDF/JPEG/PNG, 10MB max).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :kind (String)

    Informational; used for the stored filename.

Returns:



1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1253

def upload_phone_number_port_in_document_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.upload_phone_number_port_in_document ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling PhoneNumbersApi.upload_phone_number_port_in_document"
  end
  allowable_values = ["loa", "invoice"]
  if @api_client.config.client_side_validation && opts[:'kind'] && !allowable_values.include?(opts[:'kind'])
    fail ArgumentError, "invalid value for \"kind\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/port-in/documents'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file
  form_params['kind'] = opts[:'kind'] if !opts[:'kind'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UploadPhoneNumberPortInDocument200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.upload_phone_number_port_in_document",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#upload_phone_number_port_in_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {}) ⇒ ValidatePhoneNumberKycAddress200Response

Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (administrative_area) is required by the validator; when it is omitted the pre-check is skipped and { ok: true, skipped: true } is returned (the final submit still validates).

Parameters:

Returns:



1317
1318
1319
1320
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1317

def validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {})
  data, _status_code, _headers = validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts)
  data
end

#validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {}) ⇒ Array<(ValidatePhoneNumberKycAddress200Response, Integer, Hash)>

Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (`administrative_area`) is required by the validator; when it is omitted the pre-check is skipped and `{ ok: true, skipped: true }` is returned (the final submit still validates).

Parameters:

Returns:



1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1327

def validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.validate_phone_number_kyc_address ...'
  end
  # verify the required parameter 'validate_phone_number_kyc_address_request' is set
  if @api_client.config.client_side_validation && validate_phone_number_kyc_address_request.nil?
    fail ArgumentError, "Missing the required parameter 'validate_phone_number_kyc_address_request' when calling PhoneNumbersApi.validate_phone_number_kyc_address"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/kyc/validate-address'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_phone_number_kyc_address_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ValidatePhoneNumberKycAddress200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PhoneNumbersApi.validate_phone_number_kyc_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PhoneNumbersApi#validate_phone_number_kyc_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end