Orders
Get Latest Order Sync Info
Latest-sync summary for an instance's orders: the most recently updated synced order and the total number of orders stored. Useful before queuing a refresh to decide whether a `since_latest` sync is sufficient.
Get Square Order
Get a single Square order by ID, including line items.
Sync Square Orders
Queue a background refresh of orders from the Square API. The job fetches orders modified since the last sync watermark (default), then promotes newly fetched orders into SKU sales orders. Progress can be tracked via the returned tracked_job_log_id.
Submit Square Order Fulfillments
Push pending SKU fulfillments back to Square for the given instance. Omit `fulfillment_ids` to submit every pending fulfillment on the instance; provide them to submit a specific subset. Returns per-run counts (submitted, skipped, failed) plus any per-fulfillment errors.
Get Order By ID
Fetch a single Magento 2 order by its internal ID, scoped to the supplied integration instance. The response includes the Magento money block, timestamps, the resolved Magento admin URL, all line items, shipments, invoices, credit memos, and — when linked — the SKU.io sales order with its fulfillments. `sku_sales_order_updated_at` carries that linked order's last create/update timestamp (the 'Last SKU Sync' column on the orders list), or null when the Magento order isn't mapped yet.
Refresh Orders
Dispatch the tracked job that refreshes Magento 2 orders. Returns the `tracked_job_log_id` so the frontend can pivot the global JobProgressTray to it. Job name prefix is `Refresh Magento 2 Orders: ` — the page's `lastCompletedJob` watcher matches on this prefix.
Pre-Start-Date Orders — Search Specific Order
Live single-order lookup against the Magento store for the pre-start-date import dialog's **Search specific order** tab. Hits Magento directly via the REST API (GET /V1/orders/{id} for `entity_id`, GET /V1/orders?searchCriteria for `email`) — local DB lookups would miss orders that have never been imported, which is the whole point of a pre-start-date back-fill.
Pre-Start-Date Orders — Import
Dispatches the tracked job that back-fills Magento 2 orders pre-dating the integration's normal sync start date. Returns `tracked_job_log_id` so the frontend can pivot the global JobProgressTray to it. Job name prefix is `Import Pre-Start-Date Magento 2 Orders: `.
Refresh Single Square Order
Refetch a single Square order from the Square API and re-promote it if a linked SKU sales order exists.
Create SKU Orders (bulk)
Bulk-promote selected Square orders into SKU sales orders. Only rows in the `pending` state with no existing sales_order_id are considered.
Update SKU Orders (bulk)
Bulk-refresh linked SKU sales orders — unlinks the existing SO and re-promotes each Square order so the SO is regenerated with latest data.
Delete Single SKU Order (unlink)
Detach the linked SKU sales order from a single Square order (deletes the SKU order; the Square row is kept and reset back to `pending`).
Bulk Delete SKU Orders
Bulk-detach linked SKU sales orders. Square orders are kept and reset back to `pending`.
Bulk Delete Square Orders
Hard-delete Square orders (removes the channel-side rows). Linked SKU sales orders are NOT removed automatically — call `bulk-delete-sku-orders` first if you want both gone.