Raising an invoice via API - invoice item_type "no unit"

Hi,

I want to raise an invoice via the API - the invoice item I am adding isn’t
represented by freeagent (we’re invoicing by number of users), so i want to
use “No Unit”. Now, I can do that in the web app, but the API won’t let me
use “No Unit”, I have to choose “Product”, which looks wrong in the invoice.

Is there any way round this, seems an odd limitation for the API.

Matt

Hi Matt,

I’ve just checked and we seem to have missed that option from our
documentation, but it does work. The item_type should be set to “-no
unit-”, or omitted entirely and no unit will be assumed as the default.

{ “invoice”:
{
“contact”:“https://api.freeagent.com/v2/contacts/43”,
“dated_on”:“2014-11-24”,
“reference”:“004”,
“currency”:“GBP”,
“omit_header”:false,
“payment_terms_in_days”:5,
“invoice_items”:[
{
“description”:“Test InvoiceItem”,
“item_type”:"-no unit-",
“price”:“10.0”,
“quantity”:“10.0”
}
]
}
}

I’ll add that to our list of things to fix in the documentation.

Cheers,
Paul.On Wednesday, 19 November 2014 09:40:49 UTC, Matt Roberts wrote:

Hi,

I want to raise an invoice via the API - the invoice item I am adding
isn’t represented by freeagent (we’re invoicing by number of users), so i
want to use “No Unit”. Now, I can do that in the web app, but the API won’t
let me use “No Unit”, I have to choose “Product”, which looks wrong in the
invoice.

Is there any way round this, seems an odd limitation for the API.

Matt

Thanks Paul.

I’m sure I tried leaving it blank, but I’ll do it again and see what I get.

MattOn Monday, 24 November 2014 12:49:13 UTC, Paul Smith wrote:

Hi Matt,

I’ve just checked and we seem to have missed that option from our
documentation, but it does work. The item_type should be set to “-no
unit-”, or omitted entirely and no unit will be assumed as the default.

{ “invoice”:
{
“contact”:“https://api.freeagent.com/v2/contacts/43”,
“dated_on”:“2014-11-24”,
“reference”:“004”,
“currency”:“GBP”,
“omit_header”:false,
“payment_terms_in_days”:5,
“invoice_items”:[
{
“description”:“Test InvoiceItem”,
“item_type”:"-no unit-",
“price”:“10.0”,
“quantity”:“10.0”
}
]
}
}

I’ll add that to our list of things to fix in the documentation.

Cheers,
Paul.

On Wednesday, 19 November 2014 09:40:49 UTC, Matt Roberts wrote:

Hi,

I want to raise an invoice via the API - the invoice item I am adding
isn’t represented by freeagent (we’re invoicing by number of users), so i
want to use “No Unit”. Now, I can do that in the web app, but the API won’t
let me use “No Unit”, I have to choose “Product”, which looks wrong in the
invoice.

Is there any way round this, seems an odd limitation for the API.

Matt