Invoice Creation Problem

Hi Developers,

I am creating invoice using code get from
https://github.com/nicwise/FreeAgent. My code is like:

        Invoice c = new Invoice();
        c.comments = "Comments";
        c.contact = "Contact";
        c.created_at = "sometime";
        c.currency = "any";
        c.dated_on = "somedate";
        c.discount_percent = 6.6;
        c.due_on = "nothing";
        c.ec_status = "ec status";
        c.exchange_rate = 9.9;
        c.invoice_items = new List<InvoiceItem>();
        c.net_value = 4.4;
        c.payment_terms_in_days = 10;
        c.project = "poject";
        c.reference = "referece";
        c.sales_tax_value = 4.4;
        c.status = "status";
        c.updated_at = "sometime";
        c.written_off_date = "somedate";

        InvoiceClient ic = new InvoiceClient(_client);
        ic.Put(c);

When i try to create invoice using Put method it gives me error response
({“errors”:[{“message”:“Contact not found for this
company”},{“message”:“Project not found for this company”}]})

Kindly tell me where i am wrong? Either i am going wrong way to create
invoice or some other problem?

Kind Regards,
Cheesa,
Developer, Ambosco, Sherserve

Thanks Nic Wise. it really help me. :slight_smile:

Kind Regards,
Cheesa, Ambosco, SherserveOn Tuesday, July 16, 2013 2:05:14 PM UTC+5, Nic Wise wrote:

On 16 July 2013 09:13, Cheesa <fake...@gmail.com <javascript:>> wrote:

Hi Developers,

I am creating invoice using code get from
GitHub - nicwise/FreeAgent: A basic .NET client for FreeAgent.com (work in progress). My code is like:

PLEASE read the docs. I know RTFM is a cop-out, but still

FreeAgent Developer Dashboard

        Invoice c = new Invoice(); 
        c.comments = "Comments"; 
        c.contact = "Contact"; 

this is a reference to a contact, eg
http://api.freeagent.com/v2/contacts/12345

(you can also use /v2/contacts/12345)

        c.created_at = "sometime"; 

2013-07-11

        c.currency = "any"; 

GBP

        c.dated_on = "somedate"; 

2013-07-11

        c.discount_percent = 6.6; 
        c.due_on = "nothing"; 

its a required field.

        c.ec_status = "ec status"; 
        c.exchange_rate = 9.9; 
        c.invoice_items = new List<InvoiceItem>(); 
        c.net_value = 4.4; 
        c.payment_terms_in_days = 10; 
        c.project = "poject"; 

see the contact one above

        c.reference = "referece"; 
        c.sales_tax_value = 4.4; 
        c.status = "status"; 
        c.updated_at = "sometime"; 
        c.written_off_date = "somedate"; 

        InvoiceClient ic = new InvoiceClient(_client); 
        ic.Put(c); 

When i try to create invoice using Put method it gives me error response
({“errors”:[{“message”:“Contact not found for this
company”},{“message”:“Project not found for this company”}]})

Kindly tell me where i am wrong? Either i am going wrong way to create
invoice or some other problem?

FreeAgent Developer Dashboard

also

Invoices, in the current version of my client, are not fully
implemented, so you may/will have to make changes to get it working.
I’m working on that at the moment for another project, but I doubt
submitting an invoice works at the moment. It only has enough in it
for the work I’ve done so far (it’s not an official client)

Pulling invoices down does work tho. If you GET an existing invoice,
and have a look at the object which is returned, it gives you a very
good idea of what the values should be.


Nic Wise
t. +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/

Hi Developers,

I am creating invoice using code get from
GitHub - nicwise/FreeAgent: A basic .NET client for FreeAgent.com (work in progress). My code is like:

PLEASE read the docs. I know RTFM is a cop-out, but still

        Invoice c = new Invoice();
        c.comments = "Comments";
        c.contact = "Contact";

this is a reference to a contact, eg http://api.freeagent.com/v2/contacts/12345

(you can also use /v2/contacts/12345)

        c.created_at = "sometime";

2013-07-11

        c.currency = "any";

GBP

        c.dated_on = "somedate";

