Overview
DemoStore is a deliberately simple HTTP API that simulates a tiny online shop. It lets you create and manage products and add them to a shopping cart. The API is designed to be predictable and easy to script against.
All examples below assume the base URL:
https://shop-api.holacloud.app.
Main resources
- Product โ item you can buy (name, price, stock, description).
- Cart โ per-user basket with product lines and quantities.
Authentication
All product endpoints require the following headers:
Api-Key: demo-api-keyApi-Secret: demo-api-secret
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /v1/products | Create a new product. |
| GET | /v1/products/{product_id} | Retrieve a product by id. |
| PATCH | /v1/products/{product_id} | Patch only name, price and description. |
| DELETE | /v1/products/{product_id} | Delete a product by id. |
| POST | /v1/cart/items | Add a product to a user's cart. |
Typical flow
A common test scenario looks like:
- Create a product with
POST /v1/products. - Read that product back with
GET /v1/products/{product_id}. - Patch its public details with
PATCH /v1/products/{product_id}. - Add it to a user's cart using
POST /v1/cart/items. - Optionally, delete the product afterwards.
cURL examples
1. Create a product
Creates a new T-shirt. The API will generate the id if you omit it.
curl -X POST "https://shop-api.holacloud.app/v1/products" \
-H "Content-Type: application/json" \
-H "Api-Key: demo-api-key" \
-H "Api-Secret: demo-api-secret" \
-d '{
"name": "T-Shirt DemoStore",
"price": 19.99,
"stock": 100,
"description": "Soft cotton T-shirt with DemoStore logo"
}'
Example response:
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "prod-bff3ca37-5db2-475e-8b2e-07b734baf7bd",
"name": "T-Shirt DemoStore",
"price": 19.99,
"stock": 100,
"description": "Soft cotton T-shirt with DemoStore logo",
"createdAt": "2025-12-01T05:11:13.531Z"
}
2. Get a product by id
Reads the product using its id via a unique index in InceptionDB.
curl "https://shop-api.holacloud.app/v1/products/prod-bff3ca37-5db2-475e-8b2e-07b734baf7bd" \
-H "Api-Key: demo-api-key" \
-H "Api-Secret: demo-api-secret"
3. Patch a product (name, price, description only)
Only these fields are allowed in the patch payload: name, price, description.
curl -X PATCH "https://shop-api.holacloud.app/v1/products/prod-bff3ca37-5db2-475e-8b2e-07b734baf7bd" \
-H "Content-Type: application/json" \
-H "Api-Key: demo-api-key" \
-H "Api-Secret: demo-api-secret" \
-d '{
"name": "DemoStore Premium T-Shirt",
"price": 24.99,
"description": "Upgraded T-shirt with improved material"
}'
4. Delete a product
Removes the product using an index-based remove operation inside InceptionDB.
curl -X DELETE \
"https://shop-api.holacloud.app/v1/products/prod-bff3ca37-5db2-475e-8b2e-07b734baf7bd" \
-H "Api-Key: demo-api-key" \
-H "Api-Secret: demo-api-secret"
5. Add an item to a user's cart
Creates or updates a cart for the given userId. If the product line already exists,
its quantity is increased.
curl -X POST "https://shop-api.holacloud.app/v1/cart/items" \
-H "Content-Type: application/json" \
-d '{
"userId": "user-123",
"productId": "prod-bff3ca37-5db2-475e-8b2e-07b734baf7bd",
"quantity": 2
}'
Typical response:
{
"userId": "user-123",
"items": [
{
"productId": "prod-bff3ca37-5db2-475e-8b2e-07b734baf7bd",
"name": "DemoStore Premium T-Shirt",
"price": 24.99,
"quantity": 2
}
],
"updatedAt": "2025-12-01T05:31:10.123Z"
}
Using with FlowTest
In FlowTest, you can store values from one response and reuse them in the next step. For example:
// Step 1: POST /v1/products
// Save response.id as {{ productId }}
// Step 2: GET /v1/products/{{ productId }}
// Step 3: POST /v1/cart/items
{
"userId": "user-123",
"productId": "{{ productId }}",
"quantity": 2
}