Inventory management system for e-commerce. The API allows you to manage data from different online stores like Amazon, Walmart, Etsy, Shopify, Ebay etc. and stores it in one place.
Initially the user creates an account, then they connect their e-commerce stores, and then when the stores are connected the data populates the app, showing the inventory items(products)' data (title, price, quantity, etc.). Through the API you can read, create, update and delete inventory items(products). All data is pulled from online store's API.
For now the following stores are available:
- Shopify
- Ebay
What improvements can be made:
- More e-commerce stores (Amazon, Walmart, Etsy, etc.)
- Update the method of user authorization, maybe integrate OAuth2. Now it doesn't provide very good protection
- Use hashing instead of encryption for user passwords
- Inventory item reports
- Webhooks for inventory items
- More data to manage in the app (for example, orders)
POST /auth/login
- Body:
{
"email": "[email protected]",
"password": "password"
}
- Returns:
{
"status": 200,
"message": "Logged in successfully"
}
POST /auth/logout
- Returns:
{
"status": 200,
"message": "Logged out successfully"
}
POST /signup
- Body:
{
"firstname": "firstname",
"lastname": "lastname",
"email": "[email protected]",
"password": "password"
}
- Returns:
{
"status": 201,
"message": "Signed up successfully"
}
GET /user
- Returns:
{
"user": {
"id": 1,
"email": "[email protected]",
"firstname": "firstname",
"lastname": "lastname",
"verified": false,
"authorities": [
{
"name": "someAuthority"
}
]
}
}
PUT /user?field=
- Parameter field can be equal to
firstname, lastname
,firstname
,lastname
,email
orpassword
(if it is equal to the last two, the session will be logged out) - Body depends on what you want to update
- Returns:
{
"user": {
"id": 1,
"email": "[email protected]",
"firstname": "new",
"lastname": "new",
"verified": false,
"authorities": []
}
}
POST /user/verification/verify
- Returns:
{
"status": 200,
"message": "User email has been successfully verified"
}
POST /user/verification/mail
- Returns:
{
"status": 200,
"message": "Verification code has been successfully sent"
}
GET /onlinestores
- Returns:
{
"onlineStores": [
{
"id": {
"ordinal": 1,
"email": "[email protected]"
},
"arbitraryStoreName": "storeName",
"type": "SHOPIFY"
},
{
"id": {
"ordinal": 2,
"email": "[email protected]"
},
"arbitraryStoreName": "anotherStoreName",
"type": "AMAZON"
}
]
}
POST /onlinestores
- Body:
{
"type": "SHOPIFY",
"arbitraryStoreName": "storeName",
"credentials": {
"storeName": "someStoreName",
"token": "",
"extra": {
"username": "username",
"password": "password"
}
}
}
credentials
depends on inventory item type.
- Shopify requires
storeName
andtoken
- Ebay requires
token
and allextra
values (storeName
is required only if this store is sandbox - api.sandbox. Default value - api)
- Returns:
{
"onlineStore": {
"id": {
"ordinal": 1,
"email": "[email protected]"
},
"arbitraryStoreName": "storeName",
"type": "SHOPIFY"
}
}
PUT /onlinestores/{currentName}?new={newName}
- Returns:
{
"onlineStore": {
"id": {
"ordinal": 1,
"email": "[email protected]"
},
"arbitraryStoreName": "newName",
"type": "SHOPIFY"
}
}
DELETE /onlinestores/{name}
- Returns:
{
"status": 200,
"message": "Online store 'storeName' has been successfully deleted"
}
GET /inventoryitems/{id}
- Returns:
{
"id": 1,
"inventoryId": "999999",
"title": "Some title",
"inventoryItem": {
"productId": 999999,
"title": "Some title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
}
inventoryItem
can have any json, depends on the type.
GET /inventoryitems
- Returns:
{
"inventoryItems": [
{
"id": 1,
"inventoryId": "999999",
"title": "Some title",
"inventoryItem": {
"productId": "999999",
"title": "Some title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
},
{
"id": 2,
"inventoryItem": {
"title": "some product linker"
},
"mergedProducts": [
{
"id": 1,
"inventoryId": "999999",
"title": "Some title",
"inventoryItem": {
"productId": "999999",
"title": "Some title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
}
],
"type": "PRODUCT_LINKER"
}
]
}
inventoryItem
can have any json, depends on the type.
GET /onlinestores/{arbitraryStoreName}/inventoryitems
- Returns:
{
"inventoryItems": [
{
"id": 1,
"inventoryId": "999999",
"title": "Some title",
"inventoryItem": {
"productId": "999999",
"title": "Some title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
}
]
}
inventoryItem
can have any json, depends on the type.
POST /onlinestores/{arbitraryStoreName}/inventoryitems
- Body (can have any json, depends on the type.):
{
"productId": "999999",
"title": "Some title"
}
- Returns:
{
"id": 1,
"inventoryId": "999999",
"title": "Some title",
"inventoryItem": {
"productId": "999999",
"title": "Some title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
}
PUT /inventoryitems/{id}
- Body (can have any json, depends on the type):
{
"productId": "999999",
"title": "Some updated title"
}
- Returns:
{
"id": 1,
"inventoryId": "999999",
"title": "Some updated title",
"inventoryItem": {
"productId": "999999",
"title": "Some updated title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
}
DELETE /inventoryitems/{id}
- Returns:
{
"status": 200,
"message": "Product with id '1' has been successfully deleted"
}
POST /inventoryitems/merge?id=1,2
- Body (can have any json):
{
"title": "some product linker"
}
- Returns:
{
"id": 1,
"inventoryItem": {
"title": "some product linker"
},
"mergedProducts": [
{
"id": 1,
"productId": 888888,
"title": "Some title",
"inventoryItem": {
"productId": 888888,
"title": "Some title"
},
"type": "SHOPIFY",
"arbitraryStoreName": "storeName"
},
{
"id": 2,
"productId": 999999,
"title": "Some title",
"inventoryItem": {
"productId": 999999,
"title": "Some title"
},
"type": "AMAZON",
"arbitraryStoreName": "anotherStoreName"
}
],
"type": "PRODUCT_LINKER"
}
POST /inventoryitems/update
- Returns:
{
"status": 200,
"message": "Product list has been successfully updated"
}
{
"status": STATUS_CODE,
"message": "MESSAGE"
}