> For the complete documentation index, see [llms.txt](https://docs.dsyncstudios.store/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dsyncstudios.store/products/dsync-banking/integrations/events-and-commands.md).

# Events & Commands

## Events & Commands

### Opening the UI

The primary integration point for other resources (menus, `ox_target` zones, custom peds) is a single client event:

```lua
-- Open a full bank branch UI
TriggerEvent('Dsync-Banking:client:openBankUI', { atm = false })

-- Open the simplified ATM UI (card/PIN gated in item mode)
TriggerEvent('Dsync-Banking:client:openBankUI', { atm = true })
```

`ox_target` zones on ATM props and bank peds already trigger this event out of the box — you only need it if you're adding your own custom interaction (a phone app shortcut, a keybind, etc.).

### Commands

| Command                       | Side   | Description                                                                                                                                            |
| ----------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `/givecash <target> <amount>` | Server | Gives cash directly to a nearby player (distance-checked). Logged as `Banking-GiveCash` since cash-to-cash transfers never touch the ledger otherwise. |
| `/closeBankUI`                | Client | Force-closes the bank/ATM UI. Mainly a safety net for edge cases (stuck UI after a disconnect, etc).                                                   |

### Internal callbacks

All money-moving operations (`banking:server:deposit`, `:withdraw`, `:transfer`, loan/savings/bill actions, etc.) are internal `ox_lib` callbacks invoked by the NUI and validated entirely server-side. They are **not** intended for other resources to call directly — use the [server exports](/products/dsync-banking/integrations/server-exports.md) instead, which wrap the same logic with a stable, documented contract.

### Framework lifecycle events (informational)

Dsync-Banking listens to the standard framework player-lifecycle events (`QBCore:Server:PlayerLoaded`, `esx:onPlayerSpawn`, `playerDropped`, etc.) to seed new accounts and clean up per-player caches. You don't need to interact with these directly, but they explain why a fresh character always has a personal account and starting credit score the moment they spawn.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.dsyncstudios.store/products/dsync-banking/integrations/events-and-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
