Get a customer credit
distru-get-creditReadGets one customer credit by ID, with where it came from (sourcePayment or sourceReturn) and where it was applied (creditUses); line items and history are opt-in.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Resolve via distru-search-credits. |
| includeCreditActivities | boolean | No | History, oldest first. creditUse is set on a CREDIT_USED or CREDIT_USE_DELETED entry: what was applied or released. _IN_QBO types came from QuickBooks. |
| includeCreditItems | boolean | No | Line items, each product line followed by its tax lines; tax is set only on a tax line. price is per unit. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence |
|---|---|---|
| credit | object | Can be null |
| 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 |
| credit. | object[] | Can be absent |
| credit. | string | Always |
| credit. | string | Always |
| credit. | string | Can be null |
| 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 |
| credit. | object[] | Can be absent |
| credit. | enumCREDIT_CANCELEDCREDIT_CANCELED_IN_QBOCREDIT_CREATEDCREDIT_CREATED_IN_QBOCREDIT_DELETEDCREDIT_DELETED_IN_QBOCREDIT_EDITEDCREDIT_EDITED_IN_QBOCREDIT_USE_DELETEDCREDIT_USE_DELETED_IN_QBOCREDIT_USEDCREDIT_USED_IN_QBO | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | object | Always |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | object | Can be null |
| credit. | string | Always |
| credit. | string | Always |
What the AI reads
Gets one customer credit by ID, with where it came from (sourcePayment or sourceReturn) and where it was applied (creditUses); line items and history are opt-in. To browse or filter credits use distru-search-credits. amount is the current face value, originalAmount the value at issue. remainingBalance is amount minus the credit already applied; a CANCELED credit keeps its balance but can't be spent, so leave CANCELED credits out of what a customer has available. INVOICE_PAYMENT and QB_PAYMENT credits are a payment's overpayment. customer is null when the caller's team can't see it. qbSyncStatus ERROR: distru-search-quickbooks-activities with creditIds gives the error. ERROR or NOT_SYNCED: distru-sync-to-quickbooks pushes it, or says why it can't. creditUses lists live uses only, oldest first: a use released by a void, a reversing cancel or a QuickBooks change is left out, and creditActivities records it. sourcePayment is null once its invoice is deleted or hidden from the caller's team, and sourceReturn once the return is removed or hidden; a credit use's payment and invoice are null when the team can't see that invoice. Null if no credit matches the ID; a permission error if the caller can't view it.