> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequencehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Consuming credits

When a customer is billed, Sequence automatically uses any available credits to offset the total.

![Draw down credits](https://mintcdn.com/sequence/mG-N6nCfQdxFJGM7/images/product/credits/credits_4.png?fit=max\&auto=format\&n=mG-N6nCfQdxFJGM7\&q=85\&s=b0b326e00874beb407f79069e71181a1)

Available credits are automatically applied to offset charges

The billing engine uses metric credits ahead of cash credits. So when calculating charges for any usage-based products, Sequence will look for any eligible credits associated with the metric for said usage based product. If any are found, they will create a Line Item to offset the default cost of the product.

After assessing all products, any available Cash Credits will be applied to reduce the remaining costs.

In both cases, Sequence draws down from whichever grant would forfeit its balance soonest, so credit is never left to lapse when a later-expiring grant could have been used instead:

1. **Soonest effective expiry date first**: for a grant that refreshes and doesn't roll over, this is the end of its current refresh period rather than its expiry date, since that's when its remaining balance is actually lost
2. **Oldest grant**, as a tie-break
3. **A grant with nothing to lose** (no refresh boundary and no expiry) is drawn from last

Customer's credit balances are deducted when an invoice is created. If the invoice is subsequently voided, any credits used in the voided invoice will be added back to the credit balance.

See [Credit-based billing](https://docs.sequencehq.com/billing/credit-based-billing.md) for how applied and expected credit are itemized on an invoice.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.