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

# Accounts Payable

> Vendor bills, payments, reimbursements, and fixed assets

# Accounts Payable

Accounts Payable (AP) tracks what Finindex owes to suppliers. Bills originate from Cutmake [procurement](/cutmake/staging/index) (purchase orders and goods receipts), are approved and posted to the GL, then settled through the payment queue and confirmed against the bank.

## The AP Flow

```mermaid theme={null}
flowchart LR
  Vendor[Vendor] --> Bill[Bill from PLM procurement]
  Bill -->|approve| Post[Post Bill]
  Post --> Queue[Payment queue]
  Queue -->|post| Payment[Payment posted]
  Payment -->|bank-confirm| Bank[Bank confirmation]
  Bank --> GL[GL posting]
```

```mermaid theme={null}
sequenceDiagram
  participant Vendor
  participant Bill
  participant Payment
  participant Bank
  participant GL
  Vendor->>Bill: Submit invoice (from PO)
  Bill->>GL: Post bill (AP credit, expense debit)
  Bill->>Payment: Queue for payment
  Payment->>Payment: Post payment
  Payment->>Bank: Send to bank
  Bank-->>Payment: Confirm settlement
  Payment->>GL: Post (AP debit, cash credit)
```

## Bills

A bill is a vendor's claim for payment. Create it, approve it, then post it to recognize the liability.

```bash theme={null}
GET  /api/v1/bills
POST /api/v1/bills
GET  /api/v1/bills/:bill_id
Authorization: Bearer <access_token>
```

<ParamField body="supplier_id" type="string" required>
  Supplier the bill is owed to
</ParamField>

<ParamField body="amount" type="number" required>
  Bill total in the bill's currency
</ParamField>

<ParamField body="currency" type="string">
  ISO currency code (default: VND)
</ParamField>

<ParamField body="due_date" type="string">
  Payment due date in YYYY-MM-DD format
</ParamField>

```bash theme={null}
POST /api/v1/bills
Authorization: Bearer <access_token>

{
  "supplier_id": "uuid",
  "amount": 12000000,
  "currency": "VND",
  "due_date": "2026-04-15"
}
```

### Post a Bill

Posting recognizes the liability in the GL (credit AP, debit expense/asset per the mapping).

```bash theme={null}
POST /api/v1/bills/:bill_id/post
Authorization: Bearer <access_token>
```

To unwind a posting, call `POST /api/v1/bills/:bill_id/void-posting`.

## Payments

Approved bills flow into the **payment queue**. From there a payment is posted, then confirmed once the bank settles it.

```bash theme={null}
GET  /api/v1/payments/queue
POST /api/v1/payments
POST /api/v1/payments/:payment_id/post
POST /api/v1/payments/:payment_id/bank-confirm
Authorization: Bearer <access_token>
```

<Steps>
  <Step title="Review the queue">
    `GET /api/v1/payments/queue` returns bills awaiting payment.
  </Step>

  <Step title="Post the payment">
    `POST /api/v1/payments/:payment_id/post` records the disbursement and posts to the GL.
  </Step>

  <Step title="Confirm against the bank">
    `POST /api/v1/payments/:payment_id/bank-confirm` marks the payment as settled once the bank confirms.
  </Step>
</Steps>

## Reimbursements

Employee expense claims are approved and posted as reimbursements payable.

```bash theme={null}
POST /api/v1/reimbursements/expense-claims
GET  /api/v1/reimbursements/expense-claims/awaiting
POST /api/v1/reimbursements/expense-claims/:claim_id/approve
POST /api/v1/reimbursements/expense-claims/:claim_id/post
POST /api/v1/reimbursements/:reimbursement_id/post
Authorization: Bearer <access_token>
```

## Fixed Assets

Capital purchases are tracked as fixed assets and depreciated over time. Depreciation runs post journal entries to the GL.

```bash theme={null}
GET  /api/v1/fixed-assets
POST /api/v1/fixed-assets
POST /api/v1/fixed-assets/depreciation-runs
Authorization: Bearer <access_token>
```

<Info>
  See the **API Reference** tab for the full list of bills, payments, reimbursements, and fixed-asset endpoints.
</Info>
