
# Writing data

Many resources support writes as well as reads: `create`, `edit`, `delete` and resource-specific actions such as `mark-sent` or `categorize`. To see what a resource supports, run `fob-zb resource`. For one action's flags, run `fob-zb resource action --help`.

<Callout type="warning" title="Try it on a test organization first">
Writes change your real books immediately. Create a free test organization in Zoho Books, connect it as its own profile with `--from` ([how](/docs/zoho-books/cli/profiles#adding-profiles)), and practise there with `--profile test`.
</Callout>

<Video title="Doing tasks with fob-zb: invoices, vendor payments and the bank feed (3–5 min)" />

## How writes behave

- **`edit` only changes the flags you pass.** Everything else on the record stays as it is.
- **`delete` asks for confirmation.** It refuses to run without `--yes` (`-y`).
- **`--json`** prints the saved record as JSON, which is handy for capturing the new ID in a script.
- **IDs** are Zoho's numeric IDs. Get them from `list` (the first column) or `show`.

## Examples

### Customers and invoices

```bash
# A customer
fob-zb contacts create --name "Acme Ltd" --type customer --email ap@acme.example --payment-terms 30

# An invoice with one line, then send it
fob-zb invoices create --customer 4600xxxxxxx --item 4600yyyyyyy --quantity 2 --rate 5000
fob-zb invoices email 4600zzzzzzz
```

For several lines, repeat `--line`:

```bash
fob-zb invoices create --customer 4600xxxxxxx \
  --line "item_id=4600aaa,quantity=1,rate=1200" \
  --line "description=Setup fee,quantity=1,rate=300"
```

### Paying bills

```bash
fob-zb bills list --status open
fob-zb vendor-payments create --vendor 4600xxxxxxx --amount 1500 --date 2026-10-01 \
  --paid-through 4600bbbbbbb --bill 4600ccccccc
```

`--bill` applies the whole amount to one bill. To split a payment, repeat `--apply "bill_id=amount"` instead.

### Bank feed

```bash
fob-zb bank-transactions list --account-id 4600xxxxxxx --status uncategorized
fob-zb bank-transactions categorize 4600ddddddd --as expense \
  --field account_id=4600eeeeeee --field amount=49.00 --field date=2026-09-30
fob-zb bank-transactions exclude 4600fffffff
```

`categorize --as` and `match` pass extra fields straight to Zoho's API with `--field key=value` or `--json-body`. Check the field names in the [Zoho Books banking API](https://www.zoho.com/books/api/v3/bank-transactions/). These two commands are Beta: they haven't been validated against a live bank feed yet.

## Every write command

The [command reference](/docs/zoho-books/cli/reference/sales) lists every action and its options, grouped by area.
