Skip to main content

Preview Bulk Delete Sales Orders

POST 

/api/sales-orders/bulk-delete/preview

Before deleting sales orders (in bulk, or one with ids: [id]): what the delete would do.

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

  • selected: how many orders the selection covers.
  • channels_with_order_sync[] (integration_instance_id, name, integration, orders_count): sales channel connections with order sync on. While order sync is on, a channel imports any of its orders that have no sales order, so orders deleted from such a channel come back unless sync is paused and their channel orders archived (see Bulk Delete Sales Orders (Tracked)).
  • kept: the orders the delete will keep and why, from the same checks the delete makes (returned stock used elsewhere, PayPal payments, a credit on another order, an issued or consolidated sales invoice, stock movements in the closed period, a drop-ship vendor label in progress). count; checked and unchecked (the first 500 orders are checked here, the rest as the delete runs); groups[] with reason, label, count, message, next_step and the first orders by name (items[]: id, label, link, detail).
  • dropship_purchasing: orders whose drop-ship purchase orders have a vendor invoice. They are deleted; by default their purchase orders, invoices and payments are kept as standalone purchase records. orders_count, purchase_orders_count, invoices_count, deletable_count (orders whose records can be deleted with delete_dropship_purchasing), truncated, and orders[] (first 50): sales_order_id, sales_order_number, link, can_delete_purchasing, blocked_reasons[] (why not: synced to accounting, closed period, supplier payment run, vendor deposit or credit, label in progress), purchase_orders[] (id, purchase_order_number, link, invoices[] with id, invoice_number, status, link, payments_count).

Authentication: Requires Bearer token.

Body: the same ids / apply_to_all + filters selection as Bulk Delete Sales Orders (Tracked).

Requires permission: sales_orders.delete

Request​

Responses​

OK

Response Headers
    Content-Type