license_manager 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -0
- data/README.md +1 -1
- data/docs/BillingPortalSession.md +18 -0
- data/docs/CreateBillingPortalSession.md +18 -0
- data/docs/CreateIntegrationMapping.md +1 -1
- data/docs/Integration.md +6 -0
- data/docs/IntegrationMapping.md +2 -0
- data/docs/IntegrationMappingRecurring.md +20 -0
- data/docs/License.md +2 -0
- data/docs/LicenseSubscription.md +34 -0
- data/docs/LicensesApi.md +1 -1
- data/docs/Mrr.md +26 -0
- data/docs/MrrByIntervalInner.md +24 -0
- data/docs/MrrByPolicyInner.md +22 -0
- data/docs/PortalApi.md +79 -0
- data/docs/ProductStats.md +2 -0
- data/docs/Revenue.md +8 -4
- data/docs/StripePermission.md +3 -1
- data/docs/StripePrice.md +2 -0
- data/docs/StripePriceRecurring.md +20 -0
- data/docs/SubscriptionStats.md +38 -0
- data/docs/UpdateIntegration.md +3 -1
- data/lib/license_manager/api/licenses_api.rb +2 -2
- data/lib/license_manager/api/portal_api.rb +70 -0
- data/lib/license_manager/models/billing_portal_session.rb +178 -0
- data/lib/license_manager/models/create_billing_portal_session.rb +161 -0
- data/lib/license_manager/models/create_integration_mapping.rb +1 -1
- data/lib/license_manager/models/event_type.rb +4 -1
- data/lib/license_manager/models/integration.rb +82 -1
- data/lib/license_manager/models/integration_mapping.rb +13 -1
- data/lib/license_manager/models/integration_mapping_recurring.rb +228 -0
- data/lib/license_manager/models/license.rb +13 -1
- data/lib/license_manager/models/license_subscription.rb +388 -0
- data/lib/license_manager/models/mrr.rb +291 -0
- data/lib/license_manager/models/mrr_by_interval_inner.rb +279 -0
- data/lib/license_manager/models/mrr_by_policy_inner.rb +229 -0
- data/lib/license_manager/models/product_stats.rb +14 -1
- data/lib/license_manager/models/revenue.rb +60 -6
- data/lib/license_manager/models/stripe_permission.rb +31 -4
- data/lib/license_manager/models/stripe_price.rb +13 -1
- data/lib/license_manager/models/stripe_price_recurring.rb +228 -0
- data/lib/license_manager/models/subscription_stats.rb +456 -0
- data/lib/license_manager/models/update_integration.rb +42 -4
- data/lib/license_manager/version.rb +1 -1
- data/lib/license_manager.rb +9 -0
- data/openapi.json +563 -10
- data/spec/api/licenses_api_spec.rb +1 -1
- data/spec/api/portal_api_spec.rb +13 -0
- data/spec/models/billing_portal_session_spec.rb +36 -0
- data/spec/models/create_billing_portal_session_spec.rb +36 -0
- data/spec/models/create_token_spec.rb +1 -1
- data/spec/models/integration_mapping_recurring_spec.rb +46 -0
- data/spec/models/integration_mapping_spec.rb +6 -0
- data/spec/models/integration_spec.rb +18 -0
- data/spec/models/license_spec.rb +6 -0
- data/spec/models/license_subscription_spec.rb +88 -0
- data/spec/models/mrr_by_interval_inner_spec.rb +58 -0
- data/spec/models/mrr_by_policy_inner_spec.rb +48 -0
- data/spec/models/mrr_spec.rb +60 -0
- data/spec/models/product_stats_spec.rb +6 -0
- data/spec/models/revenue_spec.rb +12 -0
- data/spec/models/stripe_permission_spec.rb +6 -0
- data/spec/models/stripe_price_recurring_spec.rb +46 -0
- data/spec/models/stripe_price_spec.rb +6 -0
- data/spec/models/subscription_stats_spec.rb +96 -0
- data/spec/models/token_spec.rb +1 -1
- data/spec/models/update_integration_spec.rb +6 -0
- metadata +37 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d2fad9e16d3194d5a682104cbf199cbadf37b8960a262943d61355963bbf5bc
|
|
4
|
+
data.tar.gz: 423f1d92ca5ce3b5f3f47368437131f53b47bb12811e54709902ade88e691c28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ead20ee997f6de97969a0fe24d9e3e26d4f9e665e7f15ef1776e5f71227cc1805f7078f3c6bf0ebf1f56e3054642912e8cc2aa27e7db5dd715cafc0a91bfe25d
|
|
7
|
+
data.tar.gz: 46838fa3d3d6777363fb88e38372d21234ea1a837201c88f1942fcbf7f07076f28d28023fac6d33d95e1aa45a7942beac19500683a902a8036590df10f01227e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 (2026-10-27)
|
|
4
|
+
|
|
5
|
+
### Breaking changes
|
|
6
|
+
|
|
7
|
+
- `POST /v1/customers/{id}/tokens`: added the new `customer:billing` enum value to the `scope/items/` response property for the response status `201`
|
|
8
|
+
- `GET /v1/licenses/{id}/events`: added the new `license.payment_failed` enum value to the `data/items/type` response property for the response status `200`
|
|
9
|
+
- `GET /v1/licenses/{id}/events`: added the new `license.payment_succeeded` enum value to the `data/items/type` response property for the response status `200`
|
|
10
|
+
- `GET /v1/licenses/{id}/events`: added the new `license.subscription_ended` enum value to the `data/items/type` response property for the response status `200`
|
|
11
|
+
- `POST /v1/licenses/{id}/tokens`: added the new `customer:billing` enum value to the `scope/items/` response property for the response status `201`
|
|
12
|
+
- `POST /v1/machines/{id}/tokens`: added the new `customer:billing` enum value to the `scope/items/` response property for the response status `201`
|
|
13
|
+
- `GET /v1/policies/{id}/events`: added the new `license.payment_failed` enum value to the `data/items/type` response property for the response status `200`
|
|
14
|
+
- `GET /v1/policies/{id}/events`: added the new `license.payment_succeeded` enum value to the `data/items/type` response property for the response status `200`
|
|
15
|
+
- `GET /v1/policies/{id}/events`: added the new `license.subscription_ended` enum value to the `data/items/type` response property for the response status `200`
|
|
16
|
+
|
|
17
|
+
### Changes
|
|
18
|
+
|
|
19
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/subscription` to the response with the `200` status
|
|
20
|
+
- `POST /v1/customers/{id}/billing-portal-sessions`: endpoint added
|
|
21
|
+
- `POST /v1/customers/{id}/tokens`: added the new `customer:billing` enum value to the request property `scope/items/`
|
|
22
|
+
- `PATCH /v1/integration-mappings/{id}`: added the required property `recurring` to the response with the `200` status
|
|
23
|
+
- `PATCH /v1/integrations/{id}`: added the new optional request property `subscriptionGraceDays`
|
|
24
|
+
- `PATCH /v1/integrations/{id}`: added the required property `canBillingPortal` to the response with the `200` status
|
|
25
|
+
- `PATCH /v1/integrations/{id}`: added the required property `canManageSubscriptions` to the response with the `200` status
|
|
26
|
+
- `PATCH /v1/integrations/{id}`: added the required property `subscriptionGraceDays` to the response with the `200` status
|
|
27
|
+
- `POST /v1/integrations/{id}/check`: added the required property `canBillingPortal` to the response with the `200` status
|
|
28
|
+
- `POST /v1/integrations/{id}/check`: added the required property `canManageSubscriptions` to the response with the `200` status
|
|
29
|
+
- `POST /v1/integrations/{id}/check`: added the required property `subscriptionGraceDays` to the response with the `200` status
|
|
30
|
+
- `GET /v1/integrations/{id}/stripe/prices`: added the required property `data/items/recurring` to the response with the `200` status
|
|
31
|
+
- `GET /v1/licenses/{id}`: added the required property `subscription` to the response with the `200` status
|
|
32
|
+
- `PATCH /v1/licenses/{id}`: added the non-success response with the status `409`
|
|
33
|
+
- `PATCH /v1/licenses/{id}`: added the required property `subscription` to the response with the `200` status
|
|
34
|
+
- `POST /v1/licenses/{id}/cancel`: added the required property `subscription` to the response with the `200` status
|
|
35
|
+
- `GET /v1/licenses/{id}/events`: added the enum value `license.payment_failed` to the property `anyOf[#/components/schemas/EventType]/` of the `query` request parameter `type` (shared schema: `EventType`, also at `anyOf[#/components/schemas/EventType]`, `anyOf[subschema #2]/items`)
|
|
36
|
+
- `GET /v1/licenses/{id}/events`: added the enum value `license.payment_succeeded` to the property `anyOf[#/components/schemas/EventType]/` of the `query` request parameter `type` (shared schema: `EventType`, also at `anyOf[#/components/schemas/EventType]`, `anyOf[subschema #2]/items`)
|
|
37
|
+
- `GET /v1/licenses/{id}/events`: added the enum value `license.subscription_ended` to the property `anyOf[#/components/schemas/EventType]/` of the `query` request parameter `type` (shared schema: `EventType`, also at `anyOf[#/components/schemas/EventType]`, `anyOf[subschema #2]/items`)
|
|
38
|
+
- `POST /v1/licenses/{id}/tokens`: added the new `customer:billing` enum value to the request property `scope/items/`
|
|
39
|
+
- `POST /v1/machines/{id}/tokens`: added the new `customer:billing` enum value to the request property `scope/items/`
|
|
40
|
+
- `GET /v1/policies/{id}/events`: added the enum value `license.payment_failed` to the property `anyOf[#/components/schemas/EventType]/` of the `query` request parameter `type` (shared schema: `EventType`, also at `anyOf[#/components/schemas/EventType]`, `anyOf[subschema #2]/items`)
|
|
41
|
+
- `GET /v1/policies/{id}/events`: added the enum value `license.payment_succeeded` to the property `anyOf[#/components/schemas/EventType]/` of the `query` request parameter `type` (shared schema: `EventType`, also at `anyOf[#/components/schemas/EventType]`, `anyOf[subschema #2]/items`)
|
|
42
|
+
- `GET /v1/policies/{id}/events`: added the enum value `license.subscription_ended` to the property `anyOf[#/components/schemas/EventType]/` of the `query` request parameter `type` (shared schema: `EventType`, also at `anyOf[#/components/schemas/EventType]`, `anyOf[subschema #2]/items`)
|
|
43
|
+
- `GET /v1/products/{id}/stats`: added the required property `revenue/items/paymentCount` to the response with the `200` status
|
|
44
|
+
- `GET /v1/products/{id}/stats`: added the required property `revenue/items/subscriptionTotal` to the response with the `200` status
|
|
45
|
+
- `GET /v1/products/{id}/stats`: added the required property `subscriptions` to the response with the `200` status
|
|
46
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/canBillingPortal` to the response with the `200` status
|
|
47
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/canManageSubscriptions` to the response with the `200` status
|
|
48
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/subscriptionGraceDays` to the response with the `200` status
|
|
49
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `mappings/items/recurring` to the response with the `200` status
|
|
50
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `requiredPermissions/items/subscriptions` to the response with the `200` status
|
|
51
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/canBillingPortal` to the response with the `200` status
|
|
52
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/canManageSubscriptions` to the response with the `200` status
|
|
53
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/subscriptionGraceDays` to the response with the `200` status
|
|
54
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `mappings/items/recurring` to the response with the `200` status
|
|
55
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `requiredPermissions/items/subscriptions` to the response with the `200` status
|
|
56
|
+
- `POST /v1/products/{productId}/integrations/stripe/mappings`: added the required property `recurring` to the response with the `201` status
|
|
57
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/subscription` to the response with the `200` status
|
|
58
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `subscription` to the response with the `201` status
|
|
59
|
+
|
|
3
60
|
## 0.2.0 (2026-10-27)
|
|
4
61
|
|
|
5
62
|
### Breaking changes
|
data/README.md
CHANGED
|
@@ -77,7 +77,7 @@ Every method is documented, with its parameters and responses, in the [`docs`](d
|
|
|
77
77
|
| Class | Methods |
|
|
78
78
|
| --- | --- |
|
|
79
79
|
| [`LicensesApi`](docs/LicensesApi.md) | `validate_key`, `list_licenses`, `create_license`, `list_customer_licenses`, `get_license`, `delete_license`, `update_license`, `get_license_stats`, `cancel_license`, `send_license_keys`, `get_signing_key` |
|
|
80
|
-
| [`PortalApi`](docs/PortalApi.md) | `get_portal`, `request_portal_link`, `create_portal_link`, `send_portal_link` |
|
|
80
|
+
| [`PortalApi`](docs/PortalApi.md) | `get_portal`, `request_portal_link`, `create_portal_link`, `create_billing_portal_session`, `send_portal_link` |
|
|
81
81
|
| [`ProductsApi`](docs/ProductsApi.md) | `list_products`, `create_product`, `get_product`, `delete_product`, `update_product`, `reset_product`, `upload_product_logo`, `delete_product_logo`, `get_product_stats` |
|
|
82
82
|
| [`PoliciesApi`](docs/PoliciesApi.md) | `list_policies`, `create_policy`, `get_policy`, `delete_policy`, `update_policy` |
|
|
83
83
|
| [`CustomersApi`](docs/CustomersApi.md) | `list_customers`, `create_customer`, `get_customer`, `delete_customer`, `update_customer` |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# LicenseManager::BillingPortalSession
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **url** | **String** | Link to the Stripe customer portal, to open right away: it expires shortly. | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'license_manager'
|
|
13
|
+
|
|
14
|
+
instance = LicenseManager::BillingPortalSession.new(
|
|
15
|
+
url: https://billing.stripe.com/p/session/test_YWNjdF8x
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# LicenseManager::CreateBillingPortalSession
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **return_url** | **String** | Where the Stripe customer portal links back to: a page of the customer portal, or of one of the product's `returnDomains`. The customer portal of the product by default. | [optional] |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'license_manager'
|
|
13
|
+
|
|
14
|
+
instance = LicenseManager::CreateBillingPortalSession.new(
|
|
15
|
+
return_url: https://example.com/account
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **stripe_price_id** | **String** | Active one-time price of the Stripe account. | |
|
|
7
|
+
| **stripe_price_id** | **String** | Active one-time or licensed recurring price of the Stripe account. | |
|
|
8
8
|
| **policy_id** | **String** | | |
|
|
9
9
|
|
|
10
10
|
## Example
|
data/docs/Integration.md
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
| **last_event_at** | **Time** | Last time it received an event from the provider. | |
|
|
17
17
|
| **auto_refund** | **Boolean** | Whether canceling a license bought through Stripe refunds its payment. On by default, always off when `canRefund` is false. | |
|
|
18
18
|
| **can_refund** | **Boolean** | Whether the API key has the optional Refunds: Write permission, checked when connecting and every day. Without it, canceled licenses aren't refunded: refund their payments from Stripe. | |
|
|
19
|
+
| **can_manage_subscriptions** | **Boolean** | Whether the API key has the optional Subscriptions: Write permission, checked when connecting and every day. Without it, subscription licenses can't be canceled from the app: cancel their subscriptions from Stripe. | |
|
|
20
|
+
| **can_billing_portal** | **Boolean** | Whether the API key has the optional Customer portal: Write permission, checked when connecting and every day. Without it, the license portal doesn't link to the Stripe customer portal. | |
|
|
21
|
+
| **subscription_grace_days** | **Integer** | Days a subscription license stays valid after its period ends while its renewal is unpaid, as Stripe retries the payment. 7 by default. | |
|
|
19
22
|
| **created_at** | **Time** | | |
|
|
20
23
|
|
|
21
24
|
## Example
|
|
@@ -36,6 +39,9 @@ instance = LicenseManager::Integration.new(
|
|
|
36
39
|
last_event_at: null,
|
|
37
40
|
auto_refund: true,
|
|
38
41
|
can_refund: true,
|
|
42
|
+
can_manage_subscriptions: true,
|
|
43
|
+
can_billing_portal: true,
|
|
44
|
+
subscription_grace_days: 7,
|
|
39
45
|
created_at: null
|
|
40
46
|
)
|
|
41
47
|
```
|
data/docs/IntegrationMapping.md
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
| **stripe_price_id** | **String** | | |
|
|
13
13
|
| **product_name** | **String** | Name of the Stripe product when it was mapped. | |
|
|
14
14
|
| **price** | [**Price**](Price.md) | | |
|
|
15
|
+
| **recurring** | [**IntegrationMappingRecurring**](IntegrationMappingRecurring.md) | | |
|
|
15
16
|
| **status** | **String** | `error` when the price can no longer be paid, explained by `statusReason`. | |
|
|
16
17
|
| **status_reason** | **String** | | |
|
|
17
18
|
| **created_at** | **Time** | | |
|
|
@@ -30,6 +31,7 @@ instance = LicenseManager::IntegrationMapping.new(
|
|
|
30
31
|
stripe_price_id: price_1MoBy5LkdIwHu7ix,
|
|
31
32
|
product_name: Acme Pro,
|
|
32
33
|
price: null,
|
|
34
|
+
recurring: null,
|
|
33
35
|
status: null,
|
|
34
36
|
status_reason: The price is archived in Stripe,
|
|
35
37
|
created_at: null
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# LicenseManager::IntegrationMappingRecurring
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **interval** | **String** | | |
|
|
8
|
+
| **interval_count** | **Integer** | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'license_manager'
|
|
14
|
+
|
|
15
|
+
instance = LicenseManager::IntegrationMappingRecurring.new(
|
|
16
|
+
interval: null,
|
|
17
|
+
interval_count: 1
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/License.md
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
| **cancellable_until** | **Time** | End of the money back guarantee: until then, the customer can cancel the license from the customer portal, or with a token. Set from the policy's `moneyBackGuaranteeDays` when the license is created. `null` when the customer can't cancel it. | |
|
|
24
24
|
| **canceled_at** | **Time** | When the license was canceled: validating its key fails since. `null` when it wasn't. | |
|
|
25
25
|
| **cancellation_reason** | [**CancellationReason**](CancellationReason.md) | | |
|
|
26
|
+
| **subscription** | [**LicenseSubscription**](LicenseSubscription.md) | | |
|
|
26
27
|
| **cancellation_comment** | **String** | Comment given when the license was canceled. `null` when there's none. | |
|
|
27
28
|
| **stripe_refund_id** | **String** | Id of the Stripe refund of the license's payment once it was canceled, through the Stripe integration. `null` otherwise. | |
|
|
28
29
|
| **updated_at** | **Time** | Last time the license's settings were edited, not when its key was validated. | |
|
|
@@ -52,6 +53,7 @@ instance = LicenseManager::License.new(
|
|
|
52
53
|
cancellable_until: 2026-02-14T09:30:00.000Z,
|
|
53
54
|
canceled_at: 2026-01-20T16:12:00.000Z,
|
|
54
55
|
cancellation_reason: null,
|
|
56
|
+
subscription: null,
|
|
55
57
|
cancellation_comment: I only needed it for one project.,
|
|
56
58
|
stripe_refund_id: re_3MtwBwLkdIwHu7ix0Bs5rA2b,
|
|
57
59
|
updated_at: 2026-01-15T09:30:00.000Z
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# LicenseManager::LicenseSubscription
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **stripe_subscription_id** | **String** | | |
|
|
8
|
+
| **status** | **String** | Status of the subscription in Stripe: `active`, `trialing`, `past_due` while a failed payment is retried, `canceled`, `unpaid`, `paused`, `incomplete` or `incomplete_expired`. | |
|
|
9
|
+
| **interval** | **String** | | |
|
|
10
|
+
| **interval_count** | **Integer** | Number of intervals between payments. | |
|
|
11
|
+
| **quantity** | **Integer** | Units subscribed, multiplying the policy's machines. | |
|
|
12
|
+
| **price** | [**Price**](Price.md) | Price of one unit for one period, before taxes. | |
|
|
13
|
+
| **current_period_end** | **Time** | End of the paid period, when the subscription renews or ends. | |
|
|
14
|
+
| **cancel_at_period_end** | **Boolean** | Whether the subscription ends at the end of the period. | |
|
|
15
|
+
| **ended_at** | **Time** | | |
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
require 'license_manager'
|
|
21
|
+
|
|
22
|
+
instance = LicenseManager::LicenseSubscription.new(
|
|
23
|
+
stripe_subscription_id: sub_1MowQVLkdIwHu7ix,
|
|
24
|
+
status: active,
|
|
25
|
+
interval: null,
|
|
26
|
+
interval_count: 1,
|
|
27
|
+
quantity: 1,
|
|
28
|
+
price: null,
|
|
29
|
+
current_period_end: null,
|
|
30
|
+
cancel_at_period_end: null,
|
|
31
|
+
ended_at: null
|
|
32
|
+
)
|
|
33
|
+
```
|
|
34
|
+
|
data/docs/LicensesApi.md
CHANGED
|
@@ -23,7 +23,7 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
23
23
|
|
|
24
24
|
Cancel a license
|
|
25
25
|
|
|
26
|
-
Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
26
|
+
Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. A subscription license isn't refunded: its Stripe subscription is canceled at once, without proration, which needs the integration's `canManageSubscriptions`. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
27
27
|
|
|
28
28
|
### Examples
|
|
29
29
|
|
data/docs/Mrr.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# LicenseManager::Mrr
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **currency** | **String** | | |
|
|
8
|
+
| **mrr** | **Float** | Monthly recurring revenue: the price of every ongoing subscription in the currency, times its quantity, brought to one month (a year counts for a twelfth), before taxes and discounts. | |
|
|
9
|
+
| **by_interval** | [**Array<MrrByIntervalInner>**](MrrByIntervalInner.md) | Ongoing subscriptions and MRR of each billing period, like monthly and yearly, from the highest MRR. | |
|
|
10
|
+
| **by_policy** | [**Array<MrrByPolicyInner>**](MrrByPolicyInner.md) | MRR of each policy, from the highest. | |
|
|
11
|
+
| **by_month** | **Array<Float>** | MRR at the end of each month, aligned on `months`, today for this month, at the current prices of the subscriptions. | |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'license_manager'
|
|
17
|
+
|
|
18
|
+
instance = LicenseManager::Mrr.new(
|
|
19
|
+
currency: USD,
|
|
20
|
+
mrr: 1240,
|
|
21
|
+
by_interval: null,
|
|
22
|
+
by_policy: null,
|
|
23
|
+
by_month: [900, 1100, 1240]
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# LicenseManager::MrrByIntervalInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **interval** | **String** | | |
|
|
8
|
+
| **interval_count** | **Integer** | | |
|
|
9
|
+
| **subscription_count** | **Integer** | | |
|
|
10
|
+
| **mrr** | **Float** | | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'license_manager'
|
|
16
|
+
|
|
17
|
+
instance = LicenseManager::MrrByIntervalInner.new(
|
|
18
|
+
interval: null,
|
|
19
|
+
interval_count: 1,
|
|
20
|
+
subscription_count: 80,
|
|
21
|
+
mrr: 800
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# LicenseManager::MrrByPolicyInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **policy_id** | **String** | | |
|
|
8
|
+
| **subscription_count** | **Integer** | | |
|
|
9
|
+
| **mrr** | **Float** | | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'license_manager'
|
|
15
|
+
|
|
16
|
+
instance = LicenseManager::MrrByPolicyInner.new(
|
|
17
|
+
policy_id: p4Rt8LmQ,
|
|
18
|
+
subscription_count: 80,
|
|
19
|
+
mrr: 800
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/PortalApi.md
CHANGED
|
@@ -4,12 +4,91 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**create_billing_portal_session**](PortalApi.md#create_billing_portal_session) | **POST** /v1/customers/{id}/billing-portal-sessions | Open the Stripe customer portal of a customer |
|
|
7
8
|
| [**create_portal_link**](PortalApi.md#create_portal_link) | **POST** /v1/customers/{id}/portal-links | Create a link to the customer portal |
|
|
8
9
|
| [**get_portal**](PortalApi.md#get_portal) | **GET** /v1/portal/{productId} | Get the customer portal of a product |
|
|
9
10
|
| [**request_portal_link**](PortalApi.md#request_portal_link) | **POST** /v1/portal/{productId}/request-link | Email a link to the customer portal |
|
|
10
11
|
| [**send_portal_link**](PortalApi.md#send_portal_link) | **POST** /v1/customers/{id}/portal-links/send | Email a link to the customer portal to the customer |
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
## create_billing_portal_session
|
|
15
|
+
|
|
16
|
+
> <BillingPortalSession> create_billing_portal_session(id, opts)
|
|
17
|
+
|
|
18
|
+
Open the Stripe customer portal of a customer
|
|
19
|
+
|
|
20
|
+
Link to the Stripe customer portal of the customer's Stripe customer, where they manage their subscriptions: change their plan or payment method, see their invoices, cancel. Needs the Stripe integration's `canBillingPortal`, and the customer portal configured in the Stripe account's settings. The changes come back through the integration's webhook, keeping the subscription licenses in line. **Token access**: customer tokens with the `customer:billing` permission (or the matching write one). A customer token reaches its own customer. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
21
|
+
|
|
22
|
+
### Examples
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
require 'time'
|
|
26
|
+
require 'license_manager'
|
|
27
|
+
# setup authorization
|
|
28
|
+
LicenseManager.configure do |config|
|
|
29
|
+
# Configure API key authorization: apiKey
|
|
30
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
31
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
32
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
33
|
+
|
|
34
|
+
# Configure Bearer authorization (JWT): token
|
|
35
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
api_instance = LicenseManager::PortalApi.new
|
|
39
|
+
id = 'c9Wd3RtE' # String |
|
|
40
|
+
opts = {
|
|
41
|
+
create_billing_portal_session: LicenseManager::CreateBillingPortalSession.new # CreateBillingPortalSession |
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
begin
|
|
45
|
+
# Open the Stripe customer portal of a customer
|
|
46
|
+
result = api_instance.create_billing_portal_session(id, opts)
|
|
47
|
+
p result
|
|
48
|
+
rescue LicenseManager::ApiError => e
|
|
49
|
+
puts "Error when calling PortalApi->create_billing_portal_session: #{e}"
|
|
50
|
+
end
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### Using the create_billing_portal_session_with_http_info variant
|
|
54
|
+
|
|
55
|
+
This returns an Array which contains the response data, status code and headers.
|
|
56
|
+
|
|
57
|
+
> <Array(<BillingPortalSession>, Integer, Hash)> create_billing_portal_session_with_http_info(id, opts)
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
begin
|
|
61
|
+
# Open the Stripe customer portal of a customer
|
|
62
|
+
data, status_code, headers = api_instance.create_billing_portal_session_with_http_info(id, opts)
|
|
63
|
+
p status_code # => 2xx
|
|
64
|
+
p headers # => { ... }
|
|
65
|
+
p data # => <BillingPortalSession>
|
|
66
|
+
rescue LicenseManager::ApiError => e
|
|
67
|
+
puts "Error when calling PortalApi->create_billing_portal_session_with_http_info: #{e}"
|
|
68
|
+
end
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Parameters
|
|
72
|
+
|
|
73
|
+
| Name | Type | Description | Notes |
|
|
74
|
+
| ---- | ---- | ----------- | ----- |
|
|
75
|
+
| **id** | **String** | | |
|
|
76
|
+
| **create_billing_portal_session** | [**CreateBillingPortalSession**](CreateBillingPortalSession.md) | | [optional] |
|
|
77
|
+
|
|
78
|
+
### Return type
|
|
79
|
+
|
|
80
|
+
[**BillingPortalSession**](BillingPortalSession.md)
|
|
81
|
+
|
|
82
|
+
### Authorization
|
|
83
|
+
|
|
84
|
+
[apiKey](../README.md#apiKey), [token](../README.md#token)
|
|
85
|
+
|
|
86
|
+
### HTTP request headers
|
|
87
|
+
|
|
88
|
+
- **Content-Type**: application/json
|
|
89
|
+
- **Accept**: application/json
|
|
90
|
+
|
|
91
|
+
|
|
13
92
|
## create_portal_link
|
|
14
93
|
|
|
15
94
|
> <PortalLink> create_portal_link(id, create_portal_link)
|
data/docs/ProductStats.md
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
| **new_licenses_by_month** | **Array<Integer>** | Number of licenses created each month, aligned on `months`. | |
|
|
21
21
|
| **new_licenses_by_policy** | [**Array<ProductStatsNewLicensesByPolicyInner>**](ProductStatsNewLicensesByPolicyInner.md) | Number of licenses of each policy created each day and each month, for the policies with licenses created over the covered months. | |
|
|
22
22
|
| **cancellation** | [**CancellationStats**](CancellationStats.md) | Cancellations of the licenses with a money back guarantee. `null` when no license of the product has one. | |
|
|
23
|
+
| **subscriptions** | [**SubscriptionStats**](SubscriptionStats.md) | Subscriptions of the product. `null` when it has never had one. | |
|
|
23
24
|
| **revenue** | [**Array<Revenue>**](Revenue.md) | Revenue in each currency licenses were sold in, from the one with the most licenses sold. Amounts aren't converted between currencies. | |
|
|
24
25
|
| **activations_by_version** | [**Array<ProductStatsActivationsByVersionInner>**](ProductStatsActivationsByVersionInner.md) | Successful activations of the licenses of the product each day, per version of the application, from the most recent one. | |
|
|
25
26
|
| **active_machines_by_version** | [**Array<ProductStatsActiveMachinesByVersionInner>**](ProductStatsActiveMachinesByVersionInner.md) | Number of active machines running each version of the application, from the most recent one. | |
|
|
@@ -47,6 +48,7 @@ instance = LicenseManager::ProductStats.new(
|
|
|
47
48
|
new_licenses_by_month: [4, 9, 12],
|
|
48
49
|
new_licenses_by_policy: null,
|
|
49
50
|
cancellation: null,
|
|
51
|
+
subscriptions: null,
|
|
50
52
|
revenue: null,
|
|
51
53
|
activations_by_version: null,
|
|
52
54
|
active_machines_by_version: null,
|
data/docs/Revenue.md
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **currency** | **String** | ISO 4217 code of the currency of the revenue. | |
|
|
8
|
-
| **license_count** | **Integer** | Number of licenses sold in the currency, free ones included, canceled ones left out. | |
|
|
9
|
-
| **total** | **Float** |
|
|
10
|
-
| **
|
|
11
|
-
| **
|
|
8
|
+
| **license_count** | **Integer** | Number of licenses sold once in the currency, free ones included, canceled ones and subscription licenses left out. | |
|
|
9
|
+
| **total** | **Float** | Revenue in the currency, in major units: the prices of the licenses sold once, canceled ones left out, plus the payments of the subscriptions, `subscriptionTotal`. | |
|
|
10
|
+
| **subscription_total** | **Float** | Sum of the payments of the subscription licenses in the currency, before taxes, in major units. | |
|
|
11
|
+
| **payment_count** | **Integer** | Number of payments of the subscription licenses in the currency. | |
|
|
12
|
+
| **canceled_license_count** | **Integer** | Number of canceled licenses sold once in the currency. | |
|
|
13
|
+
| **canceled_total** | **Float** | Sum of the prices of the canceled licenses sold once in the currency, in major units: revenue lost to cancellations. | |
|
|
12
14
|
| **this_month** | **Float** | Revenue of the current month, in UTC. | |
|
|
13
15
|
| **last_month** | **Float** | Revenue of the previous month, in UTC. | |
|
|
14
16
|
| **last30_days** | **Float** | Revenue of the last 30 days, today included, in UTC. | |
|
|
@@ -25,6 +27,8 @@ instance = LicenseManager::Revenue.new(
|
|
|
25
27
|
currency: USD,
|
|
26
28
|
license_count: 42,
|
|
27
29
|
total: 2099.58,
|
|
30
|
+
subscription_total: 480,
|
|
31
|
+
payment_count: 48,
|
|
28
32
|
canceled_license_count: 2,
|
|
29
33
|
canceled_total: 99.98,
|
|
30
34
|
this_month: 349.93,
|
data/docs/StripePermission.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **access** | **String** | | |
|
|
9
9
|
| **reason** | **String** | | |
|
|
10
10
|
| **optional** | **Boolean** | Whether the key can connect without it, losing what it's for, explained by `reason`. | |
|
|
11
|
+
| **subscriptions** | **Boolean** | Whether it's only needed to sell subscriptions: checked once a recurring price is mapped. | |
|
|
11
12
|
|
|
12
13
|
## Example
|
|
13
14
|
|
|
@@ -18,7 +19,8 @@ instance = LicenseManager::StripePermission.new(
|
|
|
18
19
|
resource: Prices,
|
|
19
20
|
access: null,
|
|
20
21
|
reason: Lists your prices so you can choose which ones create licenses, and checks they can still be paid.,
|
|
21
|
-
optional: false
|
|
22
|
+
optional: false,
|
|
23
|
+
subscriptions: false
|
|
22
24
|
)
|
|
23
25
|
```
|
|
24
26
|
|
data/docs/StripePrice.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
| **product_name** | **String** | | |
|
|
10
10
|
| **nickname** | **String** | | |
|
|
11
11
|
| **price** | [**Price**](Price.md) | | |
|
|
12
|
+
| **recurring** | [**StripePriceRecurring**](StripePriceRecurring.md) | | |
|
|
12
13
|
| **mapped** | **Boolean** | Whether the price already creates licenses of a product. | |
|
|
13
14
|
|
|
14
15
|
## Example
|
|
@@ -22,6 +23,7 @@ instance = LicenseManager::StripePrice.new(
|
|
|
22
23
|
product_name: Acme Pro,
|
|
23
24
|
nickname: Launch price,
|
|
24
25
|
price: null,
|
|
26
|
+
recurring: null,
|
|
25
27
|
mapped: null
|
|
26
28
|
)
|
|
27
29
|
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# LicenseManager::StripePriceRecurring
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **interval** | **String** | | |
|
|
8
|
+
| **interval_count** | **Integer** | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'license_manager'
|
|
14
|
+
|
|
15
|
+
instance = LicenseManager::StripePriceRecurring.new(
|
|
16
|
+
interval: null,
|
|
17
|
+
interval_count: 1
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# LicenseManager::SubscriptionStats
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **active_count** | **Integer** | Number of ongoing subscriptions: `active`, `trialing` or `past_due`. | |
|
|
8
|
+
| **trialing_count** | **Integer** | | |
|
|
9
|
+
| **past_due_count** | **Integer** | Number of them whose renewal failed, as Stripe retries it: their licenses stay valid for the integration's grace days. | |
|
|
10
|
+
| **canceling_count** | **Integer** | Number of them set to end at the end of their period. | |
|
|
11
|
+
| **new_count** | **Integer** | Number of subscriptions started in the last 30 days. | |
|
|
12
|
+
| **ended_count** | **Integer** | Number of subscriptions that ended in the last 30 days. | |
|
|
13
|
+
| **churn_rate** | **Float** | Share of the subscriptions ongoing 30 days ago that ended since, from 0 to 1. | |
|
|
14
|
+
| **new_by_month** | **Array<Integer>** | Number of subscriptions started each month, aligned on `months`. | |
|
|
15
|
+
| **ended_by_month** | **Array<Integer>** | Number of subscriptions that ended each month, aligned on `months`. | |
|
|
16
|
+
| **active_by_month** | **Array<Integer>** | Number of ongoing subscriptions at the end of each month, aligned on `months`, today for this month. | |
|
|
17
|
+
| **mrr** | [**Array<Mrr>**](Mrr.md) | MRR in each currency, from the highest number of subscriptions. Amounts aren't converted between currencies. | |
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
require 'license_manager'
|
|
23
|
+
|
|
24
|
+
instance = LicenseManager::SubscriptionStats.new(
|
|
25
|
+
active_count: 120,
|
|
26
|
+
trialing_count: 4,
|
|
27
|
+
past_due_count: 3,
|
|
28
|
+
canceling_count: 5,
|
|
29
|
+
new_count: 14,
|
|
30
|
+
ended_count: 3,
|
|
31
|
+
churn_rate: 0.025,
|
|
32
|
+
new_by_month: [3, 5, 8],
|
|
33
|
+
ended_by_month: [0, 1, 2],
|
|
34
|
+
active_by_month: [90, 104, 120],
|
|
35
|
+
mrr: null
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
data/docs/UpdateIntegration.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **auto_refund** | **Boolean** | Whether canceling a license bought through Stripe refunds its payment. Can only be turned on when the integration's `canRefund` is true: the API key has the Refunds: Write permission. | [optional] |
|
|
8
|
+
| **subscription_grace_days** | **Integer** | Days a subscription license stays valid after its period ends while its renewal is unpaid, as Stripe retries the payment. | [optional] |
|
|
8
9
|
|
|
9
10
|
## Example
|
|
10
11
|
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
require 'license_manager'
|
|
13
14
|
|
|
14
15
|
instance = LicenseManager::UpdateIntegration.new(
|
|
15
|
-
auto_refund: false
|
|
16
|
+
auto_refund: false,
|
|
17
|
+
subscription_grace_days: 7
|
|
16
18
|
)
|
|
17
19
|
```
|
|
18
20
|
|
|
@@ -20,7 +20,7 @@ module LicenseManager
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Cancel a license
|
|
23
|
-
# Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
23
|
+
# Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. A subscription license isn't refunded: its Stripe subscription is canceled at once, without proration, which needs the integration's `canManageSubscriptions`. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
24
24
|
# @param id [String]
|
|
25
25
|
# @param cancel_license [CancelLicense]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
@@ -31,7 +31,7 @@ module LicenseManager
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Cancel a license
|
|
34
|
-
# Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
34
|
+
# Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. A subscription license isn't refunded: its Stripe subscription is canceled at once, without proration, which needs the integration's `canManageSubscriptions`. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
35
35
|
# @param id [String]
|
|
36
36
|
# @param cancel_license [CancelLicense]
|
|
37
37
|
# @param [Hash] opts the optional parameters
|