/api/qmail/local/inbox-fee
GETLook up the inbox fee stored for a contact by serial number. Local database only — does not contact RAIDA. Handler: api_handle_qmail_inbox_fee.
Description
Returns the contact record’s configured inbox_fee for the given serial number. The amount is emitted as an exact decimal CloudCoin number (microunit-backed; representation supports 0.0001 CC granularity). Beacons and local compose UIs use this value when deciding how large an inbox-fee locker to fund for Tell.
This endpoint is not a full send-cost calculator. It does not estimate storage fees, accept file lists, or accept recipient address lists. Storage-fee preflight (size-based formula, files= / stripe_bytes, estimated_server_count) lives on /api/qmail/local/can-send (api_handle_qmail_can_send), not here.
Inbox fee (this endpoint): per-recipient Tell payment from the contact/DRD record (or client default when composing). Decimal CC — often a whole amount such as 10, but fractions are valid.
Storage fee (upload path / can-send estimate): interim pricing is 0.01 CC per MiB of per-server stripe data, always ceil to the next 0.01 CC, free under the welfare allowance (default 1 MiB). Example: 2.5 MiB per server → 0.03 CC per server. See Upload payment & pricing.
The old flat rule “1 CC per server per file + 10 CC per recipient” is obsolete and must not be used for estimates.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
sn |
integer | Yes | Contact serial number (must be > 0). Looked up in the local QMail contacts database. |
Legacy alias: /api/qmail/inbox-fee hits the same handler (used by some raidax beacon paths).
Response
{
"command": "inbox-fee",
"success": true,
"request_id": "…",
"sn": 16777216,
"denomination": 0,
"inbox_fee": 10
}| Field | Type | Description |
|---|---|---|
command | string | Always "inbox-fee". |
success | bool | true when the contact was found. |
request_id | string | Correlation id for logs. |
sn | integer | Serial number from the contact record. |
denomination | integer | Contact address denomination. |
inbox_fee | number | Exact decimal CC amount (e.g. 10, 0.5, 0.0001). From the contact row; not recomputed by this handler. |
Fractional example (contact override):
{
"command": "inbox-fee",
"success": true,
"request_id": "…",
"sn": 2841,
"denomination": 1,
"inbox_fee": 0.25
}Errors
| HTTP | Message |
|---|---|
| 400 | Missing required parameter: sn |
| 400 | Invalid sn parameter |
| 404 | Contact not found |
| 500 | QMail database not available / Database error |
Example
curl "http://localhost:8081/api/qmail/local/inbox-fee?sn=16777216"Related
- /api/qmail/local/can-send — preflight funding check; optional
files=/stripe_bytesfor storage-fee estimate via the D6 formula; returnsestimated_server_count, decimalrequired_inbox_fee,wallet_required, etc. - /api/qmail/local/locker-pool/status — upload/inbox locker counts and wallet balance.
- CMD 70 payment & pricing — storage fee formula, welfare, claim-by-download.