Class: FactPulse::PDFXMLVerificationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/factpulse/api/pdfxml_verification_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PDFXMLVerificationApi

Returns a new instance of PDFXMLVerificationApi.



19
20
21
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 19

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

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



17
18
19
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_verification_status_api_v1_verification_verify_async_task_id_status_get(task_id, opts = {}) ⇒ AsyncTaskStatus

Get status of an asynchronous verification Retrieves the status and result of an asynchronous verification task. Possible statuses: - PENDING: Task waiting in queue - STARTED: Task currently running - SUCCESS: Task completed successfully (see result) - FAILURE: System error (unhandled exception) Note: The result.status field can be "SUCCESS" or "ERROR" independently of Celery status (which will always be SUCCESS if the task ran).

Parameters:

  • task_id (String) —

    Celery task ID returned by /verify-async endpoint

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 27

def get_verification_status_api_v1_verification_verify_async_task_id_status_get(task_id, opts = {})
  data, _status_code, _headers = get_verification_status_api_v1_verification_verify_async_task_id_status_get_with_http_info(task_id, opts)
  data
end

#get_verification_status_api_v1_verification_verify_async_task_id_status_get_0(task_id, opts = {}) ⇒ AsyncTaskStatus

Get status of an asynchronous verification Retrieves the status and result of an asynchronous verification task. Possible statuses: - PENDING: Task waiting in queue - STARTED: Task currently running - SUCCESS: Task completed successfully (see result) - FAILURE: System error (unhandled exception) Note: The result.status field can be "SUCCESS" or "ERROR" independently of Celery status (which will always be SUCCESS if the task ran).

Parameters:

  • task_id (String) —

    Celery task ID returned by /verify-async endpoint

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

    the optional parameters

Returns:



90
91
92
93
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 90

def get_verification_status_api_v1_verification_verify_async_task_id_status_get_0(task_id, opts = {})
  data, _status_code, _headers = get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_with_http_info(task_id, opts)
  data
end

#get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_with_http_info(task_id, opts = {}) ⇒ Array<(AsyncTaskStatus, Integer, Hash)>

Get status of an asynchronous verification Retrieves the status and result of an asynchronous verification task. Possible statuses: - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) Note: The `result.status` field can be &quot;SUCCESS&quot; or &quot;ERROR&quot; independently of Celery status (which will always be SUCCESS if the task ran).

Parameters:

  • task_id (String) —

    Celery task ID returned by /verify-async endpoint

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

    the optional parameters

Returns:

  • (Array<(AsyncTaskStatus, Integer, Hash)>) —

    AsyncTaskStatus data, response status code and response headers



100
101
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
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 100

