Cancel a customer credit

distru-cancel-creditWriteQuickBooks

Cancels 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.

FieldTypeRequiredDescription
idstringYesResolve via distru-search-credits. Not a QB_PAYMENT credit: it follows its payment's unapplied amount in QuickBooks.
alsoReverseApplicationsbooleanNoAlso 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.

FieldTypePresence
creditobjectAlways
credit.idstringAlways
credit.creditNumberstringAlways
credit.statusenum
ACTIVECANCELEDREDEEMED
Always
credit.sourceenum
INVOICE_PAYMENTQB_CREDIT_MEMOQB_PAYMENTRETURNUSER
Always
credit.amountstringAlways
credit.originalAmountstringAlways
credit.remainingBalancestringAlways
credit.customerobjectCan be null
credit.customer.idstringAlways
credit.customer.namestringNull or absent
credit.ownerobjectCan be null
credit.owner.idstringAlways
credit.owner.profileobjectAlways
credit.owner.profile.fullNamestringAlways
credit.externalNotestringCan be null
credit.internalNotestringCan be null
credit.qbCreditMemoIdstringCan be null
credit.qbPaymentIdstringCan be null
credit.qbSyncStatusenum
DELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED
Can be null
credit.insertedAtstringAlways
credit.updatedAtstringAlways
credit.canceledAtstringCan be null
credit.sourcePaymentobjectCan be null
credit.sourcePayment.idstringAlways
credit.sourcePayment.paymentNumberstringAlways
credit.sourcePayment.invoiceobjectCan be null
credit.sourcePayment.invoice.idstringAlways
credit.sourcePayment.invoice.invoiceNumberstringAlways
credit.sourceReturnobjectCan be null
credit.sourceReturn.idstringAlways
credit.sourceReturn.returnNumberstringAlways
credit.creditUsesobject[]Always
credit.creditUses[].amountstringAlways
credit.creditUses[].appliedAtstringAlways
credit.creditUses[].paymentobjectCan be null
credit.creditUses[].payment.idstringAlways
credit.creditUses[].payment.paymentNumberstringAlways
credit.creditUses[].invoiceobjectCan be null
credit.creditUses[].invoice.idstringAlways
credit.creditUses[].invoice.invoiceNumberstringAlways
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.