Subscriptions are generated from the creation of a Risk Item, which includes a package containing pre-configured settings for recurring payments. These subscriptions can be daily, weekly, monthly, or annual, and may feature a trial period. Additionally, they can specify whether the payment is charged at the end of the month, at the beginning, or upon the expiration of the last payment.
The process begins with the creation of a Risk Item. A webhook then evaluates whether the Risk Item is a one-time payment or a subscription. For one-time payments, an order is created immediately, and the Risk Item is protected until the specified end_date. For subscriptions, protection is provided based on payment renewal, using the end_date as the final date of the subscription (with the option to set the end_date to null to indicate that the subscription does not expire).
Once the subscription and the first order are created, the next payment date is generated and stored in the database. A CRON job runs daily at night to generate new orders for subscriptions, continuing this process until the subscription ends.
Use cases include daily, weekly, monthly, and annual subscriptions, where Risk Items are protected and orders are generated according to the specified intervals. Subscriptions can also include a trial period, delaying the first payment for a defined duration. The payment schedule is flexible, allowing payments to be scheduled at the end of the month, the beginning of the month, or upon the expiration of the last payment, based on the package configuration.
Cancelations
To cancel a subscription, you need the ID or UID of the Risk Item to be canceled. This allows you to terminate the subscription or modify its end date. It is important to note that if you cancel midway through a monthly subscription, you remain protected for the month you paid for, and protection ceases once the paid subscription period ends.