Toy Store API

Add a new toy

post
https://api.toystore.com/v1/toys

Body

application/json

Toy

idstringrequired
namestringrequired
pricenumberrequired
categorystringrequired
stockintegerrequired

Response

201

Toy added successfully

post/toys

Body

{ "id": "id", "name": "name", "price": 0, "category": "category", "stock": 0 }
 
201

Get details of a specific toy

get
https://api.toystore.com/v1/toys/{toyId}

Path Parameters

toyIdstringrequired

Response

200 application/json

Details of the toy

Toy

idstringrequired
namestringrequired
pricenumberrequired
categorystringrequired
stockintegerrequired
get/toys/{toyId}
 
200 application/json

Update a toy's details

put
https://api.toystore.com/v1/toys/{toyId}

Path Parameters

toyIdstringrequired

Body

application/json

Toy

idstringrequired
namestringrequired
pricenumberrequired
categorystringrequired
stockintegerrequired

Response

200

Toy updated successfully

put/toys/{toyId}

Body

{ "id": "id", "name": "name", "price": 0, "category": "category", "stock": 0 }
 
200

Delete a toy

delete
https://api.toystore.com/v1/toys/{toyId}

Path Parameters

toyIdstringrequired

Response

204

Toy deleted successfully

delete/toys/{toyId}
 
204

Place a new order

post
https://api.toystore.com/v1/orders

Body

application/json

Order

idstringrequired
customerIdstringrequired
itemsarray[object]required
Show Child Parameters
totalPricenumberrequired

Response

201

Order placed successfully

post/orders

Body

{ "id": "id", "customerId": "customerId", "items": [ { "toyId": "toyId", "quantity": 0 } ], "totalPrice": 0 }
 
201