Suppliers (v1)
This section documents workspace supplier management endpoints: suppliers, supplier invoices, and supplier payments. Use these APIs to manage the workspace’s relationship with suppliers (فواتير، دفعات، حسابات).
Base path
All endpoints use the base path:
/api/v1/workspace/:workspaceId
Actual backend path: /v1/workspace/:workspaceId for supplier resources; invoice/payment by-ID endpoints use /v1/workspace/:workspaceId/supplier-invoices/:invoiceId and /v1/workspace/:workspaceId/supplier-payments/:paymentId.
Authentication
Required: Workspace authentication (JWT). Access is typically restricted to Workspace Owner (e.g. suppliers section is owner-only by default). Staff access can be granted via workspace menu and permissions if configured.
Supplier management
- List Suppliers – List suppliers, optionally with summary (totalAccount, totalPaid, remaining)
- Create Supplier – Create a new supplier
- Get Supplier – Get a supplier by ID
- Update Supplier – Update a supplier
- Delete Supplier – Delete a supplier (must have no invoices/payments or delete those first)
- Get Supplier Summary – Get aggregated totals: حسابه، واصلاً، متبقي له
Supplier invoices
- List Supplier Invoices – List invoices for a supplier
- Create Supplier Invoice – Create an invoice (day/date, amount, etc.)
- Upload Supplier Invoice Image – Upload optional invoice scan; use returned URL as
imageUrl - Get Supplier Invoice – Get an invoice by ID
- Update Supplier Invoice – Update an invoice
- Delete Supplier Invoice – Delete an invoice
Supplier payments
- List Supplier Payments – List payments for a supplier
- Create Supplier Payment – Create a payment (optionally linked to an invoice)
- Upload Supplier Payment Image – Upload optional receipt image; use returned URL as
imageUrl - Get Supplier Payment – Get a payment by ID
- Update Supplier Payment – Update a payment
- Delete Supplier Payment – Delete a payment
Persona access
- Workspace Owner: Full access to all supplier endpoints when the suppliers section is enabled for the workspace (via business category or menu override).
- Staff / Customer: No access unless explicitly configured via permissions and menu.