This project utilizes a couple of third-party laravel packages, those packages are listed below corresponding to thier installation commands.
Package Name | URL | Installation Command |
---|---|---|
Stancl/Tenancy | Tenancy for laravel | composer require stancl/tenancy |
Tymon/JWT-Auth | jwt-auth | composer require tymon/jwt-auth |
php artisan jwt:secret
php artisan migrate
php artisan db:seed
All responses returned from the documented API are following the same following schema
{
"status": "boolean",
"data": "any",
"error": "Error|null"
}
the value of the data
field differs according to the requested resource, while the value of the error
field is either null
- in case of success, or an Error
object as described below
{
"message": "string",
"code": "integer",
"details": "array"
}
the details
field holds an extra details about the error - optionally provided at development - and will only be visible if the debug is enabled.
For full requests & response reference, see schema.
If you are using Postman to discover this API, you may need this
Request Group | Request Name | HTTP Method | URL | Allowed For |
---|---|---|---|---|
Merchants | Signup Merchant | POST | api/merchants/register | World |
Merchants | Authenticate Merchant | POST | api/merchants/login | World |
Consumers | Signup Consumer | POST | api/consumers/register | World |
Consumers | Authenticate Consumer | POST | api/consumers/login | World |
Stores | Update Store | PUT | api/stores/{storeId} | Merchant |
Products | Get All Products | GET | api/stores/{storeId}/products | World 1 |
Products | Create Product | POST | api/stores/{storeId}/products | Merchant |
Products | Update Product | PUT | api/stores/{storeId}/products | Merchant |
- All tenants databases are hosted together.
Top - Response Structure - Available Requests
Footnotes
-
Merchants allowed only for their stores. ↩