Skip to main content

convertQuoteToInvoice

Requires permission sales:sales_invoice:create.

Create an invoice directly from a quote. Lines keep the quoted prices. Taxed lines without a valid tax method are rejected, and the customer's credit limit is checked unless the caller can override it.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation ConvertQuoteToInvoice($quoteId: ID!) {
convertQuoteToInvoice(quoteId: $quoteId) {
id
invoiceNumber
supplierCode
supplierDisplayName
supplierName
status
allocations {
id
invoiceNumber
paymentNumber
createdAt
amount
appliedFromAdvance
}
}
}

Variables:

{
"quoteId": "id"
}

Response:

{
"data": {
"convertQuoteToInvoice": {
"id": "id",
"invoiceNumber": "string",
"supplierCode": "string",
"supplierDisplayName": "string",
"supplierName": "string",
"status": "APPROVED",
"allocations": [
{
"id": "id",
"invoiceNumber": "string",
"paymentNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"amount": 0,
"appliedFromAdvance": true
}
]
}
}
}

Convert a quote to an invoice:

mutation ConvertQuoteToInvoice($quoteId: ID!) {
convertQuoteToInvoice(quoteId: $quoteId) {
id
invoiceNumber
status
totalAmount
}
}

Variables:

{
"quoteId": "QUOTE_ID"
}

Response:

{
"data": {
"convertQuoteToInvoice": {
"id": "INVOICE_ID",
"invoiceNumber": "INVOICE_NUMBER",
"status": "DRAFT",
"totalAmount": 200
}
}
}
convertQuoteToInvoice(
quoteId: ID!
): Invoice!

Arguments​

convertQuoteToInvoice.quoteId ● ID! non-null scalar​

The ID of the quote to invoice.

Type​

Invoice object​

A sales invoice issued to a customer or a purchase invoice received from a supplier, with its lines, totals, status and settlement.