> For the complete documentation index, see [llms.txt](https://docs.17movement.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.17movement.net/phone/exports/ebuy/server-exports.md).

# SERVER EXPORTS

<details>

<summary>EbuyAuction Structure</summary>

```
{
  "id": 1,
  "seller": 5,
  "category": "car",
  "title": "Sports Car",
  "description": "Fast and reliable.",
  "images": ["[https://example.com/car.jpg](https://example.com/car.jpg)"],
  "phoneNumber": "555-0123",
  "price": 50000,
  "hideNumber": false,
  "createdAt": 1678900000
}
```

</details>

### Fetch Auctions

Fetches a list of auctions based on various filters like search query, category, sorting order, and pagination limits.

{% code lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Ebuy_FetchAuctions(search, category, sort, cursor, limit, userId)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean, auctions: EbuyAuction[] }`

<table><thead><tr><th width="125" align="center">Argument</th><th width="313" align="center">Type</th><th width="142" align="center">Optional</th><th align="center">Explanation</th></tr></thead><tbody><tr><td align="center">search</td><td align="center"><code>string</code></td><td align="center">✅</td><td align="center">Search query to filter auctions by title.</td></tr><tr><td align="center">category</td><td align="center"><code>"all" | "item" | "car"</code>    </td><td align="center">✅</td><td align="center">Fetching auctions only from this category</td></tr><tr><td align="center">sort</td><td align="center"><code>"priceAsc" | "priceDesc"| "newest"</code> </td><td align="center">✅</td><td align="center">Sorting auctions by this param</td></tr><tr><td align="center">cursor</td><td align="center"><code>number</code></td><td align="center">✅</td><td align="center">Number of items to skip (pagination). Requires <code>limit</code>.</td></tr><tr><td align="center">limit</td><td align="center"><code>number</code></td><td align="center">✅</td><td align="center">Maximum number of auctions to return.</td></tr><tr><td align="center">userId</td><td align="center"><code>number</code></td><td align="center">✅</td><td align="center">Filter auctions created by a specific user ID.</td></tr></tbody></table>

### Add Auction

Creates a new auction listing in the Ebuy marketplace.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Ebuy_AddAuction(title, description, images, phoneNumber, price, seller, category, hideNumber)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean, id?: number }`

<table><thead><tr><th width="130" align="center">Argument</th><th width="146" align="center">Type</th><th width="112" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">title</td><td align="center"><code>string</code></td><td align="center">❌</td><td>The title of the auction.</td></tr><tr><td align="center">description</td><td align="center"><code>string</code></td><td align="center">❌</td><td>Detailed description of the item/vehicle.</td></tr><tr><td align="center">images</td><td align="center"><code>string[]</code></td><td align="center">❌</td><td>Array of image URLs.</td></tr><tr><td align="center">phoneNumber</td><td align="center"><code>string</code></td><td align="center">✅</td><td>Contact phone number for the seller.</td></tr><tr><td align="center">price</td><td align="center"><code>number</code></td><td align="center">❌</td><td>Price of the item.</td></tr><tr><td align="center">seller</td><td align="center"><code>number</code></td><td align="center">✅</td><td>User ID of the seller. Defaults to 0 (System).</td></tr><tr><td align="center">category</td><td align="center"><code>"item" | "car"</code></td><td align="center">❌</td><td>Auction category</td></tr><tr><td align="center">hideNumber</td><td align="center"><code>boolean</code></td><td align="center">❌</td><td>Whether to hide the seller's phone number.</td></tr></tbody></table>

### Delete Auction

Removes an existing auction listing from the marketplace.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Ebuy_DeleteAuction(id)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean }`

| Argument | Type     | Optional | Explanation                      |
| -------- | -------- | -------- | -------------------------------- |
| id       | `number` | ❌        | The ID of the auction to delete. |
