---
title: Update a Sale
slug: update-a-sale
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "kSIeN5TrUElV2IeOTTnt6",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://developer.digitail.io/api/v1/sales/{id}",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/sales/{id}",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/sales/{id}",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Update a Sale",
    "description": "<p>Permissions needed: any of (CREATE_CHECKUPS, EDIT_CHECKUPS, CREATE_EDIT_COUNTER_SALE, SELL_SERVICES)</p>\n<p><strong>Discontinued product validation (422)</strong>\nThe following rules apply when a product is discontinued (soft-deleted):</p>\n<ul>\n<li>\n<p>A new <code>sold_products</code> entry whose <code>product_id</code> refers to a discontinued product is rejected.</p>\n</li>\n<li>\n<p>For an existing treatment whose product is discontinued, <code>quantity</code>, <code>unit_id</code>, and <code>purchase_order_items</code>\n(both the set of IDs and their quantities) must not differ from the stored values.</p>\n</li>\n<li>\n<p>For an existing <code>sold_services[].products</code> item whose product is discontinued, <code>quantity</code>, <code>unit_id</code>, and\n<code>purchase_order_items</code> (both the set of IDs and their quantities) must not differ from the stored values.</p>\n</li>\n<li>\n<p>An existing sold item whose product is discontinued (or whose product no longer exists) may still be\nremoved by omitting it from the payload; no stock adjustment is made for it on removal.</p>\n</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "new_response",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "remove_irrelevant_tasks",
              "kind": "optional",
              "type": "boolean",
              "description": ""
            },
            {
              "name": "discount",
              "kind": "optional",
              "type": "number<float>",
              "nullable": true,
              "description": "",
              "format": "float"
            },
            {
              "name": "discount_percentage",
              "kind": "optional",
              "type": "number<float>",
              "nullable": true,
              "description": "",
              "format": "float"
            },
            {
              "name": "discount_type",
              "kind": "optional",
              "type": "string<fixed | percentage>",
              "nullable": true,
              "description": "",
              "enum": [
                "fixed",
                "percentage"
              ]
            },
            {
              "name": "discount_reason",
              "kind": "optional",
              "type": "object",
              "nullable": true,
              "description": "",
              "example": "",
              "schema": [
                {
                  "name": "reason",
                  "kind": "optional",
                  "type": "string",
                  "nullable": true,
                  "description": ""
                },
                {
                  "name": "is_private",
                  "kind": "optional",
                  "type": "string<public | private>",
                  "description": "",
                  "enum": [
                    "public",
                    "private"
                  ]
                }
              ]
            },
            {
              "name": "predefined_discounts",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "sold_products",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer",
                  "description": "ID of an existing treatment. Omit or set to null for new treatments."
                },
                {
                  "name": "product_id",
                  "kind": "optional",
                  "type": "integer",
                  "description": "<p>Product to sell. Cannot refer to a discontinued (soft-deleted) product when creating a new treatment.</p>"
                },
                {
                  "name": "vet_id",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "unit_id",
                  "kind": "optional",
                  "type": "string<unit | subunit>",
                  "description": "Cannot be changed for an existing treatment whose product is discontinued.",
                  "enum": [
                    "unit",
                    "subunit"
                  ]
                },
                {
                  "name": "unit",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "quantity",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "Cannot be changed for an existing treatment whose product is discontinued.",
                  "format": "float"
                },
                {
                  "name": "sale_price",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "sale_price_with_vat",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "vat",
                  "kind": "optional",
                  "type": "number<float>",
                  "deprecated": true,
                  "description": "Warning: Deprecated\n<p>Deprecated for lines referencing a catalog item — use <code>tax_rate_ids</code>. Still required on write-in lines (no <code>product_id</code> / <code>service_package_id</code>).</p>",
                  "format": "float"
                },
                {
                  "name": "tax_rate_ids",
                  "kind": "optional",
                  "type": "array",
                  "description": "<p>Tax rate ids to apply. Takes precedence over <code>vat</code> when present. Send at most the clinic's <code>max_tax_rates</code> (1 today).</p>",
                  "example": "[57]",
                  "itemType": "integer",
                  "customType": "integer[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "price",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "sub_price",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "product_name",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "label",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "recommendations",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "is_checkout_bought",
                  "kind": "optional",
                  "type": "boolean",
                  "description": ""
                },
                {
                  "name": "fixed_fee",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "include_fixed_fee",
                  "kind": "optional",
                  "type": "boolean",
                  "description": ""
                },
                {
                  "name": "discount_reason",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "reason",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": ""
                    },
                    {
                      "name": "is_private",
                      "kind": "optional",
                      "type": "string<public | private>",
                      "description": "",
                      "enum": [
                        "public",
                        "private"
                      ]
                    }
                  ]
                },
                {
                  "name": "discount",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "discount_percentage",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "discount_type",
                  "kind": "optional",
                  "type": "string<fixed | percentage>",
                  "description": "",
                  "enum": [
                    "fixed",
                    "percentage"
                  ]
                },
                {
                  "name": "price_threshold_type",
                  "kind": "optional",
                  "type": "string<minimum | maximum>",
                  "description": "",
                  "enum": [
                    "minimum",
                    "maximum"
                  ]
                },
                {
                  "name": "purchase_order_items",
                  "kind": "optional",
                  "type": "array",
                  "description": "<p>For an existing treatment whose product is discontinued, the set of batch IDs and their quantities must exactly match the stored values. Any addition, removal, or quantity change results in a 422.</p>",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "id",
                      "kind": "optional",
                      "type": "integer",
                      "description": "<p>ID of the purchase order item (batch).</p>"
                    },
                    {
                      "name": "quantity",
                      "kind": "optional",
                      "type": "number<float>",
                      "description": "",
                      "format": "float"
                    }
                  ]
                }
              ]
            },
            {
              "name": "sold_services",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer",
                  "description": ""
                },
                {
                  "name": "service_package_id",
                  "kind": "optional",
                  "type": "integer",
                  "description": ""
                },
                {
                  "name": "quantity",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "price",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "unit_price",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "vat",
                  "kind": "optional",
                  "type": "number<float>",
                  "deprecated": true,
                  "description": "Warning: Deprecated\n<p>Deprecated for lines referencing a catalog item — use <code>tax_rate_ids</code>. Still required on write-in lines (no <code>product_id</code> / <code>service_package_id</code>).</p>",
                  "format": "float"
                },
                {
                  "name": "tax_rate_ids",
                  "kind": "optional",
                  "type": "array",
                  "description": "<p>Tax rate ids to apply. Takes precedence over <code>vat</code> when present. Send at most the clinic's <code>max_tax_rates</code> (1 today).</p>",
                  "example": "[57]",
                  "itemType": "integer",
                  "customType": "integer[]",
                  "itemExample": "",
                  "itemDefault": ""
                },
                {
                  "name": "vet_id",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "original_price",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "is_checkout_bought",
                  "kind": "optional",
                  "type": "boolean",
                  "description": ""
                },
                {
                  "name": "discount",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "discount_percentage",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "discount_type",
                  "kind": "optional",
                  "type": "string<fixed | percentage>",
                  "description": "",
                  "enum": [
                    "fixed",
                    "percentage"
                  ]
                },
                {
                  "name": "discount_reason",
                  "kind": "optional",
                  "type": "object",
                  "nullable": true,
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "reason",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": ""
                    },
                    {
                      "name": "is_private",
                      "kind": "optional",
                      "type": "string<public | private>",
                      "description": "",
                      "enum": [
                        "public",
                        "private"
                      ]
                    }
                  ]
                },
                {
                  "name": "aaha_code",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "products",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "id",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "product_id",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "units",
                      "kind": "optional",
                      "type": "array",
                      "description": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "itemExample": "",
                      "itemDefault": ""
                    },
                    {
                      "name": "formula",
                      "kind": "optional",
                      "type": "number<float>",
                      "description": "",
                      "format": "float"
                    },
                    {
                      "name": "unit_price_with_vat",
                      "kind": "optional",
                      "type": "number<float>",
                      "description": "",
                      "format": "float"
                    },
                    {
                      "name": "subunit_price_with_vat",
                      "kind": "optional",
                      "type": "number<float>",
                      "description": "",
                      "format": "float"
                    },
                    {
                      "name": "unit_id",
                      "kind": "optional",
                      "type": "string<unit | subunit>",
                      "description": "Cannot be changed for an existing service product whose product is discontinued.",
                      "enum": [
                        "unit",
                        "subunit"
                      ]
                    },
                    {
                      "name": "quantity",
                      "kind": "optional",
                      "type": "number<float>",
                      "description": "Cannot be changed for an existing service product whose product is discontinued.",
                      "format": "float"
                    },
                    {
                      "name": "label",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "recommendations",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "name",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "displayed",
                      "kind": "optional",
                      "type": "boolean",
                      "description": ""
                    },
                    {
                      "name": "purchase_order_items",
                      "kind": "optional",
                      "type": "array",
                      "description": "<p>For an existing service product whose product is discontinued, the set of batch IDs and their quantities must exactly match the stored values. Any addition, removal, or quantity change results in a 422.</p>",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "id",
                          "kind": "optional",
                          "type": "integer",
                          "description": "<p>ID of the purchase order item (batch).</p>"
                        },
                        {
                          "name": "quantity",
                          "kind": "optional",
                          "type": "number<float>",
                          "description": "",
                          "format": "float"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "passport",
          "name": "passport",
          "kind": "optional",
          "type": "oauth2",
          "description": "Laravel passport oauth2 security.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://digitail.test/oauth/authorize",
              "tokenUrl": "https://digitail.test/oauth/token",
              "refreshUrl": "https://digitail.test/oauth/token"
            }
          }
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/paths/~1api~1v1~1sales/post/responses/200/content/application~1json/schema/properties/data",
                "customType": "data",
                "schema": []
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "6G8jhZtaHkLhMPoOWG0_K",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://developer.digitail.io/api/v1/sales/{id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "2ISyOnfZOLrpN5RkIzfiZ",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/sales/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "2U8f-_p2pzKBdW_-70ILR",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/sales/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "wTpVKmdjD7QkT74XmgUAX",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/sales/{id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "6G8jhZtaHkLhMPoOWG0_K"
    },
    "results": {
      "languages": [
        {
          "id": "33liaPOt-35yIR-gIm1_8",
          "language": "200",
          "code": "{\n  \"data\": {}\n}"
        }
      ],
      "selectedLanguageId": "33liaPOt-35yIR-gIm1_8"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}