Users
This page covers all API endpoints for users
Retrieve all users
GET
https://wemx.app/api/v1/users
Returns a list of all users on your application
Available Relationships (optional)
Available relationships:
balance_transactions
, notifications
, punishments
, permissions
, affiliate
, suborder
, orders
, payments
, devices
, address
, groups
, emails
, oauth
, ips
Filters (optional)
Available Filters:
first_name
, last_name
, username
, email
, is_subscribed
, is_online
, created_at
Sorting (optional)
Available Sorting Parameters:
first_name
, last_name
, username
, email
, balance
, created_at
Sorting operators
asc
, desc
, random
Dates (optional)
Operator | Description |
---|---|
today | Get users created today |
yesterday | Get users created yesterday |
| Get users created last x days |
YYYY-MM-DD,YYY-MM-DD | Get users created between a range of dates |
Create a user
POST
https://wemx.app/api/v1/users
Create a user on your application
Path Parameters
Name | Type | Description |
---|---|---|
first_name* | String | First name of the user |
last_name* | String | Last name of the user |
username* | String | Username of the user |
email* | String | Email of the user |
password | String | Password of the user, leave empty to generate random password and email it |
language | Code | Language code i.e "en" |
address[company_name] | String | Company name |
address[street] | String | Street name of address |
address[street2] | String | Second street name |
address[city] | String | Name of city of the address |
address[region] | String | Name of the state / province / region |
address[country] | Code | Country code i.e "US", "DE", "NL" |
address[zip_code] | String | Zip code of the address |
welcome_email | Boolean | Send an welcome email upon creation or not |
mark_email_verified | Boolean | Mark email as verified upon creation |
Get current authenticated user
GET
https://wemx.app/api/v1/users/auth
Returns the current user that is logged in
Retrieve a user from id
GET
https://wemx.app/api/v1/users/{user}
Returns a user from id
Query Parameters
Name | Type | Description |
---|---|---|
balance_transactions | Returns user with their balance transactions | |
notifications | String | User with their notifications |
payments | String | Users with their payments |
orders | String | Users with their orders |
suborders | String | Users with their suborders |
affiliate | String | User with their affiliate info |
permissions | String | User with their permissions |
punishments | String | User with their punishments |
address | String | Users with their address |
devices | String | Users with their devices |
groups | String | Users with their groups |
emails | String | Users with their emails |
oauth | String | Users with their oauth services |
ips | String | Users with their IP Addresses |
Update user details
PUT
https://wemx.app/api/v1/users/{user}
Update a users information, only values that are passed in the body are updated, the remaining values remain as default if they are not specified.
Request Body
Name | Type | Description |
---|---|---|
first_name | String | First name of the user |
last_name | String | Last name of the user |
username | String | Username of the user |
password | String | Password of the user |
language | Code | String of the user "en" |
Delete a user
DELETE
https://wemx.app/api/v1/users/{user}
Delete a user permanently from your application. The user cannot have any active, or suspended orders and must not have any punishments on record.
Request Body
Name | Type | Description |
---|---|---|
force | Boolean | Delete user forcefully, ignores whether the user has active orders or has punishments on record. |
Retrieve orders for a user
GET
https://wemx.app/api/v1/users/{user}/orders
Returns all orders the user owns
Retrieve payments for a user
GET
https://wemx.app/api/v1/users/{user}/payments
Returns all payments the user has made
Update user balance
PUT
https://wemx.app/api/v1/users/{user}/update-balance
Update a users balance
Path Parameters
Name | Type | Description |
---|---|---|
type* | Enum | add, remove or set |
amount* | Number | The amount you wish to update |
description | String | Description of the transaction |
Send a user an email
POST
https://wemx.app/api/v1/users/{user}/send-email
Email the user through your application
Path Parameters
Name | Type | Description |
---|---|---|
subject* | String | Subject of the email |
content* | String | Content of the email, HTML is supported |
Notify a user
POST
https://wemx.app/api/v1/users/{user}/send-notification
Send a notification to the user
Path Parameters
Name | Type | Description |
---|---|---|
type* | Enum | success, warning, danger |
icon* | Icon | SVG or font icon from BoxIcons |
message* | String | Message on the notification |
url | URL | URL the notification should redirect to when clicked |
Last updated