latestOpenAPI 3.0.0Apache 2.02026-08-201250995.7 KB

bd9694db5fce

Sales

Update a Sale

Permissions needed: any of (CREATE_CHECKUPS, EDIT_CHECKUPS, CREATE_EDIT_COUNTER_SALE, SELL_SERVICES)

Discontinued product validation (422) The following rules apply when a product is discontinued (soft-deleted):

  • A new sold_products entry whose product_id refers to a discontinued product is rejected.

  • For an existing treatment whose product is discontinued, quantity, unit_id, and purchase_order_items (both the set of IDs and their quantities) must not differ from the stored values.

  • For an existing sold_services[].products item whose product is discontinued, quantity, unit_id, and purchase_order_items (both the set of IDs and their quantities) must not differ from the stored values.

  • An existing sold item whose product is discontinued (or whose product no longer exists) may still be removed by omitting it from the payload; no stock adjustment is made for it on removal.

put/api/v1/sales/{id}

Query parameters

Parameters

#/paths/~1api~1v1~1sales/delete/parameters/0 — unresolved $ref

Request body

remove_irrelevant_tasksboolean
discountnumber float nullable
discount_percentagenumber float nullable
discount_type'fixed' | 'percentage' nullable
predefined_discountsinteger[]

Example request

{
  "sold_products": [
    {
      "tax_rate_ids": [
        57
      ]
    }
  ],
  "sold_services": [
    {
      "tax_rate_ids": [
        57
      ]
    }
  ]
}

Response

dataData — unresolved $ref