> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/vip-shop/readme.md).

# CAS VIP Shop

A premium, Tebex integrated VIP store for RedM. Players open a cinematic Red Dead Redemption 2 style storefront in game, browse it like a frontier catalogue, and complete real money payments without ever leaving the server.

Built for VORP and RSG with automatic framework detection, automatic SQL setup, and a fully server authoritative economy.

## Highlights

* **Authentic RDR2 interface.** Every surface is built from real game textures: torn paper panels, catalogue stamps, brush stroke dividers, and the classic crafting hover frame. The RDR Lino, Hapna Slab, RDR Catalogue and Redemption typefaces are used throughout.
* **Eight bespoke pages.** Featured, Hot Deals (daily spotlight, countdown and the Bounty Board), Coin Packs (Gold Exchange tiers), Weapons (Gunsmith's Catalogue with stat bars), Cash and Gold (County Bank), Horses (Painted Pony Stables), Packages (Overland Freight Co.) and Outlaw Passes (memberships).
* **In game Tebex checkout.** Real money purchases open Tebex's secure checkout inside the game. The live catalog (coin packs, memberships) is pulled straight from your webstore through the Headless API.
* **Coin economy.** A premium currency stored in your own database. Balances, prices and deliveries are all validated server side; the UI is never trusted.
* **Real deliveries.** Items with dual VORP/RSG naming, weapons with real RDR2 hashes, ammo, cash, gold, and horses written directly into the stable database (`stables` and `player_horses`, both schemas verified).
* **Memberships.** Monthly Tebex subscriptions (Deputy, Marshal, Legend) with configurable monthly reward bundles of coins, cash, gold, supplies, weapons and horses, a server enforced store discount, plus a lifetime Founder's Charter.
* **Optional order book.** Products with an `order` delivery are logged to a database commission book and announced to your staff Discord, for servers that sell staff-made work.
* **Redeem codes.** Usage limits, expiry dates, one redemption per player, seeded from config or created in game.
* **Production hardened.** Inventory capacity checks before charging, atomic balance updates that are safe under race conditions, Discord logging, English and Turkish locales, 60 FPS compositor friendly animations, and WebP assets keeping the resource around 11 MB.

## How it fits together

| Layer    | Technology                                | Responsibility                                               |
| -------- | ----------------------------------------- | ------------------------------------------------------------ |
| UI (NUI) | React 19, TypeScript, Vite 8              | Rendering, Tebex checkout window, live catalog display       |
| Resource | Lua 5.4 (`vip_shop`)                      | Framework adapter, deliveries, balances, memberships, orders |
| Database | MySQL through oxmysql                     | Six tables created automatically, no manual SQL              |
| Payments | Tebex (Headless API and package commands) | Real money checkout, subscriptions, coin top ups             |

## Quick links

* [Requirements](/script-documentation/vip-shop/getting-started/requirements.md)
* [Installation](/script-documentation/vip-shop/getting-started/installation.md)
* [Tebex Store Setup](/script-documentation/vip-shop/tebex-integration/store-setup.md)
* [Catalog and Deliveries](/script-documentation/vip-shop/configuration/catalog.md)
* [Commands](/script-documentation/vip-shop/reference/commands.md)
* [Troubleshooting](/script-documentation/vip-shop/reference/troubleshooting.md)
