Examples of cancelling a subscription and refunding the end customers automatically
The section includes examples of canceling a subscription with different refunds based on the same calculated credit memo and an example of canceling a subscription with a refund and write-off through the REST API.
Examples of canceling a subscription with different refunds
The following subscription will be used in the examples:
- Subscription Term Type: Termed
- Charge: 1 monthly recurring charge of 100 USD
- Contract Effective Date: 2022-12-01
For simplification, the following table only lists information on the first two billing periods of the subscription.
Billing period | Billing period start date | Billing period end date | Payment |
---|---|---|---|
1st | 12/01/2022 | 12/31/2022 | $100 |
2nd | 01/01/2022 | 1/31/2022 | $100 |
Cancel Effective Date | Specific Date: 01/09/2022 | Calculated credit memo: $74.2 |
An end customer cancels the subscription by specifying the cancellation effective date as 01/09/2022, which only affects the 2nd billing period and payment. A credit memo is calculated based on the specified cancellation effective date. That is, counting from 01/09/2022, 23 out of 31 days do not need to be paid, and thus $74.2 is calculated as a credit memo.
The end customer can specify a refund amount based on the calculated credit memo $74.2 in different situations, as follows:
Refund 1 | Total amount | Amount | |
---|---|---|---|
Payment | $100 | Applied amount | $25.8 |
Credit Memo | $74.2 | Unapplied amount | $0 |
Invoice | $100 | Balance | $0 |
Refund | $74.2 |
In refund 1, since the refund amount is $74.2, the same amount will be unapplied from the original payment $100, so the applied amount to the invoice is $25.8. Then the credit memo with the amount $74.2 will be fully applied to the invoice. As a result, the invoice balance is still 0.
Refund 2 | Total amount | Amount | |
---|---|---|---|
Payment | $100 | Applied amount | $60 |
Credit Memo | $74.2 | Unapplied amount | $34.2 |
Invoice | $100 | Balance | $0 |
Refund | $40 |
In refund 2, the merchant has decided to refund $40.0 to the end customer based on the business policy. Refund 2 differs from refund 1 in that the merchant refunds less than the recommended amount to the end customer, that is, $40.0 instead of $74.2. In this case, $40 will be unapplied from the original payment $100, so the payment amount applied to the invoice becomes $60. To keep the invoice balance to 0, $40 out of the $74.2 credit memo will be applied to the invoice, the remaining unapplied credit amount is $34.2.
An example of canceling a subscription with a refund and write-off through the REST API
- Subscription Term Type: Termed
- Charge: 1 monthly recurring charge of 100 USD
- Contract Effective Date: 2022-01-01
An invoice has been generated on the Target Date of 2022-11-30. Therefore, 1100 USD has been billed to the end customer. A payment of 1100 USD then has been processed and collected from the customer.
Later, the customer requested to cancel the subscription effective on 2022-04-30, and the agreed amount to be refunded is 800 USD.
Among the 800 USD, 700 USD is for the seven unconsumed subscription periods; the other 100 USD is compensation that is agreed upon between the vendor and the end customer. This 100 USD will need to be written off from the invoice.