{"openapi":"3.1.0","info":{"title":"POST /api/v1/invoices/{invoice_id}/send","version":"1.0.0","description":"Send invoice via email"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/invoices/{invoice_id}/send":{"post":{"tags":["invoices"],"summary":"Send invoice via email","description":"Send an invoice to the customer via email. Optionally attach the PDF and CC the sender.","operationId":"send_invoice_email_api_v1_invoices__invoice_id__send_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceSendEmailRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSendEmailResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceSendEmailRequest":{"properties":{"custom_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Custom Message","description":"Optional personalized message to include in the email body."},"cc_sender":{"type":"boolean","title":"Cc Sender","description":"If true, CC the sending user on the email.","default":false},"attach_pdf":{"type":"boolean","title":"Attach Pdf","description":"If true, attach the invoice PDF to the email. Requires Stripe integration.","default":true}},"type":"object","title":"InvoiceSendEmailRequest","description":"Request schema for sending an invoice via email.","example":{"attach_pdf":true,"cc_sender":true,"custom_message":"Please let me know if you have any questions about this invoice."}},"InvoiceSendEmailResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the email was sent successfully."},"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the invoice sent."},"invoice_number":{"type":"string","title":"Invoice Number","description":"Invoice number (e.g., INV-001)."},"customer_email":{"type":"string","title":"Customer Email","description":"Email address the invoice was sent to."},"cc_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cc Email","description":"Email address that was CC'd (if cc_sender was true)."},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id","description":"SES message ID for tracking."},"pdf_attached":{"type":"boolean","title":"Pdf Attached","description":"Whether the PDF was attached to the email.","default":false}},"type":"object","required":["success","invoice_id","invoice_number","customer_email"],"title":"InvoiceSendEmailResponse","description":"Response schema for sending an invoice via email.","example":{"cc_email":"user@company.com","customer_email":"customer@example.com","invoice_id":"019abc12-3456-7890-abcd-ef1234567890","invoice_number":"INV-0042","message_id":"0100018f-1234-5678-9abc-def012345678","pdf_attached":true,"success":true}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}