---
title: Change SaleCustomer
slug: change-salecustomer
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "0DswbzDdLdKpStiEKqDUp",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://developer.digitail.io/api/v1/sale/{id}/customer",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/sale/{id}/customer",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/sale/{id}/customer",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Change SaleCustomer",
    "description": "<p>Permissions needed: any of (CREATE_CHECKUPS, EDIT_CHECKUPS, CREATE_EDIT_COUNTER_SALE, SELL_SERVICES);\nEdit the Sale's customer</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": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "customer_id",
              "kind": "optional",
              "type": "integer",
              "nullable": true,
              "description": "<p>Pet parent to attach to the sale. Must be a client of the clinic the sale belongs to; a client of another clinic in the group is rejected. Send null to detach the current customer.</p>",
              "example": 1
            }
          ],
          "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": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "Custom information about a PetParent that is related to a sale.",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "John"
                  },
                  {
                    "name": "last_name",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Doe"
                  },
                  {
                    "name": "email",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "john@example.com"
                  },
                  {
                    "name": "phone",
                    "kind": "optional",
                    "type": "string",
                    "description": "Phone number in E.164 format",
                    "example": "+16175551212."
                  },
                  {
                    "name": "address",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Flowers St. 300, Palo Alto, 123456, USA"
                  },
                  {
                    "name": "city",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Palo Alto"
                  },
                  {
                    "name": "street",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Flowers St."
                  },
                  {
                    "name": "street_number",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "300"
                  },
                  {
                    "name": "country",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1public~1clinics~1%7Bslug%7D/get/responses/200/content/application~1json/schema/properties/data/properties/country",
                    "customType": "country",
                    "schema": []
                  },
                  {
                    "name": "zip",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "123456"
                  },
                  {
                    "name": "region",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "California"
                  },
                  {
                    "name": "timezone",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "America/Los_Angeles"
                  },
                  {
                    "name": "has_app",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "",
                    "example": true
                  },
                  {
                    "name": "chatUid",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "e58ed763-928c-4155-bee9-fdbaaadc15f3"
                  },
                  {
                    "name": "vat_number",
                    "kind": "optional",
                    "type": "string",
                    "description": "present when included legalEntity",
                    "example": "123456789"
                  },
                  {
                    "name": "discounts",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1pet-parents/post/responses/201/content/application~1json/schema/properties/data/properties/discounts/items",
                    "customType": "items[]",
                    "schema": []
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "<p>The customer is not a client of the sale's clinic, or the id does not exist</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "undefined",
            "example": "{\"message\":\"The client is not registered at the clinic this sale belongs to.\",\"errors\":{\"customer_id\":[\"The client is not registered at the clinic this sale belongs to.\"]}}",
            "description": "",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "uUaj3T-BtepE_idVf-J-E",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://developer.digitail.io/api/v1/sale/{id}/customer \\\n     --header 'accept: application/json'"
        },
        {
          "id": "q0iziSvUD_7SDnnwT3I5G",
          "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/sale/{id}/customer\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qOhmQvbxLwk5asaXcSOBZ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/sale/{id}/customer\")\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": "t1KJ90vMJnD2Gng7Wrr4B",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/sale/{id}/customer\"\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": "uUaj3T-BtepE_idVf-J-E"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// successful operation\n{\n  \"data\": {\n    \"id\": 1,\n    \"name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john@example.com\",\n    \"phone\": \"+16175551212.\",\n    \"address\": \"Flowers St. 300, Palo Alto, 123456, USA\",\n    \"city\": \"Palo Alto\",\n    \"street\": \"Flowers St.\",\n    \"street_number\": \"300\",\n    \"country\": {},\n    \"zip\": \"123456\",\n    \"region\": \"California\",\n    \"timezone\": \"America/Los_Angeles\",\n    \"has_app\": true,\n    \"chatUid\": \"e58ed763-928c-4155-bee9-fdbaaadc15f3\",\n    \"vat_number\": \"123456789\",\n    \"discounts\": [\n      \"\"\n    ]\n  }\n}"
        },
        {
          "id": "response-1-422",
          "language": "422",
          "code": "// The customer is not a client of the sale's clinic, or the id does not exist\n\"{\\\"message\\\":\\\"The client is not registered at the clinic this sale belongs to.\\\",\\\"errors\\\":{\\\"customer_id\\\":[\\\"The client is not registered at the clinic this sale belongs to.\\\"]}}\""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}