Class: EInvoiceAPI::Resources::Documents::Ubl
- Inherits:
-
Object
- Object
- EInvoiceAPI::Resources::Documents::Ubl
- Defined in:
- lib/e_invoice_api/resources/documents/ubl.rb
Instance Method Summary collapse
-
#create_from_ubl(file: , request_options: {}) ⇒ EInvoiceAPI::Models::DocumentResponse
Create a new invoice or credit note from a UBL file.
-
#get(document_id, request_options: {}) ⇒ EInvoiceAPI::Models::Documents::UblGetResponse
Get the UBL for an invoice or credit note.
-
#initialize(client:) ⇒ Ubl
constructor
private
A new instance of Ubl.
Constructor Details
#initialize(client:) ⇒ Ubl
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 Ubl.
51 52 53 |
# File 'lib/e_invoice_api/resources/documents/ubl.rb', line 51 def initialize(client:) @client = client end |
Instance Method Details
#create_from_ubl(file: , request_options: {}) ⇒ EInvoiceAPI::Models::DocumentResponse
Create a new invoice or credit note from a UBL file
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/e_invoice_api/resources/documents/ubl.rb', line 17 def create_from_ubl(params) parsed, = EInvoiceAPI::Documents::UblCreateFromUblParams.dump_request(params) @client.request( method: :post, path: "api/documents/ubl", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: EInvoiceAPI::DocumentResponse, options: ) end |
#get(document_id, request_options: {}) ⇒ EInvoiceAPI::Models::Documents::UblGetResponse
Get the UBL for an invoice or credit note
39 40 41 42 43 44 45 46 |
# File 'lib/e_invoice_api/resources/documents/ubl.rb', line 39 def get(document_id, params = {}) @client.request( method: :get, path: ["api/documents/%1$s/ubl", document_id], model: EInvoiceAPI::Models::Documents::UblGetResponse, options: params[:request_options] ) end |