LeaderOS API
  • 👋Getting Started
    • Introduction
    • Authentication
  • 🔐Auth
    • Login
    • Register
    • Sessions
  • 🧑‍🦱Users
    • Profiles
    • Roles
    • Tickets
    • Orders
  • 🛍️Store
    • Listing
    • Products
    • Categories
    • Buy
    • Donations
  • 🍏Bazaar
    • Player Storages
    • Servers
  • 🚨Support
    • Tickets
    • Messages
    • Categories
    • Quick Answers
  • 🪙Credits
    • Show Credits
    • Add Credits
    • Remove Credits
    • Send Credits
    • Set Credits
  • 👍Vote
    • Vote Links
  • 🎮Discord
    • Users
    • Settings
    • Roles
Powered by GitBook
On this page
  1. Store

Buy

Buy action

POST https://yourwebsite.com/api/store/buy

Request Body

Name
Type
Description

products*

array

An array of product IDs

userID*

int

User ID

{
    "status": true,
    "orderID": "123",
    "credits": "10.00",
    "products": [
        {
            "id": 1,
            "quantity": 1,
            "variables": []
        }
    ],
    "cashback": "1.00",
    "total": "10.00",
    "subtotal": "10.00",
    "discount": "0.00"
}
{
    "status": false,
    "error": "USER_NOT_FOUND",
    "message": "User not found!"
}
{
    "status": false,
    "error": "PRODUCT_NOT_FOUND",
    "message": "Product not found!"
}
{
    "status": false,
    "error": "INVALID_QUANTITY",
    "message": "Invalid quantity!"
}
{
    "status": false,
    "error": "INSUFFICIENT_BALANCE",
    "message": "Insufficient balance!"
}
{
    "status": false,
    "error": "OUT_OF_STOCK",
    "message": "Out of stock!"
}
{
    "status": false,
    "error": "INVALID_VARIABLE",
    "message": "Invalid variable provided for product ID: 1"
}
PreviousCategoriesNextDonations

Last updated 4 months ago

🛍️