Weblutions Documentation
Weblutions Main Site Contact Us Our Discord
FaxStore IconFaxStore

Weblutions Documentation / FaxStore / Accounts API

Updated

Accounts API

By Josh M. 10 mins 55

The Accounts API for FaxStore provides a comprehensive solution for managing user accounts, including creation, deletion, modification, and retrieval of account details. This API ensures secure and efficient handling of user information and authentication processes across the platform.

Table of Contents


Get Single Account

GET/api/account/:id
Returns the user information for the requested account.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe users displayed ID, or internal database ID
Responses
200OKjson
View response body
{
  "id": 51,
  "userId": "1703144023354",
  "username": "John Doe",
  "userImage": "/images/faxstore.png",
  "userEmail": "john.doe@example.com",
  "createdAt": "1703144023354",
  "banned": 0,
  "ip": "N/A",
  "bio": "Unused Profile Bio",
  "staffnotes": null,
  "authType": "local",
  "disabled": 1,
  "getEmails": 1,
  "cart": null,
  "bitfield": "0"
}
400OKplaintext
View response body
Account ID not found.

Get Account Permissions

GET/api/account/:id/permission
Returns a Boolean value whether the user has the provided permission. The function also returns a list of the permissions the user has.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe users displayed ID, or internal database ID
Query parameters
NameTypeRequiredDescription
hasStringoptionalA permission name to check for against the users existing permissions
Responses
200OKjson
View response body
{"result": true, "permissions": "VIEW_STAFF_PANEL, MANAGE_LICENSES"}
403No Permissionsjson
View response body
{"result": false, "permissions": "VIEW_STAFF_PANEL, MANAGE_LICENSES"}
404OKplaintext
View response body
Account ID not found.

Get Account Download Audit Logs

GET/api/account/:id/downloadlogs
Returns an array of all downloads a user has made
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe users displayed ID, or internal database ID
Responses
200OKjson
View response body
[
  {
    "id": 150810089161732100,
    "userId": "282762192544333827",
    "username": "faxes",
    "userEmail": "support@weblutions.com",
    "productID": 19,
    "productName": "Example Product Name",
    "ownedProductEntryID": 213,
    "downloadedFilename": "Example Product Name - faxes.json",
    "orderID": "0",
    "ip": "{ip:'::1',error:true,reason:'Reserved IP Address',reserved:true,version:'IPv6'}",
    "country": "Australia",
    "useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
    "lang": "en-AU",
    "device": "Desktop",
    "browser": "Chrome",
    "referrer": "http://weblutions.com/user/",
    "sessionID": "VImPLyVq2t2QPpTjWUS6EAZo1T2WTn-4x",
    "createdAt": "1759635927172"
  }
]
200OKjson
View response body

Get Account Orders

GET/api/accounts/:id/orders
Returns an array of orders the account holder has made.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe user ID to fetch data from.
Responses
200OKjson
View response body
[
  {
    "id": 74,
    "userId": "282762192544333827",
    "username": "John Doe",
    "subtotal": "9.99",
    "total": "9.99",
    "processorFee": "0.00",
    "fee": "0.00",
    "discount": "0.00",
    "object": "{\"title\":\"Cart payment via PayPal\",\"payment\":{\"subtotal\":\"9.99\",\"discount\":\"0.00\",\"total\":\"9.99\",\"promoCode\":null},\"items\":[{\"name\":\"Custom Design  - 2\",\"price\":\"9.99\",\"description\":\"Item type: 1\"}],\"createdAt\":1699931646679}",
    "createdAt": "1699931646679",
    "method": "via PayPal",
    "customer": "{\"id\":\"1DC02600C4769332G\",\"email\":\"sb-h2sue18503054@personal.example.com\",\"name\":\"John Doe\"}",
    "ip": "::1",
    "clientObject": null,
    "ownedID": null
  },
  ...
]
401Unauthorizedplaintext
View response body
You are not authorized to access this resource.

