Trelis Docs


Create automatically recurring subscriptions
To create and run subscriptions, you first need to register as a merchant. This allows us to deploy a smart contract for your wallet to receive subscriptions.

Creating subscriptions:

There are two options for running subscription payments:
a. Manual. Merchants can initiate each subscription payment via API.
b. Automatic. Merchants, when creating the initial subscription, can choose for payments to be automatically processed. (This is the only option available via the dashboard.)

How do subscriptions work?

The subscription is defined by:
  • A customer's paying wallet address
  • The merchant's receiving address
  • The subscription amount
  • The subscription period (monthly or annual)
  • The remaining number of subscription payments.
At the time of subscription creation or modification, this information is recorded in a smart contract.
Customers grant the smart contract permission to spend from their wallet - via a permit function. By default, the customer grants the smart contract permission to spend the following maximum amounts (cumulative across all subscription periods):
  • $1,000 for subscriptions less than $50 per period
  • $10,000 for subscriptions over $50 per period.
The smart contract allows the merchant's wallet to initiate a transfer from the customer's wallet at the end of every subscription period. This prevents the merchant from withdrawing more per period than the subscription amount.
At any time, the customer can:
  • Cancel their subscription, which sets the smart contract allowance to zero.
  • Renew their subscription, which sets the smart contract allowance back to the default amount.

Further Documentation:

  • Trelis' smart contracts are open source and viewable on Github.
  • Smart contracts in use are verified on a public block explorer. At present, a unique smart contract is deployed for each merchant.