Payments
Auto-topup rule and quiver state
/v1/balance/auto-topupResponses
threshold_usdstring(required)max_per_monthinteger(required)suspendedboolean(required)consecutive_failuresinteger(required)quiverobject(required)ready_value_usdstring(required)used_this_monthinteger(required)arrowsobject[](required)
Example
curl -X GET https://api.cofferline.com/v1/balance/auto-topup \ -H "authorization: Bearer $TOKEN"
Configure auto-topup: a threshold plus pre-signed authorizations
/v1/balance/auto-topupEach authorization is a fixed-value EIP-3009 transferWithAuthorization to the treasury with a unique nonce — signed by the payer wallet, settleable exactly once, cancellable on-chain by the payer at any time. When a fee debit drops the balance below the threshold, the platform settles the oldest ready authorization and credits the balance. PUT replaces the rule (and re-arms a suspended one) and ADDS the given authorizations to the quiver; already-known nonces are skipped.
Request body
threshold_usdstring(required)max_per_monthintegerauthorizationsobject[](required)
Responses
Example
curl -X PUT https://api.cofferline.com/v1/balance/auto-topup \
-H "authorization: Bearer $TOKEN" \
-H "content-type: application/json" \
-d '{"threshold_usd":"…","authorizations":[{"from":"…","to":"…","value":"…","valid_after":"…","valid_before":"…","nonce":"…","signature":"…"}]}'
Remove the auto-topup rule and its unsettled authorizations
/v1/balance/auto-topupDeletes the rule and every stored authorization. Settled credits stay on the ledger. Deleting here does not revoke the signatures cryptographically — the response's cancellation block carries everything the payer needs to void each outstanding nonce on-chain (sign CancelAuthorization over the given domain; anyone may submit).
Responses
removed_authorizationsinteger(required)notestring(required)cancellationobject(required)
Example
curl -X DELETE https://api.cofferline.com/v1/balance/auto-topup \ -H "authorization: Bearer $TOKEN"
Prepaid balance (Σ settled credits − Σ fee debits)
/v1/balanceResponses
balance_usdstring(required)currency"USD"(required)
Example
curl -X GET https://api.cofferline.com/v1/balance \ -H "authorization: Bearer $TOKEN"
Top up the prepaid balance via x402 (USDC, EIP-3009)
/v1/balance/topupWithout an X-PAYMENT header this answers 402 with exact-scheme payment requirements for the requested amount. Retry with the signed transferWithAuthorization: it settles on-chain first (real USDC to the treasury), then credits — the authorization nonce guarantees a retry can never double-credit. A durable pending-settlement record exists before anything is broadcast, so an interrupted request converges on exactly one credit (202 = outcome pending, reconciled from chain truth).
Request body
amount_usdstring(required)
Responses
settlement_status"pending"(required)noncestring(required)value_usdstring(required)remediationstring(required)
Example
curl -X POST https://api.cofferline.com/v1/balance/topup \
-H "authorization: Bearer $TOKEN" \
-H "content-type: application/json" \
-d '{"amount_usd":"…"}'