Skip to content

Endpoints

Attention

The selected frontend policy permits public catalog GETs and requires ROLE_ADMIN for product writes at Gateway. Product's own authorization must match this policy before real-service acceptance; its source/image is an external prerequisite. See integration limits.

The Product API must expose the following endpoints:

POST /products

Create a new product.

1
2
3
4
5
{
    "name": "Tomato",
    "price": 10.12,
    "unit": "kg"
}

1
2
3
4
5
6
{
    "id": "0195abfb-7074-73a9-9d26-b4b9fbaab0a8",
    "name": "Tomato",
    "price": 10.12,
    "unit": "kg"
}
Response code: 201 (created)

GET /products

Get all products.

[
    {
        "id": "0195abfb-7074-73a9-9d26-b4b9fbaab0a8",
        "name": "Tomato",
        "price": 10.12,
        "unit": "kg"
    },
    {
        "id": "0195abfe-e416-7052-be3b-27cdaf12a984",
        "name": "Cheese",
        "price": 0.62,
        "unit": "slice"
    }
]
Response code: 200 (ok)

GET /products/{id}

Get a product by its ID.

1
2
3
4
5
6
{
    "id": "0195abfb-7074-73a9-9d26-b4b9fbaab0a8",
    "name": "Tomato",
    "price": 10.12,
    "unit": "kg"
}
Response code: 200 (ok)

DELETE /products/{id}

Delete a product by its ID.

Response code: 204 (no content)