/** * Parameters for canceling a Creem subscription. * * @example * ```typescript * const { data, error } = await authClient.creem.cancelSubscription({ * id: "sub_abc123" * }); * ``` */ interface CancelSubscriptionInput { /** * The CREEM subscription ID to cancel. * You can get this from the subscription object returned by retrieveSubscription * or from webhook events. * * @example "sub_abc123" */ id: string; } /** * Response from canceling a subscription. */ interface CancelSubscriptionResponse { /** * Indicates whether the cancellation was successful. */ success: boolean; /** * Success message confirming the cancellation. */ message: string; } /** * Response from hasAccessGranted endpoint */ interface HasAccessGrantedResponse { /** * Whether the user has access granted * - `true` - User has active access * - `false` - User has no active access * - `undefined` - Could not determine (not logged in, persistence disabled, or error) */ hasAccessGranted: boolean | undefined; /** * Human-readable message explaining the status */ message?: string; /** * Active subscription details (if hasAccessGranted is true) */ subscription?: { id: string; status: string; productId: string; periodEnd?: Date | string; }; /** * All subscriptions (if hasAccessGranted is false) * Useful for debugging or showing expired subscriptions */ subscriptions?: Array<{ id: string; status: string; productId: string; periodEnd?: Date | string; }>; /** * Error message (if an error occurred) */ error?: string; } export type { CancelSubscriptionInput as C, HasAccessGrantedResponse as H, CancelSubscriptionResponse as a };