USDC
subscription payments. Let’s walk through how you could integrate Otim to support crypto subscriptions.
First, update your frontend to allow users to connect their Otim-delegated account. For users that don’t have an Otim-delegated account, direct them to the Otim onboarding page. For users that already have an Otim-delegated account, direct them to a page that prompts them to visit their Otim dashboard and approve your Instruction request.
Next, we’ll use Otim’s API to request the user to subscribe to Netflix. Under the hood, we’ll be requesting that users execute the TransferERC20
Action on a monthly basis. Let’s break this down:
Instruction.action
to the address of the TransferERC20
Action
Instruction.arguments
to encoded calldata specifying:
Schedule.interval
to one month in seconds
USDC
USDC
the user must pay each month
InstructionExecuted(bytes32 indexed instructionId, uint256 executionCount)
. You simply listen for this event to be emitted from the user’s account with the correct instructionId
. As long as it’s emitted on-schedule, you can continue to provide services.