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

KeyTypeSample ValueDescription
statusString“ok”File was loaded successfully.
num_rcvd_invoicesNumber24Number 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 CodeDescription
400 Bad RequestThe request could not be understood by the server due to incorrect syntax.
401 UnauthenticatedThe request requires user authentication information. Your API token is missing or invalid.
403 ForbiddenUnauthorized request. The client does not have access rights to the content. Unlike 401, the client’s identity is known to the server.
404 Not FoundThe API that you requested does not exist on this server.
500The 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.
503The request has failed due to a temporary failure of the server. You can try this request at a later time.

Calling the API