# Charges

Here, you'll find key exports for managing charges. These exports allow you to create, update and delete charges as needed.

***

## Type

```typescript
type Charge = {
    id: number,
    name: string,
    description: string,
    jail?: number,
    fine?: number,
    createdAt: string,
    tag: {
        identifier: string,
        label: string,
        color: string
    }
}
```

## Exports

### Search for a charge

```lua
exports['redutzu-mdt']:SearchCharge(id: number) // ChargeType | null
```

### Create a new charge

```lua
exports['redutzu-mdt']:CreateCharge({
  name = 'Charge name',
  description = 'Charge description',
  jail = 5, -- this is optional
  fine = 1000, -- this is optional
  tag = 'tag identifier'
}) -- number (id)
```

### Update a charge

```lua
-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateCharge(id, { name = 'New name', jail = 10 }) -- boolean
```

### Delete a charge

<pre class="language-lua"><code class="lang-lua">-- It returns a boolean (if it was successfully deleted)
<strong>exports['redutzu-mdt']:DeleteCharge(id: number) // boolean
</strong></code></pre>


---

# 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.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/charges.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.
