---
title: "createOrder"
url: "https://kong-portal.millennia-solusi.xyz/apis/pizza-shackapi-1/versions/1ff7da65-7182-4ce7-a35c-b8a62959bbe2/operations/createOrder"
---

> Full API specification: https://kong-portal.millennia-solusi.xyz/apis/pizza-shackapi-1/versions/1ff7da65-7182-4ce7-a35c-b8a62959bbe2.md

# createOrder

`POST` `/order`

Operation ID: `createOrder`

Create a new Order

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Created. Successful response with the newly created object as entity inthe body.Location header contains URL of newly created entity.
- `400` - Bad Request. Invalid request or validation error.
- `415` - Unsupported Media Type. The entity of the request was in a not supported format.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: PizzaShackAPI
  version: 1.0.0
servers:
  - url: https://localhost:9443/am/sample/pizzashack/v1/api
    description: Production API server
    x-internal: false
paths:
  /order:
    post:
      tags:
        - order
      description: Create a new Order
      operationId: createOrder
      requestBody:
        $ref: "#/components/requestBodies/Order"
      responses:
        "201":
          description: Created. Successful response with the newly created object as
            entity inthe body.Location header contains URL of newly created
            entity.
          headers:
            Location:
              description: The URL of the newly created resource.
              style: simple
              explode: false
              schema:
                type: string
            Content-Type:
              description: The content type of the body.
              style: simple
              explode: false
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Order"
        "400":
          description: Bad Request. Invalid request or validation error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "415":
          description: Unsupported Media Type. The entity of the request was in a not
            supported format.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - default: []
      x-auth-type: Application & Application User
      x-throttling-tier: Unlimited
      x-wso2-application-security:
        security-types:
          - oauth2
        optional: false
security:
  - default: []
components:
  requestBodies:
    Order:
      description: Order object that needs to be added
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Order"
      required: true
  schemas:
    Order:
      title: Pizza Order
      required:
        - orderId
      properties:
        customerName:
          type: string
        delivered:
          type: boolean
        address:
          type: string
        pizzaType:
          type: string
        creditCardNumber:
          type: string
        quantity:
          type: number
        orderId:
          type: string
    Error:
      title: Error object returned with 4XX HTTP status
      required:
        - code
        - message
      properties:
        message:
          type: string
          description: Error message.
        error:
          type: array
          description: If there are more than one error list them out. Ex. list out
            validation errors by each field.
          items:
            $ref: "#/components/schemas/ErrorListItem"
        description:
          type: string
          description: A detail description about the error message.
        code:
          type: integer
          format: int64
        moreInfo:
          type: string
          description: Preferably an url with more details about the error.
    ErrorListItem:
      title: Description of individual errors that may have occurred during a request.
      required:
        - code
        - message
      properties:
        message:
          type: string
          description: Description about individual errors occurred
        code:
          type: integer
          format: int64
  securitySchemes:
    default:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://test.com
          scopes: {}
```
