# Exports

{% hint style="info" %}

#### **Note**

These exports are entirely optional and can be used as needed within your own scripts or integrations.
{% endhint %}

##

***

## Server

### Get Balance

Returns a player’s **VIP balance**.

{% code title="@parameters" %}

```lua
--- @param number source The player source.
--- @return number balance The player’s VIP balance.

--- @example
local balance = exports['cd_vipshop']:GetVipBalance(source)
print('VIP Balance:', balance)
```

{% endcode %}

```lua
local balance = exports['cd_vipshop']:GetVipBalance(source)
```

***

### Add Balance

Adds VIP tokens to a player.

{% code title="@parameters" %}

```lua
--- @param number source The player source.
--- @param number amount The amount of VIP tokens to add.

--- @example
exports['cd_vipshop']:AddVipBalance(source, 5)
```

{% endcode %}

```lua
exports['cd_vipshop']:AddVipBalance(source, amount)
```

***

### Remove Balance

Removes VIP tokens from a player.

{% code title="@parameters" %}

```lua
--- @param number source The player source.
--- @param number amount The amount of VIP tokens to remove.

--- @example
exports['cd_vipshop']:RemoveVipBalance(source, 5)
```

{% endcode %}

```lua
exports['cd_vipshop']:RemoveVipBalance(source, amount)
```

***

### Can Purchase Check

Checks whether a player can afford a purchase.

{% code title="@parameters" %}

```lua
--- @param number source The player source.
--- @param number cost The cost of the purchase.
--- @return boolean canPurchase Whether the player can afford the purchase.

--- @example
local canPurchase = exports['cd_vipshop']:CanPurchaseCheck(source, 50)
print('Can purchase:', canPurchase)
```

{% endcode %}

```lua
local canPurchase = exports['cd_vipshop']:CanPurchaseCheck(source, cost)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codesign.pro/paid-scripts/vip-shop/developer-api/exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
