Shop API

A small e-commerce flow: browse products, build a cart, apply coupons and check out. Out-of-stock items return 409, invalid coupons 422, expired coupons 410, and checkout honors Idempotency-Key so retries never double-charge.

Base URL: https://funapi.dev/api/shop/v1 · 12 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.

products

things you do not need

carts

add, remove, regret

checkout

where the money pretends to move

The Shop API is a checkout: products with real stock counts, carts, and coupons that expire. Stock is decremented on checkout, so the interesting failures happen between adding an item and paying for it — which is precisely the window most e-commerce test suites skip.

What you can practise here

Example request and response

GET https://funapi.dev/api/shop/v1/products — List products, filter by category. No token, no signup:

curl -i https://funapi.dev/api/shop/v1/products

Response: 200 OK

{
  "total": 6,
  "data": [
    {
      "id": 1,
      "name": "Rubber Duck (QA Edition)",
      "price": 9.99,
      "stock": 12,
      "category": "office"
    },
    {
      "id": 2,
      "name": "Mechanical Keyboard, Extra Clicky",
      "price": 129,
      "stock": 5,
      "category": "office"
    },
    {
      "id": 3,
      "name": "Limited Sneaker Drop",
      "price": 249.99,
      "stock": 0,
      "category": "fashion"
    },
    {
      "id": 4,
      "name": "Coffee Beans, 1kg, Depressingly Strong",
      "price": 18.5,
      "stock": 40,
      "category": "food"
    },
    {
      "id": 5,
      "name": "HTTP Status Cats Poster",
      "price": 14,
      "stock": 7,
      "category": "decor"
    },
    {
      "id": 6,
      "name": "Infinite TODO Notebook",
      "price": 11.25,
      "stock": 3,
      "category": "office"
    }
  ]
}

Open and run this endpoint

All 55 mock REST APIs

Use this response elsewhere

Last updated