Subscriptions

Carry a signed allowance change onto the chain

For a customer who holds no native currency. They signed two things - the allowance change and a bounded fee for the transaction that carries it - and P2Flux sends one call that does both. A change that cannot execute returns the fee, so nobody is charged for something that did not happen.

allowance_units of "0" REMOVES the allowance, which stops collection. That is not a revocation of the recurring authorization: only the payer's own transaction to the recurring contract does that, and the two must be described separately to customers.

No gas-service fee is added here. A subscription already pays a fixed network fee on every collection.

post/v1/allowances/restore/submit

Request

  • Base URL: https://api.p2flux.com
  • URL: https://api.p2flux.com/v1/allowances/restore/submit
  • Auth: none required

Request body

approve_tokenstring required
quotestring required
permit_signaturestring required
network_fee_signaturestring required
allowance_units'0'

Only "0" is accepted, and it REMOVES the allowance (stops collection - not a revocation of the recurring authorization). Absent means "restore what this subscription needs": the allowance is the subscription's own, never a number the browser chooses.

permit_noncestring

What the wallet was told the token's permit counter was. Checked against the chain before anything is sent.

Response

Settled or confirming

status'SETTLED' | 'SPONSORSHIP_CONFIRMING'
tx_hashstring
network_fee_unitsstring
allowance_unitsstring
block_numberstring
native_gas_spent_weistring

Changes

No recorded changes to this operation across all 1 revision of this API.