BillingPlan, set the minimumCommitment to the number of billing cycles the customer must complete without incurring a cancellation fee, and set the cancelFees amount and currency type. Note however that since most subscriptions are paid at the beginning of each cycle, a three-month billing plan, starting on January 1 and canceled on March 3, will not trigger a penalty fee, as the payment for the third month of the commitment period will already have been paid on March 1.
Note: Beginning in release 25.0 you can no longer set the minimumCommitment in the AutoBill.
When canceling a subscription during the commitment period, set a cancelFeePolicy to specify whether to prorate the fee, or to refund the full amount or waive the fee altogether (the default). Be sure also to set disentitle to True to stop entitlements, and set settle to True to have Subscribe calculate a settlement. And since the subscription is still within the commitment period, you must set force to True to have the penalty fee calculated as defined in the cancelFeePolicy field.
To have Subscribe return just the calculated settlement amount, set amountOnly to True in AutoBill.settlementQuote. When set to false (the default), full Transaction and Refund settlement details are generated.
Create a Billing Plan with a minimum commitment
In the following example, a billing plan specifies two billing periods. One billing period is monthly with one cycle and is free; the other billing period is yearly and has 12 one-month cycles, two currencies, and is open ended (cycles => 0).
The subscription requires a minimum commitment of two cycles (the first free, the second billed), and comes with an early cancellation fee that will be applied if the subscription is canceled before the second payment is billed.
Billing plan with early cancel fee:

