shop.checkout.createOrder(params)
Places an order. Call this when the customer confirms checkout.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
customer_name | string | ✅ | Full name |
customer_email | string | ✅ | Email address |
customer_phone | string | ❌ | Phone number |
items | CartItem[] | ✅ | At least one item required |
shipping_address | object | ❌ | Delivery address |
shipping_method | string | ❌ | Selected shipping method |
payment_method | string | ❌ | Default: 'cod' |
notes | string | ❌ | Order notes from customer |
promo_code_id | string | ❌ | ID from validatePromo result |
discount_amount | number | ❌ | Discount value from validatePromo |
CartItem type
Response
Example — Full checkout flow
Always snapshot the product
name and price at checkout time into the items array. Do not rely on re-fetching prices at order creation — prices may change.