Skip to main content

Invoices

Invoices drive outgoing billing in Naqood. You can create drafts, send them to customers, record payments, or void them for corrections.

Prerequisites

  • A Naqood API secret or OAuth-issued secret scoped to the target organization
  • The organization slug for every operation
  • A role that grants the Invoices permission set

Invoice fields

Invoice objects returned by the API expose commercial, presentation, and posting metadata.

FieldTypeNotes
idID!Stable identifier for follow-up mutations.
numberInt!Auto-incremented per organization.
statusString!draft, sent, or voided.
paymentStatusStringPayment indicator shown in the UI (unpaid, overdue, paid).
contactIdID!Linked customer.
contactDetailsString!Serialized snapshot of the customer’s bill-to details.
dateDate!Posting date.
dueDateDate!Calculated from paymentTermType + paymentTermDays.
titleStringLarge document heading rendered above the bill-to block.
headerStringSecondary subtitle shown beneath the title, above the line items.
commentStringFreeform body copy displayed between the invoice metadata and the header.
lineItems[JSONObject!]!Array of line breakdowns (see Products & Services).
subtotal / vat / totalStringMonetary amounts in organization currency.
originalSubtotal / originalVat / originalTotalStringAmounts in the original transaction currency.
remainderString!Outstanding balance (negative values mean the customer still owes money).
currencyString!Defaults to the organization currency, override for FX invoices.
exchangeRateStringRequired when currency differs from the base currency.
bankAccountIdID!Settlement account credited when the invoice is paid.
bankAccountBankAccountHelpful when you fetch invoices with related bank data.
pdfBase64Supplied on demand when emailing invoices.
journalEntries[JournalEntry!]Ledger postings created when an invoice is sent or paid.
baseJournalEntryJournalEntryThe primary posting created when the invoice was issued.
createdAt / updatedAtTimestamp!Audit timestamps.

For information about quote-only documents, including how to convert them into invoices, refer to the Quotes guide.

Fetch a single invoice

query Invoice($invoiceID: ID!) {
invoice(invoiceID: $invoiceID) {
id
number
status
date
dueDate
contact {
id
name
}
lineItems
subtotal
vat
total
remainder
currency
paymentStatus
bankAccount {
id
name
}
journalEntries {
id
number
date
}
}
}

List invoices

Use the organization-scoped query with pagination, filters, and ordering:

query Invoices(
$slug: Slug!
$offset: Int
$limit: Int
$orderBy: OrderByInput
$filter: JSONObject
) {
organization(slug: $slug) {
invoices(
offset: $offset
limit: $limit
orderBy: $orderBy
filter: $filter
) {
count
entries {
id
number
status
date
total
remainder
contact {
id
name
}
}
}
}
}

Filters support the standard operators (equalTo, greaterThan, in, and/or, etc.). Apply date ranges, contact IDs, currencies, or statuses as needed.

Create an invoice

mutation CreateInvoice($input: CreateInvoiceInput!) {
createInvoice(input: $input) {
id
number
status
total
}
}

CreateInvoiceInput highlights:

FieldRequiredNotes
slugOrganization issuing the invoice.
contactIdCustomer to bill.
contactDetailsSerialized string stored on the document (typically from the UI).
datePosting date.
paymentTermTypedays, current_month, etc.
paymentTermDaysNumber of days added to calculate the due date.
bankAccountIdDefault receiving account.
lineItemsArray of line item payloads (quantity, unit price, VAT, account IDs).
currencyOptionalDefaults to the org currency. Provide exchangeRate when overriding.
statusOptionalOmit for draft. Set to sent to post immediately after creation.
titleOptionalHero heading shown at the top of the PDF.
headerOptionalSubtitle appearing under the title.
commentOptionalIntroductory paragraph shown before the header and line items.
orgLogoImageId, orgStampImageIdOptionalReuse stored imagery without re-uploading.

Example variables:

{
"input": {
"slug": "acme-co",
"contactId": "d8f59f7d-08b1-4fe6-8ae1-3a3dfd65ac87",
"contactDetails": "Acme Trading LLC\nAccounts Payable",
"date": "2026-01-04",
"paymentTermType": "days",
"paymentTermDays": 30,
"bankAccountId": "b34aa6b1-b527-4d8f-8e7f-66b07f1b6f51",
"status": "draft",
"lineItems": [
{
"type": "item",
"lineItemId": "1e68d9a7-6ce6-403a-887f-5c3ed003e5da",
"quantity": "10",
"unitPrice": "150.00",
"discount": "0",
"vatId": "5ea0cb4a-6bd5-4d59-a859-9eaec4ee2c05"
}
]
}
}

Update an invoice

mutation UpdateInvoice($input: UpdateInvoiceInput!) {
updateInvoice(input: $input) {
id
status
total
updatedAt
}
}
  • Only invoices in draft status can be edited. Sent invoices must be voided and recreated.
  • Provide the id plus any fields to change; omitted fields remain untouched.

Send invoices to customers

mutation SendInvoice($input: SendInvoiceToCustomerInput!) {
sendInvoiceToCustomer(input: $input)
}
FieldRequiredNotes
invoiceIDTarget invoice or quote.
emailsOptionalArray of additional recipients. Defaults to the contact email.

Naqood generates the PDF (including logos/stamps if provided) and emails it to the customer.

Record payments

mutation PayInvoice($input: PayInvoiceInput!) {
payInvoice(input: $input) {
id
remainder
journalEntries {
id
date
}
}
}

PayInvoiceInput fields:

FieldRequiredNotes
invoiceIDInvoice to settle.
amountDecimal string in invoice currency. Partial payments are supported.
accountIDCash or bank account credited for the receipt.
dateOptionalDefaults to today.
commentOptionalNarration stored on the journal entry.
exchangeRate / transactionCurrency / transactionAmountOptionalProvide when payment currency differs from invoice currency.

Each payment generates the necessary journal entries, adjusts remainder, and updates invoice status when fully paid.

Delete or void

mutation DeleteInvoice($invoiceID: ID!) {
deleteInvoice(invoiceID: $invoiceID)
}
  • Drafts and quotes are permanently deleted.
  • Sent invoices cannot be deleted outright; calling deleteInvoice voids their journal entries and marks the document as voided so history remains intact.

Use these flows to keep external billing systems, CPQ tools, or customer portals aligned with the data your finance team sees inside Naqood.