Skip to content

REST API

This document covers the main API endpoints.

Interactive Documentation

For the complete API reference with request/response examples, use the Swagger UI.

Products

List Products

GET /api/products/

Query Parameters:

Parameter Type Description
category int Filter by category ID
is_featured bool Filter featured products
search string Search by name
page int Page number

Response:

{
    "count": 50,
    "next": "/api/products/?page=2",
    "results": [
        {
            "id": 1,
            "name": "Classic T-Shirt",
            "slug": "classic-t-shirt",
            "base_price": "24.95",
            "color_variants": [...]
        }
    ]
}

Get Product Detail

GET /api/products/{slug}/

Cart

Get Cart

GET /api/cart/

Returns the current user's shopping cart.

Add to Cart

POST /api/cart/add/

Request Body:

{
    "product_id": 1,
    "variant_id": 5,
    "quantity": 2,
    "design_id": 123
}

Update Cart Item

PATCH /api/cart/items/{id}/

Remove from Cart

DELETE /api/cart/items/{id}/

Orders

Create Order

POST /api/orders/

Request Body:

{
    "email": "customer@example.com",
    "phone": "+31612345678",
    "shipping_name": "John Doe",
    "shipping_address_line1": "Main Street 1",
    "shipping_postal_code": "1234 AB",
    "shipping_city": "Amsterdam",
    "shipping_country": "NL"
}

Get Order

GET /api/orders/{order_number}/

Designs

Create Design

POST /api/designs/

Update Design

PATCH /api/designs/{id}/

Upload Image

POST /api/upload/image/
Content-Type: multipart/form-data

Error Responses

All errors follow this format:

{
    "error": "Error message",
    "detail": "Additional details"
}

Status Codes

Code Description
200 Success
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
429 Rate Limited
500 Server Error