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

# Create bill

> Crea una nueva factura para un jugador o sociedad del lado del servidor.

```lua Export theme={null}
exports["billing_ui"]:createBill(senderIdentifier, targetIdentifier, reason, amount, target, targetType)
```

### Parámetros

| Nombre | Tipo de dato | Descripción |
| - | - | - |
| `senderIdentifier` | string | El identificador del jugador que crea la factura. **En QBCore es el citizen ID.** |
| `targetIdentifier` | string | El identificador del jugador que recibe la factura. **En QBCore es el citizen ID.** |
| `reason` | string | El motivo de la factura |
| `amount` | integer | El importe de la factura |
| `target` | string | Quién recibirá el pago de la factura. Si `targetType` es `player`, el target es un identificador (o citizen ID en QBCore). Si `targetType` es `society`, el target es, por ejemplo, `society_police`. |
| `targetType` | string | `player` o `society` |

## Ejemplo

```lua theme={null}
-- Ejemplo con ESX
RegisterCommand("sendInvoiceToOfflinePlayer", function(playerId, args)
    local senderIdentifier = ESX.GetPlayerFromId(playerId).identifier
    local targetIdentifier = args[1] -- Ejemplo 6833b871ee066492978077ef154480366a2374b
    local reason = args[2] -- Ejemplo "Speed limit exceeded"
    local amount = tonumber(args[3]) -- Ejemplo 5000
    local target = "society_police"
    local targetType = "society"

    exports["billing_ui"]:createBill(senderIdentifier, targetIdentifier, reason, amount, target, targetType)
end)

-- Ejemplo con QBCore
RegisterCommand("sendInvoiceToOfflinePlayer", function(playerId, args)
    local senderIdentifier = QBCore.Functions.GetPlayer(playerId).PlayerData.citizenid
    local targetIdentifier = args[1] -- Ejemplo GPI46753
    local reason = args[2] -- Ejemplo "Speed limit exceeded"
    local amount = tonumber(args[3]) -- Ejemplo 5000
    local target = "society_police"
    local targetType = "society"

    exports["billing_ui"]:createBill(senderIdentifier, targetIdentifier, reason, amount, target, targetType)
end)
```


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