Skip to main content

Cancel POS Invoice (v1)

Method & Path

DELETE /v1/workspace/:workspaceId/pos/invoices/:invoiceId

Actual backend path: /v1/workspace/:workspaceId/pos/invoices/:invoiceId

Description

Cancel a draft POS invoice. The invoice status is set to cancelled and it is removed from the open-invoices list. Only draft invoices can be cancelled; completed or already cancelled invoices return 422.

Persona access: Workspace Owner and Staff with permission store.orders.manage.

Authentication

Required: JWT in Authorization header.

Required permissions: store.orders.manage

Persona: Workspace Owner, Staff (store.orders.manage)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
invoiceIdstringYesPOS invoice ID (MongoDB ObjectId)

Response 200 OK

Returns the cancelled invoice (with status: "cancelled").

{
"invoice": {
"id": "507f1f77bcf86cd799439012",
"workspaceId": "507f1f77bcf86cd799439010",
"storeId": "507f1f77bcf86cd799439013",
"clientId": "507f1f77bcf86cd799439011",
"publicId": "POS-001",
"status": "cancelled",
"items": [...],
"subtotal": 0,
"discounts": [],
"total": 0,
"stockDeductedAt": null,
"createdBy": null,
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:05:00.000Z"
}
}

Common Errors

  • 400 Bad Request: Invalid invoice identifier
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions (requires store.orders.manage)
  • 404 Not Found: Workspace or invoice not found
  • 422 Unprocessable Entity: Invoice is not in draft status (only draft invoices can be cancelled)
  • 500 Internal Server Error: Server error