API

Application Programming Interface

InvoiceXpress Documentation



Create


items.create

Creates a new item.

Regarding item taxes, if the tax name is not found, the default tax is applied to that item.

You call this method by submitting an HTTP POST request to the following URL with the XML data of the new item on the request body:

https://{account-name}.app.invoicexpress.com/items.xml
Header

Content-Type: application/xml; charset=utf-8

Body
<item>
  <name>stuff</name>
  <description>good stuff</description>
  <unit_price>3</unit_price>
  <tax>
    <name>IVA20</name>
  </tax>
</item>

Parameters

Parameter Required Description
api_key Yes Your secret identifier. You can find your API Key under Account >> API in the Account section.
item / name Yes Name of the item. Must be unique.
item / description Yes Item’s description
item / unit_price Yes Item’s unit price. Must be a number equal or greater than 0.0.
item / unit No The item unit of measure
item / tax No The tax applied to the item line. If not present the default tax is applied to the item
item / tax / name No The tax name to be used on this item line. If not found the default tax is applied to the line item

Return Values

These are the results that will be returned on success and error.

Success
HTTP: 201 CREATED
<item>
  <id>166178</id>
  <name>stuff</name>
  <description>good stuff</description>
  <unit_price>3.0</unit_price>
  <unit>service</unit>
  <tax>
    <name>IVA20</name>
    <value>20.0</value>
    <!-- tax value:20.0% -->
  </tax>
</item>
Error
Code Description
HTTP: 401 Access denied The API Key parameter is missing or is incorrectly entered.
HTTP: 422 Unprocessable Entity Some parameters were incorrect.

Possible errors for HTTP: 422

<errors>
 <error>Name has already been taken</error>
 <error>Unit price can't be blank</error>
 <error>Unit price is not a number</error>
 <error>Unit kg is not included in the list of accepted units</error>
</errors>