2013-07-11

        c.discount_percent = 6.6;
        c.due_on = "nothing";

its a required field.

        c.ec_status = "ec status";
        c.exchange_rate = 9.9;
        c.invoice_items = new List<InvoiceItem>();
        c.net_value = 4.4;
        c.payment_terms_in_days = 10;
        c.project = "poject";

see the contact one above

        c.reference = "referece";
        c.sales_tax_value = 4.4;
        c.status = "status";
        c.updated_at = "sometime";
        c.written_off_date = "somedate";

        InvoiceClient ic = new InvoiceClient(_client);
        ic.Put(c);

When i try to create invoice using Put method it gives me error response
({“errors”:[{“message”:“Contact not found for this
company”},{“message”:“Project not found for this company”}]})

Kindly tell me where i am wrong? Either i am going wrong way to create
invoice or some other problem?

also

Invoices, in the current version of my client, are not fully
implemented, so you may/will have to make changes to get it working.
I’m working on that at the moment for another project, but I doubt
submitting an invoice works at the moment. It only has enough in it
for the work I’ve done so far (it’s not an official client)

Pulling invoices down does work tho. If you GET an existing invoice,
and have a look at the object which is returned, it gives you a very
good idea of what the values should be.

Nic Wise
t. +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/

https://lh6.googleusercontent.com/-IsaUMq-wE3c/VEnkI2Kdt5I/AAAAAAAAAFc/5300oY3OZIw/s1600/freeagent.png

I GET an existing invoice, object showing me contact in these formats “https://api.sandbox.freeagent.com/v2/contacts/27387” AND " /v2/contacts/27387". Now for creating invoice when i am giving this as contact object it shows Object reference exception. kindly help.On Tuesday, July 16, 2013 2:05:14 PM UTC+5, Nic Wise wrote:

On 16 July 2013 09:13, Cheesa <fake...@gmail.com <javascript:>> wrote:

Hi Developers,

I am creating invoice using code get from
GitHub - nicwise/FreeAgent: A basic .NET client for FreeAgent.com (work in progress). My code is like:

PLEASE read the docs. I know RTFM is a cop-out, but still

FreeAgent Developer Dashboard

        Invoice c = new Invoice(); 
        c.comments = "Comments"; 
        c.contact = "Contact"; 

this is a reference to a contact, eg
http://api.freeagent.com/v2/contacts/12345
http://www.google.com/url?q=http%3A%2F%2Fapi.freeagent.com%2Fv2%2Fcontacts%2F12345&sa=D&sntz=1&usg=AFQjCNEWOOd6JIBo07g7XqN5QyYNCr_Kkg

(you can also use /v2/contacts/12345)

        c.created_at = "sometime"; 

2013-07-11

        c.currency = "any"; 

GBP

        c.dated_on = "somedate"; 

2013-07-11

        c.discount_percent = 6.6; 
        c.due_on = "nothing"; 

its a required field.

        c.ec_status = "ec status"; 
        c.exchange_rate = 9.9; 
        c.invoice_items = new List<InvoiceItem>(); 
        c.net_value = 4.4; 
        c.payment_terms_in_days = 10; 
        c.project = "poject"; 

see the contact one above

        c.reference = "referece"; 
        c.sales_tax_value = 4.4; 
        c.status = "status"; 
        c.updated_at = "sometime"; 
        c.written_off_date = "somedate"; 

        InvoiceClient ic = new InvoiceClient(_client); 
        ic.Put(c); 

When i try to create invoice using Put method it gives me error response
({“errors”:[{“message”:“Contact not found for this
company”},{“message”:“Project not found for this company”}]})

Kindly tell me where i am wrong? Either i am going wrong way to create
invoice or some other problem?

FreeAgent Developer Dashboard

also

Invoices, in the current version of my client, are not fully
implemented, so you may/will have to make changes to get it working.
I’m working on that at the moment for another project, but I doubt
submitting an invoice works at the moment. It only has enough in it
for the work I’ve done so far (it’s not an official client)

Pulling invoices down does work tho. If you GET an existing invoice,
and have a look at the object which is returned, it gives you a very
good idea of what the values should be.


Nic Wise
t. +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/