Billing & Treasury API
Read the account service balance and create treasury top-ups.
These account-wide Dashboard endpoints require a merchant JWT. They are not project-scoped customer payment APIs.
| Method | Path | Purpose |
|---|---|---|
GET | /billing/me | Balance, fee rate, monthly volume, and account status |
GET | /billing/ledger?page=1&limit=20 | Paginated append-only balance history |
POST | /treasury/deposits | Create an exact-amount top-up intent |
GET | /treasury/deposits | List top-up intents |
GET | /treasury/deposits/:id | Read one intent |
POST | /treasury/deposits/:id/cancel | Cancel a PENDING intent |
Money fields are decimal strings. Discover currently available funding routes from the treasury collection of GET /assets/routes; a merchant receiving wallet is not a funding route. Do not hardcode a network or use the customer checkout's merchant routes for top-ups.
Create with { assetId, amount, idempotencyKey }. Persist the key and immutable body before sending the request. An uncertain response must be retried with the same body and key, rather than creating a second intent. An idempotent replay can recover an existing intent even if that route is no longer available for new deposits. A successful create response need not include the asset relation: obtain the owned deposit through GET /treasury/deposits/:id before displaying payment instructions. Every read requires the owner's merchant JWT; an invoice ID is not an access credential.
The returned address and permanently reserved expectedAmount are the payment instructions. Send the exact amount once in the specified asset and network before expiresAt. New attribution-version-3 intents credit the nominal requestedAmount; the unique adjustment is used for on-chain attribution. creditedAmount records the received transfer amount and can differ from the balance credit. Historical version-2 deposits retain their original actual-received credit behavior. Do not recalculate historical credits using the new rule.
The create flow selects one immutable route. It is not a multi-route hosted payment session: changing a selector after issuance must not rewrite the address, amount or asset. EXPIRED removes instructions to send another transfer; a transfer included in time may still complete confirmation and produce CREDITED. CANCELLED does not automatically credit. Incorrect or late transfers require support review; a successful lookup alone is not manual settlement or a refund.
Effective balance and rate fields
GET /billing/me returns decimal strings commissionBalance (B), commissionCreditLimit (C), remainingCommission (B+C), commissionDebt, plus creditRevision, status, tierRate, monthlyVolumeUsd, rollingVolumeUsd, billingPolicy (WEEKLY_V2 or LEGACY_V1), activationAt, period, and recognitionPolicy: "FEE_POSTING_TIME". Period includes startAt/endAt/windowStartAt/windowEndAt/volumeUsd; it is null without an active weekly period. tierRate can reflect an individually assigned tariff. Monthly volume is not the fixed period basis.
GET /billing/notifications and PUT /billing/notifications manage account-wide reminders. PUT accepts { "enabled": true, "thresholdUsd": "5" }; threshold is a positive decimal string up to 18 fractional digits and $1,000,000. Notification preferences do not alter B+C admission. Referral rewards have their own ledger at /referrals, separate from service-balance history.