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_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: 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_company_id: 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.
183 184 185 |
# File 'lib/e_invoice_api/resources/validate.rb', line 183 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_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: 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_company_id: 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
116 117 118 119 120 121 122 123 124 125 |
# File 'lib/e_invoice_api/resources/validate.rb', line 116 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).
146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/e_invoice_api/resources/validate.rb', line 146 def validate_peppol_id(params) parsed, = EInvoiceAPI::ValidateValidatePeppolIDParams.dump_request(params) query = EInvoiceAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/validate/peppol-id", query: query, model: EInvoiceAPI::Models::ValidateValidatePeppolIDResponse, options: ) end |
#validate_ubl(file:, request_options: {}) ⇒ EInvoiceAPI::Models::UblDocumentValidation
Validate the correctness of a UBL document
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/e_invoice_api/resources/validate.rb', line 168 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 |