Record an invoice payment

distru-create-invoice-paymentWriteLeafLinkQuickBooks

Records a payment received against an invoice. QuickBooks gets the invoice if it isn't there yet, otherwise the payment when your QuickBooks settings sync payments. LeafLink gets the payment when your LeafLink settings sync payments and the order is linked to LeafLink.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
invoiceIdstringYesResolve via distru-search-invoices.
receivedobjectNoMoney from the customer (cash, check, card, ACH). Omit when paying only with credit.
received.amountstring or numberYesDollars.
received.paymentMethodIdstringYesResolve via distru-search-lookups (type PAYMENT_METHOD).
creditAmountstring or numberNoDollars paid from the customer's active credits the caller can see, oldest first, up to their credit balance. With credit, received.amount + creditAmount must not exceed the invoice's remaining balance.
paymentDatestringNoWhen received. Default now. ISO 8601 with a UTC offset, e.g. "2026-09-01T00:00:00-07:00"; the company timezone is on distru-get-me.
notestringNo
qbDepositAccountstringNoQuickBooks account by full name ("Parent:Child" for a sub-account) or name; an active Bank or Other Current Asset account. Resolve via distru-search-qb-accounts. Default: the company's Sales Deposit Account, rejected when unset or inactive (point the user to Settings → QuickBooks). A name several accounts share is rejected with their full names to choose from. Rejected when the company is not on QuickBooks.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
invoicePaymentobjectAlways
invoicePayment.idstringAlways
invoicePayment.paymentNumberstringAlways
invoicePayment.paymentDatestringAlways
invoicePayment.statusenum
POSTEDVOIDED
Always
invoicePayment.voidedAtstringCan be null
invoicePayment.receivedobjectCan be null
invoicePayment.received.amountstringAlways
invoicePayment.received.paymentMethodobjectCan be null
invoicePayment.received.paymentMethod.idstringAlways
invoicePayment.received.paymentMethod.namestringAlways
invoicePayment.creditAmountstringAlways
invoicePayment.appliedAmountstringAlways
invoicePayment.overpaidAmountstringAlways
invoicePayment.notestringCan be null
invoicePayment.customerobjectCan be null
invoicePayment.customer.idstringAlways
invoicePayment.customer.namestringNull or absent
invoicePayment.invoiceobjectCan be null
invoicePayment.invoice.idstringAlways
invoicePayment.invoice.invoiceNumberstringAlways
invoicePayment.invoice.paymentStatusenum
NOT_PAIDOVER_PAIDPAIDPARTIALLY_PAID
Always
invoicePayment.qbDepositAccountstringCan be null
invoicePayment.qbPaymentIdstringCan be null
invoicePayment.qbSyncStatusenum
DELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED
Can be null
invoicePayment.insertedAtstringAlways
invoicePayment.updatedAtstringAlways
invoicePayment.creditUsesobject[]Always
invoicePayment.creditUses[].amountstringAlways
invoicePayment.creditUses[].appliedAtstringAlways
invoicePayment.creditUses[].creditobjectCan be null
invoicePayment.creditUses[].credit.idstringAlways
invoicePayment.creditUses[].credit.creditNumberstringAlways
invoicePayment.overpaymentCreditsobject[]Always
invoicePayment.overpaymentCredits[].idstringAlways
invoicePayment.overpaymentCredits[].creditNumberstringAlways
invoicePayment.overpaymentCredits[].amountstringAlways
invoicePayment.overpaymentCredits[].statusenum
ACTIVECANCELEDREDEEMED
Always
What the AI reads

Records a payment received against an invoice: money from the customer, customer credit, or both. The applied amount is capped at the invoice's remaining balance; excess money becomes customer credit, returned in overpaymentCredits. Rejected when the invoice is fully paid or voided. A payment can't be edited: void it with distru-void-invoice-payment and create it again. Returns the payment as distru-get-invoice-payment does.