> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Order

Gameball’s **Order APIs** are built for e-commerce platforms and any system that needs to **track customer orders efficiently**.\
They streamline customer purchase management by combining multiple actions into a **single unified endpoint**.

> [!NOTE]
>
> Instead of making multiple API calls (e.g., sending a purchase event + calculating cashback rewards), you can rely on the **Order API** to handle everything in one go.\
> This makes integration easier and ensures a smooth customer experience.

***

## 🚀 What You Can Do with the Order API

> [card] Order Tracking
>
> Create an order in Gameball to automatically:
>
> * Record purchases
> * Trigger loyalty rules
> * Calculate rewards/cashback

> [card] Calculate Order Cashback
>
> Preview how many **cashback points** a customer will earn before checkout.\
> Useful for showing customers "Earn X points with this order".

> [card] Preview Order Rewards
>
> Quote **cashback plus place\_order campaign rewards** (points and coupons) before checkout — without awarding anything.

> [card] Order Points Breakdown
>
> See exactly **how points were earned** on a placed order:
>
> * Which items were eligible
> * The rate and campaign multiplier applied
> * How the item points add up to the total

> [card] Order Transactions
>
> Retrieve the full **order history** including:
>
> * Rewards
> * Refunds
> * Adjustments\
>   For clear and transparent tracking.

***

## 🧭 How It Works

**1. Create an Order**

Use the **Order Tracking API** to log the purchase and let Gameball handle rewards and rules automatically.

**2. Preview Rewards**

Optionally, call **Calculate Order Cashback** for cashback only, or **Preview Order Rewards** for cashback plus `place_order` campaign rewards.

**3. Track Transactions**

Retrieve a detailed breakdown of all activities tied to the order with **Order Transactions**. For many orders at once, use the **Order Transactions Batch Job**.

**4. Explain the Points Earned**

Use **Order Points Breakdown** to show the customer, item by item, how the order's points were calculated.

***

## 📖 Learn More

> [tab] Order Tracking
>
> [Order Tracking →](https://docs.gameball.co/api-reference/order/order-tracking.md)

> [tab] Order Rewards & History
>
> [Calculate Order Cashback →](https://docs.gameball.co/api-reference/order/calculate-order-cashback.md)
>
> [Preview Order Rewards →](https://docs.gameball.co/api-reference/order/preview-order-rewards.md)
>
> [Order Points Breakdown →](https://docs.gameball.co/api-reference/order/order-points-breakdown.md)
>
> [Order Transactions →](https://docs.gameball.co/api-reference/order/order-transactions.md)

***

> [!NOTE]
>
> Together, these APIs provide a **comprehensive solution** for managing customer orders, calculating rewards, and retrieving detailed transaction histories — all within the **Gameball ecosystem**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.