# Start a new basket session (InGameCart)

This assumes you are not using the built-in **StoreBrowser**, which automatically manages the cart for you if enabled.

```csharp
using Tebex.TebexUnity;
using Tebex.Headless;
using UnityEngine;

public class StoreController : MonoBehaviour
{
    [SerializeField] InGameCart cart;

    // Call this once when the player opens the store.
    // Pass the in-game username; alternatively use NewBasketWithEmail().
    public void StartSession(string playerUsername)
    {
        cart.NewBasketWithUsername(playerUsername);
    }

    // Call this when the player clicks "Add to Cart" on a product.
    public void OnAddToCart(Package package)
    {
        cart.AddPackage(package);
        cart.Open(); // Slide the cart into view
    }
}
```


---

# 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.tebex.io/developers/unity-engine/examples/start-a-new-basket-session-ingamecart.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.
