Class: Freshbooks::API::Invoice

Inherits:
Client
  • Object
show all
Defined in:
lib/freshbooks/api/invoice.rb

Overview

Instance Attribute Summary

Attributes inherited from Client

#api_url, #token

Instance Method Summary collapse

Methods inherited from Client

#call, #hash_to_raw_xml, #initialize, #options, #parse, #post, #to_request, #underscore

Methods included from CRUD

#create, #delete, #get, #list, #update

Methods included from Methods

#callbacks, #categories, #clients, #contractors, #currencies, #default_terms, #email_templates, #estimates, #expenses, #gateways, #invoices, #items, #languages, #payments, #projects, #receipts, #recurring, #reports, #staff, #systems, #tasks, #taxes, #time_entries

Constructor Details

This class inherits a constructor from Freshbooks::Client

Instance Method Details

#add_lines(params = {}) ⇒ Object Also known as: add_line

Adds a new line/lines to an existing invoice.


23
24
25
# File 'lib/freshbooks/api/invoice.rb', line 23

def add_lines(params = {})
  call('invoice.lines.add', params)
end

#delete_lines(params = {}) ⇒ Object Also known as: delete_line

Deletes a line from an existing invoice.


29
30
31
# File 'lib/freshbooks/api/invoice.rb', line 29

def delete_lines(params = {})
  call('invoice.lines.delete', params)
end

#get_pdf(params = {}) ⇒ Object

Returns the specified invoice in PDF format.


8
9
10
# File 'lib/freshbooks/api/invoice.rb', line 8

def get_pdf(params = {})
  call('invoice.getPDF', params)
end

#send_by_email(params = {}) ⇒ Object

Send an existing invoice to your client via e-mail.


13
14
15
# File 'lib/freshbooks/api/invoice.rb', line 13

def send_by_email(params = {})
  call('invoice.sendByEmail', params)
end

#send_by_snail_mail(params = {}) ⇒ Object

Send an existing invoice to your client via snail mail.


18
19
20
# File 'lib/freshbooks/api/invoice.rb', line 18

def send_by_snail_mail(params = {})
  call('invoice.sendBySnailMail', params)
end

#update_lines(params = {}) ⇒ Object Also known as: update_line

Updates a line on an existing invoice.


35
36
37
# File 'lib/freshbooks/api/invoice.rb', line 35

def update_lines(params = {})
  call('invoice.lines.update', params)
end