Modifying subscriptions
Upgrading
There are 3 steps to upgrade a customer.
- Calculate and charge the customer for any pro-rated amount
- Cancel the existing subscription in Loop
- Send the customer a checkout link for the new subscription plans
1. Calculate and charge the customer for any pro-rated amount
You should calculate the amount to charge the customer, and then charge them using their existing agreement. To do this, you will need to use the POST Transfers endpoint.
Like all transactions, the customer will need to have sufficient balance and allowance to cover this transaction. The customer can increase their allowance on the customer portal. The token, network and wallet must match the existing payment method.
Here is sample code
[
{
"invoiceId": "first-test",
"amount": "10",
"token": "0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8",
"usd": true,
"itemId": "9035c1cb-c850-46ec-970b-bc3fdaaf2c43",
"from": "0x10D7373d05dDdDf5EB5770aE739d78fe11c82ec0",//Wallet of the customer you are charging
"networkId": "11155111",
"to": "0x11117373d05dDdDf5EB5770aE739d78fe11c82ec0",//Your treasury wallet
"entityId": "5fee3b4c-c70b-1111-bfdb-3dbbcd6b2fd7" //Found on the "Developer" page of your dashboard
}
]
2. Cancel the existing subscription in Loop
Once you have received the pro-rated amount, cancel the existing subscription in Loop either on Loop's Company Portal or via Loop's PATCH agreement endpoint.
See directions on the cancellations page.
Any upcoming transactions should cancel on their own. You can confirm this on the Transaction page of the company portal.
3. Send the customer a checkout link for the new subscription plans
Send the customer the checkout link for the new product. The bill date will anchor to the date they checkout. If you would like the bill date to be in the future, you can use free trial days. However, please note the free trial days will start from when the customer completes checkout.
Updated 7 days ago