Import order lines as JSON

POST/v1/orders/import
Auth: Factory API key

The main integration point: push a retailer's order as lines and Skuflo creates the order, its pieces and their labels. on_duplicate controls a repeated (order_no, sku, colour): error (default) reports it and saves nothing, skip ignores just that line, allow adds it as extra units. pieces per line falls back to the SKU's configured piece count (Settings, SKU pieces), then 1; a line with neither comes back in unknown_skus. Responds 422 with { error, errors: [...] } and saves nothing if any line fails validation.

Request body

FieldTypeDescription
retailer_idrequiredstring·
production_datestring·
on_duplicatestring·
one of: "error", "skip", "allow"
default: "error"
linesrequiredobject[]·
order_norequiredstring·
skurequiredstring·
colourstring, nullable·
qtyrequiredinteger·
piecesinteger, nullable·

Response

201

FieldTypeDescription
upload_idstring·
production_datestring (date)·
ordersinteger·
linesinteger·
skippedinteger·
itemsintegerpieces created (labels to print)
unknown_skusstring[]SKUs with no configured piece count, defaulted to 1 piece
errorsobject[]·

Code samples

curl -X POST "https://api.skuflo.io/v1/orders/import" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "retailer_id": "ret_9c1a4e",
    "lines": [
      {
        "order_no": "#1042",
        "sku": "OTT4FT6",
        "qty": 1,
        "colour": "Grey Plush",
        "pieces": 3
      }
    ],
    "production_date": "production_date",
    "on_duplicate": "error"
  }'