PyrHouse API (0.1.0)

Download OpenAPI specification:Download

E-mail: warrmag7@gmail.com License: MIT

This is API overview

Get docs

Authorizations:
bearerAuth

Responses

Health

Basic health endpoint

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "ok"
}

auth

Authorize & generate jwt

Authorizations:
bearerAuth
Request Body schema: application/json
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "username": "admin",
  • "password": "admin"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

items

Returns array of items both with serial and with q

Returns array of items both with serial and with quantity

Authorizations:
bearerAuth
query Parameters
location_ids
Array of integers

List of location IDs to filter items by

category_id
integer

Category ID to filter items by

category_type
string
Enum: "asset" "stock"

Type of items to retrieve (asset or stock)

category_label
string

Category label to filter items by

Responses

Response samples

Content type
application/json
[
  • {
    }
]

asset

Add a new asset

Authorizations:
bearerAuth
Request Body schema: application/json
serial
string
category_id
string
origin
string
Enum: "druga-era" "probis" "targowe" "personal-{}" "other-{}"

Where is it from, default types are enum, but it allows to pass also personal & other, it just need to contain "keyword" to pass like druga-era-external

Responses

Request samples

Content type
application/json
{
  • "serial": "string",
  • "category_id": "string",
  • "origin": "druga-era"
}

Response samples

Content type
application/json
{
  • "id": 321,
  • "serial": "XYZ321",
  • "pyrcode": "PYR0L100",
  • "location": {
    },
  • "category": {
    }
}

/assets/pyrcode/{pyrcode}

Authorizations:
bearerAuth
path Parameters
pyrcode
required
string

Barcode value of item

Responses

Response samples

Content type
application/json
{
  • "id": 321,
  • "serial": "XYZ321",
  • "pyrcode": "PYR0L100",
  • "location": {
    },
  • "category": {
    }
}

Add multiple assets in bulk

Creates multiple assets with the same category, location and status

Authorizations:
bearerAuth
Request Body schema: application/json
serials
Array of strings

List of serial numbers for assets to create

location_id
integer

Location ID where assets will be stored (defaults to 1 if not specified)

status
string

Status of the assets (defaults to "available" if not specified)

category_id
integer

Category ID for the assets

origin
string

Origin of the assets (e.g. "purchase")

Responses

Request samples

Content type
application/json
{
  • "serials": [
    ],
  • "location_id": 0,
  • "status": "string",
  • "category_id": 0,
  • "origin": "string"
}

Response samples

Content type
application/json
{
  • "created": [
    ],
  • "errors": [
    ]
}

/assets/{assetID}

Authorizations:
bearerAuth
path Parameters
assetID
required
integer

Numeric ID of the asset

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

stock

Register stock item

Create stock item

Authorizations:
bearerAuth
Request Body schema: application/json
category_id
integer

category of stock

quantity
integer

Responses

Request samples

Content type
application/json
{
  • "category_id": 4,
  • "quantity": 99
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "category_id": 4,
  • "quantity": 99
}

location

Create new location (Czteropak)

Authorizations:
bearerAuth
Request Body schema: application/json
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": 3,
  • "name": "Gzdaczroom"
}

Get list of assets and stock items in given location to-refactor path

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "assets": [
    ],
  • "stock_items": [
    ]
}

Remove location by ID

Authorizations:
bearerAuth
path Parameters
locationID
required
integer

Numeric ID of the location

Responses

Response samples

Content type
application/json
{
  • "message": "Location deleted successfully"
}

Search items in location

Search for items in a specific location by serial number, category name, or category label

Authorizations:
bearerAuth
path Parameters
locationID
required
integer

Numeric ID of the location

query Parameters
q
required
string

Search query (minimum 1 character)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

transfer

Pobierz listę wszystkich transferów

Zwraca listę wszystkich transferów w systemie

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Utwórz nowy transfer

Tworzy nowy transfer zasobów i pozycji magazynowych między lokalizacjami

Authorizations:
bearerAuth
Request Body schema: application/json
from_location_id
required
integer

Identyfikator lokalizacji źródłowej

location_id
required
integer

Identyfikator lokalizacji docelowej

Array of objects

Kolekcja zasobów serializowanych do transferu

Array of objects

Kolekcja pozycji magazynowych do transferu

Responses

Request samples

Content type
application/json
{
  • "from_location_id": 1,
  • "location_id": 2,
  • "asset_item_collection": [
    ],
  • "stock_item_collection": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "from_location": {
    },
  • "to_location": {
    },
  • "assets_collection": [
    ],
  • "stock_items_collection": [
    ],
  • "transfer_date": "2019-08-24T14:15:22Z",
  • "status": "in_transit"
}

Pobierz szczegóły transferu

Zwraca szczegółowe informacje o transferze na podstawie jego ID

Authorizations:
bearerAuth
path Parameters
transferID
required
integer

Identyfikator transferu

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "from_location": {
    },
  • "to_location": {
    },
  • "assets_collection": [
    ],
  • "stock_items_collection": [
    ],
  • "transfer_date": "2019-08-24T14:15:22Z",
  • "status": "in_transit"
}

