Mark invoice as unpaid
Reverts a paid invoice back to unpaid status. This changes the invoice status from “Paid” back to “New” or “Sent” (depending on whether it was sent before), allowing you to correct payment records.
What happens when you mark an invoice as unpaid:
- Invoice status changes from “Paid” back to “New” or “Sent”
- If the invoice was sent before, it returns to “Sent” status
- If the invoice was never sent, it returns to “New” status
- Payment date and runtime are cleared
- Status change timestamp and user are recorded
- The invoice moves from the “Paid” tab back to the appropriate tab
Important restrictions:
- Only invoices with status “Paid” can be marked as unpaid
- Invoices that are “Cancelled” cannot be marked as unpaid
- This operation is useful for correcting payment recording errors
Use cases:
- Correct payment recording errors
- Revert accidental payment marking
- Handle payment reversals or refunds
What is returned:
- Success response confirming the invoice was marked as unpaid
POST
/billing/invoices/{id}/mark-as-unpaidAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstring<uuid>requiredInvoice ID (UUID)
Responses
200Invoice marked as unpaid successfully
successbooleanrequiredOperation success flag
400Invoice cannot be marked as unpaid (only invoices with status "Paid" can be marked as unpaid)
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Invoice not found
Request
curl -X POST "https://leadtime.app/api/public/billing/invoices/%3Cuuid%3E/mark-as-unpaid" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/billing/invoices/%3Cuuid%3E/mark-as-unpaid", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.post(
"https://leadtime.app/api/public/billing/invoices/%3Cuuid%3E/mark-as-unpaid",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
{
"success": true
}Invoice cannot be marked as unpaid (only invoices with status "Paid" can be marked as unpaid)
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Invoice not found