Skip to content

Commit 5d6f421

Browse files
feat(api): add customer entitlement-grants list endpoint and feature integration config
Stainless-Generated-From: 02a1bc4
1 parent 3418ee2 commit 5d6f421

17 files changed

Lines changed: 112 additions & 38 deletions

CHANGELOG.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# Changelog
22

3-
## [1.106.1](https://github.com/dodopayments/dodopayments-python/compare/v1.106.0...v1.106.1) (2026-06-27)
4-
5-
6-
### Bug Fixes
7-
8-
* **api:** add allow_editing_addons checkout flag and refine schema descriptions ([8f9a015](https://github.com/dodopayments/dodopayments-python/commit/8f9a015b340a816d1f643069ff51909e76912f89))
9-
* **api:** add allow_editing_addons checkout flag and refine schema descriptions ([d578037](https://github.com/dodopayments/dodopayments-python/commit/d578037d7c376ef86571a5b3eec465085ce1105f))
10-
113
## [1.106.0](https://github.com/dodopayments/dodopayments-python/compare/v1.105.1...v1.106.0) (2026-06-23)
124

135

scripts/mock

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/dodopayments/resources/entitlements/entitlements.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ def update(
187187
integration_config: Integration-specific configuration supplied when creating or updating an
188188
entitlement. The shape required matches the entitlement's `integration_type`.
189189
190+
Untagged enum: variants are matched in order. `FeatureFlag` must precede
191+
`LicenseKey`, whose fields are all optional and would otherwise match a
192+
`feature_flag` config.
193+
194+
metadata: Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
195+
190196
extra_headers: Send extra headers
191197
192198
extra_query: Add additional query parameters to the request
@@ -218,7 +224,7 @@ def list(
218224
self,
219225
*,
220226
integration_type: Literal[
221-
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key"
227+
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key", "feature_flag"
222228
]
223229
| Omit = omit,
224230
page_number: int | Omit = omit,
@@ -441,6 +447,12 @@ async def update(
441447
integration_config: Integration-specific configuration supplied when creating or updating an
442448
entitlement. The shape required matches the entitlement's `integration_type`.
443449
450+
Untagged enum: variants are matched in order. `FeatureFlag` must precede
451+
`LicenseKey`, whose fields are all optional and would otherwise match a
452+
`feature_flag` config.
453+
454+
metadata: Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
455+
444456
extra_headers: Send extra headers
445457
446458
extra_query: Add additional query parameters to the request
@@ -472,7 +484,7 @@ def list(
472484
self,
473485
*,
474486
integration_type: Literal[
475-
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key"
487+
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key", "feature_flag"
476488
]
477489
| Omit = omit,
478490
page_number: int | Omit = omit,

src/dodopayments/resources/subscriptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ def update(
302302
the invoice instead of the customer's personal name. Send `null` to explicitly
303303
clear the business name.
304304
305+
metadata: Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
306+
305307
extra_headers: Send extra headers
306308
307309
extra_query: Add additional query parameters to the request
@@ -1111,6 +1113,8 @@ async def update(
11111113
the invoice instead of the customer's personal name. Send `null` to explicitly
11121114
clear the business name.
11131115
1116+
metadata: Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
1117+
11141118
extra_headers: Send extra headers
11151119
11161120
extra_query: Add additional query parameters to the request

src/dodopayments/types/credit_entitlements/balance_list_grants_response.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class BalanceListGrantsResponse(BaseModel):
3838
expires_at: Optional[datetime] = None
3939

4040
metadata: Optional[Metadata] = None
41+
"""Arbitrary key-value metadata.
42+
43+
Values can be string, integer, number, or boolean.
44+
"""
4145

4246
parent_grant_id: Optional[str] = None
4347

src/dodopayments/types/discount.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class Discount(BaseModel):
2727
"""The unique discount ID"""
2828

2929
metadata: Metadata
30+
"""Arbitrary key-value metadata.
31+
32+
Values can be string, integer, number, or boolean.
33+
"""
3034

3135
preserve_on_plan_change: bool
3236
"""

src/dodopayments/types/entitlement_integration_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
__all__ = ["EntitlementIntegrationType"]
66

77
EntitlementIntegrationType: TypeAlias = Literal[
8-
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key"
8+
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key", "feature_flag"
99
]

src/dodopayments/types/entitlement_list_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class EntitlementListParams(TypedDict, total=False):
1111
integration_type: Literal[
12-
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key"
12+
"discord", "telegram", "github", "figma", "framer", "notion", "digital_files", "license_key", "feature_flag"
1313
]
1414
"""Filter by integration type"""
1515

src/dodopayments/types/entitlement_update_params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ class EntitlementUpdateParams(TypedDict, total=False):
1818
"""
1919
Integration-specific configuration supplied when creating or updating an
2020
entitlement. The shape required matches the entitlement's `integration_type`.
21+
22+
Untagged enum: variants are matched in order. `FeatureFlag` must precede
23+
`LicenseKey`, whose fields are all optional and would otherwise match a
24+
`feature_flag` config.
2125
"""
2226

2327
metadata: Optional[MetadataParam]
28+
"""Arbitrary key-value metadata.
29+
30+
Values can be string, integer, number, or boolean.
31+
"""
2432

2533
name: Optional[str]

src/dodopayments/types/entitlements/entitlement_grant.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@
1010
from ..digital_product_delivery import DigitalProductDelivery
1111
from ..entitlement_integration_type import EntitlementIntegrationType
1212

13-
__all__ = ["EntitlementGrant"]
13+
__all__ = ["EntitlementGrant", "Feature"]
14+
15+
16+
class Feature(BaseModel):
17+
"""
18+
Typed feature payload, present only when the entitlement integration is
19+
`feature_flag`; `null` for every other integration type.
20+
"""
21+
22+
feature_id: str
23+
"""Identifier of the capability this grant confers."""
24+
25+
feature_type: Literal["boolean"]
26+
"""Type of capability conferred."""
1427

1528

1629
class EntitlementGrant(BaseModel):
@@ -64,6 +77,12 @@ class EntitlementGrant(BaseModel):
6477
error_message: Optional[str] = None
6578
"""Human-readable message reported when delivery failed, when applicable."""
6679

80+
feature: Optional[Feature] = None
81+
"""
82+
Typed feature payload, present only when the entitlement integration is
83+
`feature_flag`; `null` for every other integration type.
84+
"""
85+
6786
license_key: Optional[LicenseKeyGrant] = None
6887
"""
6988
License-key delivery payload, present when the entitlement integration is

0 commit comments

Comments
 (0)