> ## Documentation Index
> Fetch the complete documentation index at: https://hacktronai-changelog-e1a164be.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Credits and billing

> Understand Whitebox Scan credits, estimates, purchases, deductions, and refunds.

Whitebox Scans use shared organization credits. A scan must have a completed or
partial cost estimate with credits before it can start, and the organization
needs enough credits for that estimate.

<Info>
  Whitebox Scan credits are organization-wide. They are separate from Code
  Review seats, trials, and pooled PR/MR review limits.
</Info>

## How credits work

<Steps>
  <Step title="Estimate first">
    Hacktron estimates the credit cost from the selected repositories and scope.
    Estimation does not deduct credits.
  </Step>

  <Step title="Start with enough balance">
    Starting the scan deducts the estimated credits from the organization's
    Whitebox Scan credit balance. Internal unlimited organizations show
    unlimited credits and are not charged.
  </Step>

  <Step title="Track usage">
    Billing shows the current balance. Credit transaction history records
    purchases, scan deductions, and refunds.
  </Step>
</Steps>

## Buy credits

Organization owners can buy Whitebox Scan credits. If a member reaches checkout
without enough credits, Hacktron asks them to contact an owner to top up the
balance.

Owners need a saved payment method before purchasing credits. If there is no
payment method on file, the checkout flow prompts the owner to add one first,
then opens the credit purchase modal.

Organization owners can buy credits from **Billing** or from the Whitebox Scan
checkout step when the organization does not have enough credits.

<Steps>
  <Step title="Open Billing">
    Go to **Billing** in the Hacktron dashboard and find the Whitebox Scan
    credit balance.
  </Step>

  <Step title="Add a payment method">
    If the organization does not have a payment method, add one before buying
    credits.
  </Step>

  <Step title="Choose an amount">
    Use **Buy credits** to select the credit amount and review the checkout
    price.
  </Step>

  <Step title="Complete checkout">
    Complete any required card authentication. Hacktron adds the purchased
    credits to the organization balance after checkout succeeds.
  </Step>
</Steps>

Credit purchases are idempotent and can require 3D Secure or another card
authentication step. If payment succeeds but credits are not applied, contact
support before retrying the purchase.

## Insufficient credits

If the organization does not have enough credits for the estimate, the scan
will not start.

To continue:

1. Reduce the scope and run a new cost estimate.
2. Buy enough credits from **Billing**.
3. Start the scan again after the balance covers the estimate.

API callers receive `402 Payment Required` when a scan cannot start because the
organization has insufficient Whitebox Scan credits.

<Tip>
  The API does not buy credits automatically. Handle `402` by directing an
  organization owner to Billing, then retry `POST /scans` after the balance is
  updated.
</Tip>

## Refunds and cancellations

If a started scan cannot launch successfully after credits are deducted,
Hacktron attempts to refund those credits automatically. Failed and stopped
scans can show refunded credits in the scan details and transaction history.

For Stripe purchase refunds, Hacktron applies the matching credit clawback to
the organization balance. If the refunded credits have already been spent, the
balance can become negative until the organization tops up again.

## Related docs

<Columns cols={2}>
  <Card title="Trigger a Whitebox Scan" icon="shield-halved" href="/api-reference/scans/create-scan">
    Start Whitebox Scans from the REST API and handle insufficient-credit errors.
  </Card>
</Columns>
