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

{
  "id": "4e3Fo0vR7THxN88wnHHaS",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/sales",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/sales",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/sales",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Create a Sale",
    "description": "<p>Permissions needed: any of (CREATE_CHECKUPS, EDIT_CHECKUPS, CREATE_EDIT_COUNTER_SALE, SELL_SERVICES)</p>",
    "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": "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": ""
                },
                {
                  "name": "product_id",
                  "kind": "optional",
                  "type": "integer",
                  "description": ""
                },
                {
                  "name": "vet_id",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "format": "float"
                },
                {
                  "name": "unit_id",
                  "kind": "optional",
                  "type": "string<unit | subunit>",
                  "description": "",
                  "enum": [
                    "unit",
                    "subunit"
                  ]
                },
                {
                  "name": "unit",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "quantity",
                  "kind": "optional",
                  "type": "number<float>",
                  "description": "",
                  "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": "",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "id",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "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": "",
                      "enum": [
                        "unit",
                        "subunit"
                      ]
                    },
                    {
                      "name": "quantity",
                      "kind": "optional",
                      "type": "number<float>",
                      "description": "",
                      "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": "",
                      "example": "",
                      "itemType": "object",
                      "customType": "object[]",
                      "schema": [
                        {
                          "name": "id",
                          "kind": "optional",
                          "type": "integer",
                          "description": ""
                        },
                        {
                          "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": "",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "clinic_id",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "1"
                  },
                  {
                    "name": "customer_id",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "1"
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "customer",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1sale~1%7Bid%7D~1customer/put/responses/200/content/application~1json/schema/properties/data",
                    "customType": "data",
                    "schema": []
                  },
                  {
                    "name": "file",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1records/post/responses/201/content/application~1json/schema/properties/data",
                    "customType": "data",
                    "schema": []
                  },
                  {
                    "name": "counter_sale",
                    "kind": "optional",
                    "type": "integer",
                    "nullable": true,
                    "description": "Id of the realted counter sale",
                    "example": ""
                  },
                  {
                    "name": "amount_paid",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "0.000"
                  },
                  {
                    "name": "amount_due",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "250.000"
                  },
                  {
                    "name": "edit_state_details",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1sale~1%7Bid%7D~1change-edit-state/put/responses/200/content/application~1json/schema/properties/data/properties/edit_state_details",
                    "customType": "edit_state_details",
                    "schema": []
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "integer",
                    "description": "<p><code>0</code> - No sale (zero total and no line items) <code>1</code> - Pending <code>2</code> - Paid <code>3</code> - Partially Paid <code>4</code> - Paid (Overdraft)</p>",
                    "enum": [
                      "0",
                      "1",
                      "2",
                      "3",
                      "4"
                    ]
                  },
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "250.000"
                  },
                  {
                    "name": "global_discount_net",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "0.000"
                  },
                  {
                    "name": "global_discount_tax",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "0.000"
                  },
                  {
                    "name": "global_discount_gross",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "0.000"
                  },
                  {
                    "name": "consolidated",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "A consolidated sale is a group of sale. A consolidated sale can't have direct products or services associated with it.",
                    "example": false
                  },
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2022-07-18T08:58:36.000000Z",
                    "format": "date-time"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2022-07-18T08:58:36.000000Z",
                    "format": "date-time"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "4DXPwlc9YuQs4j41QVEi7",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/sales \\\n     --header 'accept: application/json'"
        },
        {
          "id": "CZM5uMd3gGUBaqEJSImmN",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/sales\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "d5KNqbLY3SIri9uB_lprx",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/sales\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "nS4WgMUJ328JNqVaTGVny",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/sales\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "4DXPwlc9YuQs4j41QVEi7"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"data\": {\n    \"id\": 1,\n    \"clinic_id\": \"1\",\n    \"customer_id\": \"1\",\n    \"type\": 1,\n    \"customer\": {},\n    \"file\": {},\n    \"counter_sale\": 0,\n    \"amount_paid\": \"0.000\",\n    \"amount_due\": \"250.000\",\n    \"edit_state_details\": {},\n    \"status\": 0,\n    \"total\": \"250.000\",\n    \"global_discount_net\": \"0.000\",\n    \"global_discount_tax\": \"0.000\",\n    \"global_discount_gross\": \"0.000\",\n    \"consolidated\": false,\n    \"created_at\": \"2022-07-18T08:58:36.000000Z\",\n    \"updated_at\": \"2022-07-18T08:58:36.000000Z\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}