# Get invoice by ID

**Retrieve a specific invoice by its unique identifier**
This endpoint provides detailed invoice information including:
- Complete invoice details and line items
- Invoice status and payment tracking
- Client and project relationships
- Tax calculations and compliance data
- Payment history and outstanding balances
- Document generation and delivery status

**Invoice Management Features:**
- Invoice lifecycle tracking
- Payment status monitoring
- Tax calculation and compliance
- Client relationship integration
- Document generation and delivery

**Invoice Details Include:**
- Invoice number and reference
- Invoice status and payment status
- Client and project information
- Line items and amounts
- Tax calculations
- Payment history

**Business Applications:**
- Invoice status monitoring
- Payment tracking and reconciliation
- Client billing history
- Revenue recognition analysis
- Tax compliance reporting

**Real Example:**

```bash
curl --location 'https://{{host}}/v1/invoice/45678' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json'
```
**Response Example:**

```json
{
  "arTranId": 45678,
  "invoiceNumber": "INV-2024-001",
  "dueDate": "2024-12-31T23:59:59Z",
  "status": "POSTED",
  "tax": 2000.00,
  "interest": 0.00,
  "description": "Q4 Financial Audit",
  "createdAt": "2024-12-01T09:00:00Z",
  "updatedAt": "2024-12-15T10:30:00Z",
  "ar_tran": {
    "id": 45678,
    "pmsRef": "AR-2024-045678",
    "transactionDate": "2024-12-01T00:00:00Z",
    "amount": 22000.00,
    "allocated": 15000.00,
    "clientId": 789
  }
}
```

Endpoint: GET /gql/v1/invoice/{id}
Version: 1.0.0
Security: BearerAuth

## Path parameters:

  - `id` (integer, required)
    Unique identifier of the invoice

## Response 200 fields (application/json):

  - `arTranId` (integer)
    Invoice identifier (equal to the AR transaction id)
    Example: 45678

  - `invoiceNumber` (string)
    Invoice number
    Example: INV-2024-001

  - `dueDate` (string)
    Invoice due date
    Example: 2024-12-31T23:59:59Z

  - `status` (string)
    Invoice status
    Example: POSTED

  - `tax` (number)
    Tax amount recorded on the invoice
    Example: 2000

  - `interest` (number)
    Interest amount recorded on the invoice
    Example: 0

  - `description` (string)
    Invoice description
    Example: Q4 Financial Audit

  - `createdAt` (string)
    Invoice creation timestamp
    Example: 2024-12-01T09:00:00Z

  - `updatedAt` (string)
    Last update timestamp
    Example: 2024-12-15T10:30:00Z

  - `ar_tran` (object)
    Underlying accounts-receivable transaction

  - `ar_tran.id` (integer)
    AR transaction identifier
    Example: 45678

  - `ar_tran.pmsRef` (string)
    Practice-management-system reference
    Example: AR-2024-045678

  - `ar_tran.transactionDate` (string)
    AR transaction date
    Example: 2024-12-01T00:00:00Z

  - `ar_tran.amount` (number)
    Total transaction amount
    Example: 22000

  - `ar_tran.allocated` (number)
    Amount allocated (applied/paid) against the transaction
    Example: 15000

  - `ar_tran.clientId` (integer)
    Associated client identifier
    Example: 789

## Response 404 fields (application/json):

  - `error` (string)
    Example: Invoice not found

  - `message` (string)
    Example: Invoice with ID 45678 does not exist

