Check wallet access
Whether the customer’s prepaid credit in a currency or credit unit still covers them, net of
usage not invoiced yet. Denies only when the wallet blocks usage once its credit is used up;
otherwise access stays allowed and exhausted signals the empty balance on its own. With
subscription_id, only the credit that subscription can use counts: pass it when the
customer has several subscriptions, since one subscription’s credit cannot pay another’s
usage. The balance follows usage within a few seconds near zero or a threshold, within a
minute otherwise, and the answer is cached for one second: use it to gate consumption, not
to bill.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Customer ID or alias
Query Parameters
Defaults to the customer's currency.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNH, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL "EUR"
Checks the wallet of this credit unit (its code) instead of a currency.
Checks only the credit that can pay for this product: credit not restricted to products, and credit restricted to it. Absent checks all credit.
"prd_7n42DGM5Tflk9n8mt7Fhc7"
Checks only the credit this subscription (sub_…) can spend, net of its own usage no
credit pays: the credit that belongs to it and the customer's credit that belongs to no
subscription, once every subscription's unbilled usage is paid. has_access is then the
decision the access gate makes for that subscription's usage. Absent checks the
customer's credit as a whole.
"sub_7n42DGM5Tflk9n8mt7Fhc7"
Response
Whether the customer still has credit
Whether a customer may keep consuming what their prepaid credit pays for.
When balance was computed.
The balance: credit on account net of the usage not invoiced yet that it will pay, in
minor units of currency or credit_unit; never negative for the customer as a whole,
as balance of GET /wallets. With product_id, only the credit that can pay for that
product, net of its usage no credit covers. With subscription_id, only the credit that
subscription can spend (credit restricted to products it is not charged for left out),
net of its usage no credit covers; credit that belongs to no subscription counts in every
subscription's balance (see shared_balance).
Always false: balance may lag usage by a few seconds (see as_of), and the answer is
cached for one second.
True once balance is at or below zero, or, with subscription_id, once no credit is
left for some of its usage. Independent of has_access: a wallet that allows overage
still reports this, so the caller can warn without refusing.
False only once balance is at or below zero and blocks_when_exhausted is true.
Customers without a wallet in currency do not prepay, and always have access. With
subscription_id: false when blocks_when_exhausted is true and no credit that
subscription can spend is left for some of its usage (of product_id when given), as the
access gate refuses it; a subscription charged no usage in the wallet keeps access.
Age of balance, in milliseconds.
Whether usage is refused as soon as the credit is used up: the wallet's usage_at_zero,
else the plan of the subscription checked (of any active subscription without one). A plan
that invoices usage up to a cap refuses it past the cap only, as has_access reports.
The credit unit (its code) checked; absent for a currency.
Decimal places of credit_unit: balance is in integers of 10^-precision credit.
x >= 0Absent when a credit unit was checked.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNH, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL "EUR"
With subscription_id only: the part of balance that belongs to no subscription, which
the customer's other subscriptions can spend too.