## List Entries `client.v1.creditGrants.listEntries(CreditGrantListEntriesParamsparams?, RequestOptionsoptions?): CreditGrantListEntriesResponse` **post** `/v1/credits/listEntries` Fetches a list of credit ledger entries. Returns lists of ledgers per customer. Ledger entries are returned in chronological order. Ledger entries associated with voided credit grants are not included. ### Parameters - **params:** `CreditGrantListEntriesParams` - **next\_page:** `string` Query param: Cursor that indicates where the next page of results should start. - **sort:** `"asc" | "desc"` Query param: Ledgers sort order by date, asc or desc. Defaults to asc. - `"asc"` - `"desc"` - **credit\_type\_ids:** `Array` Body param: A list of Metronome credit type IDs to fetch ledger entries for. If absent, ledger entries for all credit types will be returned. - **customer\_ids:** `Array` Body param: A list of Metronome customer IDs to fetch ledger entries for. If absent, ledger entries for all customers will be returned. - **ending\_before:** `string` Body param: If supplied, ledger entries will only be returned with an effective_at before this time. This timestamp must not be in the future. If no timestamp is supplied, all entries up to the start of the customer's next billing period will be returned. - **starting\_on:** `string` Body param: If supplied, only ledger entries effective at or after this time will be returned. ### Returns - `CreditGrantListEntriesResponse` - **data:** `Array` - **customer\_id:** `string` - **ledgers:** `Array` - **credit\_type:** `CreditTypeData` - **ending\_balance:** `EndingBalance` the effective balances at the end of the specified time window - **effective\_at:** `string` the ending_before request parameter (if supplied) or the current billing period's end date - **excluding\_pending:** `number` the ending balance, including the balance of all grants that have not expired before the effective_at date and deductions that happened before the effective_at date - **including\_pending:** `number` the excluding_pending balance plus any pending invoice deductions and expirations that will happen by the effective_at date - **entries:** `Array` - **amount:** `number` an amount representing the change to the customer's credit balance - **created\_by:** `string` - **credit\_grant\_id:** `string` the credit grant this entry is related to - **effective\_at:** `string` - **reason:** `string` - **running\_balance:** `number` the running balance for this credit type at the time of the ledger entry, including all preceding charges - **invoice\_id:** `string | null` if this entry is a deduction, the Metronome ID of the invoice where the credit deduction was consumed; if this entry is a grant, the Metronome ID of the invoice where the grant's paid_amount was charged - **pending\_entries:** `Array` - **amount:** `number` an amount representing the change to the customer's credit balance - **created\_by:** `string` - **credit\_grant\_id:** `string` the credit grant this entry is related to - **effective\_at:** `string` - **reason:** `string` - **running\_balance:** `number` the running balance for this credit type at the time of the ledger entry, including all preceding charges - **invoice\_id:** `string | null` if this entry is a deduction, the Metronome ID of the invoice where the credit deduction was consumed; if this entry is a grant, the Metronome ID of the invoice where the grant's paid_amount was charged - **starting\_balance:** `StartingBalance` - **effective\_at:** `string` the starting_on request parameter (if supplied) or the first credit grant's effective_at date - **excluding\_pending:** `number` the starting balance, including all posted grants, deductions, and expirations that happened at or before the effective_at timestamp - **including\_pending:** `number` the excluding_pending balance plus any pending activity that has not been posted at the time of the query - **next\_page:** `string | null` ### Example ```node import Metronome from '@metronome/sdk'; const client = new Metronome({ bearerToken: 'My Bearer Token', }); const response = await client.v1.creditGrants.listEntries({ credit_type_ids: ['2714e483-4ff1-48e4-9e25-ac732e8f24f2'], customer_ids: ['6a37bb88-8538-48c5-b37b-a41c836328bd'], ending_before: '2021-02-01T00:00:00Z', starting_on: '2021-01-01T00:00:00Z', }); console.log(response.data); ```