> ## 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 Receivable

> Customer invoices, receipts, and bank reconciliation

# Accounts Receivable

Accounts Receivable (AR) tracks what customers owe Finindex. Invoices are raised against delivered [sales orders](/cutmake/staging/index), sent to the customer, then settled by receipts that are posted to the GL and reconciled against the bank statement.

## The AR Flow

```mermaid theme={null}
flowchart LR
  SO[Sales Order delivery] --> Invoice[Invoice]
  Invoice -->|send| Customer[Customer]
  Customer -->|payment| Receipt[Receipt / Payment]
  Receipt -->|post| GL[GL posting]
  Receipt --> Recon[Bank Statement reconcile]
  Recon --> GL
```

```mermaid theme={null}
sequenceDiagram
  participant Customer
  participant Invoice
  participant Payment
  participant Bank
  participant GL
  Invoice->>Customer: Send invoice (AR debit, revenue credit)
  Customer->>Payment: Remit receipt
  Payment->>GL: Post (cash debit, AR credit)
  Bank-->>Payment: Bank statement line
  Payment->>Bank: Reconcile receipt to statement
  Bank->>GL: Confirm cleared balance
```

## Invoices

An invoice records a customer's obligation to pay. Create it, post it to recognize revenue and the receivable, then send it.

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

<ParamField body="client_id" type="string" required>
  Customer the invoice is issued to
</ParamField>

<ParamField body="amount" type="number" required>
  Invoice total in the invoice'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/invoices
Authorization: Bearer <access_token>

{
  "client_id": "uuid",
  "amount": 45000000,
  "currency": "VND",
  "due_date": "2026-04-30"
}
```

### Post an Invoice

Posting recognizes the receivable in the GL (debit AR, credit revenue per the mapping).

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

To unwind a posting, call `POST /api/v1/invoices/:invoice_id/void-posting`.

## Receipts (Customer Payments)

Customer payments are recorded as payments and posted to the GL to clear the receivable.

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

<ParamField body="invoice_id" type="string">
  Invoice this receipt settles
</ParamField>

<ParamField body="amount" type="number" required>
  Amount received
</ParamField>

## Bank Statement Reconciliation

Import bank statements and match their lines to posted receipts so the GL cash balance agrees with the bank.

```bash theme={null}
GET    /api/v1/bank-statements
POST   /api/v1/bank-statements
GET    /api/v1/bank-statements/:statement_id
PATCH  /api/v1/bank-statements/:statement_id
Authorization: Bearer <access_token>
```

<Steps>
  <Step title="Import the statement">
    `POST /api/v1/bank-statements` loads the bank's transaction lines.
  </Step>

  <Step title="Match to receipts">
    Reconcile each statement line against a posted payment.
  </Step>

  <Step title="Confirm the balance">
    Reconciled cash agrees with the GL — feeding the [trial balance](/finindex/accounting/general-ledger).
  </Step>
</Steps>

<Info>
  See the **API Reference** tab for the full list of invoice, payment, and bank-statement endpoints.
</Info>
