# Invoicing & Finance

Transportial provides full invoicing and quoting capabilities tied to your transport operations. Generate invoices from transport orders, send quotes to customers, and manage the financial lifecycle.

## Invoices

### Creating an Invoice


```bash
curl -X POST https://api.otms.transportial.com/api/invoice \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "name": "Invoice #2026-042",
    "direction": "OUT",
    "date": "2026-03-22",
    "subjectBusiness": { "id": "your-business-uuid" },
    "targetBusiness": { "id": "customer-business-uuid" },
    "lines": [
      {
        "description": "Transport Rotterdam → Amsterdam",
        "quantity": 1,
        "unitPrice": 450.00,
        "taxPercentage": 21
      }
    ]
  }'
```

**Response:**


```json
{
  "success": true,
  "message": "OK",
  "invoice": {
    "id": "invoice-uuid",
    "number": "2026-042",
    "status": "concept",
    "direction": "OUT",
    "subTotal": 450.00,
    "tax": 94.50,
    "total": 544.50,
    "totalOpen": 544.50,
    "currency": "EUR",
    "createdAt": "2026-03-22T10:00:00Z"
  }
}
```

### Sending an Invoice


```bash
curl -X POST "https://api.otms.transportial.com/api/invoice/{id}/send" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

This emails the invoice to the target business's contact email.

### Sending a Payment Reminder


```bash
curl -X POST "https://api.otms.transportial.com/api/invoice/{id}/send:reminder" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Invoice from Email

Transportial can create invoices from incoming emails:


```bash
curl -X PUT "https://api.otms.transportial.com/api/invoice/mail/receiver" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "from": "supplier@example.com",
    "subject": "Invoice #INV-2026-100",
    "body": "Please find attached invoice..."
  }'
```

### Listing Invoices


```bash
# List invoices for an administration (paginated)
curl -X GET "https://api.otms.transportial.com/api/invoices/{administrationId}/0/20" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Search invoices with filters
curl -X POST "https://api.otms.transportial.com/api/invoices/{administrationId}/0/20" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "status": "sent",
    "direction": "OUT"
  }'
```

## Quotes

Quotes provide pricing before a transport order is accepted. They can be sent to customers and converted to invoices.

### Creating a Quote


```bash
curl -X POST https://api.otms.transportial.com/api/quote \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "name": "Quote #Q-2026-015",
    "direction": "OUT",
    "date": "2026-03-22",
    "dueAt": "2026-04-05T23:59:59Z",
    "subjectBusiness": { "id": "your-business-uuid" },
    "targetBusiness": { "id": "customer-business-uuid" },
    "lines": [
      {
        "description": "Transport Rotterdam → Berlin (full truck)",
        "quantity": 1,
        "unitPrice": 1200.00,
        "taxPercentage": 21
      }
    ]
  }'
```

### Sending a Quote


```bash
curl -X POST "https://api.otms.transportial.com/api/quote/{id}/send" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### Public Quote Links

Quotes support shared links that allow recipients to accept or decline without logging in:


```bash
# Recipient views the quote
GET /api/quote:public/{id}/{shareCode}

# Recipient accepts
POST /api/quote:public/{id}/accept/{shareCode}

# Recipient declines
POST /api/quote:public/{id}/decline/{shareCode}
```

### Converting a Quote to an Invoice

Once accepted, convert a quote directly into an invoice:


```bash
curl -X POST "https://api.otms.transportial.com/api/quote/{id}/create:invoice" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Financial Fields on Transport Entities

Transport orders, consignments, and trips all carry financial fields:

| Entity | Fields |
|  --- | --- |
| Transport Order | `expectedRevenue`, `expectedCost` |
| Consignment | `expectedRevenue`, `expectedCost`, `pricingElements` |
| Trip | `expectedRevenue`, `expectedCost`, `actualCost` |
| Invoice | `subTotal`, `tax`, `total`, `totalOpen` |
| Quote | `subTotal`, `tax`, `total` |


These fields allow you to track estimated vs. actual costs across the entire transport chain.

## Invoice Directions

| Direction | Description |
|  --- | --- |
| `OUT` | Outgoing invoice — you are billing a customer |
| `IN` | Incoming invoice — a supplier is billing you |


## Next Steps

- Create transport orders first with the [Quickstart guide](/guides/quickstart)
- Learn about the [entity hierarchy](/guides/concepts) that drives financial data
- See the full [API Reference](/apis) for all invoice and quote endpoints