# Credits (/docs/reseller/your-business/credits)

> Fund a client at a rate you choose, track your margin, and take unused minutes back. Two rates move on every transfer.

You hold a balance. You move minutes from it to a client at a rate you choose, and you
can take unused minutes back. The gap between what you pay and what you charge is your
margin.

Two different amounts move on every transfer: your balance is debited at **your** rate,
and the client is credited at the rate **you set**. A revert is the exact mirror.

<svg viewBox="0 0 780 130" role="img" aria-label="On a transfer the reseller is debited at their own rate while the client is credited at the sell rate. On a revert the client is deducted at their rate and the reseller is refunded at theirs." style={{ maxWidth: '100%', height: 'auto' }}>
  <defs>
    <marker id="rc-a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
      <path d="M0,0 L10,5 L0,10 z" fill="currentColor" stroke="none" />
    </marker>
  </defs>
  <g fill="none" stroke="currentColor" strokeWidth="1.4" fontFamily="ui-monospace, Menlo, monospace" fontSize="12">
    <rect x="20" y="40" width="190" height="46" rx="6" />
    <text x="115" y="68" textAnchor="middle" stroke="none" fill="currentColor">your balance</text>

    <rect x="570" y="40" width="190" height="46" rx="6" />
    <text x="665" y="68" textAnchor="middle" stroke="none" fill="currentColor">the client</text>

    <path d="M210 54 H568" markerEnd="url(#rc-a)" />
    <text x="389" y="44" textAnchor="middle" stroke="none" fill="currentColor" fontSize="10.5">transfer: you pay your rate, they get your sell rate</text>

    <path d="M570 74 H212" markerEnd="url(#rc-a)" />
    <text x="389" y="96" textAnchor="middle" stroke="none" fill="currentColor" fontSize="10.5">revert: they are deducted at their rate, you get yours back</text>
  </g>
</svg>
A revert needs no rate from you: the client is deducted at their current rate,
which is what they were charged, and you are refunded at yours, which is what it cost you.

## Preview a transfer [#preview-a-transfer]

Nothing moves on this call. Use it to confirm the amounts before you commit.

```http
POST /api/v1/reseller/credits/calculate

{ "minutes": 100, "cost_per_min": 0.20 }
```

## Transfer minutes to a client [#transfer-minutes-to-a-client]

Your balance is debited immediately. A `cost_per_min` below your own rate is refused as
a loss.

```http
POST /api/v1/reseller/credits/transfer

{ "to_organization_id": 5678, "minutes": 100, "cost_per_min": 0.20 }
```

## Take unused minutes back [#take-unused-minutes-back]

Pass only how many. No rate: the client is deducted at its current rate, which is what it
was charged, and you are refunded at yours, which is what it cost you.

```http
POST /api/v1/reseller/credits/revert

{ "from_organization_id": 5678, "minutes": 40 }
```

## Read the ledger [#read-the-ledger]

Every move is recorded.

```http
GET /api/v1/reseller/credits/logs
```

  Transfer and revert do not take an idempotency key today. If a request times out, read
  the ledger before you retry, so a recovered response does not double the move.