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

# Exports

### Client

#### Open Billing UI

```lua
exports['mz_billing']:OpenBillingUI()
```

#### Open Create Bill UI

```lua
exports['mz_billing']:OpenCreateBillUI({
    mode = 'personal' -- personal | business
})
```

***

### Server

#### Open Billing UI

```lua
exports['mz_billing']:OpenBillingUI(source)
```

#### Open Create Bill UI

```lua
exports['mz_billing']:OpenCreateBillUI(source, {
    mode = 'personal' -- personal | business
})
```

#### Create Bill

```lua
local success, result = exports['mz_billing']:CreateBill({
    issuerSource = source,
    targetSource = target,
    amount = 500,
    description = 'Vehicle Repair'
})
```

| Field        | Description      |
| ------------ | ---------------- |
| issuerSource | Bill issuer      |
| targetSource | Bill recipient   |
| amount       | Bill amount      |
| description  | Bill description |

#### Get Pending Bills

```lua
local bills = exports['mz_billing']:GetPendingBillsForSource(source)
```

Returns a table containing all unpaid bills for the player.

***

### Example

```lua
-- Create a fine
exports['mz_billing']:CreateBill({
    issuerSource = source,
    targetSource = suspect,
    amount = 1000,
    description = 'Speeding'
})

-- Open billing list
exports['mz_billing']:OpenBillingUI(source)

-- Open business bill UI
exports['mz_billing']:OpenCreateBillUI(source, {
    mode = 'business'
})
```
