Invoicing via API
This section lets you submit your invoices you issue to GreenLeaze directly from your own system, without going through the dashboard or sending via mail.
Overall flow
An invoice is created in two steps: first the structured data (number, line items, links to subscription lines), then the PDF uploaded to an S3 presigned URL.
GET /subscriptions/{id}/invoice-details— fetch the invoicing context (customer, lines, suppliers, …)POST /invoices/upload— submit{ subscriptionId, invoiceNumber, supplierId?, items?, insuranceInfo?, accessoryLinks? }and receive{ invoice, presignedUrl }PUT <presignedUrl>— upload the PDF binary withContent-Type: application/pdf
At step 2 the invoice is created with status awaiting_upload. If the PDF is not received within 5 minutes, the invoice is rejected and an invoice_upload_failed webhook is emitted with reason PDF_NOT_UPLOADED. If the uploaded PDF is a duplicate of an existing invoice, it is also rejected with reason DUPLICATE_PDF.
Once the PDF is received and validated, the invoice moves to uploaded and will be proccessed by our team.