def get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_with_http_info(task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get_0 ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling PDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get_0"
  end
  # resource path
  local_var_path = '/api/v1/verification/verify-async/{task_id}/status'.sub('{' + 'task_id' + '}', CGI.escape(task_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] || 'AsyncTaskStatus'

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

  new_options = opts.merge(
    :operation => :"PDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get_0",
    :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: PDFXMLVerificationApi#get_verification_status_api_v1_verification_verify_async_task_id_status_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_verification_status_api_v1_verification_verify_async_task_id_status_get_with_http_info(task_id, opts = {}) ⇒ Array<(AsyncTaskStatus, Integer, Hash)>

Get status of an asynchronous verification Retrieves the status and result of an asynchronous verification task. Possible statuses: - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) Note: The `result.status` field can be &quot;SUCCESS&quot; or &quot;ERROR&quot; independently of Celery status (which will always be SUCCESS if the task ran).

Parameters:

  • task_id (String) —

    Celery task ID returned by /verify-async endpoint

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

    the optional parameters

Returns:

  • (Array<(AsyncTaskStatus, Integer, Hash)>) —

    AsyncTaskStatus data, response status code and response headers



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/factpulse/api/pdfxml_verification_api.rb', line 37

def get_verification_status_api_v1_verification_verify_async_task_id_status_get_with_http_info(task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling PDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get"
  end
  # resource path
  local_var_path = '/api/v1/verification/verify-async/{task_id}/status'.sub('{' + 'task_id' + '}', CGI.escape(task_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] || 'AsyncTaskStatus'

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

  new_options = opts.merge(
    :operation => :"PDFXMLVerificationApi.get_verification_status_api_v1_verification_verify_async_task_id_status_get",
    :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: PDFXMLVerificationApi#get_verification_status_api_v1_verification_verify_async_task_id_status_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_pdf_async_api_v1_verification_verify_async_post(pdf_file, opts = {}) ⇒ TaskResponse

Verify PDF/XML Factur-X compliance (asynchronous) Verifies PDF/XML Factur-X compliance asynchronously. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a NOT_FACTURX error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if force_ocr=true. Returns immediately a task ID. Use /verify-async/{task_id}/status to retrieve the result. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency Advantages over synchronous version: - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: callback_url=https://your-server.com/webhook The webhook will POST a JSON payload with: - event_type: verification.completed or verification.failed - data.is_compliant: Whether the PDF/XML are consistent - data.compliance_score: Compliance score (0-1) - X-Webhook-Signature header for HMAC verification

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Options Hash (opts):

  • :force_ocr (Boolean) —

    Force OCR usage even if PDF contains native text (default to false)

  • :callback_url (String)
  • :webhook_mode (String) —

    Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')

Returns:



156
157
158
159
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 156

def verify_pdf_async_api_v1_verification_verify_async_post(pdf_file, opts = {})
  data, _status_code, _headers = verify_pdf_async_api_v1_verification_verify_async_post_with_http_info(pdf_file, opts)
  data
end

#verify_pdf_async_api_v1_verification_verify_async_post_0(pdf_file, opts = {}) ⇒ TaskResponse

Verify PDF/XML Factur-X compliance (asynchronous) Verifies PDF/XML Factur-X compliance asynchronously. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a NOT_FACTURX error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if force_ocr=true. Returns immediately a task ID. Use /verify-async/{task_id}/status to retrieve the result. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency Advantages over synchronous version: - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: callback_url=https://your-server.com/webhook The webhook will POST a JSON payload with: - event_type: verification.completed or verification.failed - data.is_compliant: Whether the PDF/XML are consistent - data.compliance_score: Compliance score (0-1) - X-Webhook-Signature header for HMAC verification

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Options Hash (opts):

  • :force_ocr (Boolean) —

    Force OCR usage even if PDF contains native text (default to false)

  • :callback_url (String)
  • :webhook_mode (String) —

    Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')

Returns:



234
235
236
237
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 234

def verify_pdf_async_api_v1_verification_verify_async_post_0(pdf_file, opts = {})
  data, _status_code, _headers = verify_pdf_async_api_v1_verification_verify_async_post_0_with_http_info(pdf_file, opts)
  data
end

#verify_pdf_async_api_v1_verification_verify_async_post_0_with_http_info(pdf_file, opts = {}) ⇒ Array<(TaskResponse, Integer, Hash)>

Verify PDF/XML Factur-X compliance (asynchronous) Verifies PDF/XML Factur-X compliance asynchronously. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. Returns immediately a task ID. Use `/verify-async/task_id/status` to retrieve the result. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency Advantages over synchronous version: - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `verification.completed` or `verification.failed` - `data.is_compliant`: Whether the PDF/XML are consistent - `data.compliance_score`: Compliance score (0-1) - `X-Webhook-Signature` header for HMAC verification

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Options Hash (opts):

  • :force_ocr (Boolean) —

    Force OCR usage even if PDF contains native text (default to false)

  • :callback_url (String)
  • :webhook_mode (String) —

    Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')

Returns:

  • (Array<(TaskResponse, Integer, Hash)>) —

    TaskResponse data, response status code and response headers



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
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 247

def verify_pdf_async_api_v1_verification_verify_async_post_0_with_http_info(pdf_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post_0 ...'
  end
  # verify the required parameter 'pdf_file' is set
  if @api_client.config.client_side_validation && pdf_file.nil?
    fail ArgumentError, "Missing the required parameter 'pdf_file' when calling PDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post_0"
  end
  # resource path
  local_var_path = '/api/v1/verification/verify-async'

  # 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['pdf_file'] = pdf_file
  form_params['force_ocr'] = opts[:'force_ocr'] if !opts[:'force_ocr'].nil?
  form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
  form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"PDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post_0",
    :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: PDFXMLVerificationApi#verify_pdf_async_api_v1_verification_verify_async_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_pdf_async_api_v1_verification_verify_async_post_with_http_info(pdf_file, opts = {}) ⇒ Array<(TaskResponse, Integer, Hash)>

Verify PDF/XML Factur-X compliance (asynchronous) Verifies PDF/XML Factur-X compliance asynchronously. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. Returns immediately a task ID. Use `/verify-async/task_id/status` to retrieve the result. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency Advantages over synchronous version: - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `verification.completed` or `verification.failed` - `data.is_compliant`: Whether the PDF/XML are consistent - `data.compliance_score`: Compliance score (0-1) - `X-Webhook-Signature` header for HMAC verification

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Options Hash (opts):

  • :force_ocr (Boolean) —

    Force OCR usage even if PDF contains native text (default to false)

  • :callback_url (String)
  • :webhook_mode (String) —

    Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')

Returns:

  • (Array<(TaskResponse, Integer, Hash)>) —

    TaskResponse data, response status code and response headers



169
170
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
223
224
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 169

def verify_pdf_async_api_v1_verification_verify_async_post_with_http_info(pdf_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post ...'
  end
  # verify the required parameter 'pdf_file' is set
  if @api_client.config.client_side_validation && pdf_file.nil?
    fail ArgumentError, "Missing the required parameter 'pdf_file' when calling PDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post"
  end
  # resource path
  local_var_path = '/api/v1/verification/verify-async'

  # 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['pdf_file'] = pdf_file
  form_params['force_ocr'] = opts[:'force_ocr'] if !opts[:'force_ocr'].nil?
  form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
  form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"PDFXMLVerificationApi.verify_pdf_async_api_v1_verification_verify_async_post",
    :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: PDFXMLVerificationApi#verify_pdf_async_api_v1_verification_verify_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_pdf_sync_api_v1_verification_verify_post(pdf_file, opts = {}) ⇒ VerificationSuccessResponse

Verify PDF/XML Factur-X compliance (synchronous) Verifies compliance between the PDF and its embedded Factur-X XML. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the /verify-async endpoint. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Returns:



309
310
311
312
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 309

def verify_pdf_sync_api_v1_verification_verify_post(pdf_file, opts = {})
  data, _status_code, _headers = verify_pdf_sync_api_v1_verification_verify_post_with_http_info(pdf_file, opts)
  data
end

#verify_pdf_sync_api_v1_verification_verify_post_0(pdf_file, opts = {}) ⇒ VerificationSuccessResponse

Verify PDF/XML Factur-X compliance (synchronous) Verifies compliance between the PDF and its embedded Factur-X XML. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the /verify-async endpoint. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Returns:



378
379
380
381
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 378

def verify_pdf_sync_api_v1_verification_verify_post_0(pdf_file, opts = {})
  data, _status_code, _headers = verify_pdf_sync_api_v1_verification_verify_post_0_with_http_info(pdf_file, opts)
  data
end

#verify_pdf_sync_api_v1_verification_verify_post_0_with_http_info(pdf_file, opts = {}) ⇒ Array<(VerificationSuccessResponse, Integer, Hash)>

Verify PDF/XML Factur-X compliance (synchronous) Verifies compliance between the PDF and its embedded Factur-X XML. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Returns:

  • (Array<(VerificationSuccessResponse, Integer, Hash)>) —

    VerificationSuccessResponse data, response status code and response headers



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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 388

def verify_pdf_sync_api_v1_verification_verify_post_0_with_http_info(pdf_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post_0 ...'
  end
  # verify the required parameter 'pdf_file' is set
  if @api_client.config.client_side_validation && pdf_file.nil?
    fail ArgumentError, "Missing the required parameter 'pdf_file' when calling PDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post_0"
  end
  # resource path
  local_var_path = '/api/v1/verification/verify'

  # 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['pdf_file'] = pdf_file

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

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

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

  new_options = opts.merge(
    :operation => :"PDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post_0",
    :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: PDFXMLVerificationApi#verify_pdf_sync_api_v1_verification_verify_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_pdf_sync_api_v1_verification_verify_post_with_http_info(pdf_file, opts = {}) ⇒ Array<(VerificationSuccessResponse, Integer, Hash)>

Verify PDF/XML Factur-X compliance (synchronous) Verifies compliance between the PDF and its embedded Factur-X XML. IMPORTANT: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. Verification principle (Factur-X 1.08): - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF Verified fields: - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency

Parameters:

  • pdf_file (File) —

    Factur-X PDF file to verify

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

    the optional parameters

Returns:

  • (Array<(VerificationSuccessResponse, Integer, Hash)>) —

    VerificationSuccessResponse data, response status code and response headers



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
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/factpulse/api/pdfxml_verification_api.rb', line 319

def verify_pdf_sync_api_v1_verification_verify_post_with_http_info(pdf_file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post ...'
  end
  # verify the required parameter 'pdf_file' is set
  if @api_client.config.client_side_validation && pdf_file.nil?
    fail ArgumentError, "Missing the required parameter 'pdf_file' when calling PDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post"
  end
  # resource path
  local_var_path = '/api/v1/verification/verify'

  # 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['pdf_file'] = pdf_file

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

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

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

  new_options = opts.merge(
    :operation => :"PDFXMLVerificationApi.verify_pdf_sync_api_v1_verification_verify_post",
    :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: PDFXMLVerificationApi#verify_pdf_sync_api_v1_verification_verify_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end