---
title: "Creates a new order for the given order request"
method: POST
path: "/api/v1/orders"
tags: ["order"]
---

# Creates a new order for the given order request

`POST /api/v1/orders`

Creates a new order for the given order request.

## Request body

- NewOrder — Contains the new order request information
  - `customerId` string
  - `address` Address
    - `id` string — Order identifier
    - `number` string — house of flat number
    - `residency` string — Socieity or building name
    - `street` string — street name
    - `city` string — city name
    - `state` string — state name
    - `country` string — country name
    - `pincode` string — postal code
  - `card` Card
    - `id` string — Order identifier
    - `cardNumber` string — Card Number
    - `expires` string — Expiration date
    - `cvv` string — CVV code
    - `userId` string
  - `items` Item[] — Items in shopping cart
    - `id` string — Item Identifier
    - `quantity` integer — The item quantity
    - `unitPrice` unknown

## Response `201`

Order added successfully

- Order — Represents an order
  - `id` string — Order identifier
  - `customer` User
    - `id` string
    - `username` string
    - `firstName` string
    - `lastName` string
    - `email` string
    - `password` string
    - `phone` string
    - `userStatus` string
  - `address` Address
    - `id` string — Order identifier
    - `number` string — house of flat number
    - `residency` string — Socieity or building name
    - `street` string — street name
    - `city` string — city name
    - `state` string — state name
    - `country` string — country name
    - `pincode` string — postal code
  - `card` Card
    - `id` string — Order identifier
    - `cardNumber` string — Card Number
    - `expires` string — Expiration date
    - `cvv` string — CVV code
    - `userId` string
  - `date` string, date-time — Order's data and time details
  - `items` Item[] — Collection of order items.
    - `id` string — Item Identifier
    - `quantity` integer — The item quantity
    - `unitPrice` unknown
  - `total` unknown
  - `payment` Payment
    - `id` string — Order identifier
    - `authorized` boolean — Flag that specified whether payment is authorized or not
    - `message` string — Approval or rejection message
  - `shipment` Shipment
    - `id` string — Shipment Identifier
    - `carrier` string — Shipping Carrier
    - `trackingNumber` string — Shipping Tracking Number
    - `estDeliveryDate` string, date — Estimated Delivery Date
  - `status` 'CREATED' | 'PAID' | 'SHIPPED' | 'PAYMENT_FAILED' | 'SHIPMENT_FAILED' | 'COMPLETED' — Order Status

## Other responses

- `406` — If payment is not authorized.

---

[API](https://skmtc.dev/packtpublishing/apis/sample-ecommerce-app.md) · [All operations](https://skmtc.dev/packtpublishing/apis/sample-ecommerce-app/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/packtpublishing/sample-ecommerce-app/revisions/51a26ae44206/schema)
