---
title: Change Sale customer
slug: import-test-pdf/change-sale-customer
createdAt: 2025-10-28T16:28:34.273Z
---

{
  "id": "g8fBxhT_BsZrKnO7Byn8G",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/api/v1/sale/{id}/customer",
    "servers": [],
    "name": "Change Sale customer",
    "description": "Change Sale customer",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "customer_id",
              "kind": "optional",
              "type": "integer",
              "description": "",
              "example": 1
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/SaleCustomer",
                "customType": "SaleCustomer",
                "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",
                    "description": "",
                    "modelRef": "#/components/schemas/Country",
                    "customType": "Country",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "integer",
                        "description": "",
                        "example": 6
                      },
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "description": "",
                        "example": "United States"
                      },
                      {
                        "name": "iso_code",
                        "kind": "optional",
                        "type": "string",
                        "description": "",
                        "example": "us"
                      },
                      {
                        "name": "code",
                        "kind": "optional",
                        "type": "string",
                        "description": "",
                        "example": "usa"
                      }
                    ]
                  },
                  {
                    "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"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "undefined",
            "example": "{\"message\":\"The given data was invalid.\",\"errors\":{\"customer_id\":[\"This value is invalid\"]}}",
            "description": "",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url /api/v1/sale/{id}/customer \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "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(\"/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": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/v1/sale/{id}/customer\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/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": "example-0-curl"
    },
    "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      \"id\": 6,\n      \"name\": \"United States\",\n      \"iso_code\": \"us\",\n      \"code\": \"usa\"\n    },\n    \"zip\": \"123456\",\n    \"region\": \"California\",\n    \"timezone\": \"America/Los_Angeles\",\n    \"has_app\": true,\n    \"chatUid\": \"e58ed763-928c-4155-bee9-fdbaaadc15f3\"\n  }\n}"
        },
        {
          "id": "response-1-422",
          "language": "422",
          "code": "// Bad request\n\"{\\\"message\\\":\\\"The given data was invalid.\\\",\\\"errors\\\":{\\\"customer_id\\\":[\\\"This value is invalid\\\"]}}\""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}