Base URL: https://www.cockpitkingdom.com/public/api
Authorization: Bearer ck_your_token_herePOST /public/api/auth/register or POST /public/api/auth/login.
Create a new seller account and receive an API token.
{
"username": "simbuilder42",
"email": "you@example.com",
"password": "SecurePass123"
}
{
"success": true,
"data": {
"user": { "id": 5, "username": "simbuilder42", "role": "seller" },
"token": "ck_a1b2c3d4..."
}
}
Authenticate and retrieve your token.
{ "email": "you@example.com", "password": "SecurePass123" }
Returns the authenticated user's info, profile and stats.
Generate an additional token (e.g. for a specific integration).
{ "label": "My app integration" }
List all your tokens. Add ?id=X with DELETE method to revoke one.
Browse all marketplace products. No authentication required.
| Param | Type | Description |
|---|---|---|
| q | string | Keyword search (title, description, seller) |
| type | digital|physical | Filter by product type |
| cat | int | Category ID |
| sort | newest|oldest|price_asc|price_desc|popular | Sort order |
| page | int | Page number (default 1) |
| per_page | int | Results per page (max 50) |
List your own products with pagination and filters.
Create a new product.
{
"title": "B737 MCP Panel Config",
"description": "Complete MCP configuration for MSFS 2020...",
"price_cents": 1999,
"type": "digital",
"category_id": 2
}
| Field | Type | Description |
|---|---|---|
| title | string* | Product name (3–255 chars) |
| description | string* | Full description (min 10 chars) |
| price_cents | int* | Price in euro cents (0 = free) |
| type | digital|physical* | Product type |
| stock_qty | int | Stock (physical only, default 0) |
| category_id | int | Category ID (see /public/api/categories) |
Full product detail including images, files, stats and category.
Full replacement update (all fields required).
Partial update — only send the fields you want to change.
{ "price_cents": 2499, "stock_qty": 10 }
Permanently delete a product and all its media files.
Upload a product image. Send as multipart/form-data, field name: image. Max 8MB. JPG, PNG, WebP, GIF.
curl -X POST https://www.cockpitkingdom.com/public/api/products/5/image \
-H "Authorization: Bearer ck_..." \
-F "image=@/path/to/photo.jpg"
Remove a specific image. Get mediaId from the product detail response.
Upload the downloadable file for a digital product. Field: file. Max 200MB.
Get your public profile, account info, and token list.
Update your public profile. All fields optional with PATCH semantics.
{
"bio": "B737 sim builder based in Paris",
"location": "Paris, France",
"sim_platform": "MSFS 2020, X-Plane 12",
"website": "https://mysite.com"
}
Upload your avatar. multipart/form-data, field: avatar. Max 4MB. JPG, PNG, WebP.
List orders received for your products. Includes revenue summary in meta.
| Param | Type | Description |
|---|---|---|
| status | pending|paid|shipped|cancelled | Filter by status |
| product_id | int | Filter by product |
| page | int | Page number |
Full order detail including buyer info.
Update order status (useful for physical products).
{ "status": "shipped" }
List all categories with product count. No authentication required.
{
"success": true,
"data": [
{ "id": 1, "name": "MCP Panels", "slug": "mcp-panels", "product_count": 12 },
{ "id": 2, "name": "Arduino Scripts", "slug": "arduino-scripts", "product_count": 7 }
]
}
| HTTP Code | Meaning |
|---|---|
| 400 | Bad request / missing required field |
| 401 | Missing or invalid token |
| 403 | Forbidden (role mismatch) |
| 404 | Resource not found |
| 405 | Method not allowed |
| 409 | Conflict (e.g. duplicate email) |
| 413 | File too large |
| 415 | Unsupported file type |
| 422 | Validation error (see errors field) |
| 500 | Server error |
{
"success": false,
"error": "Validation failed.",
"errors": {
"title": ["title is required."],
"price_cents": ["price_cents must be numeric."]
}
}
# 1. Create account
curl -X POST https://www.cockpitkingdom.com/public/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"pilot42","email":"you@test.com","password":"MyPass123"}'
# → save the token from the response
TOKEN="ck_your_token_here"
# 2. Create a product
curl -X POST https://www.cockpitkingdom.com/public/api/products \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"B737 MCP Config","description":"Full config for MSFS 2020 B737","price_cents":1499,"type":"digital"}'
# → save the product id
PRODUCT_ID=7
# 3. Upload an image
curl -X POST https://www.cockpitkingdom.com/public/api/products/$PRODUCT_ID/image \
-H "Authorization: Bearer $TOKEN" \
-F "image=@/path/to/screenshot.jpg"
# 4. Upload the downloadable file
curl -X POST https://www.cockpitkingdom.com/public/api/products/$PRODUCT_ID/file \
-H "Authorization: Bearer $TOKEN" \
-F "file=@/path/to/config.zip"
# 5. Check your orders
curl https://www.cockpitkingdom.com/public/api/orders \
-H "Authorization: Bearer $TOKEN"
CockpitKingdom API v1.0 — Back to marketplace