Skip to main content
POST
Upload Order File
Upload an Excel order list with the same parsing template used by operators in the order import screen. This endpoint uses your existing customer API key.
Availability requires the backend release containing this endpoint to be deployed.

Prepare the order file

  1. Call List Order Templates and choose an enabled order template.
  2. Prepare one .xlsx or .xls file whose headers match the template’s columns. The file must contain at least one data row.
  3. Include your customer name in the filename, as in the operator workflow. For customer ZTQ, 26ZTQ018.xlsx is valid.
  4. Send a multipart/form-data request. Let your HTTP client generate the multipart boundary.
The API key determines the order customer. Do not send selectedUser, customerId, action or an operator login token. This endpoint always imports orders and preserves the existing Excel order and factory validation rules.

Example

This example matches the screenshot workflow: import orders, use pipe-separated image URLs, select the new downloader, and disable image downloads. Set needDownloadImage=true to create image download tasks. To include attachments, repeat the field:
Supported attachment formats include archives (zip, rar, 7z, tar, gz), spreadsheets (xlsx, xls, csv), documents (pdf, doc, docx), images (jpg, jpeg, png, gif, bmp, webp) and text (txt, json, xml). Attachments are stored with the order batch; they do not replace image URLs in the spreadsheet.

Options

Success and follow-up queries

Save uniqueRequestId. Use it with Query Orders, Query Waybills and Query Trackings. A successful upload means the order batch was imported; factory matching, shipment creation and image downloads can still be pending.

Validation failures

If a row fails validation, HTTP 400 includes Excel row numbers. No orders from that file are committed:
Other request errors (such as an empty file, unsupported format, unavailable template or malformed workbook) return HTTP 400 with code, msg and optional data. Missing or invalid API keys return HTTP 401. Existing order numbers are rejected by the Excel import duplicate checks. The endpoint does not accept a client-generated idempotency key. If a request times out, check the order batch in the operator dashboard before uploading the same file again.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
templateId
integer<int64>
required

Enabled order template ID from List Order Templates.

file
file
required

One non-empty .xlsx or .xls order file. Filename must contain the authenticated customer name; headers must match the selected template.

attachments
file[]

Optional attachments. Repeat the attachments multipart field for multiple files.

namingType
enum<string>
default:default
Available options:
default,
simple,
random,
sku
urlSplitToken
enum<string>
default:0

Image URL separator: 0 = pipe, 1 = semicolon, 2 = newline.

Available options:
0,
1,
2
needDownloadImage
boolean
default:true

Create asynchronous image download tasks. Set false to import orders only.

newImageDownload
boolean
default:false

Use the new image downloader. Ignored when needDownloadImage is false.

Response

Order batch imported; downstream processing may still be pending

success
boolean
required
totalRows
integer
required
errors
object[]
required
mainOrderId
string | null

Created batch ID, encoded as a string to preserve precision.

uniqueRequestId
string | null

Server-generated batch key for Query Orders, Query Waybills and Query Trackings. Only returned on success.