perspectapi-ts-sdk 4.1.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -824,9 +824,33 @@ const orders = await client.siteUsers.getOrders(siteName, {
824
824
  // Get subscriptions
825
825
  const subscriptions = await client.siteUsers.getSubscriptions(siteName);
826
826
 
827
- // Cancel subscription
827
+ // Cancel at end of billing period (default)
828
828
  await client.siteUsers.cancelSubscription(siteName, 'sub_123', csrfToken);
829
829
 
830
+ // Cancel immediately
831
+ await client.siteUsers.cancelSubscription(
832
+ siteName,
833
+ 'sub_123',
834
+ csrfToken,
835
+ { mode: 'immediate' }
836
+ );
837
+
838
+ // Cancel at a scheduled time (absolute)
839
+ await client.siteUsers.cancelSubscription(
840
+ siteName,
841
+ 'sub_123',
842
+ csrfToken,
843
+ { mode: 'scheduled', cancel_at: '2026-05-01T15:30:00Z' }
844
+ );
845
+
846
+ // Cancel after a configured delay (days/hours/minutes)
847
+ await client.siteUsers.cancelSubscription(
848
+ siteName,
849
+ 'sub_123',
850
+ csrfToken,
851
+ { mode: 'scheduled', delay_days: 7, delay_hours: 2 }
852
+ );
853
+
830
854
  // Logout
831
855
  await client.siteUsers.logout(siteName);
832
856
  client.setAuth(null);