Potwierdź transfer

Potwierdza transfer i aktualizuje lokalizację zasobów

Authorizations:
bearerAuth
path Parameters
transferID
required
integer

Identyfikator transferu

Responses

Response samples

Content type
application/json
{
  • "transfer_id": 3,
  • "status": "completed",
  • "message": "Transfer confirmed successfully"
}

Anuluj transfer

Anuluje transfer i przywraca wszystkie zasoby i pozycje magazynowe do oryginalnej lokalizacji

Authorizations:
bearerAuth
path Parameters
transferID
required
integer

Identyfikator transferu

Responses

Response samples

Content type
application/json
{
  • "transfer_id": 3,
  • "status": "cancelled",
  • "message": "Transfer cancelled successfully"
}

Usuń zasób z transferu

Usuwa zasób z transferu i przywraca go do wskazanej lokalizacji

Authorizations:
bearerAuth
path Parameters
transferID
required
integer

Identyfikator transferu

itemID
required
integer

Identyfikator zasobu

Request Body schema: application/json
location_id
required
integer

Identyfikator lokalizacji, do której należy przywrócić zasób

Responses

Request samples

Content type
application/json
{
  • "location_id": 1
}

Response samples

Content type
application/json
{
  • "transfer_id": 3
}

Usuń pozycję magazynową z transferu

Usuwa pozycję magazynową z transferu i przywraca ją do wskazanej lokalizacji

Authorizations:
bearerAuth
path Parameters
transferID
required
integer

Identyfikator transferu

categoryID
required
integer

Identyfikator kategorii pozycji magazynowej

Request Body schema: application/json
location_id
required
integer

Identyfikator lokalizacji, do której należy przywrócić pozycję magazynową

quantity
required
integer

Ilość, która powinna zostać przywrócona

Responses

Request samples

Content type
application/json
{
  • "location_id": 1,
  • "quantity": 32
}

Response samples

Content type
application/json
{
  • "message": "Stock item removed from transfer successfully"
}

Aktualizuj lokalizację dostawy transferu

Aktualizuje lokalizację dostawy dla transferu w trakcie lub zakończonego

Authorizations:
bearerAuth
path Parameters
transferID
required
integer

Identyfikator transferu

Request Body schema: application/json
required
object

Responses

Request samples

Content type
application/json
{
  • "delivery_location": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Lokalizacja dostawy została zaktualizowana"
}

item category

Register user

This can only be done by the logged in user.

Authorizations:
bearerAuth
Request Body schema: application/json
type
string
label
string

Responses

Request samples

Content type
application/json
{
  • "type": "laptop",
  • "label": "Laptop"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "asset",
  • "name": "laptop",
  • "label": "Laptop"
}

Returns collection of users

...

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

/items/categories/{categoryID}

Authorizations:
bearerAuth
path Parameters
categoryID
required
integer

Numeric ID of the item category

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

users

Register user

This can only be done by the logged in user with admin role.

Authorizations:
bearerAuth
Request Body schema: application/json

Created user object

username
required
string
password
required
string
fullname
string
role
required
string (Role)
Enum: "user" "moderator" "admin"

Poziom uprawnień użytkownika

Responses

Request samples

Content type
application/json
{
  • "username": "johndoe",
  • "password": "password123",
  • "fullname": "John Doe",
  • "role": "user"
}

Response samples

Content type
application/json
{
  • "message": "User registered successfully"
}

Returns collection of users

Returns a list of all users. Requires moderator role.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get user by ID

Returns a single user. Requires user role.

Authorizations:
bearerAuth
path Parameters
id
required
integer <int64>

User ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "username": "johndoe",
  • "fullname": "John Doe",
  • "role": "user",
  • "points": 0
}

Update user

Updates an existing user. Requires admin role.

Authorizations:
bearerAuth
path Parameters
id
required
integer <int64>

User ID

Request Body schema: application/json

Updated user object

fullname
string
password
string
role
string (Role)
Enum: "user" "moderator" "admin"

Poziom uprawnień użytkownika

Responses

Request samples

Content type
application/json
{
  • "fullname": "John Doe Updated",
  • "password": "newpassword123",
  • "role": "user"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "username": "johndoe",
  • "fullname": "John Doe",
  • "role": "user",
  • "points": 0
}

Update user points

Updates points for an existing user. Requires admin role.

Authorizations:
bearerAuth
path Parameters
id
required
integer <int64>

User ID

Request Body schema: application/json

Points update request

points
required
integer

New points value for the user

Responses

Request samples

Content type
application/json
{
  • "points": 100
}

Response samples

Content type
application/json
{
  • "message": "User points updated successfully"
}

Add or subtract user points

Adds or subtracts points from an existing user. Use positive values to add points, negative to subtract. Requires admin role.

Authorizations:
bearerAuth
path Parameters
id
required
integer <int64>

User ID

Request Body schema: application/json

Points adjustment request

points
required
integer

Points to add (positive) or subtract (negative)

Responses

Request samples

Content type
application/json
{
  • "points": 10
}

Response samples

Content type
application/json
{
  • "message": "User points updated successfully",
  • "points": 110
}