Skip to main content
POST
Create Order

Endpoint

Headers

string
required
Bearer token with anon or service_role key
string
default:"application/json"
Request body format

Request Body

string
required
UUID of the store placing the order
string
required
Customer’s email address for order confirmation
string
required
Customer’s full name
string
required
Customer’s phone number (with country code)
object
required
Customer’s shipping address
array
required
Array of order items
string
required
Payment method selected by customerOptions: upi_direct, razorpay
string
URL of payment proof image (required if paymentMethod is upi_direct)

Response

boolean
Indicates if the order was created successfully
string
UUID of the newly created order
string
Human-readable order number (e.g., “ORD-2024-001”)
number
Total order amount in the store’s currency
number
Platform fee charged for this payment method
number
Total amount + checkout fee
string
Initial order statusOptions: pending, payment_pending, paid, processing, shipped, delivered, cancelled

Example Request

Example Response

Status Codes

Success
Order created successfully
Bad Request
Invalid request body or missing required fields
Unauthorized
Invalid or missing authorization token
Not Found
Store or product not found
Server Error
Internal server error

Business Logic

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%
The fee is added to totalAmount to calculate finalAmount.
Two emails are sent automatically:
  1. Buyer Confirmation Email
    • Order summary with items
    • Shipping address
    • Payment method
    • Order tracking link
  2. Seller Notification Email
    • New order alert
    • Customer details
    • Items to fulfill
    • Payment proof (if UPI Direct)
  • 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