Agent sells credits to Shop using cash
Agent receives cash (or another offline payment method) from a Shop, then issues credits to that Shop's CDN wallet.
Basic flow:
Agent collects payment → record full details → issue credits to Shop → save reconciliation ledger
Who does what
| Role | Action |
|---|---|
| Agent | Create credit sale transaction, enter payment details, confirm status |
| Shop | Pays per agreement; receives credits in wallet |
| System | Debits Agent credits, credits Shop, calculates amount due, writes ledger, stores audit |
Required information when selling
When Agent sells credits to a Shop, the form must include all items below before submit.
1. Counterparty & quantity
| Field | Required | Description |
|---|---|---|
| Shop | ✅ | Shop receiving credits (select from Agent's shop list) |
| Credits sold | ✅ | Credits issued to Shop CDN wallet (positive number, > 0) |
| Cost rate | ✅ (display) | Shop (buyer) cost rate at time of sale — used to calculate amount due |
| Amount due | ✅ (auto-calculated) | Credits sold × Cost rate — Agent confirms before saving |
2. Payment & receipt method
| Field | Required | Description |
|---|---|---|
| Actual amount received | ✅ | Amount Agent actually received (USD). Default = amount due |
| Receipt method | ✅ | How Shop paid — e.g. Cash, Bank transfer, Check, Other |
| Payment received at | ✅ | When Agent confirmed payment received (default = now; editable if entered late) |
| Currency | ✅ | Default USD |
3. Status
| Status | Meaning | When to use |
|---|---|---|
| Paid in full — credits issued | Full payment received, credits in Shop wallet | Standard flow: collect payment before issuing credits |
| Pending payment — credits issued | Credits issued but payment not yet received / not fully received | Only with temporary credit policy — requires separate approval |
| Partially paid | Partial payment received | Record Amount received + Remaining |
| Cancelled | Transaction cancelled, no credits issued (or credits reversed) | Wrong entry, refund, etc. |
Default recommendation: Safest flow is to allow submit only when status = Paid in full — credits issued. Other statuses are optional if receivables management is needed later.
4. Reference (optional)
| Field | Required | Description |
|---|---|---|
| External reference | Recommended | Internal receipt number, transfer reference, payment voucher number |
| Note | Recommended | Short additional description (if needed) |
Recommended additions
| Field | Reason |
|---|---|
| Performed by (Agent) | Audit — who created the transaction (from session) |
| Linked credit transaction | Reference to Agent debit / Shop credit ledger entry after issuance |
Business rules
- Cost rate is snapshotted for Shop (buyer) at time of sale — not updated if Shop changes rate later.
- Amount due =
Credits sold × Cost rateof the Shop buyer. - Agent must have sufficient credits in CDN wallet before issuing to Shop.
- Issuing credits does not change Shop's online USD wallet — this records cash / offline payment collected by Agent.
- Any status or amount change after creation must have an audit log (who, when, from value → to value).
Example
Shop Shop-Gamma under Agent Agent-Beta, Shop cost rate 80% (0.80).
| Item | Value |
|---|---|
| Credits sold | 2,000 credits |
| Amount due | 2,000 × 0.80 = $1,600 |
| Receipt method | Cash |
| Actual amount received | $1,600 |
| Status | Paid in full — credits issued |
| External reference | PT-AG-2026-0156 |
| Note | June 2026 transaction |
After submit: Shop CDN wallet +2,000 credits; Agent CDN wallet −2,000 credits; cash settlement ledger records Agent received $1,600 from Shop-Gamma.
Related
- Previous flow: Super Agent → Agent
- Chain start: Admin → Super Agent