Convert an accepted quote to a sales invoice

POSThttps://app.speybooks.com/api/v1/quotes/{id}/convert

Convert an accepted quote into a draft sales invoice. The operation runs as a single atomic transaction:

  1. Locks the source quote and validates it is in accepted status, has lines, and every line has an account assignment
  2. Generates a new invoice number from the standard sequence
  3. Creates a draft sales invoice and copies every line penny for penny (quote and invoice arithmetic share one calculation path)
  4. Links the quote and invoice to each other in both directions
  5. Advances the quote to converted and writes two audit records

All of it commits or none of it does. Returns the new invoice ID and number. Conversion is rejected if the quote is not accepted, has no lines, or has lines missing an account assignment, or if it has already been converted.

Path parameters

idstringrequired
Quote ID to convert (e.g. quo_42). Must be in accepted status.

Response

200Quote converted. Returns new invoice ID and number. Quote status is set to converted.
Show response fields
invoiceIdstring
invoiceNumberstring

Error codes

400Quote is not in accepted status, has no lines, or has lines missing an account assignment.
404Quote not found.
409Quote has already been converted.