items.create
Creates a new item.
Regarding item taxes, if the tax name is not found, no tax is applied to that item.
You call this method submitting an HTTP POST request to the following URL with the xml data of the new item on the request body:
Example xml to be submitted with item data:
<?xml version="1.0" encoding="UTF-8"?> <item> <name>stuff</name> <description>good stuff</description> <unit_price>3</unit_price> <unit>unit</unit> <tax> <name>IVA20</name> </tax> </item>
Parameters
Parameters are the data you will pass with the call.
api_key
Your secret identifier. You find your API Key under Account Overview in the Account section.
Rules: Required
name
Item name.
Rules: Required. Must be unique.
description
Item description.
Rules: Optional
unit_price
Item unit price.
Rules: Required. Needs to be greater than 0.0.
unit
Item unit of measure.
Rules: Required.
tax
Item tax.
Rules: Optional. If not present no tax is applied to the item
tax / name
Item tax name.
Rules: Optional. If not found no tax is applied to the item
Return Values
This is the result that will be passed back to you when you have sent a call.
Success
HTTP: 201 CREATED
<?xml version="1.0" encoding="UTF-8"?> <item> <id>26</id> <name>stuff</name> <description>good stuff</description> <unit_price>3.0</unit_price> <unit>unit</unit> <tax> <name>IVA20</name> <!-- tax value:20.0% --> </tax> </item>
Error
The API Key parameter is missing or incorrect.
HTTP: 422 Unprocessable Entity
Some parameters were incorrect.
Possible errors:
<?xml version="1.0" encoding="UTF-8"?> <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> <error>Unit is not included in the list of accepted units</error> </errors>
