# Cashback

Every product line carries a cashback rate you set (`cashback_rate` in basis points). The pot for a line is:

```
pot = unit_price x qty x cashback_rate / 10000
```

Cashback is **funded by the merchant** — it comes out of your side of the transaction, and the MDR is computed on the total minus tax and cashback.

## Who earns what

- **Recommender — at capture.** When a line matches a shopper's buy-list entry, the recommender earns their share the moment you capture.
- **Buyer — when they recommend.** The buyer's share is deferred. It is paid when the buyer recommends the product they bought:
  - purchase was attributed: they earn their share of the pot (the rest of the split),
  - purchase had no recommendation: they earn **100% of the pot**.

The split is a platform default (50/50 recommender/buyer) with per-country bounds, overridable per merchant by the platform team.

## Cashback lifecycle

- Cashback stays **pending** for 30 days, then lands in the user's wallet.
- Refunds reduce pending cashback; cashback that has already landed is never clawed back.

## Summary

`GET /orgs/{id}/cashback/summary` (session or API key) returns one entry per currency — never summed across currencies.

```json
{
  "currencies": [
    {
      "currency": "USD",
      "captured_count": 128,
      "captured_minor": 1240000,
      "funded_minor": 62000,
      "social_count": 41,
      "to_buyers_minor": 21000,
      "to_recommenders_minor": 10000
    }
  ]
}
```

| Field | Meaning |
| --- | --- |
| `captured_minor` | Gross volume captured |
| `funded_minor` | Cashback funded by the merchant |
| `social_count` | Captures with at least one recommender |
| `to_buyers_minor` | Cashback earned by buyers (recommendation bounties) |
| `to_recommenders_minor` | Cashback earned by recommenders |
