---
title: Place an order for a pet
slug: mihai-tests/place-an-order-for-a-pet
createdAt: 2023-11-09T13:52:55.274Z
---

{
  "id": "-yUGoQ1fvPCAqFlINrQMS",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "//petstore.swagger.io/v2/store/order",
    "servers": [
      {
        "url": "//petstore.swagger.io/v2/store/order",
        "description": "Default server"
      },
      {
        "url": "//petstore.swagger.io/sandbox/store/order",
        "description": "Sandbox server"
      }
    ],
    "name": "Place an order for a pet",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "order placed for purchasing the pet",
          "customType": "Order",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer",
              "description": "Order ID",
              "modelRef": "#/components/schemas/Id",
              "customType": "Id",
              "schema": []
            },
            {
              "name": "petId",
              "kind": "optional",
              "type": "integer",
              "description": "Pet ID",
              "modelRef": "#/components/schemas/Id",
              "customType": "Id",
              "schema": []
            },
            {
              "name": "quantity",
              "kind": "optional",
              "type": "integer<int32>",
              "example": 0,
              "default": 1
            },
            {
              "name": "shipDate",
              "kind": "optional",
              "type": "string<date-time>",
              "description": "Estimated ship date",
              "example": ""
            },
            {
              "name": "status",
              "kind": "optional",
              "type": "string<placed | approved | delivered>",
              "description": "Order Status",
              "example": ""
            },
            {
              "name": "complete",
              "kind": "optional",
              "type": "boolean",
              "description": "Indicates whenever order was completed or not",
              "example": "",
              "default": false
            },
            {
              "name": "requestId",
              "kind": "optional",
              "type": "string",
              "description": "Unique Request Id",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/Order",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "Order",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer",
                "description": "Order ID",
                "modelRef": "#/components/schemas/Id",
                "customType": "Id",
                "schema": []
              },
              {
                "name": "petId",
                "kind": "optional",
                "type": "integer",
                "description": "Pet ID",
                "modelRef": "#/components/schemas/Id",
                "customType": "Id",
                "schema": []
              },
              {
                "name": "quantity",
                "kind": "optional",
                "type": "integer<int32>",
                "example": 0,
                "default": 1
              },
              {
                "name": "shipDate",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Estimated ship date",
                "example": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<placed | approved | delivered>",
                "description": "Order Status",
                "example": ""
              },
              {
                "name": "complete",
                "kind": "optional",
                "type": "boolean",
                "description": "Indicates whenever order was completed or not",
                "example": "",
                "default": false
              },
              {
                "name": "requestId",
                "kind": "optional",
                "type": "string",
                "description": "Unique Request Id",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/Order",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid Order",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "btpKt6G0qzVhkPSO5EJ4w",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location '//petstore.swagger.io/v2/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  \"requestId\": \"\"\n}'"
        },
        {
          "id": "YYGMHAxSIWTFK_f3EXMkE",
          "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   \"requestId\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"//petstore.swagger.io/v2/store/order\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "LIUoPJEyPHXZeKjdYUT8G",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"//petstore.swagger.io/v2/store/order\")\n\nhttp = Net::HTTP.new(url.host, url.port);\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   \"requestId\": \"\"\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "kSM6Z-_fMjdRIhFfzxlGA",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"//petstore.swagger.io/v2/store/order\"\n\npayload = json.dumps({\n   \"id\": 0,\n   \"petId\": 0,\n   \"quantity\": 0,\n   \"shipDate\": \"\",\n   \"status\": \"\",\n   \"complete\": False,\n   \"requestId\": \"\"\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": "btpKt6G0qzVhkPSO5EJ4w"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// successful operation\n{\n  \"id\": 0,\n  \"petId\": 0,\n  \"quantity\": \"\",\n  \"shipDate\": \"\",\n  \"status\": \"\",\n  \"complete\": false,\n  \"requestId\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid Order\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}