license_manager 0.1.1 → 0.2.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 +95 -0
- data/README.md +2 -2
- data/docs/CancelLicense.md +22 -0
- data/docs/CancellationReason.md +15 -0
- data/docs/CancellationStats.md +30 -0
- data/docs/CancellationStatsByReasonInner.md +20 -0
- data/docs/ConnectStripe.md +1 -1
- data/docs/CreateLicense.md +2 -0
- data/docs/CreatePolicy.md +3 -1
- data/docs/CreateProductWithPolicy.md +1 -1
- data/docs/CreateToken.md +1 -1
- data/docs/EventActorOneOf.md +1 -1
- data/docs/Integration.md +5 -1
- data/docs/IntegrationsApi.md +74 -0
- data/docs/License.md +10 -0
- data/docs/LicensesApi.md +80 -3
- data/docs/Machine.md +3 -1
- data/docs/MachinesApi.md +1 -1
- data/docs/Policy.md +2 -0
- data/docs/PolicySettings.md +3 -1
- data/docs/PortalApi.md +1 -1
- data/docs/PortalLink.md +2 -2
- data/docs/Product.md +2 -0
- data/docs/ProductStats.md +6 -4
- data/docs/ProductsApi.md +2 -2
- data/docs/Revenue.md +6 -2
- data/docs/StripeIntegration.md +1 -1
- data/docs/StripePermission.md +3 -1
- data/docs/UpdateIntegration.md +18 -0
- data/docs/UpdateLicense.md +3 -1
- data/docs/UpdatePolicy.md +3 -1
- data/docs/UpdateProduct.md +3 -1
- data/lib/license_manager/api/integrations_api.rb +74 -0
- data/lib/license_manager/api/licenses_api.rb +80 -6
- data/lib/license_manager/api/machines_api.rb +3 -3
- data/lib/license_manager/api/portal_api.rb +2 -2
- data/lib/license_manager/api/products_api.rb +4 -4
- data/lib/license_manager/models/cancel_license.rb +238 -0
- data/lib/license_manager/models/cancellation_reason.rb +45 -0
- data/lib/license_manager/models/cancellation_stats.rb +347 -0
- data/lib/license_manager/models/cancellation_stats_by_reason_inner.rb +225 -0
- data/lib/license_manager/models/connect_stripe.rb +1 -1
- data/lib/license_manager/models/create_license.rb +12 -1
- data/lib/license_manager/models/create_policy.rb +40 -5
- data/lib/license_manager/models/create_product_with_policy.rb +1 -1
- data/lib/license_manager/models/create_token.rb +1 -1
- data/lib/license_manager/models/event_type.rb +4 -1
- data/lib/license_manager/models/integration.rb +55 -1
- data/lib/license_manager/models/license.rb +79 -1
- data/lib/license_manager/models/license_status.rb +2 -1
- data/lib/license_manager/models/machine.rb +17 -4
- data/lib/license_manager/models/policy.rb +14 -1
- data/lib/license_manager/models/policy_settings.rb +40 -5
- data/lib/license_manager/models/portal_link.rb +1 -1
- data/lib/license_manager/models/product.rb +28 -1
- data/lib/license_manager/models/product_stats.rb +18 -5
- data/lib/license_manager/models/revenue.rb +58 -4
- data/lib/license_manager/models/stripe_integration.rb +1 -1
- data/lib/license_manager/models/stripe_permission.rb +31 -4
- data/lib/license_manager/models/update_integration.rb +161 -0
- data/lib/license_manager/models/update_license.rb +16 -5
- data/lib/license_manager/models/update_policy.rb +40 -5
- data/lib/license_manager/models/update_product.rb +14 -4
- data/lib/license_manager/version.rb +1 -1
- data/lib/license_manager.rb +5 -0
- data/openapi.json +566 -32
- data/spec/api/integrations_api_spec.rb +13 -0
- data/spec/api/licenses_api_spec.rb +16 -3
- data/spec/api/machines_api_spec.rb +1 -1
- data/spec/api/portal_api_spec.rb +1 -1
- data/spec/api/products_api_spec.rb +2 -2
- data/spec/models/cancel_license_spec.rb +48 -0
- data/spec/models/cancellation_reason_spec.rb +30 -0
- data/spec/models/cancellation_stats_by_reason_inner_spec.rb +42 -0
- data/spec/models/cancellation_stats_spec.rb +72 -0
- data/spec/models/create_license_spec.rb +6 -0
- data/spec/models/create_policy_spec.rb +6 -0
- data/spec/models/create_token_spec.rb +1 -1
- data/spec/models/integration_spec.rb +12 -0
- data/spec/models/license_spec.rb +30 -0
- data/spec/models/machine_spec.rb +7 -1
- data/spec/models/policy_settings_spec.rb +6 -0
- data/spec/models/policy_spec.rb +6 -0
- data/spec/models/product_spec.rb +6 -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/token_spec.rb +1 -1
- data/spec/models/update_integration_spec.rb +36 -0
- data/spec/models/update_license_spec.rb +6 -0
- data/spec/models/update_policy_spec.rb +6 -0
- data/spec/models/update_product_spec.rb +6 -0
- metadata +21 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6bcf4262163e03a08877a9fcd90c3ca632ed44a53507b49fd7ec1791aeb9f09a
|
|
4
|
+
data.tar.gz: d139d65dc28028b48968c2445fe26a2002d9a648cf786c07d4e74dcde28c4dbd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 328ad38f8a2d30478b298c05c9adfcd98202fade7632455005bef6f535a7ca8a1e48bff28405963b2957f4ef40f5b12cf79e92dcfdac3bda13ecfb76fded9382
|
|
7
|
+
data.tar.gz: b1366be4e6662bb272b916a1ac1f2bc72b7182a97bc0fa1824a01a05b4a27c4e216bff5af55426a6ccd0ffac466dedabb4f084b472c3cdd9f2d169e5e7f0d6b0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,100 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0 (2026-10-27)
|
|
4
|
+
|
|
5
|
+
### Breaking changes
|
|
6
|
+
|
|
7
|
+
- `GET /v1/customers/{customerId}/licenses`: added the new `canceled` enum value to the `data/items/status` response property for the response status `200`
|
|
8
|
+
- `POST /v1/customers/{id}/tokens`: added the new `license:cancel` enum value to the `scope/items/` response property for the response status `201`
|
|
9
|
+
- `GET /v1/licenses/{id}`: added the new `canceled` enum value to the `status` response property for the response status `200`
|
|
10
|
+
- `PATCH /v1/licenses/{id}`: added the new `canceled` enum value to the `status` response property for the response status `200`
|
|
11
|
+
- `GET /v1/licenses/{id}/events`: added the new `license.canceled` enum value to the `data/items/type` response property for the response status `200`
|
|
12
|
+
- `GET /v1/licenses/{id}/events`: added the new `license.refund_failed` enum value to the `data/items/type` response property for the response status `200`
|
|
13
|
+
- `GET /v1/licenses/{id}/events`: added the new `license.refunded` enum value to the `data/items/type` response property for the response status `200`
|
|
14
|
+
- `POST /v1/licenses/{id}/tokens`: added the new `license:cancel` enum value to the `scope/items/` response property for the response status `201`
|
|
15
|
+
- `GET /v1/licenses/{licenseId}/machines`: added the new `locked` enum value to the `data/items/status` response property for the response status `200`
|
|
16
|
+
- `GET /v1/machines/{id}`: added the new `locked` enum value to the `status` response property for the response status `200`
|
|
17
|
+
- `POST /v1/machines/{id}/deactivate`: added the new `locked` enum value to the `status` response property for the response status `200`
|
|
18
|
+
- `POST /v1/machines/{id}/tokens`: added the new `license:cancel` enum value to the `scope/items/` response property for the response status `201`
|
|
19
|
+
- `GET /v1/policies/{id}/events`: added the new `license.canceled` enum value to the `data/items/type` response property for the response status `200`
|
|
20
|
+
- `GET /v1/policies/{id}/events`: added the new `license.refund_failed` enum value to the `data/items/type` response property for the response status `200`
|
|
21
|
+
- `GET /v1/policies/{id}/events`: added the new `license.refunded` enum value to the `data/items/type` response property for the response status `200`
|
|
22
|
+
- `GET /v1/products/{productId}/licenses`: added the new `canceled` enum value to the `data/items/status` response property for the response status `200`
|
|
23
|
+
- `POST /v1/products/{productId}/licenses`: added the new `canceled` enum value to the `status` response property for the response status `201`
|
|
24
|
+
|
|
25
|
+
### Changes
|
|
26
|
+
|
|
27
|
+
- `GET /v1/customers/{customerId}/licenses`: added the enum value `canceled` to the property `allOf[#/components/schemas/LicenseStatus]/` of the `query` request parameter `status`
|
|
28
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/canceledAt` to the response with the `200` status
|
|
29
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/cancellableUntil` to the response with the `200` status
|
|
30
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/cancellationComment` to the response with the `200` status
|
|
31
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/cancellationReason` to the response with the `200` status
|
|
32
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/stripeRefundId` to the response with the `200` status
|
|
33
|
+
- `POST /v1/customers/{id}/tokens`: added the new `license:cancel` enum value to the request property `scope/items/`
|
|
34
|
+
- `PATCH /v1/integrations/{id}`: endpoint added
|
|
35
|
+
- `POST /v1/integrations/{id}/check`: added the required property `autoRefund` to the response with the `200` status
|
|
36
|
+
- `POST /v1/integrations/{id}/check`: added the required property `canRefund` to the response with the `200` status
|
|
37
|
+
- `GET /v1/licenses/{id}`: added the required property `canceledAt` to the response with the `200` status
|
|
38
|
+
- `GET /v1/licenses/{id}`: added the required property `cancellableUntil` to the response with the `200` status
|
|
39
|
+
- `GET /v1/licenses/{id}`: added the required property `cancellationComment` to the response with the `200` status
|
|
40
|
+
- `GET /v1/licenses/{id}`: added the required property `cancellationReason` to the response with the `200` status
|
|
41
|
+
- `GET /v1/licenses/{id}`: added the required property `stripeRefundId` to the response with the `200` status
|
|
42
|
+
- `PATCH /v1/licenses/{id}`: added the new optional request property `cancellableUntil`
|
|
43
|
+
- `PATCH /v1/licenses/{id}`: added the required property `canceledAt` to the response with the `200` status
|
|
44
|
+
- `PATCH /v1/licenses/{id}`: added the required property `cancellableUntil` to the response with the `200` status
|
|
45
|
+
- `PATCH /v1/licenses/{id}`: added the required property `cancellationComment` to the response with the `200` status
|
|
46
|
+
- `PATCH /v1/licenses/{id}`: added the required property `cancellationReason` to the response with the `200` status
|
|
47
|
+
- `PATCH /v1/licenses/{id}`: added the required property `stripeRefundId` to the response with the `200` status
|
|
48
|
+
- `POST /v1/licenses/{id}/cancel`: endpoint added
|
|
49
|
+
- `GET /v1/licenses/{id}/events`: added the enum value `license.canceled` 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`)
|
|
50
|
+
- `GET /v1/licenses/{id}/events`: added the enum value `license.refund_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`)
|
|
51
|
+
- `GET /v1/licenses/{id}/events`: added the enum value `license.refunded` 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`)
|
|
52
|
+
- `POST /v1/licenses/{id}/tokens`: added the new `license:cancel` enum value to the request property `scope/items/`
|
|
53
|
+
- `GET /v1/licenses/{licenseId}/machines`: added the new enum value `locked` to the `query` request parameter `status`
|
|
54
|
+
- `GET /v1/licenses/{licenseId}/machines`: added the required property `data/items/overriddenByMachineId` to the response with the `200` status
|
|
55
|
+
- `GET /v1/machines/{id}`: added the required property `overriddenByMachineId` to the response with the `200` status
|
|
56
|
+
- `POST /v1/machines/{id}/deactivate`: added the required property `overriddenByMachineId` to the response with the `200` status
|
|
57
|
+
- `POST /v1/machines/{id}/tokens`: added the new `license:cancel` enum value to the request property `scope/items/`
|
|
58
|
+
- `GET /v1/policies/{id}`: added the required property `moneyBackGuaranteeDays` to the response with the `200` status
|
|
59
|
+
- `PATCH /v1/policies/{id}`: added the new optional request property `moneyBackGuaranteeDays`
|
|
60
|
+
- `PATCH /v1/policies/{id}`: added the required property `moneyBackGuaranteeDays` to the response with the `200` status
|
|
61
|
+
- `GET /v1/policies/{id}/events`: added the enum value `license.canceled` 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`)
|
|
62
|
+
- `GET /v1/policies/{id}/events`: added the enum value `license.refund_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`)
|
|
63
|
+
- `GET /v1/policies/{id}/events`: added the enum value `license.refunded` 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`)
|
|
64
|
+
- `GET /v1/products`: added the required property `data/items/autoMachineChange` to the response with the `200` status
|
|
65
|
+
- `POST /v1/products`: added the new optional request property `allOf[subschema #2]/defaultPolicy/moneyBackGuaranteeDays`
|
|
66
|
+
- `POST /v1/products`: added the required property `autoMachineChange` to the response with the `201` status
|
|
67
|
+
- `GET /v1/products/{id}`: added the required property `autoMachineChange` to the response with the `200` status
|
|
68
|
+
- `PATCH /v1/products/{id}`: added the new optional request property `autoMachineChange`
|
|
69
|
+
- `PATCH /v1/products/{id}`: added the required property `autoMachineChange` to the response with the `200` status
|
|
70
|
+
- `DELETE /v1/products/{id}/logo`: added the required property `autoMachineChange` to the response with the `200` status
|
|
71
|
+
- `PUT /v1/products/{id}/logo`: added the required property `autoMachineChange` to the response with the `200` status
|
|
72
|
+
- `POST /v1/products/{id}/reset`: added the required property `autoMachineChange` to the response with the `200` status
|
|
73
|
+
- `GET /v1/products/{id}/stats`: added the required property `cancellation` to the response with the `200` status
|
|
74
|
+
- `GET /v1/products/{id}/stats`: added the required property `revenue/items/canceledLicenseCount` to the response with the `200` status
|
|
75
|
+
- `GET /v1/products/{id}/stats`: added the required property `revenue/items/canceledTotal` to the response with the `200` status
|
|
76
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/autoRefund` to the response with the `200` status
|
|
77
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/canRefund` to the response with the `200` status
|
|
78
|
+
- `GET /v1/products/{productId}/integrations/stripe`: added the required property `requiredPermissions/items/optional` to the response with the `200` status
|
|
79
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/autoRefund` to the response with the `200` status
|
|
80
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `integration/anyOf[#/components/schemas/Integration]/canRefund` to the response with the `200` status
|
|
81
|
+
- `PUT /v1/products/{productId}/integrations/stripe`: added the required property `requiredPermissions/items/optional` to the response with the `200` status
|
|
82
|
+
- `GET /v1/products/{productId}/licenses`: added the enum value `canceled` to the property `allOf[#/components/schemas/LicenseStatus]/` of the `query` request parameter `status`
|
|
83
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/canceledAt` to the response with the `200` status
|
|
84
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/cancellableUntil` to the response with the `200` status
|
|
85
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/cancellationComment` to the response with the `200` status
|
|
86
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/cancellationReason` to the response with the `200` status
|
|
87
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/stripeRefundId` to the response with the `200` status
|
|
88
|
+
- `POST /v1/products/{productId}/licenses`: added the new optional request property `cancellableUntil`
|
|
89
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `canceledAt` to the response with the `201` status
|
|
90
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `cancellableUntil` to the response with the `201` status
|
|
91
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `cancellationComment` to the response with the `201` status
|
|
92
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `cancellationReason` to the response with the `201` status
|
|
93
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `stripeRefundId` to the response with the `201` status
|
|
94
|
+
- `GET /v1/products/{productId}/policies`: added the required property `data/items/moneyBackGuaranteeDays` to the response with the `200` status
|
|
95
|
+
- `POST /v1/products/{productId}/policies`: added the new optional request property `moneyBackGuaranteeDays`
|
|
96
|
+
- `POST /v1/products/{productId}/policies`: added the required property `moneyBackGuaranteeDays` to the response with the `201` status
|
|
97
|
+
|
|
3
98
|
## 0.1.1 (2026-10-20)
|
|
4
99
|
|
|
5
100
|
Regenerated from the same API.
|
data/README.md
CHANGED
|
@@ -76,7 +76,7 @@ Every method is documented, with its parameters and responses, in the [`docs`](d
|
|
|
76
76
|
|
|
77
77
|
| Class | Methods |
|
|
78
78
|
| --- | --- |
|
|
79
|
-
| [`LicensesApi`](docs/LicensesApi.md) | `validate_key`, `list_licenses`, `create_license`, `list_customer_licenses`, `get_license`, `delete_license`, `update_license`, `get_license_stats`, `send_license_keys`, `get_signing_key` |
|
|
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
80
|
| [`PortalApi`](docs/PortalApi.md) | `get_portal`, `request_portal_link`, `create_portal_link`, `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` |
|
|
@@ -85,7 +85,7 @@ Every method is documented, with its parameters and responses, in the [`docs`](d
|
|
|
85
85
|
| [`ReleasesApi`](docs/ReleasesApi.md) | `list_releases`, `create_release`, `get_release`, `delete_release`, `update_release` |
|
|
86
86
|
| [`TokensApi`](docs/TokensApi.md) | `create_customer_token`, `create_license_token`, `create_machine_token` |
|
|
87
87
|
| [`EventsApi`](docs/EventsApi.md) | `list_policy_events`, `list_license_events` |
|
|
88
|
-
| [`IntegrationsApi`](docs/IntegrationsApi.md) | `get_stripe_integration`, `connect_stripe`, `disconnect_integration`, `check_integration`, `list_stripe_prices`, `create_stripe_mapping`, `delete_stripe_mapping`, `update_stripe_mapping` |
|
|
88
|
+
| [`IntegrationsApi`](docs/IntegrationsApi.md) | `get_stripe_integration`, `connect_stripe`, `disconnect_integration`, `update_integration`, `check_integration`, `list_stripe_prices`, `create_stripe_mapping`, `delete_stripe_mapping`, `update_stripe_mapping` |
|
|
89
89
|
|
|
90
90
|
## Versioning
|
|
91
91
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# LicenseManager::CancelLicense
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **reason** | [**CancellationReason**](CancellationReason.md) | | |
|
|
8
|
+
| **comment** | **String** | What the customer said about the cancellation. | [optional] |
|
|
9
|
+
| **refund** | **Boolean** | Whether to refund the license's Stripe payment, when it was bought through the Stripe integration. Defaults to the integration's `autoRefund`. Ignored for tokens, which always follow `autoRefund`, and when the integration's `canRefund` is false: its API key can't create refunds. | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'license_manager'
|
|
15
|
+
|
|
16
|
+
instance = LicenseManager::CancelLicense.new(
|
|
17
|
+
reason: null,
|
|
18
|
+
comment: I only needed it for one project.,
|
|
19
|
+
refund: true
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# LicenseManager::CancellationReason
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
require 'license_manager'
|
|
12
|
+
|
|
13
|
+
instance = LicenseManager::CancellationReason.new()
|
|
14
|
+
```
|
|
15
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# LicenseManager::CancellationStats
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **license_count** | **Integer** | Number of licenses with a money back guarantee: a `cancellableUntil`. | |
|
|
8
|
+
| **canceled_license_count** | **Integer** | Number of them that were canceled. | |
|
|
9
|
+
| **cancellable_license_count** | **Integer** | Number of them whose money back guarantee hasn't ended, and that weren't canceled: they can still be. | |
|
|
10
|
+
| **rate** | **Float** | Share of them that were canceled, from 0 to 1: `canceledLicenseCount` over `licenseCount`. | |
|
|
11
|
+
| **canceled_by_day** | **Array<Integer>** | Number of them canceled each day, aligned on `days`, on the day of their cancellation. | |
|
|
12
|
+
| **canceled_by_month** | **Array<Integer>** | Number of them canceled each month, aligned on `months`, on the month of their cancellation. | |
|
|
13
|
+
| **by_reason** | [**Array<CancellationStatsByReasonInner>**](CancellationStatsByReasonInner.md) | Number of them canceled for each reason, from the most given one. Reasons never given are left out. | |
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'license_manager'
|
|
19
|
+
|
|
20
|
+
instance = LicenseManager::CancellationStats.new(
|
|
21
|
+
license_count: 80,
|
|
22
|
+
canceled_license_count: 4,
|
|
23
|
+
cancellable_license_count: 12,
|
|
24
|
+
rate: 0.05,
|
|
25
|
+
canceled_by_day: [0, 1, 0],
|
|
26
|
+
canceled_by_month: [1, 0, 2],
|
|
27
|
+
by_reason: null
|
|
28
|
+
)
|
|
29
|
+
```
|
|
30
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# LicenseManager::CancellationStatsByReasonInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **reason** | [**CancellationReason**](CancellationReason.md) | | |
|
|
8
|
+
| **count** | **Integer** | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'license_manager'
|
|
14
|
+
|
|
15
|
+
instance = LicenseManager::CancellationStatsByReasonInner.new(
|
|
16
|
+
reason: null,
|
|
17
|
+
count: 2
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/ConnectStripe.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **api_key** | **String** | Restricted API key of the Stripe account (`rk_live_…` for live products, `rk_test_…` for test products), with the `requiredPermissions` of `getStripeIntegration`. A secret key works too, but gives the app more access than it needs. | |
|
|
7
|
+
| **api_key** | **String** | Restricted API key of the Stripe account (`rk_live_…` for live products, `rk_test_…` for test products), with the `requiredPermissions` of `getStripeIntegration`. Without the optional ones, it connects with what they're for turned off. A secret key works too, but gives the app more access than it needs. | |
|
|
8
8
|
|
|
9
9
|
## Example
|
|
10
10
|
|
data/docs/CreateLicense.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
| **max_offline_duration_seconds** | **Integer** | Longest the applications can run offline with the license, in seconds. At least one hour (`3600`). Defaults to the one of the policy. | [optional] |
|
|
14
14
|
| **price** | [**PriceInput**](PriceInput.md) | | [optional] |
|
|
15
15
|
| **max_version** | [**LicenseMaxVersionInput**](LicenseMaxVersionInput.md) | | [optional] |
|
|
16
|
+
| **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. `null` to not let them. Defaults to the creation date plus the policy's `moneyBackGuaranteeDays`, or `null` when it has none. | [optional] |
|
|
16
17
|
| **send_key** | **Boolean** | `true` emails the key to the customer once the license is created, like `sendLicenseKeys`. Sent in the background: a failed email doesn't fail the creation. In test products, it's only sent when the customer's email is a member's of the organization. Defaults to `false`. | [optional] |
|
|
17
18
|
|
|
18
19
|
## Example
|
|
@@ -30,6 +31,7 @@ instance = LicenseManager::CreateLicense.new(
|
|
|
30
31
|
max_offline_duration_seconds: 604800,
|
|
31
32
|
price: null,
|
|
32
33
|
max_version: null,
|
|
34
|
+
cancellable_until: 2026-02-14T09:30:00.000Z,
|
|
33
35
|
send_key: true
|
|
34
36
|
)
|
|
35
37
|
```
|
data/docs/CreatePolicy.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
| **max_machines** | **Integer** | Maximum number of active machines of the licenses created with this policy, copied to each of them. `null` for no limit. Defaults to `null`. | [optional] |
|
|
12
12
|
| **max_offline_duration_seconds** | **Integer** | Longest the applications can run offline with the licenses created with this policy, in seconds, copied to each of them. At least one hour (`3600`). Defaults to one week. | [optional] |
|
|
13
13
|
| **max_version** | [**PolicySettingsMaxVersion**](PolicySettingsMaxVersion.md) | | [optional] |
|
|
14
|
+
| **money_back_guarantee_days** | **Integer** | Number of days after their creation during which customers can cancel the licenses created with this policy, from the customer portal or with `cancelLicense`, which refunds their Stripe payment. Each license keeps the end of its own period as `cancellableUntil`. `null` for no money back guarantee. Defaults to `null`. | [optional] |
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -24,7 +25,8 @@ instance = LicenseManager::CreatePolicy.new(
|
|
|
24
25
|
duration: null,
|
|
25
26
|
max_machines: 3,
|
|
26
27
|
max_offline_duration_seconds: 604800,
|
|
27
|
-
max_version: null
|
|
28
|
+
max_version: null,
|
|
29
|
+
money_back_guarantee_days: 30
|
|
28
30
|
)
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
| **name** | **String** | | |
|
|
8
8
|
| **slug** | **String** | Unique within the organization. Defaults to the name, lower cased, without accents and special characters. Starts with `test_` in test products, which is added when missing, and removed in live products. | [optional] |
|
|
9
9
|
| **default_policy** | [**PolicySettings**](PolicySettings.md) | | [optional] |
|
|
10
|
-
| **is_test_from_product_id** | **String** | Creates a test product: a sandbox of this live product of the organization, starting with copies of its policies, releases
|
|
10
|
+
| **is_test_from_product_id** | **String** | Creates a test product: a sandbox of this live product of the organization, starting with copies of its policies, releases, portal settings and `autoMachineChange`. | [optional] |
|
|
11
11
|
|
|
12
12
|
## Example
|
|
13
13
|
|
data/docs/CreateToken.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **scope** | **Array<String>** | Permissions of the token. A write permission implies the
|
|
7
|
+
| **scope** | **Array<String>** | Permissions of the token. A write permission implies the other ones of its resource, like the read one: `license:write` implies `license:read` and `license:cancel`. A token creating a token can only give the permissions it has. | |
|
|
8
8
|
| **expires_in_seconds** | **Integer** | How long the token works, in seconds, from 60 (1 minute) to 31536000 (365 days). Defaults to 900 (15 minutes). A token creating a token can't give it a later expiration than its own: it's shortened to it. | [optional][default to 900] |
|
|
9
9
|
|
|
10
10
|
## Example
|
data/docs/EventActorOneOf.md
CHANGED
data/docs/Integration.md
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
| **status_reason** | **String** | Why the integration isn't `active`, `null` when it is. | |
|
|
15
15
|
| **last_checked_at** | **Time** | Last time its health was checked, done every day. | |
|
|
16
16
|
| **last_event_at** | **Time** | Last time it received an event from the provider. | |
|
|
17
|
+
| **auto_refund** | **Boolean** | Whether canceling a license bought through Stripe refunds its payment. On by default, always off when `canRefund` is false. | |
|
|
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. | |
|
|
17
19
|
| **created_at** | **Time** | | |
|
|
18
20
|
|
|
19
21
|
## Example
|
|
@@ -27,11 +29,13 @@ instance = LicenseManager::Integration.new(
|
|
|
27
29
|
livemode: null,
|
|
28
30
|
account_name: Acme Inc.,
|
|
29
31
|
api_key_hint: rk_live_…Ab3d,
|
|
30
|
-
webhook_url: https://api.
|
|
32
|
+
webhook_url: https://api.licensemanager.dev/v1/webhooks/stripe/i8Fz4QnRt,
|
|
31
33
|
status: null,
|
|
32
34
|
status_reason: The API key can't manage webhook endpoints: give it the Webhook Endpoints: Write permission,
|
|
33
35
|
last_checked_at: null,
|
|
34
36
|
last_event_at: null,
|
|
37
|
+
auto_refund: true,
|
|
38
|
+
can_refund: true,
|
|
35
39
|
created_at: null
|
|
36
40
|
)
|
|
37
41
|
```
|
data/docs/IntegrationsApi.md
CHANGED
|
@@ -11,6 +11,7 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
11
11
|
| [**disconnect_integration**](IntegrationsApi.md#disconnect_integration) | **DELETE** /v1/integrations/{id} | Disconnect an integration |
|
|
12
12
|
| [**get_stripe_integration**](IntegrationsApi.md#get_stripe_integration) | **GET** /v1/products/{productId}/integrations/stripe | Get the Stripe integration of a product |
|
|
13
13
|
| [**list_stripe_prices**](IntegrationsApi.md#list_stripe_prices) | **GET** /v1/integrations/{id}/stripe/prices | List the Stripe prices of an integration |
|
|
14
|
+
| [**update_integration**](IntegrationsApi.md#update_integration) | **PATCH** /v1/integrations/{id} | Update an integration |
|
|
14
15
|
| [**update_stripe_mapping**](IntegrationsApi.md#update_stripe_mapping) | **PATCH** /v1/integration-mappings/{id} | Change the policy of a mapping |
|
|
15
16
|
|
|
16
17
|
|
|
@@ -513,6 +514,79 @@ end
|
|
|
513
514
|
- **Accept**: application/json
|
|
514
515
|
|
|
515
516
|
|
|
517
|
+
## update_integration
|
|
518
|
+
|
|
519
|
+
> <Integration> update_integration(id, update_integration)
|
|
520
|
+
|
|
521
|
+
Update an integration
|
|
522
|
+
|
|
523
|
+
Changes the settings of the integration, for every product of its mode. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
524
|
+
|
|
525
|
+
### Examples
|
|
526
|
+
|
|
527
|
+
```ruby
|
|
528
|
+
require 'time'
|
|
529
|
+
require 'license_manager'
|
|
530
|
+
# setup authorization
|
|
531
|
+
LicenseManager.configure do |config|
|
|
532
|
+
# Configure API key authorization: apiKey
|
|
533
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
534
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
535
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
api_instance = LicenseManager::IntegrationsApi.new
|
|
539
|
+
id = 'i8Fz4QnRt' # String |
|
|
540
|
+
update_integration = LicenseManager::UpdateIntegration.new # UpdateIntegration |
|
|
541
|
+
|
|
542
|
+
begin
|
|
543
|
+
# Update an integration
|
|
544
|
+
result = api_instance.update_integration(id, update_integration)
|
|
545
|
+
p result
|
|
546
|
+
rescue LicenseManager::ApiError => e
|
|
547
|
+
puts "Error when calling IntegrationsApi->update_integration: #{e}"
|
|
548
|
+
end
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
#### Using the update_integration_with_http_info variant
|
|
552
|
+
|
|
553
|
+
This returns an Array which contains the response data, status code and headers.
|
|
554
|
+
|
|
555
|
+
> <Array(<Integration>, Integer, Hash)> update_integration_with_http_info(id, update_integration)
|
|
556
|
+
|
|
557
|
+
```ruby
|
|
558
|
+
begin
|
|
559
|
+
# Update an integration
|
|
560
|
+
data, status_code, headers = api_instance.update_integration_with_http_info(id, update_integration)
|
|
561
|
+
p status_code # => 2xx
|
|
562
|
+
p headers # => { ... }
|
|
563
|
+
p data # => <Integration>
|
|
564
|
+
rescue LicenseManager::ApiError => e
|
|
565
|
+
puts "Error when calling IntegrationsApi->update_integration_with_http_info: #{e}"
|
|
566
|
+
end
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
### Parameters
|
|
570
|
+
|
|
571
|
+
| Name | Type | Description | Notes |
|
|
572
|
+
| ---- | ---- | ----------- | ----- |
|
|
573
|
+
| **id** | **String** | | |
|
|
574
|
+
| **update_integration** | [**UpdateIntegration**](UpdateIntegration.md) | | |
|
|
575
|
+
|
|
576
|
+
### Return type
|
|
577
|
+
|
|
578
|
+
[**Integration**](Integration.md)
|
|
579
|
+
|
|
580
|
+
### Authorization
|
|
581
|
+
|
|
582
|
+
[apiKey](../README.md#apiKey)
|
|
583
|
+
|
|
584
|
+
### HTTP request headers
|
|
585
|
+
|
|
586
|
+
- **Content-Type**: application/json
|
|
587
|
+
- **Accept**: application/json
|
|
588
|
+
|
|
589
|
+
|
|
516
590
|
## update_stripe_mapping
|
|
517
591
|
|
|
518
592
|
> <IntegrationMapping> update_stripe_mapping(id, update_integration_mapping)
|
data/docs/License.md
CHANGED
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
| **max_version** | [**LicenseMaxVersion**](LicenseMaxVersion.md) | | |
|
|
21
21
|
| **price** | [**Price**](Price.md) | | |
|
|
22
22
|
| **status** | [**LicenseStatus**](LicenseStatus.md) | | |
|
|
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
|
+
| **canceled_at** | **Time** | When the license was canceled: validating its key fails since. `null` when it wasn't. | |
|
|
25
|
+
| **cancellation_reason** | [**CancellationReason**](CancellationReason.md) | | |
|
|
26
|
+
| **cancellation_comment** | **String** | Comment given when the license was canceled. `null` when there's none. | |
|
|
27
|
+
| **stripe_refund_id** | **String** | Id of the Stripe refund of the license's payment once it was canceled, through the Stripe integration. `null` otherwise. | |
|
|
23
28
|
| **updated_at** | **Time** | Last time the license's settings were edited, not when its key was validated. | |
|
|
24
29
|
|
|
25
30
|
## Example
|
|
@@ -44,6 +49,11 @@ instance = LicenseManager::License.new(
|
|
|
44
49
|
max_version: null,
|
|
45
50
|
price: null,
|
|
46
51
|
status: null,
|
|
52
|
+
cancellable_until: 2026-02-14T09:30:00.000Z,
|
|
53
|
+
canceled_at: 2026-01-20T16:12:00.000Z,
|
|
54
|
+
cancellation_reason: null,
|
|
55
|
+
cancellation_comment: I only needed it for one project.,
|
|
56
|
+
stripe_refund_id: re_3MtwBwLkdIwHu7ix0Bs5rA2b,
|
|
47
57
|
updated_at: 2026-01-15T09:30:00.000Z
|
|
48
58
|
)
|
|
49
59
|
```
|
data/docs/LicensesApi.md
CHANGED
|
@@ -4,6 +4,7 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**cancel_license**](LicensesApi.md#cancel_license) | **POST** /v1/licenses/{id}/cancel | Cancel a license |
|
|
7
8
|
| [**create_license**](LicensesApi.md#create_license) | **POST** /v1/products/{productId}/licenses | Create a license |
|
|
8
9
|
| [**delete_license**](LicensesApi.md#delete_license) | **DELETE** /v1/licenses/{id} | Delete a license |
|
|
9
10
|
| [**get_license**](LicensesApi.md#get_license) | **GET** /v1/licenses/{id} | Get a license |
|
|
@@ -16,13 +17,89 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
16
17
|
| [**validate_key**](LicensesApi.md#validate_key) | **POST** /v1/products/{productId}/validate-key | Validate a license key |
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
## cancel_license
|
|
21
|
+
|
|
22
|
+
> <License> cancel_license(id, cancel_license)
|
|
23
|
+
|
|
24
|
+
Cancel a license
|
|
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.
|
|
27
|
+
|
|
28
|
+
### Examples
|
|
29
|
+
|
|
30
|
+
```ruby
|
|
31
|
+
require 'time'
|
|
32
|
+
require 'license_manager'
|
|
33
|
+
# setup authorization
|
|
34
|
+
LicenseManager.configure do |config|
|
|
35
|
+
# Configure API key authorization: apiKey
|
|
36
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
37
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
38
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
39
|
+
|
|
40
|
+
# Configure Bearer authorization (JWT): token
|
|
41
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
45
|
+
id = 'l3Nv8KwB' # String |
|
|
46
|
+
cancel_license = LicenseManager::CancelLicense.new({reason: LicenseManager::CancellationReason::TOO_EXPENSIVE}) # CancelLicense |
|
|
47
|
+
|
|
48
|
+
begin
|
|
49
|
+
# Cancel a license
|
|
50
|
+
result = api_instance.cancel_license(id, cancel_license)
|
|
51
|
+
p result
|
|
52
|
+
rescue LicenseManager::ApiError => e
|
|
53
|
+
puts "Error when calling LicensesApi->cancel_license: #{e}"
|
|
54
|
+
end
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Using the cancel_license_with_http_info variant
|
|
58
|
+
|
|
59
|
+
This returns an Array which contains the response data, status code and headers.
|
|
60
|
+
|
|
61
|
+
> <Array(<License>, Integer, Hash)> cancel_license_with_http_info(id, cancel_license)
|
|
62
|
+
|
|
63
|
+
```ruby
|
|
64
|
+
begin
|
|
65
|
+
# Cancel a license
|
|
66
|
+
data, status_code, headers = api_instance.cancel_license_with_http_info(id, cancel_license)
|
|
67
|
+
p status_code # => 2xx
|
|
68
|
+
p headers # => { ... }
|
|
69
|
+
p data # => <License>
|
|
70
|
+
rescue LicenseManager::ApiError => e
|
|
71
|
+
puts "Error when calling LicensesApi->cancel_license_with_http_info: #{e}"
|
|
72
|
+
end
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Parameters
|
|
76
|
+
|
|
77
|
+
| Name | Type | Description | Notes |
|
|
78
|
+
| ---- | ---- | ----------- | ----- |
|
|
79
|
+
| **id** | **String** | | |
|
|
80
|
+
| **cancel_license** | [**CancelLicense**](CancelLicense.md) | | |
|
|
81
|
+
|
|
82
|
+
### Return type
|
|
83
|
+
|
|
84
|
+
[**License**](License.md)
|
|
85
|
+
|
|
86
|
+
### Authorization
|
|
87
|
+
|
|
88
|
+
[apiKey](../README.md#apiKey), [token](../README.md#token)
|
|
89
|
+
|
|
90
|
+
### HTTP request headers
|
|
91
|
+
|
|
92
|
+
- **Content-Type**: application/json
|
|
93
|
+
- **Accept**: application/json
|
|
94
|
+
|
|
95
|
+
|
|
19
96
|
## create_license
|
|
20
97
|
|
|
21
98
|
> <License> create_license(product_id, create_license)
|
|
22
99
|
|
|
23
100
|
Create a license
|
|
24
101
|
|
|
25
|
-
Without a `key`, the license gets a random one, like `7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF`: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than `O`, `0`, `I` and `1`. That's 32 possible characters encoding 5 bits each, for 125 random bits. Without a `policyId`, the license follows the product's default policy. Without an `expiresAt`, the license expires after the duration of its policy, or never when the policy has none. `expiresAt: null` makes it never expire. Without a `price`, the price paid for the license is unknown: it's left out of the revenue stats. The values of `maxVersion` left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock. The license belongs to the product's customer with the given `email`, which is created when there's none. With `sendKey: true`, the key is emailed to the customer once the license is created. The license copies the settings of its policy when it's created: later changes to the policy don't affect it. Its key, policy and customer can't be changed afterwards. **Required role permission**: `license:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
102
|
+
Without a `key`, the license gets a random one, like `7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF`: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than `O`, `0`, `I` and `1`. That's 32 possible characters encoding 5 bits each, for 125 random bits. Without a `policyId`, the license follows the product's default policy. Without an `expiresAt`, the license expires after the duration of its policy, or never when the policy has none. `expiresAt: null` makes it never expire. Without a `price`, the price paid for the license is unknown: it's left out of the revenue stats. Without a `cancellableUntil`, the customer can cancel the license during the policy's `moneyBackGuaranteeDays` after its creation, or never when the policy has none. The values of `maxVersion` left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock. The license belongs to the product's customer with the given `email`, which is created when there's none. With `sendKey: true`, the key is emailed to the customer once the license is created. The license copies the settings of its policy when it's created: later changes to the policy don't affect it. Its key, policy and customer can't be changed afterwards. **Required role permission**: `license:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
26
103
|
|
|
27
104
|
### Examples
|
|
28
105
|
|
|
@@ -683,7 +760,7 @@ nil (empty response body)
|
|
|
683
760
|
|
|
684
761
|
Update a license
|
|
685
762
|
|
|
686
|
-
The key, policy and customer of a license can't be changed: sending them does nothing. The changes apply to the next validations of the key, not to the license tokens `validateKey` already returned, which stay valid until they expire. Lowering `maxMachines` doesn't deactivate machines: the ones already active keep validating, and new ones are refused until enough are deactivated. **Required role permission**: `license:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
763
|
+
The key, policy and customer of a license can't be changed: sending them does nothing. The changes apply to the next validations of the key, not to the license tokens `validateKey` already returned, which stay valid until they expire. Lowering `maxMachines` doesn't deactivate machines: the ones already active keep validating, and new ones replace them one at a time when the product has `autoMachineChange`, or are refused until enough are deactivated. **Required role permission**: `license:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
687
764
|
|
|
688
765
|
### Examples
|
|
689
766
|
|
|
@@ -756,7 +833,7 @@ end
|
|
|
756
833
|
|
|
757
834
|
Validate a license key
|
|
758
835
|
|
|
759
|
-
Checks the license key of the product on a machine and returns a token the application can verify offline with the organization's public key. Doesn't need authentication. The license must allow the `version`: up to its `maxVersion.version` when it has one, like `\"2.3\"` for every 2.3.z version and older. Its `maxVersion.lockMajorAt` and `maxVersion.lockMinorAt` are enforced once they hard-code `maxVersion.version`, within the hour they're reached. When it doesn't, the error's `latestAllowedVersion` is the latest release of the product the license allows, so the application can offer to install it. The machine with the `fingerprint` is created when the license has none, and activated when it's deactivated, unless the license is already active on its maximum number of machines. A machine that's already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its `version`, and its `name` and `platform` when given, are updated: they can't be cleared. The checks run in this order, and the first one failing answers: the license has expired, then it doesn't allow the version, then it's on its maximum number of machines. Each failure is recorded as a `license.validation_failed` event, except for keys that don't exist. Changes to the license, like deactivating the machine or shortening its expiration, don't revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.
|
|
836
|
+
Checks the license key of the product on a machine and returns a token the application can verify offline with the organization's public key. Doesn't need authentication. The license must allow the `version`: up to its `maxVersion.version` when it has one, like `\"2.3\"` for every 2.3.z version and older. Its `maxVersion.lockMajorAt` and `maxVersion.lockMinorAt` are enforced once they hard-code `maxVersion.version`, within the hour they're reached. When it doesn't, the error's `latestAllowedVersion` is the latest release of the product the license allows, so the application can offer to install it. The machine with the `fingerprint` is created when the license has none, and activated when it's deactivated, unless the license is already active on its maximum number of machines. A machine that's already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its `version`, and its `name` and `platform` when given, are updated: they can't be cleared. Unless the product disables `autoMachineChange`, a new machine isn't refused when the license is on its maximum number of machines: it takes the place of the active machine validated the longest ago, which is deactivated with its `overriddenByMachineId` set to the new machine, and recorded as a `machine.deactivated` event. When a machine deactivated this way is validated again, it takes its place back: the machine that overrode it, and the ones that overrode that one in turn, are locked, with their `overriddenByMachineId` set to the machine coming back. A locked machine is always refused, so two machines can't take turns on one place. The checks run in this order, and the first one failing answers: the license has expired or was canceled, then it doesn't allow the version, then the machine is locked, then it's on its maximum number of machines. Each failure is recorded as a `license.validation_failed` event, except for keys that don't exist. Changes to the license, like deactivating the machine or shortening its expiration, don't revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.
|
|
760
837
|
|
|
761
838
|
### Examples
|
|
762
839
|
|
data/docs/Machine.md
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
| **fingerprint** | **String** | Identifies the machine. Unique within the license. | |
|
|
10
10
|
| **platform** | **String** | | |
|
|
11
11
|
| **name** | **String** | | |
|
|
12
|
-
| **status** | **String** | Whether the machine counts as using the license. | |
|
|
12
|
+
| **status** | **String** | Whether the machine counts as using the license. A `locked` machine doesn't, and its validations are refused with `machine_locked`: it overrode a machine that came back. See `validateKey`. | |
|
|
13
13
|
| **version** | **String** | Version of the application last validated on the machine. | |
|
|
14
|
+
| **overridden_by_machine_id** | **String** | For a machine deactivated or locked by automatic machine changes, the machine that took its place. Validating the key on a deactivated machine that has one takes its place back. `null` otherwise. | |
|
|
14
15
|
| **last_validated_at** | **Time** | When the license was last validated on the machine. | |
|
|
15
16
|
| **created_at** | **Time** | | |
|
|
16
17
|
| **updated_at** | **Time** | | |
|
|
@@ -28,6 +29,7 @@ instance = LicenseManager::Machine.new(
|
|
|
28
29
|
name: Jane's MacBook,
|
|
29
30
|
status: active,
|
|
30
31
|
version: 1.4.2,
|
|
32
|
+
overridden_by_machine_id: null,
|
|
31
33
|
last_validated_at: 2026-01-15T09:30:00.000Z,
|
|
32
34
|
created_at: 2026-01-15T09:30:00.000Z,
|
|
33
35
|
updated_at: 2026-01-15T09:30:00.000Z
|
data/docs/MachinesApi.md
CHANGED
|
@@ -15,7 +15,7 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
15
15
|
|
|
16
16
|
Deactivate a machine
|
|
17
17
|
|
|
18
|
-
The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated machine does nothing. The license token `validateKey` returned to the machine isn't revoked: the application can keep running offline until it expires. Machines can't be deleted: they're deleted with their license. **Token access**: customer, license, machine tokens with the `machine:write` permission (or the matching write one). A token reaches the machine it's scoped to, or the machines of its license or customer. **Required role permission**: `machine:deactivate` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
18
|
+
The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated or locked machine does nothing. The license token `validateKey` returned to the machine isn't revoked: the application can keep running offline until it expires. Machines can't be deleted: they're deleted with their license. **Token access**: customer, license, machine tokens with the `machine:write` permission (or the matching write one). A token reaches the machine it's scoped to, or the machines of its license or customer. **Required role permission**: `machine:deactivate` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
19
19
|
|
|
20
20
|
### Examples
|
|
21
21
|
|
data/docs/Policy.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
| **max_machines** | **Integer** | Maximum number of active machines of the licenses created with this policy. `null` when there's no limit. | |
|
|
14
14
|
| **max_offline_duration_seconds** | **Integer** | Longest the applications can run offline with the licenses created with this policy, in seconds. | |
|
|
15
15
|
| **max_version** | [**PolicyMaxVersion**](PolicyMaxVersion.md) | | |
|
|
16
|
+
| **money_back_guarantee_days** | **Integer** | Number of days after their creation during which customers can cancel the licenses created with this policy, from the customer portal or with `cancelLicense`. `null` when they can't. | |
|
|
16
17
|
| **license_count** | **Integer** | Number of licenses following this policy. | |
|
|
17
18
|
| **created_at** | **Time** | | |
|
|
18
19
|
| **updated_at** | **Time** | | |
|
|
@@ -32,6 +33,7 @@ instance = LicenseManager::Policy.new(
|
|
|
32
33
|
max_machines: 3,
|
|
33
34
|
max_offline_duration_seconds: 604800,
|
|
34
35
|
max_version: null,
|
|
36
|
+
money_back_guarantee_days: 30,
|
|
35
37
|
license_count: 12,
|
|
36
38
|
created_at: 2026-01-15T09:30:00.000Z,
|
|
37
39
|
updated_at: 2026-01-15T09:30:00.000Z
|