apiV1BillingSubscribePost method
Future<ApiV1BillingSubscribePost200Response?>
apiV1BillingSubscribePost({
- BillingSubscribe? billingSubscribe,
Create subscription checkout
Create a checkout session to subscribe to a plan
Parameters:
- BillingSubscribe billingSubscribe:
Implementation
Future<ApiV1BillingSubscribePost200Response?> apiV1BillingSubscribePost({ BillingSubscribe? billingSubscribe, }) async {
final response = await apiV1BillingSubscribePostWithHttpInfo( billingSubscribe: billingSubscribe, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiV1BillingSubscribePost200Response',) as ApiV1BillingSubscribePost200Response;
}
return null;
}