README.textile in xero_gateway-2.0.4 vs README.textile in xero_gateway-2.0.5

- old
+ new

@@ -145,11 +145,11 @@ h3. GET /api.xro/2.0/contacts (get_contacts) Gets all contact records for a particular Xero customer. <pre><code> gateway.get_contacts(:type => :all, :sort => :name, :direction => :desc) - gateway.get_contacts(:type => :all, :updated_after => 1.month.ago) # modified since 1 month ago</code></pre> + gateway.get_contacts(:type => :all, :modified_since => 1.month.ago) # modified since 1 month ago</code></pre> h3. PUT /api.xro/2.0/contact @@ -198,11 +198,11 @@ h3. GET /api.xro/2.0/invoices (get_invoices) Gets all invoice records for a particular Xero customer. <pre><code> gateway.get_invoices - gateway.get_invoices(1.month.ago) # modified since 1 month ago</code></pre> + gateway.get_invoices(:modified_since => 1.month.ago) # modified since 1 month ago</code></pre> h3. PUT /api.xro/2.0/invoice @@ -212,12 +212,11 @@ <pre><code> invoice = gateway.build_invoice({ :invoice_type => "ACCREC", :due_date => 1.month.from_now, :invoice_number => "YOUR INVOICE NUMBER", :reference => "YOUR REFERENCE (NOT NECESSARILY UNIQUE!)", - :tax_inclusive => true, - :includes_tax => false + :line_amount_types => "Inclusive" # "Inclusive", "Exclusive" or "NoTax" }) invoice.contact.name = "THE NAME OF THE CONTACT" invoice.contact.phone.number = "12345" invoice.contact.address.line_1 = "LINE 1 OF THE ADDRESS" invoice.add_line_item({ @@ -236,10 +235,63 @@ Inserts multiple invoices for a specific organization in Xero (currently only adding new invoices is allowed). This method uses only a single API request to create/update multiple contacts. <pre><code> invoices = [XeroGateway::Invoice.new(...), XeroGateway::Invoice.new(...)] result = gateway.create_invoices(invoices)</code></pre> +h3. GET /api.xro/2.0/credit_note (get_credit_note_by_id) + +Gets an credit_note record for a specific Xero organisation +<pre><code> gateway.get_credit_note_by_id(credit_note_id)</code></pre> + + +h3. GET /api.xro/2.0/credit_note (get_credit_note_by_number) + +Gets a credit note record for a specific Xero organisation +<pre><code> gateway.get_credit_note_by_number(credit_note_number)</code></pre> + + + +h3. GET /api.xro/2.0/credit_notes (get_credit_notes) + +Gets all credit note records for a particular Xero customer. +<pre><code> gateway.get_credit_notes + gateway.get_credit_notes(:modified_since => 1.month.ago) # modified since 1 month ago</code></pre> + + + +h3. PUT /api.xro/2.0/credit_note + +Inserts a credit note for a specific organization in Xero (Currently only adding new credit notes is allowed). + +CreditNote and line item totals are calculated automatically. +<pre><code> credit_note = gateway.build_credit_note({ + :credit_note_type => "ACCRECCREDIT", + :credit_note_number => "YOUR CREDIT NOTE NUMBER", + :reference => "YOUR REFERENCE (NOT NECESSARILY UNIQUE!)", + :line_amount_types => "Inclusive" # "Inclusive", "Exclusive" or "NoTax" + }) + credit_note.contact.name = "THE NAME OF THE CONTACT" + credit_note.contact.phone.number = "12345" + credit_note.contact.address.line_1 = "LINE 1 OF THE ADDRESS" + credit_note.add_line_item({ + :description => "THE DESCRIPTION OF THE LINE ITEM", + :unit_amount => 1000, + :tax_amount => 125, + :tracking_category => "THE TRACKING CATEGORY FOR THE LINE ITEM", + :tracking_option => "THE TRACKING OPTION FOR THE LINE ITEM" + }) + + credit_note.create</code></pre> + + +h3. PUT /api.xro/2.0/credit_notes + +Inserts multiple credit notes for a specific organization in Xero (currently only adding new credit notes is allowed). +This method uses only a single API request to create/update multiple contacts. +<pre><code> credit_notes = [XeroGateway::CreditNote.new(...), XeroGateway::CreditNote.new(...)] + result = gateway.create_credit_notes(credit_notes)</code></pre> + h3. GET /api.xro/2.0/accounts Gets all accounts for a specific organization in Xero. <pre><code> gateway.get_accounts</code></pre> @@ -284,6 +336,6 @@ <pre> gateway.logger = ActiveSupport::BufferedLogger.new("log_file_name.log") </pre> -It doesn't have to be a buffered logger - anything that responds to "info" will do just fine. \ No newline at end of file +It doesn't have to be a buffered logger - anything that responds to "info" will do just fine.