Fee Sponsorship

Create a fee sponsorship.

Changed on

Creates a new fee sponsorship.

This endpoint requires linking to an existing policy via policyId. Create the policy first via /v2/policies with your criteria rules.

Workflow:

  1. Create a policy via /v2/policies with criteria rules
  2. Create a fee sponsorship with policyId linking to that policy

Supported criteria types:

  • evmAddress: Filter by recipient address (in/not in)
  • ethValue: Filter by ETH amount (<=, >=, <, >)
  • evmNetwork: Filter by chain ID (in/not in)
  • evmData: Filter by function selector or parameters
post/v2/fee-sponsorship

Request

  • Base URL: https://api.openfort.io
  • URL: https://api.openfort.io/v2/fee-sponsorship
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Request body

namestring

Name of the fee sponsorship policy.

paymasterstring

Paymaster UUID (optional, for pay_for_user schema).

chainIdinteger

Chain ID for single-chain sponsorship.

forwarderContractIdstring

Forwarder contract UUID (optional, for meta-transactions).

policyIdstring required

Link to a policy for criteria-based transaction filtering. Create the policy first via /v2/policies, then reference it here.

Example request

{
  "name": "My DeFi Gas Sponsorship",
  "strategy": {
    "tokenContract": "con_48eeba57-2cd5-4159-a2cb-057a23a35e65",
    "tokenContractAmount": "1000000000000000000",
    "tokenContracts": [
      {
        "contract": "con_48eeba57-2cd5-4159-a2cb-057a23a35e65",
        "amount": "1000000000000000000"
      }
    ],
    "splTokens": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ]
  },
  "paymaster": "pay_48eeba57-2cd5-4159-a2cb-057a23a35e65",
  "chainId": 8453,
  "forwarderContractId": "cfo_48eeba57-2cd5-4159-a2cb-057a23a35e65",
  "policyId": "ply_48eeba57-2cd5-4159-a2cb-057a23a35e65"
}

Response

Created.

idstring required
object'feeSponsorship' required
createdAtinteger required
namestring nullable required

Name of the fee sponsorship policy.

descriptionstring nullable required

Description or comment for the fee sponsorship.

chainIdinteger nullable required

Chain ID for single-chain sponsorship.

enabledboolean required

Whether the policy is enabled.

paymasterIdstring nullable required

Paymaster ID (optional).

forwarderContractIdstring nullable required

Forwarder contract ID (optional, for meta-transactions).

policyIdstring nullable required

Linked policy ID for criteria-based transaction filtering.

Example response

{
  "name": "My DeFi Gas Sponsorship",
  "description": "Sponsors gas for free-tier users",
  "chainId": 8453,
  "enabled": true,
  "strategy": {
    "sponsorSchema": "pay_for_user",
    "tokenContract": "con_48eeba57-2cd5-4159-a2cb-057a23a35e65",
    "tokenContractAmount": "1000000000000000000",
    "dynamicExchangeRate": true,
    "splTokens": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
    ],
    "tokenContracts": [
      {
        "contract": "con_48eeba57-2cd5-4159-a2cb-057a23a35e65",
        "amount": "1000000000000000000"
      }
    ]
  },
  "paymasterId": "pay_48eeba57-2cd5-4159-a2cb-057a23a35e65",
  "forwarderContractId": "cfo_48eeba57-2cd5-4159-a2cb-057a23a35e65",
  "policyId": "ply_48eeba57-2cd5-4159-a2cb-057a23a35e65"
}

Changes

    • info

      added the new optional request property /

    • info

      request property / deprecated

    • info

      request property / deprecated

    • info

      added the optional property / to the response with the status

    • info

      response property strategy/tokenContract deprecated

    • info

      response property strategy/tokenContractAmount deprecated

    • info

      the security scope fee_sponsorship:write was added to the endpoint's security scheme sk

    • info

      added the new optional request property /

    • info

      added the optional property / to the response with the status

    • info

      added the required property to the response with the status