Send invoice via email
Sends an invoice to the customer via email as a PDF attachment. The invoice must have a contact with a valid email address set.
What happens when you send an invoice:
- Invoice PDF document is generated
- Invoice status changes from “New” to “Sent”
- Sending date (
sentAt) is recorded as the current date - Sending type is set to “Email” (indicating email sending)
- Contact recipient is recorded (from invoice contactId)
- Payment due date (
dueDate) is calculated based on:- Organization-specific payment terms (
invoiceDueDays), or - Workspace default payment terms (
defaultInvoiceDueDays)
- Organization-specific payment terms (
- Status change timestamp and user are recorded
- Email is sent to the contact’s email address with PDF attachment
- The payment term starts running from this point
Important restrictions:
- Only invoices with status “New” or “Sent” can be sent
- Invoices that are “Paid” or “Cancelled” cannot be sent
- The invoice must have a contact with a valid email address
- Use POST /billing/setInvoiceContactId to set the contact if needed
Use cases:
- Send invoice to customer via email
- Automate invoice delivery
- Track invoice sending and payment terms
What is returned:
- Success response confirming the invoice was sent
POST
/billing/invoices/sendInvoiceAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredRequest body
requiredapplication/jsonInvoice ID to send
idstring<uuid>requiredInvoice ID (UUID) to send. The invoice must have a contact with a valid email address set. The invoice will be sent via email as a PDF attachment.
Responses
200Invoice sent successfully
successbooleanrequiredOperation success flag
400Invoice cannot be sent (only invoices with status "New" or "Sent" can be sent, or contact email is missing)
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/sendInvoice" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "123e4567-e89b-12d3-a456-426614174000"
}'const response = await fetch("https://leadtime.app/api/public/billing/invoices/sendInvoice", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"id": "123e4567-e89b-12d3-a456-426614174000"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/billing/invoices/sendInvoice",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"id": "123e4567-e89b-12d3-a456-426614174000"
},
)Response
{
"success": true
}Invoice cannot be sent (only invoices with status "New" or "Sent" can be sent, or contact email is missing)
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Invoice not found