extendBillingSubscriptionItemFreeTrialWithHttpInfo method

Future<Response> extendBillingSubscriptionItemFreeTrialWithHttpInfo(
  1. String subscriptionItemId,
  2. ExtendFreeTrialRequest extendFreeTrialRequest
)

Extend free trial for a subscription item

Extends the free trial period for a specific subscription item to the specified timestamp. The subscription item must be currently in a free trial period, and the plan must support free trials. The timestamp must be in the future and not more than 365 days from the end of the current trial period This operation is idempotent - repeated requests with the same timestamp will not change the trial period.

Note: This method returns the HTTP Response.

Parameters:

  • String subscriptionItemId (required): The ID of the subscription item to extend the free trial for

  • ExtendFreeTrialRequest extendFreeTrialRequest (required): Parameters for extending the free trial

Implementation

Future<http.Response> extendBillingSubscriptionItemFreeTrialWithHttpInfo(
  String subscriptionItemId,
  ExtendFreeTrialRequest extendFreeTrialRequest,
) async {
  // ignore: prefer_const_declarations
  final path =
      r'/billing/subscription_items/{subscription_item_id}/extend_free_trial'
          .replaceAll('{subscription_item_id}', subscriptionItemId);

  // ignore: prefer_final_locals
  Object? postBody = extendFreeTrialRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}