Endpoints
Each call acts on the mode of the key or dashboard session that makes it.
Who can call
- Any secret key can read the policy and usage, including keys made by a connected site such as the
WooCommerce plugin.
GET /v1/gas-sponsorshipsalso needs thepayments:readscope. PUT /v1/gas-policyneeds a secret key with thesessions:writescope. A connected site’s key gets403: it can read the policy but not change it.- In the dashboard, reading needs
account:read. Changing the policy needssettings:manageand a recent step-up confirmation, because the policy decides how much of your money Tendr may spend. - Publishable keys and shopper sessions are refused.
The policy
USD amounts are decimal strings with at most 6 decimals.
PUT merges the fields you send over the current policy (or the defaults) and validates the result.
Unknown fields are rejected. A cap above the budget returns 400 VALIDATION_ERROR.
default_gas_payer and a session’s gas_payer still decide whether Tendr tries to
sponsor at all. The policy decides whether a particular payment qualifies.
Usage
reserved_usd is held by sponsorships that have not settled yet. spent_usd is settled.
remaining_usd is the monthly budget minus both, never below zero. count is the number of
sponsorships holding budget. The month is a calendar month in UTC.
Budget is reserved when the shopper commits to sign, in one locked update. Two payments that together
would exceed the budget cannot both be sponsored: one is, the other falls back to shopper-pays. The
reservation is released if the payment is never submitted or fails.
Sponsorship records
GET /v1/gas-sponsorships filters: session, payment (the payment’s session), status
(pending, submitted, confirmed, failed), month (YYYY-MM, by creation time), limit
(1 to 100, default 50) and starting_after (a record id).
sponsorismerchantwhen the cost is taken from your payment, ortendrwhen Tendr could not recover it and absorbed the loss. Tendr never charges you later for a loss.methodis one ofeip3009,permit,paymaster,kora,meta_tx,forwarder. A hook call that costs more than its quoted estimate appears withhook; the excess is Tendr’s loss (sponsor: tendr), andhook_payment_idnames the payment whose hook it was. The stored method type also haspaymaster_verifying,paymaster_erc20,energyandfee_payer; no record is written with them today, so you can treat them as reserved.recovered_from_payment_idis the payment whose proceeds paid a sponsored fee (set when its reservation is settled). It is null on every other record, hook shortfalls included.estimate_usdis the quoted cost your payment was charged.cost_usdis the actual cost. Tendr keeps or absorbs the difference. Both are shown on shopper-paid and Tendr-loss records too.reservation_stateisreserved,settledorreleased, or null when nothing was reserved.fee_mode,fee_assetandfee_amountdescribe a shopper-paid fee (fee_amountin base units).- Amounts are strings.
fee_amountandgas_usedare integers.
A sponsored quote paid by copying the address
When you sponsor a quote, the network fee is part of the quote: it comes out of your proceeds through 1Click’s fees on that quote. If the shopper then pays that quote by copying the deposit address and sending from their own wallet (paying the gas themselves), the quote’s fee is still taken from your proceeds and counted against your budget, although Tendr paid no gas. This is a known difference from the design, which says the shopper then simply pays their own fee. It is bounded by your per-payment cap and monthly budget.Why a payment was not sponsored
When you sponsor and a payment falls back to the shopper,network_fee.reason on the session and
payment says why. The checks run in this order and the first failure is reported:
Other reasons are
fee_unavailable (the live fee could not be read, so the shopper’s wallet pays gas
itself) and fee_token_unpriced (the token has no price in the token list, so the token option is not
offered). The shopper sees only a general message.
Events
gas.budget_low: reserved plus spent crossed 80% of the month’s budget. At most once per month and mode.gas.budget_exhausted: a payment was not sponsored because the budget is used up. At most once per month and mode.
mode, month, budget_usd, reserved_usd, spent_usd and remaining_usd;
gas.budget_exhausted also carries requested_usd. See webhooks.
