Place Order
The Place Order endpoint is used to create a new order in the Petstore system.
This operation allows applications to place orders for pets by submitting order-related details such as pet ID, quantity, shipping date, and order status.
Endpoint
Base URL
https://petstore.swagger.io/v2/store/order
Header
Required
Description
Content-Type
Yes
Specifies the request payload format
api_key
No
API key used for authorized requests
Supported Content Types
The endpoint supports the following content types:
Content Type
Usage
application/json
JSON request payload
application/xml
XML request payload
Request Body Parameters
Parameter
Type
Required
Description
id
integer
No
Unique identifier for the order
petId
integer
Yes
Identifier of the pet being ordered
quantity
integer
No
Number of pets ordered
shipDate
string
No
Shipping date and time
status
string
No
Current order status
complete
boolean
No
Indicates whether the order is complete
Supported Status Values
Status
Description
placed
Order has been placed
approved
Order has been approved
delivered
Order has been delivered
Sample Request
cURL Python JavaScript
curl -X POST "https://petstore.swagger.io/v2/store/order" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"id": 5001,
"petId": 101,
"quantity": 1,
"shipDate": "2026-05-13T10:00:00.000Z",
"status": "placed",
"complete": true
}'
import requests
url = "https://petstore.swagger.io/v2/store/order"
payload = {
"id" : 5001 ,
"petId" : 101 ,
"quantity" : 1 ,
"shipDate" : "2026-05-13T10:00:00.000Z" ,
"status" : "placed" ,
"complete" : True
}
response = requests . post ( url , json = payload )
print ( response . json ())
fetch ( "https://petstore.swagger.io/v2/store/order" , {
method : "POST" ,
headers : {
"Content-Type" : "application/json"
},
body : JSON . stringify ({
id : 5001 ,
petId : 101 ,
quantity : 1 ,
shipDate : "2026-05-13T10:00:00.000Z" ,
status : "placed" ,
complete : true
})
})
. then ( response => response . json ())
. then ( data => console . log ( data ));
Request Body Examples
Successful Response
Response Codes
Status Code
Description
200
Order placed successfully
400
Invalid order request
404
Pet not found
Error Response Example
{
"code" : 400 ,
"type" : "error" ,
"message" : "Invalid Order"
}
Notes
The petId value must reference an existing pet record.
Request payloads must match the selected content type.
The shipDate field should follow ISO 8601 date format.
Authentication may be required for restricted environments or protected operations.