API

Obtaining the API Key

To obtain the API key:

  1. Navigate to the Settings page in the Staff Panel.

  2. Scroll down to the API Settings section.

  3. Ensure the Enable API checkbox is checked.

  4. Set your desired API key in the input field labeled "Enter API Key".

  5. Save the settings by clicking the Save Settings button.


Endpoint: /api/users/:userId (GET)

This API endpoint allows you to retrieve detailed information about a user based on their Discord ID. The data returned includes user information, the contents of their cart, and the products/serials they own.

URL Parameters

  • userID (string): The Discord ID or User ID of the user whose information you want to retrieve.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/users/:userId/addproduct/:urlId (POST)

This API endpoint allows you to add a specific product to a user's owned products list based on their Discord ID and the product's unique urlId.

URL Parameters

  • userId(string): The Discord ID or User ID of the user to whom the product should be added.

  • urlId (string): The unique identifier for the product to be added. This is typically a URL-safe string such as product-name.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/users/:userId/removeproduct/:urlId (POST)

This API endpoint allows you to remove a specific product from a user's owned products list based on their Discord ID and the product's unique urlId.

URL Parameters

  • userId(string): The Discord ID or User ID of the user to whom the product should be added.

  • urlId (string): The unique identifier for the product to be added. This is typically a URL-safe string such as product-name.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/discounts/create (POST)

This API endpoint allows you to create a new discount code for your store, specifying its name, discount percentage, maximum uses, and expiration date.

Request Body

Field
Type
Required
Description

name

string

Yes

The unique name of the discount code.

discountPercentage

number

Yes

The percentage discount (e.g., 10 for a 10% discount).

maxUses

number

No

The maximum number of times the code can be used. Leave empty for unlimited.

expiresAt

string

No

The expiration date of the code in ISO 8601 format. Leave empty for no expiration.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/payments/:transactionID (GET)

This API endpoint allows you to retrieve detailed payment information based on a specific transaction ID. The returned data includes details about the payment method, user information, products purchased, and any discounts applied.

URL Parameters

  • transactionID (string): The unique transaction ID associated with the payment you want to retrieve.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/products (GET)

This API endpoint allows you to retrieve detailed information about all products available in the system. The data returned includes the product's name, type, price, total purchases, total earned, total downloads, and creation date.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/statistics (GET)

This API endpoint provides aggregated statistics about the platform, including total purchases, total earnings, total site visits, as well as the total number of users and products.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:


Endpoint: /api/reviews (GET)

This API endpoint allows you to retrieve all reviews submitted by users. Each review includes the user's information, the name of the product reviewed, the rating, the comment, and the creation date.

Headers

  • x-api-key (string): This is required for authentication. The API key must be included in the header to access this endpoint.

Success Response

  • Status Code: 200 OK

  • Response Body:

Possible Error Responses:

Axios Example:

Last updated

Was this helpful?