Invoices
Create an invoice
Create an invoice for the authenticated team. The behavior depends on deliveryType: 'create' generates and finalizes the invoice immediately, 'create_and_send' also sends it to the customer, 'scheduled' schedules the invoice for automatic processing at the specified date.
post/invoices
Request body
Example request
{
"template": {
"title": "Invoice",
"customerLabel": "Bill To",
"fromLabel": "From",
"invoiceNoLabel": "Invoice #",
"issueDateLabel": "Issue Date",
"dueDateLabel": "Due Date",
"descriptionLabel": "Description",
"priceLabel": "Rate",
"quantityLabel": "Qty",
"totalLabel": "Amount",
"totalSummaryLabel": "Total",
"vatLabel": "VAT",
"taxLabel": "Sales Tax",
"paymentLabel": "Payment Information",
"noteLabel": "Notes",
"logoUrl": "https://example.com/logo.png",
"currency": "USD",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021"
}
]
}
]
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc, 123 Business Ave, San Francisco, CA 94105"
}
]
}
]
},
"size": "letter",
"includeVat": false,
"includeTax": true,
"discountLabel": "Discount",
"includeDiscount": false,
"includeUnits": true,
"includeDecimals": true,
"includePdf": true,
"sendCopy": true,
"includeQr": false,
"dateFormat": "MM/dd/yyyy",
"taxRate": 8.5,
"vatRate": 0,
"deliveryType": "create",
"timezone": "America/Los_Angeles",
"locale": "en-US"
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Business Ave"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "San Francisco, CA 94105"
}
]
}
]
},
"customerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer:",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Chase Bank, Account: 1234567890"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Routing: 021000021"
}
]
}
]
},
"noteDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of invoice date."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for your business!",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"dueDate": "2024-07-15T23:59:59.000Z",
"issueDate": "2024-06-15T00:00:00.000Z",
"invoiceNumber": "INV-2024-001",
"logoUrl": "https://example.com/logo.png",
"tax": 85,
"topBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for choosing TechCorp for your software development needs.",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This invoice covers the development work completed in June 2024."
}
]
}
]
},
"bottomBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Terms & Conditions:",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "bulletList",
"content": [
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of invoice date"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Late payments may incur a 1.5% monthly service charge"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "All work is subject to our standard terms of service"
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Questions? Contact us at billing@techcorp.com or (555) 123-4567",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"amount": 1085,
"lineItems": [
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Web Development Services",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Custom React application with TypeScript",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"quantity": 40,
"price": 75,
"tax": 8.5
},
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "UI/UX Design",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "User interface design and user experience optimization",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"quantity": 20,
"price": 50,
"tax": 8.5
}
],
"deliveryType": "create",
"scheduledAt": "2024-07-01T09:00:00.000Z"
}Response
Invoice created successfully. Status depends on deliveryType: 'scheduled' for scheduled invoices, 'unpaid' for create/create_and_send.
Example response
{
"id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
"status": "draft",
"createdAt": "2024-06-01T07:00:00.000Z",
"updatedAt": "2024-06-01T07:00:00.000Z",
"pdfUrl": "https://app.midday.ai/api/download/invoice?token=eyJ...",
"previewUrl": "https://app.midday.ai/i/eyJ..."
}