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:
- GraphQL
- cURL
mutation ConvertQuoteToInvoice($quoteId: ID!) {
convertQuoteToInvoice(quoteId: $quoteId) {
id
invoiceNumber
supplierCode
supplierDisplayName
supplierName
status
allocations {
id
invoiceNumber
paymentNumber
createdAt
amount
appliedFromAdvance
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ConvertQuoteToInvoice($quoteId: ID!) {\n convertQuoteToInvoice(quoteId: $quoteId) {\n id\n invoiceNumber\n supplierCode\n supplierDisplayName\n supplierName\n status\n allocations {\n id\n invoiceNumber\n paymentNumber\n createdAt\n amount\n appliedFromAdvance\n }\n }\n}",
"variables": {
"quoteId": "id"
}
}
EOF
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:
- GraphQL
- cURL
mutation ConvertQuoteToInvoice($quoteId: ID!) {
convertQuoteToInvoice(quoteId: $quoteId) {
id
invoiceNumber
status
totalAmount
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ConvertQuoteToInvoice($quoteId: ID!) {\n convertQuoteToInvoice(quoteId: $quoteId) {\n id\n invoiceNumber\n status\n totalAmount\n }\n}",
"variables": {
"quoteId": "QUOTE_ID"
}
}
EOF
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.