Place Order
Create an order from the shopping cart. This completes the checkout process.
Endpoint
POST /api/shop/checkout/orderRequest Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Bearer token (customer login required) |
Request Body
json
{
"shippingMethodCode": "flatrate_flatrate",
"paymentMethod": "paypal"
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
shippingMethodCode | string | Yes | Code of selected shipping method |
paymentMethod | string | Yes | Selected payment method |
Response Fields (200-201 Created)
| Field | Type | Description |
|---|---|---|
order | object | Created order details |
redirect | string | Payment redirect URL (if needed) |
message | string | Success message |
Order Fields
| Field | Type | Description |
|---|---|---|
id | integer | Order ID |
incrementId | string | Order increment ID |
status | string | Order status |
grandTotal | decimal | Total amount |
itemsCount | integer | Number of items |
createdAt | string | Creation timestamp |
invoiceUrl | string | Invoice download URL |
Order Status Values
pending- Awaiting payment confirmationprocessing- Payment confirmed, preparing shipmentshipped- Order shippeddelivered- Order deliveredcanceled- Order canceledfailed- Payment failed
Pre-requisites
All of these must be completed before placing order:
- Cart must have items
- Shipping address must be set
- Shipping method must be selected
- Billing address must be set
- Payment method must be selected
- All items in stock
After Order Placement
- Cart is automatically cleared
- Customer receives confirmation email
- Order status can be tracked
- Invoice becomes available
- Payment processing may redirect customer
Validation Rules
- Cart cannot be empty
- All addresses must be complete
- Inventory must be available for all items
- Shipping method must match location
- Payment method must be valid
Use Cases
- Complete customer checkout
- Create order for in-store pickup
- Process cash on delivery
- Execute payment gateway transaction
- Generate order confirmation and invoice

