> For the complete documentation index, see [llms.txt](https://cs2-store.gitbook.io/cs2-store/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs2-store.gitbook.io/cs2-store/api/api.md).

# API

You need to use StoreApi to use the API.

## API codes you can use

<pre class="language-css"><code class="lang-css"><strong># Get player credits
</strong><strong>public int GetPlayerCredits(CCSPlayerController player);
</strong>
# Set player credits
public void SetPlayerCredits(CCSPlayerController player, int value);

# Give credits to player
public void GivePlayerCredits(CCSPlayerController player, int amount);

# Make player to purchase an item
public bool Item_Purchase(CCSPlayerController player, Store_Item item);

# Make player to equip an item
public bool Item_Purchase(CCSPlayerController player, Dictionary&#x3C;string, string> item)

# Make player to unequip an item
public bool Item_Unequip(CCSPlayerController player, Dictionary&#x3C;string, string> item);

# Make player to sell an item
public bool Item_Sell(CCSPlayerController player, Dictionary&#x3C;string, string> item);

# Gets if player has an item
public bool Item_PlayerHas(CCSPlayerController player, string type, string uniqueId);

# Gets if player is using an item
public bool Item_PlayerUsing(CCSPlayerController player, string type, string uniqueId);

# Gets if item is in json
public bool Item_IsInJson(string type, string uniqueId);

# Gets an item
public Dictionary&#x3C;string, string>? GetItem(string type, string UniqueId)

# Gets items of player
public List&#x3C;Store_Item> GetPlayerItems(CCSPlayerController player);

# Gets equipments of player
public List&#x3C;Store_Equipment> GetPlayerEquipments(CCSPlayerController player);

# Gets if player is vip
public bool IsPlayerVip(CCSPlayerController player);

# Registers an item
public void RegisterType(string type, Action mapStart, Func&#x3C;CCSPlayerController, Dictionary&#x3C;string, string>, bool> equip, Func&#x3C;CCSPlayerController, Dictionary&#x3C;string, string>, bool> unequip, bool equipable, bool? alive = false);
</code></pre>

## Example of adding item type:

{% embed url="<https://github.com/schwarper/cs2-store/tree/main/Store_TestModule>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://cs2-store.gitbook.io/cs2-store/api/api.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.
