Quote to invoice
Create a quote, send it for signature, then invoice it and record the payment.
This walks one order through Flito with curl. Each step uses an id from the step before; set them as you go. The key needs a role that can send quotes and invoices (owner, admin or member), made read and write.
This sends real email
Steps 3 and 6 email the customer. Try it with your own address first.
Find the company and contact
curl -s "$FLITO_URL/api/cap/company.list" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"search": "Acme", "limit": 1}}'Note the company's id (cmp_…). contact.list with {"companyId": "cmp_…"} finds the person who will sign.
Create the quote
curl -s "$FLITO_URL/api/cap/quote.create" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: acme-order-1042-quote" \
-d '{"input": {
"companyId": "cmp_…",
"contactId": "con_…",
"name": "Acme order 1042",
"paymentTerms": "Net 30",
"lineItems": [{"name": "Annual service plan", "quantity": 1, "unitPrice": 4800}]
}}'Note result.id (qte_…) and result.quoteReviewStatus. Flito opens a deal for the quote.
Approve it and send it for signature
If quoteReviewStatus is pending_review, someone with quotes:review approves it first:
curl -s "$FLITO_URL/api/cap/quote.review" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"quoteId": "qte_…", "status": "approved", "reviewer": "Jane Doe"}, "approved": true}'Then send it:
curl -s "$FLITO_URL/api/cap/quote.send" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"quoteId": "qte_…", "recipientEmails": ["ada@acme.com"], "signerName": "Ada Lovelace"}, "approved": true}'The answer's signingInvites has the signing link and whether the email went out.
Wait for the signature
curl -s "$FLITO_URL/api/cap/esign.list" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"quoteId": "qte_…"}}'When the envelope is completed, the quote is signed. esign.document_access with {"envelopeId": "…"} returns links to the signed PDF and its certificate, valid for up to 15 minutes. Check every few minutes, or have an automation call your system when the quote changes.
Invoice it
curl -s "$FLITO_URL/api/cap/invoice.convert_from_quote" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: acme-order-1042-invoice" \
-d '{"input": {"quoteId": "qte_…", "billingType": "net_terms", "netDays": 30}}'Note the invoice's id (inv_…).
Send the invoice
curl -s "$FLITO_URL/api/cap/invoice.send" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-d '{"input": {"invoiceId": "inv_…", "recipientEmails": ["ap@acme.com"], "message": "Thank you for your order."}, "approved": true}'Record the payment
curl -s "$FLITO_URL/api/cap/invoice.record_payment" \
-H "Authorization: Bearer $FLITO_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: acme-order-1042-payment-1" \
-d '{"input": {"invoiceId": "inv_…", "payment": {"amount": 4800, "date": "2026-12-01", "method": "wire"}}}'The invoice is now paid. The deal, the quote and the invoice all show the history of each step.
Was this page useful?