Method: Invoicexpress::Client::Items#create_item

Defined in:
lib/invoicexpress/client/items.rb

#create_item(item, options = {}) ⇒ Invoicexpress::Models::Item

Creates a new item. Regarding item taxes, if the tax name is not found, no tax is applied to that item.

Parameters:

Returns:

Raises:

  • Invoicexpress::Unauthorized When the client is unauthorized

  • Invoicexpress::UnprocessableEntity When there are errors on the submission



36
37
38
39
40
41
# File 'lib/invoicexpress/client/items.rb', line 36

def create_item(item, options={})
  raise(ArgumentError, "item has the wrong type") unless item.is_a?(Invoicexpress::Models::Item)

  params = { :klass => Invoicexpress::Models::Item, :body => item }
  post("items.xml", params.merge(options))
end