Hi guys,
Can anyone help me in the Invoice generation,
The json array format is like this
{“invoice”:{“contact”:“https://api.freeagent.com/v2/contacts/2303251",“comments”:"Booking
Id =
1”,“dated_on”:“2014-01-10T09:20:52+00:00”,“payment_terms_in_days”:“365”,“currency”:“GBP”,“ec_status”:“EC
Services”,“status”:“Draft”,“invoice_items”:[{“position”:"",“item_type”:“Services”,“quantity”:“1”,“price”:“100”,“description”:“Agent
Id = 143,\r\n PropertyId = 1,\r\n Booking Id = 1,\r\n Inspection Date =
2013-12-18,\r\n Inspection Time = 7pm,\r\n Job reference number =
123”,“category”:“Property Booking”}]}}
and getting 422 error in response
[result] => Array
(
[errors] => Array
(
[0] => Array
(
[message] => contact can’t be blank
)
[1] => Array
(
[message] => payment_terms_in_days is not a number
)
[2] => Array
(
[message] => base Invoice Date is not valid
)
)
)
Please anyone tell me the true format of sending data.
thanks