Recurring payments

Authoritative terms plus the EIP-712 payload to sign

What the customer is agreeing to, stated by the server, together with the exact typed data their wallet will show them. network_fee_estimate is indicative and best-effort - it may be null if the chain could not be asked, and it is never what gets charged.

post/v1/subscriptions/resolve

Request

  • Base URL: https://api.p2flux.com
  • URL: https://api.p2flux.com/v1/subscriptions/resolve
  • Auth: none required

Request body

setup_tokenstring required

A signed P2Flux capability: payment intent (p2f1.), setup token (p2setup2.), subscription capability (p2s2.), cancel token (p2cancel1.) or refund token (p2refund1.). Opaque to the caller and unforgeable - the signature is what authorises the call. Treat it as a bearer secret: keep it server-side, never in a URL query or a log.

gas_payment_mode'native' | 'payment_token'

Optional. payment_token with payer prices the allowance transaction P2Flux would send for a customer holding no native currency, and returns the two messages they sign. Absent means the customer approves from their own wallet, exactly as before.

payerstring

An EVM address.

Example request

{
  "payer": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9"
}

Response

Terms and typed data.

recipientstring

An EVM address.

amountstring

A USDC amount as a decimal string, up to 6 decimal places. Never a JSON number: binary floating point cannot represent most decimal prices exactly, and this is money.

amount_unitsstring

An integer count of micro-USDC (6 decimals), as a string. 2500000 is 2.50 USDC. Used wherever a decimal would invite a rounding error - notably refund amounts.

periodinteger
startinteger
endinteger
tokenstring

An EVM address.

chain_idinteger
contractstring

An EVM address.

saltstring
max_gas_reimbursementstring

An integer count of micro-USDC (6 decimals), as a string. 2500000 is 2.50 USDC. Used wherever a decimal would invite a rounding error - notably refund amounts.

fee_bpsinteger
network_feestring

A USDC amount as a decimal string, up to 6 decimal places. Never a JSON number: binary floating point cannot represent most decimal prices exactly, and this is money.

network_fee_unitsstring

An integer count of micro-USDC (6 decimals), as a string. 2500000 is 2.50 USDC. Used wherever a decimal would invite a rounding error - notably refund amounts.

network_fee_estimatestring nullable
expires_atinteger
typed_dataobject

EIP-712 domain, types and primaryType.

approve_unitsstring nullable

What the checkout asks the wallet to approve, in base units. null means unlimited. Never below one charge (amount plus max_gas_reimbursement).

approve_amountstring nullable

approve_units as a decimal USDC string; null means unlimited.

gas_payment_mode'payment_token'

Present only when the signup was priced for a customer with no native currency.

sponsorship_quoteobject

With payment_token: the quoted network fee, its expiry, and the p2gas1 quote to hand back to finalize.

allowance_permitobject

With payment_token: the EIP-2612 permit the customer signs. Spender is the recurring contract; value is the subscription's allowance mode.

network_fee_authorizationobject

With payment_token: the token authorization for the quoted fee. Expires with the quote.

Example response

{
  "recipient": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "amount": "10.00",
  "amount_units": "2500000",
  "token": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "contract": "0xb4e43f3fBa5Add75395adAD366627E7d74141Fa9",
  "max_gas_reimbursement": "2500000",
  "network_fee": "10.00",
  "network_fee_units": "2500000"
}

Changes

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