Create Order
Orders
Create Order
Create a new order for a customer
POST
Create Order
Endpoint
Headers
Bearer token with
anon or service_role keyRequest body format
Request Body
UUID of the store placing the order
Customer’s email address for order confirmation
Customer’s full name
Customer’s phone number (with country code)
Customer’s shipping address
Array of order items
Payment method selected by customerOptions:
upi_direct, razorpayURL of payment proof image (required if
paymentMethod is upi_direct)Response
Indicates if the order was created successfully
UUID of the newly created order
Human-readable order number (e.g., “ORD-2024-001”)
Total order amount in the store’s currency
Platform fee charged for this payment method
Total amount + checkout fee
Initial order statusOptions:
pending, payment_pending, paid, processing, shipped, delivered, cancelledExample Request
Example Response
Status Codes
Order created successfully
Invalid request body or missing required fields
Invalid or missing authorization token
Store or product not found
Internal server error
Business Logic
Checkout Fee Calculation
Checkout Fee Calculation
UPI Direct: 0% fee (2% discount offered)Razorpay: 2-3% fee depending on payment method
- Credit/Debit Card: 2.5%
- UPI via Razorpay: 2%
- Wallets: 2%
totalAmount to calculate finalAmount.Email Notifications
Email Notifications
Two emails are sent automatically:
-
Buyer Confirmation Email
- Order summary with items
- Shipping address
- Payment method
- Order tracking link
-
Seller Notification Email
- New order alert
- Customer details
- Items to fulfill
- Payment proof (if UPI Direct)
Order Status Lifecycle
Order Status Lifecycle
- payment_pending: Order created, awaiting payment confirmation
- paid: Payment verified (auto for Razorpay, manual for UPI)
- processing: Seller is preparing the order
- shipped: Order dispatched with tracking
- delivered: Order received by customer
- cancelled: Order cancelled by seller or customer
Error Handling
Need help? Check out the Order Management Guide or reach out on GitHub Discussions
