Great News! To offer you an even better invoicing experience, Invoice Machine is officially joining invoicely on June 22nd, 2019.
Please make sure to switch to invoicely as soon as possible to continue using our platform.

Hook up your own application with The Machine's functionality.

item.new

This method will add a new item.

You call this method with the following URL:

Parameters

Parameters are the data you will pass with the call.

api_token

Your secret identifier. You find your API Token under Account Overview in the Account section.

Rules: Required.

description

The description of the item.

Rules: Required.

qty

The quantity for the item.

Rules: Required. Can only include numeric characters.

kind

The kind of the item.

Rules: Required. Must be set to a supported kind. The supported kinds are "hour", "day", "service" and "product".

price

The price for the item.

Rules: Required. Can only include numeric characters.

get (optional)

If this parameter is set the result sent back will be the new item in XML data rather than the success message.

Rules: If parameter is used it must be set to "true". Otherwise it will be ignored.

Return Values

This is the result that will be passed back to you when you have sent a call.

Success

Sucess: Item added.

The item was successfully added.

If you have set the get parameter to "true" you will rather get the new item in XML sent back to you. Like this:

<?xml version="1.0" encoding="utf-8"?>
<method request="item.get">
    <item>
        <id>204420</id>
        <description>Office Combo Kit</description>
        <qty>1</qty>
        <kind>product</kind>
        <price>349.00</price>
        <total>349.00</total>
    </item>
</method>
Error

Error: No data passed.

No data was passed to the method.

Error: API Token is invalid.

The API Token parameter is missing or incorrectly entered.

Error: Description is invalid.

The Description is missing or incorrectly entered.

Error: Qty is invalid.

The Qty parameter is missing or incorrectly entered.

Error: Kind is invalid.

The Kind parameter is missing or incorrectly entered.

Example

The example below is strictly a demonstration of the method and it's parameters. Methods should never be posted from a HTML form. They should be posted directly from your server script.

<form action="http://machine_id.invoicemachine.com/api/item.new" method="post">
    <input type="hidden" name="api_token" value="c86cea54c71sbb05a5f8297bed641944">
    <input type="hidden" name="description" value="Office Combo Kit">
    <input type="hidden" name="qty" value="1">
    <input type="hidden" name="kind" value="product">
    <input type="hidden" name="price" value="349">
</form>