I’ve already posted about this once - with no replies. I am using the API to create invoices and we’ve created hundreds of invoices automatically, so our system creates the JSON and sends it. However, we have one invoice on our system which is stuck and won’t create an invoice in FreeAgent. I’ve seen some posts about datatypes being incorrect cause an invalid JSON error - but I can’t see anything that is different to our other invoices. And I’ve tried removing the quotes from all number fields and it didn’t make a difference.
This is the JSON which has been sent - with the contact and invoice numbers changed to XXXX and with some of the number fields in quotes as all of our other invoices that have worked have been. However, I’ve tried another version which took out the quotes and it didn’t fix the problem:
{
“invoice”:{
“contact”:“https://api.freeagent.com/v2/contacts/XXXXXXXXX”,
“dated_on”:“2025-02-27”,
“due_on”:“2025-03-29”,
“reference”:“I-56157”,
“currency”:“GBP”,
“exchange_rate”:“1.0”,
“net_value”:“1966.5”,
“total_value”:“2359.8”,
“paid_value”:“0.0”,
“due_value”:“2359.8”,
“status”:“Open”,
“long_status”:“Open – due in 30 days”,
“omit_header”:false,
“always_show_bic_and_iban”:true,
“send_thank_you_emails”:false,
“send_reminder_emails”:false,
“send_new_invoice_emails”:false,
“bank_account”:“https://api.freeagent.com/v2/bank_accounts/XXXXXXX”,
“payment_terms_in_days”:30,
“payment_methods”:{
“paypal”:false,
“stripe”:false
},
“created_at”:“2025-02-27”,
“updated_at”:“2025-02-27”,
“invoice_items”:[
{
“description”:“XXXXXXXX”,
“price”:1966.5,
“sales_tax_rate”:“20”,
“quantity”:1
}
]
}
}
Any help would be gratefully received. Thanks!