Create Cart Order

POST /api/v1/payments/orders/cart

Creates a payment order for all items in the user's cart.

Headers:

Authorization: Bearer <token> or token must be passed in the cookie
Content-Type: application/json

Request Body:

{
  "shippingAddress": {
    "fullName": "John Doe",
    "address": "123 Main Street",
    "city": "Mumbai",
    "state": "Maharashtra",
    "zipCode": "400001",
    "country": "India",
    "phone": "9876543210"
  },
  "notes": "Please deliver during office hours"
}

Response:

{
  "status": "success",
  "message": "Cart order created successfully",
  "data": {
    "success": true,
    "orderId": "order_MzxJ9n7xQw5Pz8",
    "amount": 150000,
    "currency": "INR",
    "receipt": "ORDER_1640995200000_abc123",
    "paymentId": "65f8a2b4c1d2e3f4a5b6c7d8",
    "cartSummary": {
      "totalItems": 3,
      "totalAmount": 1500.0,
      "items": [
        {
          "productName": "Wireless Headphones",
          "quantity": 2,
          "price": 500.0,
          "selectedSize": "M",
          "selectedColor": "Black"
        }
      ]
    }
  }
}
Updated on