Magidoc

FygaroTopupAllowance
Object

How much of today's card top-up allowance this account has left. Does not authorise anything, so it is safe to call while the customer is still choosing an amount. Render all of them: remaining is the cap less BOTH spent and held, so without those two the gap cannot be explained. Floored at zero, so it can be LARGER than limit - spent - held when the cap has been exceeded — via a hand-credit, or via spend recorded before a limit change. The largest amount that would actually go through is min(remaining, singlePaymentLimit), and anything below minimum is refused.

Fields

#

held

Non-null

Card top-up links this account has open but has not paid. NOT spent — nothing has been charged — but not available either, because paying one would charge it. The common case is a customer who minted a link and closed the page, so this is usually the whole difference between limit - spent and remaining.

holdsExpireAt

When the SOONEST unpaid checkout link expires and its hold on the allowance lifts by itself. Null when held is zero. This is the answer to 'why is $65 left when I have spent nothing, and when do I get the rest back?'.

limit

Non-null

The account level's rolling 24-hour cap.

minimum

Non-null

The smallest top-up that will be accepted. Enforced before the charge, so a client that does not render it can only discover it by being refused.

remaining

Non-null

What would still be accepted right now AGAINST THE DAILY CAP: the cap less BOTH spent and held. Unpaid checkout links are already subtracted, exactly as the pre-charge check subtracts them, so this is what a new top-up is measured against — not limit - spent. Never negative. NOT the largest payable amount on its own: singlePaymentLimit is a separate ceiling and is deliberately not folded in here, or this number would stop meaning 'daily headroom' and resetsAt would stop describing it.

resetsAt

When the oldest counted PAYMENT ages out and the allowance it spent returns. Covers settled spend only — a hold is not a payment and never moves this. Null when no payment is counted, even if held is non-zero; see holdsExpireAt.

singlePaymentLimit

Non-null

The most that can be charged in ONE top-up, whatever the daily headroom. A separate gate from the cap, so an account with $500 remaining and a $200 single-payment limit can only pay $200 at a time — offering the $500 gets the charge refused. Take min(remaining, singlePaymentLimit) as the maximum.

spent

Non-null

Gross charged in the trailing 24 hours. Payments we captured but did not credit are excluded — they delivered nothing, so they do not spend the allowance.

Usages

#

References

#