Cancel a customer credit
distru-cancel-creditWriteQuickBooksCancels what's left on a customer credit so it can't be spent. Reaches QuickBooks when your settings sync credits and the customer is linked there, unless the credit came from an overpayment.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Resolve via distru-search-credits. Not a QB_PAYMENT credit: it follows its payment's unapplied amount in QuickBooks. |
| alsoReverseApplications | boolean | No | Also remove its uses: each invoice they paid owes that amount again, and a payment left at zero is voided and deleted (distru-search-invoice-payments no longer returns it), releasing any other credit it used. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence |
|---|---|---|
| credit | object | Always |
| credit. | string | Always |
| credit. | string | Always |
| credit. | enumACTIVECANCELEDREDEEMED | Always |
| credit. | enumINVOICE_PAYMENTQB_CREDIT_MEMOQB_PAYMENTRETURNUSER | Always |
| credit. | string | Always |
| credit. | string | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Null or absent |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | object | Always |
| credit. | string | Always |
| credit. | string | Can be null |
| credit. | string | Can be null |
| credit. | string | Can be null |
| credit. | string | Can be null |
| credit. | enumDELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED | Can be null |
| credit. | string | Always |
| credit. | string | Always |
| credit. | string | Can be null |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Always |
| credit. | object[] | Always |
| credit. | string | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Always |
What the AI reads
Cancels a customer credit's remaining balance, so it can no longer be spent; what it already paid stays applied unless alsoReverseApplications is set. An INVOICE_PAYMENT credit can't be canceled: it goes away only by voiding the payment that created it (sourcePayment.id) with distru-void-invoice-payment, which also takes that payment off its invoice and reverses the credit's uses. Rejected when the credit is already canceled, unless reversing its uses. Returns the credit as distru-get-credit does, without line items or history.