Get invoice events

Retrieves the complete timeline of events for an invoice, including status changes, submissions, validations, and user actions. Useful for audit trails and understanding invoice history.

GET /api/v1/invoices/{uuid}/events

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
X-CompanystringYesCompany UUID to scope the request

Path parameters

NameTypeRequiredDescription
uuidstringYesInvoice UUID

Request

curl https://api.storno.ro/api/v1/invoices/7c9e6679-7425-40de-944b-e07fc1f90ae7/events \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Company: 550e8400-e29b-41d4-a716-446655440000"

Response

Returns an array of event objects, ordered by timestamp (newest first).

[
  {
    "id": "9a0b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
    "type": "anaf_validated",
    "status": "validated",
    "timestamp": "2024-02-15T10:00:00Z",
    "details": "Invoice validated by e-invoice provider successfully",
    "user": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "System",
      "email": null
    },
    "metadata": {
      "validationId": "ANAF-VAL-123456",
      "downloadId": "DL-987654"
    }
  },
  {
    "id": "8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c",
    "type": "anaf_submitted",
    "status": "sent_to_provider",
    "timestamp": "2024-02-15T09:30:00Z",
    "details": "Invoice submitted to e-invoice provider",
    "user": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "John Doe",
      "email": "[email protected]"
    },
    "metadata": {
      "submissionId": "ANAF-2024-123456"
    }
  },
  {
    "id": "7e8f9a0b-1c2d-3e4f-5a6b-7c8d9e0f1a2b",
    "type": "status_change",
    "status": "issued",
    "timestamp": "2024-02-15T09:00:00Z",
    "details": "Invoice issued successfully",
    "user": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "John Doe",
      "email": "[email protected]"
    },
    "metadata": {
      "xmlGenerated": true,
      "pdfGenerated": true
    }
  },
  {
    "id": "6d7e8f9a-0b1c-2d3e-4f5a-6b7c8d9e0f1a",
    "type": "payment_received",
    "status": null,
    "timestamp": "2024-02-20T14:30:00Z",
    "details": "Payment of 500.00 RON received",
    "user": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "Jane Smith",
      "email": "[email protected]"
    },
    "metadata": {
      "paymentId": "4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9a",
      "amount": 500.00,
      "currency": "RON",
      "method": "bank_transfer"
    }
  },
  {
    "id": "5c6d7e8f-9a0b-1c2d-3e4f-5a6b7c8d9e0f",
    "type": "email_sent",
    "status": null,
    "timestamp": "2024-02-15T09:05:00Z",
    "details": "Invoice emailed to [email protected]",
    "user": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "John Doe",
      "email": "[email protected]"
    },
    "metadata": {
      "to": "[email protected]",
      "subject": "Invoice FAC-2024-001",
      "attachments": ["pdf", "xml"]
    }
  },
  {
    "id": "4b5c6d7e-8f9a-0b1c-2d3e-4f5a6b7c8d9e",
    "type": "created",
    "status": "draft",
    "timestamp": "2024-02-15T08:30:00Z",
    "details": "Invoice created",
    "user": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "John Doe",
      "email": "[email protected]"
    },
    "metadata": null
  }
]

Event types

TypeDescriptionStatus change
createdInvoice was createddraft
updatedInvoice data was modified-
status_changeStatus changed manuallyvaries
issuedInvoice was issuedissued
anaf_submittedSubmitted to e-invoice providersent_to_provider
anaf_validatedProvider validation passedvalidated
anaf_rejectedProvider validation failedrejected
email_sentInvoice emailed to client-
payment_receivedPayment recorded-
payment_deletedPayment removed-
cancelledInvoice cancelledcancelled
restoredInvoice restored from cancelleddraft
pdf_generatedPDF file generated-
xml_generatedXML file generated-
viewedInvoice viewed by client-
downloadedInvoice downloaded-

Event object fields

FieldTypeDescription
idstringEvent UUID
typestringEvent type identifier
statusstring|nullNew status (if status changed)
timestampstringISO 8601 timestamp
detailsstringHuman-readable event description
userobject|nullUser who triggered the event
metadataobject|nullAdditional event-specific data

Use cases

  • Audit trail - Track who did what and when
  • Debugging - Understand why an invoice is in a certain state
  • Timeline display - Show invoice history to users
  • Compliance - Maintain records of all invoice actions
  • Notifications - Trigger alerts based on events
  • Analytics - Analyze invoice lifecycle patterns

Filtering events (future)

While not currently supported, future versions may support filtering:

GET /api/v1/invoices/{uuid}/events?type=status_change&from=2024-01-01

Error codes

CodeDescription
401Missing or invalid authentication token
403No access to the specified company
404Invoice not found