Skip to main content

Get Supplier Invoice (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/supplier-invoices/:invoiceId

Actual backend path: GET /v1/workspace/:workspaceId/supplier-invoices/:invoiceId

Description

Get a single supplier invoice by ID.

Authentication

Required: Workspace JWT.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
invoiceIdstringYesSupplier invoice identifier

Response 200 OK

{
"invoice": {
"id": "507f1f77bcf86cd799439021",
"workspaceId": "507f1f77bcf86cd799439012",
"supplierId": "507f1f77bcf86cd799439011",
"invoiceNumber": "INV-001",
"totalAmount": 5000,
"paidAmount": 2000,
"remainingAmount": 3000,
"status": "partially-paid",
"issueDate": "2024-01-15T00:00:00.000Z",
"dueDate": "2024-02-15T00:00:00.000Z",
"description": "وصف",
"notes": "ملاحظات",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
}

Common Errors

  • 401 Unauthorized: Missing or invalid token
  • 403 Forbidden: Workspace access denied
  • 404 Not Found: Workspace or invoice not found
  • 500 Internal Server Error: Server error