Search invoice payments
distru-search-invoice-paymentsReadSearches payments received against invoices, one row per payment, without the credits it used or created (use distru-get-invoice-payment for those).
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Default: 10 |
| cursor | string | No | nextCursor of the previous call; keep the other arguments unchanged. |
| appliedAmountMax | string or number | No | Dollars, inclusive. |
| appliedAmountMin | string or number | No | Dollars, inclusive. |
| customerIds | string[] | No | The invoice's customer. Resolve via distru-search-companies. |
| invoiceIds | string[] | No | Resolve via distru-search-invoices. |
| paymentDateAfter | string | No | When received, inclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset. |
| paymentDateBefore | string | No | When received, inclusive. YYYY-MM-DD (end of day, company timezone) or ISO 8601 with a UTC offset. |
| paymentMethodIds | string[] | No | Resolve via distru-search-lookups (type PAYMENT_METHOD). |
| paymentNumber | string | No | Case-insensitive substring. |
| search | string | No | Case-insensitive substring of payment number, note or invoice number, or substring or fuzzy word match on customer name; % and _ are wildcards. Keeps the sortBy order. |
| status | enumALLPOSTEDVOIDED | No | Default POSTED; ALL for both. |
| sortBy | object | No | Default PAYMENT_DATE DESC. |
| sortBy. | enumASCDESC | Yes | |
| sortBy. | enumINSERTED_ATPAYMENT_DATEPAYMENT_NUMBERUPDATED_AT | Yes | PAYMENT_DATE: when received; INSERTED_AT: when recorded; UPDATED_AT: last change, a void included. PAYMENT_NUMBER sorts as text. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence |
|---|---|---|
| hasMore | boolean | Always |
| nextCursor | string | Can be absent |
| totalCount | integer | Can be absent |
| items | object[] | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | enumPOSTEDVOIDED | Always |
| items[]. | string | Can be null |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Null or absent |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | enumNOT_PAIDOVER_PAIDPAIDPARTIALLY_PAID | Always |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | enumDELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
What the AI reads
Searches payments received against invoices, one row per payment, without the credits it used or created (use distru-get-invoice-payment for those). Use for an invoice's payments (invoiceIds), a customer's, or those received in a date range; for invoices and their balances use distru-search-invoices. appliedAmount is what counts toward the invoice's paid amount: received.amount + creditAmount = appliedAmount + overpaidAmount, and overpaidAmount became customer credit. received is null when the payment was made entirely with credit. A VOIDED payment keeps its amounts as recorded, so leave it out of totals. customer and invoice are null when the caller's team can't see them. qbSyncStatus ERROR: distru-search-quickbooks-activities with paymentIds gives the error. ERROR or NOT_SYNCED: distru-sync-to-quickbooks pushes it, or says why it can't.