Skip to content
Last updated

Update the status of an invoice. Only staff users can perform this operation.

Status Transitions

Valid status transitions:

  • draftissuedpaid
  • draftcancelled
  • issuedoverdue (automatic)
  • issuedcancelled
  • overduepaid
  • overduecancelled

Invalid transitions will be rejected with a 422 error.

PATCHhttps://api.aitronos.com/v1/invoices/{invoice_id}/status

Path Parameters

invoice_id string required

Invoice ID (format: inv_<uuid>).

Request Body

status string required

New status. Valid values: draft, issued, paid, overdue, cancelled.

payment_date datetime optional

Payment date (required when status is paid). ISO 8601 format.

Returns

Returns the updated invoice object with the new status and payment date (if applicable).

Bash
curl -X PATCH "https://api.aitronos.com/v1/invoices/inv_123e4567e89b12d3a456426614174000/status" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "paid",
    "payment_date": "2025-01-15T10:30:00Z"
  }'

Response:

{
  "id": "inv_123e4567e89b12d3a456426614174000",
  "invoice_number": "INV-2024-12-AIT-001",
  "organization_id": "org_123e4567e89b12d3a456426614174000",
  "organization_name": "Aitronos AG",
  "billing_period_start": "2024-12-01T00:00:00Z",
  "billing_period_end": "2025-01-01T00:00:00Z",
  "issue_date": "2024-12-31T23:59:59Z",
  "due_date": "2025-01-30T23:59:59Z",
  "payment_date": "2025-01-15T10:30:00Z",
  "currency": "CHF",
  "exchange_rate": 1.0,
  "subtotal": 1250.50,
  "tax_rate": 0.081,
  "tax_amount": 101.29,
  "total_amount": 1351.79,
  "status": "paid",
  "items": [],
  "created_at": "2024-12-31T23:59:59Z",
  "updated_at": "2025-01-15T10:30:00Z"
}