Skip to main content
The gas policy decides when Tendr pays the network fee for your shoppers. There is one policy per mode (test and live). See gasless payments for how sponsorship works.

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-sponsorships also needs the payments:read scope.
  • PUT /v1/gas-policy needs a secret key with the sessions:write scope. A connected site’s key gets 403: it can read the policy but not change it.
  • In the dashboard, reading needs account:read. Changing the policy needs settings:manage and 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.
Every change is recorded in the audit log with who made it and the policy before and after. The store’s 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).
  • sponsor is merchant when the cost is taken from your payment, or tendr when Tendr could not recover it and absorbed the loss. Tendr never charges you later for a loss.
  • method is one of eip3009, permit, paymaster, kora, meta_tx, forwarder. A hook call that costs more than its quoted estimate appears with hook; the excess is Tendr’s loss (sponsor: tendr), and hook_payment_id names the payment whose hook it was. The stored method type also has paymaster_verifying, paymaster_erc20, energy and fee_payer; no record is written with them today, so you can treat them as reserved.
  • recovered_from_payment_id is 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_usd is the quoted cost your payment was charged. cost_usd is the actual cost. Tendr keeps or absorbs the difference. Both are shown on shopper-paid and Tendr-loss records too.
  • reservation_state is reserved, settled or released, or null when nothing was reserved.
  • fee_mode, fee_asset and fee_amount describe a shopper-paid fee (fee_amount in base units).
  • Amounts are strings. fee_amount and gas_used are 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.
Both carry mode, month, budget_usd, reserved_usd, spent_usd and remaining_usd; gas.budget_exhausted also carries requested_usd. See webhooks.