Class: EInvoiceAPI::Resources::Validate
- Inherits:
-
Object
- Object
- EInvoiceAPI::Resources::Validate
- Defined in:
- lib/e_invoice_api/resources/validate.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Validate
constructor
private
A new instance of Validate.
-
#validate_json(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {}) ⇒ EInvoiceAPI::Models::UblDocumentValidation
Some parameter documentations has been truncated, see Models::ValidateValidateJsonParams for more details.
-
#validate_peppol_id(peppol_id: , request_options: {}) ⇒ EInvoiceAPI::Models::ValidateValidatePeppolIDResponse
Some parameter documentations has been truncated, see Models::ValidateValidatePeppolIDParams for more details.
-
#validate_ubl(file: , request_options: {}) ⇒ EInvoiceAPI::Models::UblDocumentValidation
Validate the correctness of a UBL document.
Constructor Details
#initialize(client:) ⇒ Validate
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Validate.
176 177 178 |
# File 'lib/e_invoice_api/resources/validate.rb', line 176 def initialize(client:) @client = client end |
Instance Method Details
#validate_json(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {}) ⇒ EInvoiceAPI::Models::UblDocumentValidation
Some parameter documentations has been truncated, see Models::ValidateValidateJsonParams for more details.
Validate if the JSON document can be converted to a valid UBL document
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/e_invoice_api/resources/validate.rb', line 110 def validate_json(params = {}) parsed, = EInvoiceAPI::ValidateValidateJsonParams.dump_request(params) @client.request( method: :post, path: "api/validate/json", body: parsed, model: EInvoiceAPI::UblDocumentValidation, options: ) end |
#validate_peppol_id(peppol_id: , request_options: {}) ⇒ EInvoiceAPI::Models::ValidateValidatePeppolIDResponse
Some parameter documentations has been truncated, see Models::ValidateValidatePeppolIDParams for more details.
Validate if a Peppol ID exists in the Peppol network and retrieve supported document types. The peppol_id must be in the form of ‘<scheme>:<id>`. The scheme is a 4-digit code representing the identifier scheme, and the id is the actual identifier value. For example, for a Belgian company it is `0208:0123456789` (where 0208 is the scheme for Belgian enterprises, followed by the 10 digits of the official BTW / KBO number).
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/e_invoice_api/resources/validate.rb', line 140 def validate_peppol_id(params) parsed, = EInvoiceAPI::ValidateValidatePeppolIDParams.dump_request(params) @client.request( method: :get, path: "api/validate/peppol-id", query: parsed, model: EInvoiceAPI::Models::ValidateValidatePeppolIDResponse, options: ) end |
#validate_ubl(file: , request_options: {}) ⇒ EInvoiceAPI::Models::UblDocumentValidation
Validate the correctness of a UBL document
161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/e_invoice_api/resources/validate.rb', line 161 def validate_ubl(params) parsed, = EInvoiceAPI::ValidateValidateUblParams.dump_request(params) @client.request( method: :post, path: "api/validate/ubl", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: EInvoiceAPI::UblDocumentValidation, options: ) end |