Syntax
POST /api/invoices/load/
body = {"data": "invoices.csv"}
In addition to the csv, this API call also supports xml, xls and xlsx file formats.
Request Parameters
This API does not accept parameters.
Sample Response
Returns a JSON object that contains the status of the upload and how many invoices were actually uploaded. Example:
{ "status":"ok", "num_rcvd_invoices":24, "job_id":"12589-1c139969442840b48efcdaa918b9d4a8"
Where some more important fields are:
Response Key/Value Explanations
Key | Type | Sample Value | Description |
---|---|---|---|
status | String | “ok” | File was loaded successfully. |
num_rcvd_invoices | Number | 24 | Number of invoices that were loaded from the provided file. |
If the file format is not one of the supported file formats: csv, xml, xls and xlsx, the response object will look like this:
{ "status":"error", "error":"File must be a CSV, XML or XLS/XLSX file" }
Error Codes
Status Code | Description |
---|---|
400 Bad Request | The request could not be understood by the server due to incorrect syntax. |
401 Unauthenticated | The request requires user authentication information. Your API token is missing or invalid. |
403 Forbidden | Unauthorized request. The client does not have access rights to the content. Unlike 401, the client’s identity is known to the server. |
404 Not Found | The API that you requested does not exist on this server. |
500 | The file that is sent is not a csv file. In addition to the csv, this API call also supports xml, xls and xlsx file formats. |
503 | The request has failed due to a temporary failure of the server. You can try this request at a later time. |