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

# Hooks

Functions in the config that run after something happens. Fill them in to integrate inventories, logs or society accounts.

## Server — `config.server.lua`

| Hook | Arguments |
| - | - |
| `Config.OnLicenseEarned` | `source, licenseId` |
| `Config.OnDocumentOrdered` | `source, docTypeId, validityDays, pricePaid` |
| `Config.OnInsurancePurchased` | `source, plate, model, validityDays, pricePaid` |
| `Config.OnBillIssued` | `source, billId, billType, amount` |
| `Config.OnBillPaid` | `source, billId, billType, amount` |
| `Config.ItemCheckFn` / `Config.ItemRemoveFn` | `source, itemName` — payment item integration |

## Client — `config.client.lua`

| Hook | Arguments |
| - | - |
| `Config.OnLicenseEarned` | `licenseId` |
| `Config.OnDocumentOrdered` | `docTypeId, validityDays` |
| `Config.OnInsurancePurchased` | `plate, model, days, pricePaid` |
| `Config.OnBillPaid` | `billId, billType, amount` |

### Example: give an item when a license is earned

```lua theme={null}
-- config.server.lua (works on every framework / inventory)
Config.OnLicenseEarned = function(source, licenseId)
    Bridge.AddItem(source, licenseId .. '_license', 1)
end
```

Bridge helpers available in server hooks: `Bridge.GetIdentifier`, `GetName`, `GetJob`, `GetMoney`, `AddMoney`, `RemoveMoney`, `GetItemCount`, `AddItem`, `RemoveItem`, `AddSocietyMoney`.


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