Getting started Community Training Tutorials Documentation APIs, AI & Tools
openapi: 3.0.0
info:
title: Order Management API
version: 1.0.0
description: API for managing orders in an e-commerce platform.
servers:
- url: https://api.ecommerce.com/v1
paths:
/orders:
post: (1)
summary: Create a new order
operationId: createOrder
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'201':
description: Order created successfully
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Internal server error
security:
- bearerAuth: []
get: (2)
summary: Retrieve all orders
operationId: getOrders
responses:
'200':
description: A list of orders
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Order'
'401':
description: Unauthorized
'500':
description: Internal server error
security:
- bearerAuth: []
/orders/{orderId}: (3)
get:
summary: Retrieve a specific order
operationId: getOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
responses:
'200':
description: Order details
'404':
description: Order not found
put:
summary: Update an existing order
operationId: updateOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'200':
description: Order updated successfully
'404':
description: Order not found
delete:
summary: Delete an order
operationId: deleteOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
responses:
'204':
description: Order deleted successfully
'404':
description: Order not found
components:
securitySchemes: (4)
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas: (5)
Order:
type: object
properties:
id:
type: string
customerId:
type: string
items:
type: array
items:
$ref: '#/components/schemas/OrderItem'
totalAmount:
type: number
format: float
status:
type: string
enum: [pending, processing, completed, cancelled]
OrderItem:
type: object
properties:
productId:
type: string
quantity:
type: integer
price:
type: number
format: float



