> For the complete documentation index, see [llms.txt](https://dusadev.gitbook.io/dusa-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dusadev.gitbook.io/dusa-docs/esx/billing/installation-and-configuration-and-integration.md).

# Installation & Configuration & Integration

## <img src="/files/W1oatVHCMT6tBaAXr6T2" alt="" data-size="line">Step By Step Installation

**Install**

Login to your [keymaster](https://keymaster.fivem.net/asset-grants/) account, check Granted Assets section and download script you bought from us.

Drag & drop script, after that restart your server and setup is done

## <img src="/files/4JslPu1FspYQp1B97SK3" alt="" data-size="line">Configuration

#### **General Options**

```lua
------------------------GENERAL OPTIONS------------------------
---------------------------------------------------------------
Config.Commands = {
  OpenBilling = "billing",
  OpenAdminMenu = "billingadmin",
  PosDevice = "pos"
}

Config.WAT = 10 -- Tax will be added to invoice amount
Config.PosToJobVault = true -- Add pos moneys to player's job vault / if you set this false, money will be added to pos holder bank account
```

#### **Job Bills**

```lua
--------------------------JOB BILLS----------------------------
---------------------------------------------------------------
--[[	
	name = "Job Name" -- must be equal to your job set code
        image = "url" -- will be shown at the right top corner when invoice request sent
]]

Config.JobBills = {
  [1] = {
    name = "ambulance",
    image = "https://media.discordapp.net/attachments/1143528082913906688/1193632716617416846/Rectangle_13.png?ex=65ad6c18&is=659af718&hm=6687185cd08e20decfa93d55ceb53e732cb49a2f61bfd435ec2639617dd523f2&=&format=webp&quality=lossless"
  },
  [2] = {
    name = "police",
    image = "https://media.discordapp.net/attachments/1143528082913906688/1193632388287307958/image_1.png?ex=65ad6bc9&is=659af6c9&hm=308bf239d0530395c87f1d6a7578d6928ca30b1aaea3f021a97be2cc72174bd5&=&format=webp&quality=lossless"
  },
  [3] = {
    name = "mechanic",
    image = "https://media.discordapp.net/attachments/1143528082913906688/1193632716160249966/image_2.png?ex=65ad6c18&is=659af718&hm=6c0aa31ea7f6a2663e7b01a765a7fa7860964403e31f81e12dcf049437b6aa5f&=&format=webp&quality=lossless"
  },
  [4] = {
    name = "uwucafe",
    image = "https://media.discordapp.net/attachments/1143528082913906688/1195509620828028979/image.png?ex=65b44019&is=65a1cb19&hm=2b2f51506fb5ae7fa6b4a460d7dfa6336286e19d13fabf9017d0f1615ae324a3&=&format=webp&quality=lossless"
  },
}
```

## <img src="/files/4JslPu1FspYQp1B97SK3" alt="" data-size="line"> Integrations

### Check if player has an unpaid bill

```
// Works for client side
local hasBill = exports['dusa_billing']:hasBills()
print(hasBill)
-- output: true or false
```

### **Create Custom Invoice**

```
// Client Side
TriggerServerEvent('dusa_billing:sv:createCustomInvoice', targetSource, title, description, amount, type)
```

#### **Variables**

**targetSource:** `GetPlayerServerId(playerId)`

**title:** `Gun fight`

**description:** `Player killed a person with a gun`

**amount:**  `250`

**type:** `personel` or `company`

### **Open Billing Menu**

```
//  Client Side
exports['dusa_billing']:openBilling()

// Server Side
TriggerClientEvent('dusa_billing:cl:openBilling', source)
```

### **Open Admin Menu**

```
//  Client Side
exports['dusa_billing']:openAdmin()

// Server Side
TriggerClientEvent('dusa_billing:cl:openAdmin', source)
```

### Open POS Device

```
// Client Side
TriggerEvent('dusa_billing:openPos')

// Server Side
TriggerClientEvent('dusa_billing:openPos', source)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://dusadev.gitbook.io/dusa-docs/esx/billing/installation-and-configuration-and-integration.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.
