Cedar Books API
Every call works on your own practice data, which ends after 2 hours. Sign in with POST /api/auth/login and send the token it returns as Authorization: Bearer YOUR_TOKEN. The full description is the OpenAPI document.
POST /api/auth/login
Sign in a demo shopper
curl -X POST https://practice.qaia.io/api/auth/login \
-H "Content-Type: application/json" -d '{"email":"shopper.one@cedarbooks.example","password":"Shop!2026"}'
POST /api/auth/logout
Sign out
curl -X POST https://practice.qaia.io/api/auth/logout \
-H "Authorization: Bearer YOUR_TOKEN"
GET /api/books
Search the catalogue
curl -X GET https://practice.qaia.io/api/books?q=cedar&sort=price-asc&limit=5
GET /api/books/{id}
One book
curl -X GET https://practice.qaia.io/api/books/1
POST /api/books/{id}/reviews
Review a book
curl -X POST https://practice.qaia.io/api/books/1/reviews \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" -d '{"rating":5,"comment":"A lovely read."}'
GET /api/basket
Your basket
curl -X GET https://practice.qaia.io/api/basket \
-H "Authorization: Bearer YOUR_TOKEN"
POST /api/basket/items
Add a book
curl -X POST https://practice.qaia.io/api/basket/items \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" -d '{"bookId":1,"qty":1}'
PATCH /api/basket/items/{lineId}
Change a quantity
curl -X PATCH https://practice.qaia.io/api/basket/items/L1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" -d '{"qty":2}'
DELETE /api/basket/items/{lineId}
Remove a line
curl -X DELETE https://practice.qaia.io/api/basket/items/L1 \
-H "Authorization: Bearer YOUR_TOKEN"
POST /api/coupons/apply
Apply one coupon code (a second code replaces the first)
curl -X POST https://practice.qaia.io/api/coupons/apply \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" -d '{"code":"CEDAR10"}'
POST /api/checkout
Pay with a test card
curl -X POST https://practice.qaia.io/api/checkout \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" -d '{"card":"4242 4242 4242 4242","address":{"name":"Shopper One","line1":"1 Practice Street","city":"Testville","postcode":"TS1 1AA"}}'
GET /api/orders
Your orders
curl -X GET https://practice.qaia.io/api/orders \
-H "Authorization: Bearer YOUR_TOKEN"
GET /api/orders/{id}
One of your orders
curl -X GET https://practice.qaia.io/api/orders/1001 \
-H "Authorization: Bearer YOUR_TOKEN"
GET /api/mailbox
The confirmation messages of this practice session (nothing is ever emailed)
curl -X GET https://practice.qaia.io/api/mailbox \
-H "Authorization: Bearer YOUR_TOKEN"
GET /api/openapi.json
This document
curl -X GET https://practice.qaia.io/api/openapi.json