Get Account Owned Products

GET/api/accounts/:id/products
Returns an array of all downloable content that the account holder has including packages and custom uploaded files.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe user ID to fetch data from.
Responses
200OKjson
View response body
[
  {
    "id": 230,
    "userId": "282762192544333827",
    "username": "John Doe",
    "productId": 16,
    "productName": "Design - 2",
    "productPrice": "13.74",
    "createdAt": "1779022994982",
    "license": "/tos",
    "downloads": 0,
    "paymentId": "via Stripe",
    "usingLicenseSystem": 1,
    "customUpload": "",
    "packageId": null
  }
  ...
]
401Unauthorizedplaintext
View response body
You are not authorized to access this resource.

Notes:

  • usingLicenseSystem: indicates that a license can be created for the product. It doesn't mean that one has been created by the user.

  • customUpload: populates with a file pathway to a custom download. Often within the files directory on the host server - See more at Customer Purchases and Downloads.

  • packageId: an integer that populates if the product was apart of a package.


Create Account

POST/api/account
Creates a user with the specified data. The account password cannot be set, it is generated and the user will have to reset the password.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Request body
NameTypeRequiredDescription
usernameStringrequired
emailStringrequired
typeStringrequiredAccount type, must be one of; local, discord, github, google
idStringrequiredOptional, the user ID, if not provided one will be generated. If this is a Google, Discord, or GitHub account the services ID should be used.
imageStringoptionalAn image URL for the profile image of the account.
tebexUsernameStringoptionalA Tebex username to link to the account.
bannedBooleanoptionalIf true the account will be banned preventing login and IP blocking once any login attempt is made.
disabledBooleanoptionalIf true the account is disabled preventing actions once logged in.
Responses
200OKjson
View response body
{
  "id": 51,
  "userId": "1703144023354",
  "username": "John Doe",
  "userImage": "/images/faxstore.png",
  "userEmail": "john.doe@example.com",
  "createdAt": "1703144023354",
  "banned": 0,
  "ip": "N/A",
  "bio": "Unused Profile Bio",
  "staffnotes": null,
  "authType": "local",
  "disabled": 1,
  "getEmails": 1,
  "cart": null,
  "bitfield": "0"
}
400Missing Body Fieldplaintext
View response body
Missing required body items - X is required.
404Failed GETplaintext
View response body
Account ID not found after creation.
409Conflictplaintext
View response body
uplicate user. User already exist, found userId: x.

Update Account

PATCH/api/account/:id
Updates the user with the provided fields.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe users displayed ID, or internal database ID.
Request body
NameTypeRequiredDescription
idStringoptional
usernameStringoptional
imageStringoptionalAn image URL for the accounts profile image.
emailStringoptional
tebexUsernameStringoptionalA Tebex username to link.
Responses
200OKplaintext
View response body
OK
404Not Foundplaintext
View response body
Account ID not found.

Delete Account

DELETE/api/account/:id
Deletes the provided account from FaxStore. This action generally isn't recommended, consider banning the user instead. Associated data for the account is also deleted (i.e. payments, downloads, invoices...)
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringoptionalThe user ID as it appears in the database.
Responses
201OKplaintext
View response body
(no content)

Add Giftcard to Account

POST/api/accounts/:id/giftcards
Add a gift card to an account manually with a custom balance. A gift card code is automatically generated and returned.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredThe accounts database ID.
Request body
NameTypeRequiredDescription
amountStringrequiredThe starting balance in dollars (e.g; "10.50").
Responses
200OKjson
View response body
{
  id: 124,
  giftId: "024g024g4T_23r022-241ASFas",
  cost: "0.00",
  userId: "1703144023354",
  username: "John Doe",
  remainingAmount: "19.56"
}
400Missing Fieldsplaintext
View response body
Missing required items - userId, remainingAmount are required.

Document History

Loading version history...