Template

E-commerce Product API

A product catalog anyone can browse and orders that only their customer can see. Filter by category or price range with query parameters, and add Stripe checkout with a custom endpoint.

  • Small shops and product catalogs
  • Mobile shopping prototypes
  • Learning how real store data is modelled

What's inside

Anyone can browse products. Only admins manage the catalogue. Signed-in customers place orders and only see their own. Work out order totals in a custom endpoint rather than trusting the browser.

Categories

/categories

Product categories

namestringrequired
slugstringrequired

Read: Anyone with the API key · Write: Admins

Products

/products

Things you sell

namestringrequired
descriptiontext
pricenumberrequired
image_urlurl
in_stockboolean
category→ categories

Read: Anyone with the API key · Write: Admins

Orders

/orders

Orders placed by signed-in customers

itemsjsonrequired
totalnumber
statusstring
shipping_addresstext

Read: Only the record's owner · Write: Signed-in users

Call it from your app

Every entity is a REST endpoint with filtering, sorting and paging. Sample data is included so the first request returns something.

GET /products
curl "https://YOUR_PROJECT.codefreeapi.com/api/v1/products?sort=-createdAt&limit=20" \
  -H "X-API-Key: YOUR_API_KEY"
POST /products
curl -X POST "https://YOUR_PROJECT.codefreeapi.com/api/v1/products" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "House blend, 250 g", "price": 12.5 }'
Response (one record)
{
  "id": "b3f1…",
  "name": "House blend, 250 g",
  "description": "Chocolate and hazelnut, medium roast.",
  "price": 12.5,
  "in_stock": true,
  "category": "categories-record-id",
  "createdAt": "2026-10-26T09:00:00.000Z"
}

Start your online store backend now

Free plan, no credit card. One click copies this template into your account.