All about users microservice
- Users API
https://app.swaggerhub.com/apis-docs/olteam-go/Users/1.0.0 - Auth API
https://app.swaggerhub.com/apis-docs/olteam-go/Auth/1.0.0 - Wallets API
https://app.swaggerhub.com/apis-docs/olteam-go/Wallets/1.0.0 - Transactions API
https://app.swaggerhub.com/apis-docs/olteam-go/Transactions/1.0.0 - Transactions Histories API
https://app.swaggerhub.com/apis-docs/olteam-go/TransactionsHistories/1.0.0
Base URL: sea-store-backend-users.herokuapp.com/api/v1/users
Obtain information about list of users
Success response(200): Successfully returned list of users
Example Value | Model:
[
{
"ID": "string",
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true,
"created_at": "string",
"updated_at": "string"
}
]
Post a new user into the database
Success response(200): Successfully posted a user
body(Example Value | Model):
{
"ID": "string",
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true,
"created_at": "string",
"updated_at": "string"
}
Obtain information about a user from unique ID
Parameters: id("string")
Success response(200): Successfully returned a user
Example Value | Model:
[
{
"ID": "string",
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true,
"created_at": "string",
"updated_at": "string"
}
]
Put a user
Parameters: id("string")
Success response(200): Successfully updated a user
Error response(404): User not found
body(Example Value | Model):
{
"ID": "string",
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true
}
Put a user by username and password
Parameters: id("string")
Success response(200): Successfully updated a user
Error response(404): User not found
body(Example Value | Model):
{
"login_credentials": {
"username": "string",
"password": "string"
},
"user_to_update": {
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true
}
}
Delete a user
Parameters: id("string", Parameters)
Success response(200): Successfully deleted a user
Error response(404): User not found
Base URL: sea-store-backend-users.herokuapp.com/api/v1/auth
Login a user
credentials, body(Example Value | Model):
{
"username": "string",
"password": "string"
}
Success response(200): Successfully login a user
Response(Example Value | Model):
{
"ID": "string",
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true,
"created_at": "string",
"updated_at": "string"
}
Error response(401): Unauthorized because wrong credentials given
Register a user as customer
credentials, body(Example Value | Model):
{
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string"
}
Success response(200): Successfully registered a user
Register a user as merchant
credentials, body(Example Value | Model):
{
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string"
}
Success response(200): Successfully registered a merchant
Register a user as customer
credentials, body(Example Value | Model):
{
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"token": "string"
}
Success response(200): Successfully registered an admin
Error response(401): Unauthorized because wrong token given
Obtain information about list of users
Parameters: id("string")
Success response(200): Successfully returned list of merchant
Example Value | Model:
[
{
"ID": "string",
"username": "string",
"email": "string",
"password": "string",
"name": "string",
"gender": "string",
"type": "string",
"active": true,
"created_at": "string",
"updated_at": "string"
}
]
Put a user
Parameters: userid("string")
Success response(200): Successfully accept a pending merchant
Error response(404): Merchant not found
Put a user
Parameters: userid("string")
Success response(200): Successfully reject a pending merchant
Error response(404): Merchant not found
Base URL: sea-store-backend-users.herokuapp.com/api/v1/wallets
Obtain information about list of wallets
Success response(200): Successfully returned list of wallets
Example Value | Model:
[
{
"id": "string",
"user_id": "string",
"balance": "string",
"created_at": "string",
"updated_at": "string"
}
]
Post a new wallet credentials, body(Example Value | Model):
{
"id": "string",
"user_id": "string",
"balance": "string",
"created_at": "string",
"updated_at": "string"
}
Success response(200): Successfully posted a wallet
Obtain information about a wallet from unique ID
Parameters: id("string")
Success response(200): Successfully returned a wallet
Example Value | Model:
[
{
"id": "string",
"user_id": "string",
"balance": "string",
"created_at": "string",
"updated_at": "string"
}
]
Error response(404): Wallet not found
Put a wallet
Parameters: id("string")
user, body(Example Value | Model):
{
"id": "string",
"user_id": "string",
"balance": "string",
"created_at": "string",
"updated_at": "string"
}
Success response(200): Successfully updated a wallet
Error response(404): Wallet not found
Delete a wallet
Parameters: id("string", Parameters)
Success response(200): Successfully deleted a wallet
Error response(404): Wallet not found
Base URL: sea-store-backend-users.herokuapp.com/api/v1/transactions
Credit amount of balance to a wallet by wallet ID
Parameters: id("string")
wallet, body(Example Value | Model):
{
"amount": 0
}
Success response(200): Successfully credit amount of balance to a wallet
Error response(404): Wallet not found
Debit amount of balance to a wallet by wallet ID
Parameters: id("string")
wallet, body(Example Value | Model):
{
"amount": 0
}
Success response(200): Successfully debit amount of balance to a wallet
Error response(403): Wallet amount exceed the balance to transact
Error response(404): Wallet not found
Credit amount of balance to a wallet by user ID
Parameters: user_id("string")
walet, body(Example Value | Model):
{
"amount": 0
}
Success response(200): Successfully credit amount of balance to a wallet
Error response(404): Wallet not found
Debit amount of balance to a wallet by user ID
Parameters: user_id("string")
walet, body(Example Value | Model):
{
"amount": 0
}
Success response(200): Successfully debit amount of balance to a wallet
Error response(403): Wallet amount exceed the balance to transact
Error response(404): Wallet not found
Credit amount of balance to a wallet by user username
Parameters: username("string")
wallet, body(Example Value | Model):
{
"amount": 0
}
Success response(200): Successfully credit amount of balance to a wallet
Error response(404): Wallet not found
Debit amount of balance to a wallet by user username
Parameters: username("string")
wallet, body(Example Value | Model):
{
"amount": 0
}
Success response(200): Successfully debit amount of balance to a wallet
Error response(403): Wallet amount exceed the balance to transact
Error response(404): Wallet not found
Base URL: sea-store-backend-users.herokuapp.com/api/v1/transactions/histories
Obtain information about list of transactions history
Success response(200): Successfully returned list of transactions history
Example Value | Model:
[
{
"id": "string",
"user_id": "string",
"wallet_id": "string",
"amount": "string",
"created_at": "string",
"updated_at": "string"
}
]
Post a new transaction history
wallet, body(Example Value | Model):
{
"id": "string",
"user_id": "string",
"wallet_id": "string",
"amount": "string",
"created_at": "string",
"updated_at": "string"
}
Success response(200): Successfully posted a transaction history
Obtain information about a transaction history from unique ID
Parameters: id("string")
Success response(200): Successfully returned a transaction history
Example Value | Model:
{
"id": "string",
"user_id": "string",
"wallet_id": "string",
"amount": "string",
"created_at": "string",
"updated_at": "string"
}
Error response(404): Transaction history not found
Put a transaction history
Parameters: id("string")
user, body(Example Value | Model):
{
"id": "string",
"user_id": "string",
"wallet_id": "string",
"amount": "string",
"created_at": "string",
"updated_at": "string"
}
Success response(200): Successfully updated a transaction history
Error response(404): Transaction history not found
Delete a transaction history
Parameters: id("string", Parameters)
Success response(200): Successfully deleted a transaction history
Error response(404): Transaction history not found