POST /invoices returns 404 (on sandbox)

I can’t seem to get anything other than a 404 response with an empty body (no error messages) when trying to post a new invoice. See my request below. Is there anything I’m missing?

Thanks for your help.

curl -v -X POST -H "Authorization: Bearer ***" -H "Accept: application/json" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 7cbe4c6d-859d-966d-9418-f35282bb04bb" -d '{
"invoice": {
    "contact": "https:\/\/api.sandbox.freeagent.com\/v2\/contacts\/37083",
    "dated_on": "2016-01-01",
    "payment_terms_in_days": "30",
    "invoice_items": {
        "description": "My Service",
        "price": "1234",
        "item_type": "Services"
    }
  }
}' "https://api.sandbox.freeagent.com/v2/invoices"

Hi Lucas,

I’ve located your requests in our log files and, after reading the stack trace, I think I’ve spotted the subtle problem.

The invoice_items parameter needs to be an array of hashes.
Currently, your request is just a single hash, which is confusing our API when it tries to process your request.

Changing your request to the following, should solve your problem:

curl -v -X POST -H "Authorization: Bearer ***" -H "Accept: application/json" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 7cbe4c6d-859d-966d-9418-f35282bb04bb" -d '{
"invoice": {
    "contact": "https:\/\/api.sandbox.freeagent.com\/v2\/contacts\/37083",
    "dated_on": "2016-01-01",
    "payment_terms_in_days": "30",
    "invoice_items": [{
        "description": "My Service",
        "price": "1234",
        "item_type": "Services"
    }]
  }
}' "https://api.sandbox.freeagent.com/v2/invoices"

Hope this helps!
Dave J