Search purchase payments
distru-search-purchase-paymentsReadSearches payments made to suppliers against purchase orders, one row per payment, with the purchase's payment status, paid amount and total.
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. |
| amountMax | string or number | No | Dollars, inclusive. |
| amountMin | string or number | No | Dollars, inclusive. |
| paymentDateAfter | string | No | When paid, inclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset. |
| paymentDateBefore | string | No | When paid, 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. |
| purchaseIds | string[] | No | Resolve via distru-search-purchase-orders. |
| search | string | No | Case-insensitive substring of payment number, note or purchase number, or substring or fuzzy word match on supplier name; % and _ are wildcards. Keeps the sortBy order. |
| status | enumALLPOSTEDVOIDED | No | Default POSTED; ALL for both. |
| supplierIds | string[] | No | The purchase's supplier. Resolve via distru-search-companies. |
| sortBy | object | No | Default PAYMENT_DATE DESC. |
| sortBy. | enumASCDESC | Yes | |
| sortBy. | enumINSERTED_ATPAYMENT_DATEPAYMENT_NUMBERUPDATED_AT | Yes | PAYMENT_DATE: when paid; 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 | Description |
|---|---|---|---|
| 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 | VOIDED payments no longer count toward paid. |
| items[]. | string | Can be null | |
| items[]. | string | Always | Dollars, as recorded; a void leaves it unchanged. |
| items[]. | object | Can be null | Null once the method is deleted. |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Can be null | |
| items[]. | string | Can be null | Full name of the QuickBooks Bank or Credit Card account the payment was made from. Null when it has none or the account is not in the QuickBooks cache. |
| items[]. | string | Can be null | Its QuickBooks bill payment ID. |
| items[]. | enumDELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED | Can be null | Null unless the company's QuickBooks module is on and connected. PENDING and ERROR are its latest sync's outcome and win over the rest. A payment syncs only once its purchase has a QuickBooks bill and purchase payment sync is on, so NOT_SYNCED is normal before that. |
| items[]. | string | Always | |
| items[]. | string | Always | Also moves on a void. |
| items[]. | object | Can be null | Null when the caller's team can't see the purchase. |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | enumNOT_PAIDOVER_PAIDPAIDPARTIALLY_PAID | Always | |
| items[]. | string | Always | Sum of its non-voided payments. |
| items[]. | string | Always | |
| items[]. | object | Can be null | Null when the caller's team can't see it. |
| items[]. | string | Always | |
| items[]. | string | Null or absent |
What the AI reads
Searches payments made to suppliers against purchase orders, one row per payment, with the purchase's payment status, paid amount and total. Use for a supplier's payments, those made in a date range, or one purchase's (purchaseIds); for purchase orders and their balances use distru-search-purchase-orders. Needs permission to view payments; a purchase's own payments are also on distru-get-purchase-order (includePayments), which needs only purchase view. A VOIDED payment keeps its amount as recorded but no longer counts toward the purchase's paid. purchase and supplier are null when the caller's team can't see them. qbBillPaymentId is its QuickBooks bill payment ID; qbPaymentAccount is the full name of the QuickBooks account it was paid from. qbSyncStatus is null unless the company's QuickBooks module is on and connected; PENDING and ERROR are its latest sync's outcome and win over the rest; DELETED_IN_QBO = the bill payment was deleted in QuickBooks; NOT_SYNCED = it isn't in QuickBooks, which is normal until its purchase has a QuickBooks bill and purchase payment sync is on. For why a sync failed, use distru-search-quickbooks-activities with purchaseOrderIds (its purchase.id).