Syntax
POST /api/suppliers/load/
body = {"data": "suppliers.csv"}
In addition to the csv, this API call also supports xml, xls and xlsx file formats.
Request Parameters
None
Sample Response
Returns a JSON object that contains the status of the upload and how many suppliers were actually uploaded. Example:
{
"status":"ok",
"num_rcvd_suppliers":1,
"job_id":"12589-1c139969442840b48efcdaa918b9d4a8"
}
Response Key/Value Explanations
| Key | Type | Sample Value | Description |
|---|---|---|---|
| status | String | “ok” | File was loaded successfully. |
| num_rcvd_suppliers | Number | 1 | Number of suppliers 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"
}
HTTP Response Codes
| Status Code | Description |
|---|---|
| 200 OK | Success |
| 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 | Permission Denied – User does not have permission to perform this request |
| 404 Not Found | The resource you requested on the server does not exist |
| 500 | The request has failed due to a temporary failure of the server. You can try this request at a later time. |
| 503 | The request has failed due to a temporary failure of the server. You can try this request at a later time. |
