Records a completed sale, with its lines and payments, as if it had been rung up at a register. Use it to bring in orders from your online store or another system.
The response is the saved sale, with its new id.
Required: store_id and at least one entry in lines. Each line needs quantity plus either item_id or barcode (we look the item up by barcode when item_id is 0).
Totals are calculated for you from the lines, so any total_* you send is ignored, apart from total_loyalty and total_loyalty_points, which are stored as sent. status is set from the payments.
Returns: send a line with a negative quantity, and add linked_sale_line_id to link it to the original line. receipt_number isn't checked for duplicates.
Required permission:
| Group | Permission |
|---|---|
| Sales | Create, edit and delete sales; manage = create sales and change their staff member or customer (includes view) |
