Get your own customer support community
 

Create invoice API fails.

I'm trying to create invoices through the API.

<?xml version="1.0" encoding="UTF-8"?>
<invoice>
<company-id>28843</company-id>
<project-id>18668</project-id>
<dated-on>2009-01-30T14:34:37Z</dated-on>
<reference>1</reference>
<status>Draft</status>
<payment-terms>14</payment-terms>
</invoice>

Array
(
[url] => https://marko.freeagentcentral.com/in...
[content_type] => application/xml; charset=utf-8
[http_code] => 400
[header_size] => 509
[request_size] => 526
[filetime] => -1
[ssl_verify_result] => 19
[redirect_count] => 0
[total_time] => 0.233
[namelookup_time] => 0
[connect_time] => 0.032
[pretransfer_time] => 0.153
[size_upload] => 0
[size_download] => 189
[speed_download] => 189
[speed_upload] => 0
[download_content_length] => 189
[upload_content_length] => 0
[starttransfer_time] => 0.233
[redirect_time] => 0
)

cURL error number:0 cURL error:

HTTP/1.1 400 Bad Request
Date: Fri, 11 Sep 2009 02:38:45 GMT
Server: Apache/2.2.3 (Red Hat) DAV/2 Phusion_Passenger/2.2.5 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 mod_perl/2.0.4 Perl/v5.8.8
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.5
X-Runtime: 34
Cache-Control: no-cache
Set-Cookie: _session_id=fd6e9c00b1de249c2a890ce555e7d2f4; domain=.freeagentcentral.com; path=/; HttpOnly
Content-Length: 189
Status: 400
Connection: close
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Project is invalid</error>
<error>Payment terms in days is not a number</error>
<error>Contact can't be blank</error>
</errors>

At least this is better then before, when I tried to post a more complex xml. This resulted in no errors at all, but a 400 all the same.
 
sad I’m frustrated
Inappropriate?
1 person has this problem

The company marked this problem solved.


User_default_medium