Skip to content

Commit 59673ba

Browse files
committed
Add trial calls
1 parent d08946b commit 59673ba

12 files changed

+1819
-185
lines changed

docs/Api/SubscriptionsApi.md

+114
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ Method | HTTP request | Description
99
[**changeSubscriptionPrice**](SubscriptionsApi.md#changesubscriptionprice) | **POST** /subscription/{subscriptionId}/price | Change Price
1010
[**customerChangeSubscriptionPlan**](SubscriptionsApi.md#customerchangesubscriptionplan) | **POST** /subscription/{subscriptionId}/plan | Change Subscription Plan
1111
[**customerStartSubscription**](SubscriptionsApi.md#customerstartsubscription) | **POST** /customer/{customerId}/subscription/start | Start Subscription For Customer
12+
[**extendTrial**](SubscriptionsApi.md#extendtrial) | **POST** /subscription/{subscriptionId}/extend | Extend Trial Subscription
1213
[**getForCustomer**](SubscriptionsApi.md#getforcustomer) | **GET** /customer/{customerId}/subscription | List Customer Subscriptions
1314
[**listSubscriptionPlans**](SubscriptionsApi.md#listsubscriptionplans) | **GET** /subscription/plans | List Subscription Plans
1415
[**listSubscriptions**](SubscriptionsApi.md#listsubscriptions) | **GET** /subscription | List
1516
[**removeSeatsSubscriptions**](SubscriptionsApi.md#removeseatssubscriptions) | **POST** /subscription/{subscriptionId}/seats/remove | Remove Seats
1617
[**showSubscriptionById**](SubscriptionsApi.md#showsubscriptionbyid) | **GET** /subscription/{subscriptionId} | Detail
18+
[**startTrial**](SubscriptionsApi.md#starttrial) | **POST** /customer/{customerId}/subscription/trial | Start Trial Subscription For Customer
1719

1820
# **addSeatsSubscriptions**
1921
> \BillaBear\Model\InlineResponse20012 addSeatsSubscriptions($body, $subscription_id)
@@ -295,6 +297,62 @@ Name | Type | Description | Notes
295297

296298
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
297299

300+
# **extendTrial**
301+
> \BillaBear\Model\Subscription extendTrial($body, $subscription_id)
302+
303+
Extend Trial Subscription
304+
305+
Extend a trial subscription so it's converted from a trial to a normal subscription.
306+
307+
### Example
308+
```php
309+
<?php
310+
require_once(__DIR__ . '/vendor/autoload.php');
311+
// Configure API key authorization: ApiKeyAuth
312+
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
313+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
314+
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
315+
316+
$apiInstance = new BillaBear\Api\SubscriptionsApi(
317+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
318+
// This is optional, `GuzzleHttp\Client` will be used as default.
319+
new GuzzleHttp\Client(),
320+
$config
321+
);
322+
$body = new \BillaBear\Model\SubscriptionIdExtendBody(); // \BillaBear\Model\SubscriptionIdExtendBody |
323+
$subscription_id = "subscription_id_example"; // string | The id of the subscription to retrieve
324+
325+
try {
326+
$result = $apiInstance->extendTrial($body, $subscription_id);
327+
print_r($result);
328+
} catch (Exception $e) {
329+
echo 'Exception when calling SubscriptionsApi->extendTrial: ', $e->getMessage(), PHP_EOL;
330+
}
331+
?>
332+
```
333+
334+
### Parameters
335+
336+
Name | Type | Description | Notes
337+
------------- | ------------- | ------------- | -------------
338+
**body** | [**\BillaBear\Model\SubscriptionIdExtendBody**](../Model/SubscriptionIdExtendBody.md)| |
339+
**subscription_id** | **string**| The id of the subscription to retrieve |
340+
341+
### Return type
342+
343+
[**\BillaBear\Model\Subscription**](../Model/Subscription.md)
344+
345+
### Authorization
346+
347+
[ApiKeyAuth](../../README.md#ApiKeyAuth)
348+
349+
### HTTP request headers
350+
351+
- **Content-Type**: application/json
352+
- **Accept**: application/json
353+
354+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
355+
298356
# **getForCustomer**
299357
> \BillaBear\Model\InlineResponse2006 getForCustomer($customer_id)
300358
@@ -571,3 +629,59 @@ Name | Type | Description | Notes
571629

572630
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
573631

632+
# **startTrial**
633+
> \BillaBear\Model\Subscription startTrial($body, $customer_id)
634+
635+
Start Trial Subscription For Customer
636+
637+
Start subscription for a customer
638+
639+
### Example
640+
```php
641+
<?php
642+
require_once(__DIR__ . '/vendor/autoload.php');
643+
// Configure API key authorization: ApiKeyAuth
644+
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
645+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
646+
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
647+
648+
$apiInstance = new BillaBear\Api\SubscriptionsApi(
649+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
650+
// This is optional, `GuzzleHttp\Client` will be used as default.
651+
new GuzzleHttp\Client(),
652+
$config
653+
);
654+
$body = new \BillaBear\Model\SubscriptionTrialBody(); // \BillaBear\Model\SubscriptionTrialBody |
655+
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
656+
657+
try {
658+
$result = $apiInstance->startTrial($body, $customer_id);
659+
print_r($result);
660+
} catch (Exception $e) {
661+
echo 'Exception when calling SubscriptionsApi->startTrial: ', $e->getMessage(), PHP_EOL;
662+
}
663+
?>
664+
```
665+
666+
### Parameters
667+
668+
Name | Type | Description | Notes
669+
------------- | ------------- | ------------- | -------------
670+
**body** | [**\BillaBear\Model\SubscriptionTrialBody**](../Model/SubscriptionTrialBody.md)| |
671+
**customer_id** | **string**| The id of the customer to retrieve |
672+
673+
### Return type
674+
675+
[**\BillaBear\Model\Subscription**](../Model/Subscription.md)
676+
677+
### Authorization
678+
679+
[ApiKeyAuth](../../README.md#ApiKeyAuth)
680+
681+
### HTTP request headers
682+
683+
- **Content-Type**: application/json
684+
- **Accept**: application/json
685+
686+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
687+
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SubscriptionIdExtendBody
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**price** | [**Uuid**](Uuid.md) | |
7+
8+
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
9+

docs/Model/SubscriptionPlan.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**user_count** | **int** | | [optional]
1010
**per_seat** | **bool** | | [optional]
1111
**has_trial** | **bool** | | [optional]
12+
**is_trial_standalone** | **bool** | | [optional]
1213
**free** | **bool** | | [optional]
1314
**public** | **bool** | | [optional]
1415
**limits** | [**\BillaBear\Model\Limit[]**](Limit.md) | | [optional]

docs/Model/SubscriptionStartBody.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**subscription_plan** | **string** | The ID for the subscription plan to be used |
6+
**subscription_plan** | **string** | The ID for the subscription plan to be used (Can also be the code name) |
77
**payment_details** | **string** | The Id for the customer&#x27;s payment details to be used | [optional]
8+
**card_token** | **string** | A stripe card token that&#x27;s been created using Stripe&#x27;s js sdk. It&#x27;ll create the payment details for the customer. | [optional]
89
**price** | **string** | The ID for the price to be used | [optional]
910
**schedule** | **string** | The schedule of the plan that is to be started. Only used if price isn&#x27;t given. Requires currency as well. | [optional]
1011
**currency** | **string** | The currency of the plan that is to be started. Only used if price isn&#x27;t given. Requires schedule as well. | [optional]

docs/Model/SubscriptionTrialBody.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SubscriptionTrialBody
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**subscription_plan** | **string** | The ID for the subscription plan to be used (Can also be the code name) |
7+
**seat_numbrers** | **int** | | [optional]
8+
**trial_length_days** | **int** | | [optional]
9+
10+
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
11+

0 commit comments

Comments
 (0)