---
title: Place an order for a pet
slug: mihai-tests/4ih9-place-an-order-for-a-pet
createdAt: 2024-05-23T13:14:55.472Z
---

{
  "id": "qhziLLzYR9LLXTc0YTXWE",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://petstore3.swagger.io/api/v3/store/order",
    "servers": [
      {
        "url": "https://petstore3.swagger.io/api/v3/store/order"
      }
    ],
    "name": "Place an order for a pet",
    "description": "Place a new order in the store",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "customType": "Order",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 10
            },
            {
              "name": "petId",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 198772
            },
            {
              "name": "quantity",
              "kind": "optional",
              "type": "integer<int32>",
              "example": 7
            },
            {
              "name": "shipDate",
              "kind": "optional",
              "type": "string<date-time>",
              "example": ""
            },
            {
              "name": "status",
              "kind": "optional",
              "type": "string<placed | approved | delivered>",
              "description": "Order Status",
              "example": "approved"
            },
            {
              "name": "complete",
              "kind": "optional",
              "type": "boolean",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/Order",
          "isExpanded": true
        }
      ],
      "formDataParameters": [
        {
          "name": "id",
          "kind": "optional",
          "type": "integer<int64>",
          "example": 10
        },
        {
          "name": "petId",
          "kind": "optional",
          "type": "integer<int64>",
          "example": 198772
        },
        {
          "name": "quantity",
          "kind": "optional",
          "type": "integer<int32>",
          "example": 7
        },
        {
          "name": "shipDate",
          "kind": "optional",
          "type": "string<date-time>",
          "example": ""
        },
        {
          "name": "status",
          "kind": "optional",
          "type": "string<placed | approved | delivered>",
          "description": "Order Status",
          "example": "approved"
        },
        {
          "name": "complete",
          "kind": "optional",
          "type": "boolean",
          "example": ""
        }
      ],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "Order",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 10
              },
              {
                "name": "petId",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 198772
              },
              {
                "name": "quantity",
                "kind": "optional",
                "type": "integer<int32>",
                "example": 7
              },
              {
                "name": "shipDate",
                "kind": "optional",
                "type": "string<date-time>",
                "example": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<placed | approved | delivered>",
                "description": "Order Status",
                "example": "approved"
              },
              {
                "name": "complete",
                "kind": "optional",
                "type": "boolean",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/Order",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "405",
        "description": "Invalid input",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "2cZF_zL9_rBdTeLRY7pW_",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location 'https://petstore3.swagger.io/api/v3/store/order' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"id\": 0,\n  \"petId\": 0,\n  \"quantity\": 0,\n  \"shipDate\": \"\",\n  \"status\": \"\",\n  \"complete\": false\n}'"
        },
        {
          "id": "FGNRc9jtt3blEPIYxlLE5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"id\": 0,\n   \"petId\": 0,\n   \"quantity\": 0,\n   \"shipDate\": \"\",\n   \"status\": \"\",\n   \"complete\": false\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://petstore3.swagger.io/api/v3/store/order\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "66IYHPOJtOvkVzgAZZ_3b",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://petstore3.swagger.io/api/v3/store/order\")\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\"\nrequest.body = JSON.dump({\n   \"id\": 0,\n   \"petId\": 0,\n   \"quantity\": 0,\n   \"shipDate\": \"\",\n   \"status\": \"\",\n   \"complete\": false\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "bbzOWS-h5emZZGLUvKWUU",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://petstore3.swagger.io/api/v3/store/order\"\n\npayload = json.dumps({\n   \"id\": 0,\n   \"petId\": 0,\n   \"quantity\": 0,\n   \"shipDate\": \"\",\n   \"status\": \"\",\n   \"complete\": False\n})\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": "2cZF_zL9_rBdTeLRY7pW_"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// successful operation\n{\n  \"id\": 10,\n  \"petId\": 198772,\n  \"quantity\": 7,\n  \"shipDate\": \"\",\n  \"status\": \"approved\",\n  \"complete\": false\n}"
        },
        {
          "id": "response-1-405",
          "language": "405",
          "code": "// Invalid input\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "ARbtAybNnihDBHaLC_ee2",
      "type": "paragraph",
      "children": [
        {
          "text": "Place a new order in the store"
        }
      ]
    }
  ]
}