Download OpenAPI specification:
An API ment for communication in a simple market system.
A API inspired by the Space-Market API. Its ment for communication of a simple market system.
These endpoints define how clients can authenticate to the server to create and change protected items.
This creates a authentication token, that can be used to modify specific data.
| passphrase | string |
{- "passphrase": "string"
}{- "token": "string",
- "token_valid_until": "string",
- "refresh_token": "string",
- "refresh_token_valid_until": "string"
}This creates a new token, with a refresh token as authentication. The refresh token should be used as Bearer.
{- "token": "string",
- "token_valid_until": "string",
- "refresh_token": "string",
- "refresh_token_valid_until": "string"
}{- "version": "Matender v0.0.1-beta",
- "credit_limit": 2000,
- "currency": {
- "symbol": "€",
- "symbol_location": "AFTER_AMOUNT"
}, - "energy_unit": "kcal",
- "mass_unit": "g"
}[- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "Mio Mio Mate",
- "price": 170,
- "active": true,
- "image_id": "b25afde4-07a4-45a3-a99d-bad3a7780cbb",
- "label": {
- "type": "string",
- "bottle_size": 0.5,
- "caffeine": 20,
- "energy": 102,
- "alcohol": 0
}
}
]| name required | string |
| price required | number <int32> Price in the smallest format of the currency (f.E. cents) |
| active required | boolean If active is false, its considered to be not avaliable. This should not prevent people to buy it, however. Frontend may use this value to add a dialog to notify users of the fact, its not avaliable. |
| image_id | string <uuid> |
required | object or object or object (ProductLabel) |
{- "name": "Mio Mio Cola",
- "price": 0,
- "active": true,
- "image_id": "84c230fd-5520-4984-8119-37365b66fd80",
- "label": {
- "type": "string",
- "bottle_size": 0.5,
- "caffeine": 20,
- "energy": 102,
- "alcohol": 0
}
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "Mio Mio Cola",
- "price": 170,
- "active": true,
- "image_id": "b25afde4-07a4-45a3-a99d-bad3a7780cbb",
- "label": {
- "type": "string",
- "bottle_size": 0.5,
- "caffeine": 20,
- "energy": 102,
- "alcohol": 0
}
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "Mio Mio Mate",
- "price": 170,
- "active": true,
- "image_id": "b25afde4-07a4-45a3-a99d-bad3a7780cbb",
- "label": {
- "type": "string",
- "bottle_size": 0.5,
- "caffeine": 20,
- "energy": 102,
- "alcohol": 0
}
}| id | string <uuid> |
| name | string |
| price | number <int32> Price in the smallest format of the currency (f.E. cents) |
| active | boolean If active is false, its considered to be not avaliable. This should not prevent people to buy it, however. Frontend may use this value to add a dialog to notify users of the fact, its not avaliable. |
| image_id | string <uuid> |
object or object or object (ProductLabel) |
{- "name": "Mio Mio Mate with pep",
- "price": 0,
- "active": true,
- "image_id": "84c230fd-5520-4984-8119-37365b66fd80",
- "label": {
- "type": "string",
- "bottle_size": 0.5,
- "caffeine": 20,
- "energy": 102,
- "alcohol": 0
}
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "name": "Mio Mio Mate with pep",
- "price": 170,
- "active": true,
- "image_id": "b25afde4-07a4-45a3-a99d-bad3a7780cbb",
- "label": {
- "type": "string",
- "bottle_size": 0.5,
- "caffeine": 20,
- "energy": 102,
- "alcohol": 0
}
}[- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "username": "string",
- "balance": 0,
- "active": true,
- "track_transactions": true,
- "avatar_id": "ceaabbd8-6fdf-460c-878c-7d0ae67338c0"
}
]This endpoint creates a new user
| username required | string |
| balance required | number <int32> The balance of the user in cents |
| active required | boolean |
| track_transactions | boolean If set to true, transactions should contain the users id as related user id. Setting it to false, the server should remove the user id from related transactions. |
| avatar_id | string <uuid> The avatar image for the user. |
{- "username": "string",
- "balance": 0,
- "active": true,
- "track_transactions": true,
- "avatar_id": "ceaabbd8-6fdf-460c-878c-7d0ae67338c0"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "username": "string",
- "balance": 0,
- "active": true,
- "track_transactions": true,
- "avatar_id": "ceaabbd8-6fdf-460c-878c-7d0ae67338c0",
- "name": "Mio Mio Cola"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "username": "string",
- "balance": 0,
- "active": true,
- "track_transactions": true,
- "avatar_id": "ceaabbd8-6fdf-460c-878c-7d0ae67338c0"
}| id | string <uuid> |
| username | string |
| balance | number <int32> The balance of the user in cents |
| active | boolean |
| track_transactions | boolean If set to true, transactions should contain the users id as related user id. Setting it to false, the server should remove the user id from related transactions. |
| avatar_id | string <uuid> The avatar image for the user. |
{- "username": "you",
- "balance": 0,
- "active": true,
- "track_transactions": true,
- "avatar_id": "ceaabbd8-6fdf-460c-878c-7d0ae67338c0"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "username": "you",
- "balance": 0,
- "active": true,
- "track_transactions": true,
- "avatar_id": "ceaabbd8-6fdf-460c-878c-7d0ae67338c0"
}| id | string <uuid> |
| amount | number <int32> |
{- "amount": 0
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "PURCHASE",
- "amount": 0,
- "related_user_id": "6038a5c3-28e1-43f7-8a72-a713a7005b26",
- "related_product_id": "e0da22be-5437-465a-bea9-b80a9c82af7b"
}| id | string <uuid> |
| product_id | string <uuid> |
{- "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "PURCHASE",
- "amount": 0,
- "related_user_id": "6038a5c3-28e1-43f7-8a72-a713a7005b26",
- "related_product_id": "e0da22be-5437-465a-bea9-b80a9c82af7b"
}Define how a image is created and can be obtained.
Due to human error, the server should not expect the client to delete the image, when it is not used anymore. The server should implerment a garbage collection system for that.
Creates a new image with the provided information.
| file | Array of any |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "filename": "44d3e5d4-60a9-4a16-a20b-1b68c2662e1a.png",
- "hash": "dd593e6cbf80204e5a68bc64c50a4156a3da7569650f61d7cfe6437428a805d4",
- "filesize": 1048576,
- "mime_type": "image/png"
}This endpoint offers metadata about the specified image
| id | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "filename": "44d3e5d4-60a9-4a16-a20b-1b68c2662e1a.png",
- "hash": "dd593e6cbf80204e5a68bc64c50a4156a3da7569650f61d7cfe6437428a805d4",
- "filesize": 1048576,
- "mime_type": "image/png"
}Returns details for the barcode requested.
| barcode required | string |
| type required | string Enum: "PRODUCT" "USER" |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "type": "PRODUCT"
}[- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "barcode": "string",
- "type": "PRODUCT",
- "linked_object": "9d4556b9-8a59-469d-a7ea-6f0f9d203a9a"
}
]This endpoint allows to create a barcode, which points to a object
| barcode required | string |
| type required | string Enum: "PRODUCT" "USER" |
| linked_object required | string <uuid> |
{- "barcode": "string",
- "type": "PRODUCT",
- "linked_object": "9d4556b9-8a59-469d-a7ea-6f0f9d203a9a"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "barcode": "string",
- "type": "PRODUCT",
- "linked_object": "9d4556b9-8a59-469d-a7ea-6f0f9d203a9a"
}This endpoint returns the stored data for this barcode
| id | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "barcode": "string",
- "type": "PRODUCT",
- "linked_object": "9d4556b9-8a59-469d-a7ea-6f0f9d203a9a"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "barcode": "string",
- "type": "PRODUCT",
- "linked_object": "9d4556b9-8a59-469d-a7ea-6f0f9d203a9a"
}This endpoint returns all transactions, with optional filtering
| user_id | string <uuid> The user id to filter for. |
{- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}[- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "PURCHASE",
- "amount": 0,
- "related_user_id": "6038a5c3-28e1-43f7-8a72-a713a7005b26",
- "related_product_id": "e0da22be-5437-465a-bea9-b80a9c82af7b"
}
]Creates a new transaction with the provided information. This is primarily used for migration.
| timestamp required | string <date-time> The timestamp when the transaction happend |
| type required | string Enum: "PURCHASE" "DEPOSIT" |
| amount required | number <int32> |
| related_user_id | string <uuid> |
| related_product_id | string <uuid> |
{- "timestamp": "2019-08-24T14:15:22Z",
- "type": "PURCHASE",
- "amount": 0,
- "related_user_id": "6038a5c3-28e1-43f7-8a72-a713a7005b26",
- "related_product_id": "e0da22be-5437-465a-bea9-b80a9c82af7b"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "PURCHASE",
- "amount": 0,
- "related_user_id": "6038a5c3-28e1-43f7-8a72-a713a7005b26",
- "related_product_id": "e0da22be-5437-465a-bea9-b80a9c82af7b"
}Get transaction details from the provided id
| id | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "timestamp": "2019-08-24T14:15:22Z",
- "type": "PURCHASE",
- "amount": 0,
- "related_user_id": "6038a5c3-28e1-43f7-8a72-a713a7005b26",
- "related_product_id": "e0da22be-5437-465a-bea9-b80a9c82af7b"
}