QA
Senior~25 minAPI journeysBusiness rulesMoney assertionsOrder lifecycle

API: register, bag rules, coupon, order and cancel

App: TrendKart, a practice fashion marketplace (Myntra-style). Login: Guest checkout works; members: arya@trendkart.test / Trendy@123 or register. REST API: tests call it as /api/... through the request fixture or page.request; GET /api lists every endpoint ↗.

Next scenario →

Interview scenario

"Write the API journey a new customer takes: register, try to add a product without a size and an out-of-stock size, add three tees, apply TRENDY10, save an address, place a UPI order, see it in the order history and cancel it. Assert the money at every step."

Acceptance criteria

  1. POST /api/auth/register with a unique email: status 201 and a token.
  2. POST /api/bag/items for productId 104 without size is 400 (Please select a size); productId 101 size XL is 409 (out of stock).
  3. productId 104 size M qty 3 gives totals.total 1197; coupon TRENDY10 gives totals.coupon 120 and total 1077.
  4. POST /api/addresses, then POST /api/orders { addressId, payment: 'upi' }: status 201, order.status confirmed, totals.total 1077. GET /api/orders has 1 item; POST /api/orders/:id/cancel sets status cancelled.

🔒 This lab is part of Pro

Pro unlocks the live editor, the scenario checks and the reference solutions in Playwright and Selenium Java for all 37 labs, plus every interview answer. One payment of ₹1,299, lifetime access. Already on a lower tier? Upgrade for the difference.