Skip to main content

Get Lab Visit Invoice (v1)

Method & Path

GET /api/v1/{workspaceId}/labs/visits/{labVisitId}/invoice

Description

Return the invoice for a lab visit. If no invoice exists, the server generates a default one from the visit tests.

note

Backend route: /:workspaceId/labs/visits/:labVisitId/invoice

Authentication

Required: Workspace Owner or Staff with labs.view.

Headers

  • Authorization: Bearer <token>
  • Content-Type: application/json

Path Parameters

NameTypeRequiredDescription
workspaceIdstringنعمWorkspace ID
labVisitIdstringنعمLab visit ID

Response 200 OK

{
"labVisit": {
"id": "64f1a0a6a2d4f3c8b6f9a123",
"workspaceId": "64f1a0a6a2d4f3c8b6f9a999",
"clientId": "64f1a0a6a2d4f3c8b6f9a456",
"labVisitStatus": "pending",
"labVisitType": "in-lab",
"labVisitInvoice": {
"items": [
{
"id": "item-1",
"description": "CBC",
"quantity": 1,
"unitPrice": 20,
"total": 20
}
],
"subtotal": 20,
"discount": 0,
"discountType": "fixed",
"total": 20,
"currency": "USD",
"notes": null,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
},
"linkedClientInvoiceId": null
},
"invoice": {
"items": [
{
"id": "item-1",
"description": "CBC",
"quantity": 1,
"unitPrice": 20,
"total": 20
}
],
"subtotal": 20,
"discount": 0,
"discountType": "fixed",
"total": 20,
"currency": "USD",
"notes": null,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}
}

Common Errors

  • 400 Bad Request: Invalid identifiers or parameters.
  • 401 Unauthorized: Missing/invalid auth token.
  • 403 Forbidden: Staff lacks labs.view.
  • 404 Not Found: Visit not found.
  • 422 Unprocessable Entity: Validation failed.
  • 500 Internal Server Error: Unexpected error.