Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ This release uses the API version `2026-01-28.preview`.
* Add support for `url` on `FinancialConnections.Session`
* Add support for `billing_cycle_anchor` on `SubscriptionCreateParamsTrialSettingEndBehavior` and `SubscriptionModifyParamsTrialSettingEndBehavior`

## 14.4.1 - 2026-03-06
* [#1748](https://github.com/stripe/stripe-python/pull/1748) Add Stripe-Request-Trigger header
* [#1743](https://github.com/stripe/stripe-python/pull/1743) Add agent information to UserAgent

## 14.4.0 - 2026-02-25
This release changes the pinned API version to `2026-02-25.clover`.

Expand Down
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49b1e23eef1a5004ed00987c41d5ec8447a19e27
6dded749243c6d0c16f48c648aa32d13cb66c439
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2189
v2190
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export PATH := `pwd` / VENV_NAME / "bin:" + env('PATH')
_default:
just --list --unsorted

# ⭐ run format, lint, typecheck, and tests to prepare for CI
prepare: format lint typecheck test

# ⭐ run all unit tests
[positional-arguments]
test *args: install-test-deps
Expand Down
5 changes: 5 additions & 0 deletions stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,18 @@ def specific_oauth_error(self, rbody, rcode, resp, rheaders, error_code):
return None

AI_AGENTS = [
# aiAgents: The beginning of the section generated from our OpenAPI spec
("ANTIGRAVITY_CLI_ALIAS", "antigravity"),
("CLAUDECODE", "claude_code"),
("CLINE_ACTIVE", "cline"),
("CODEX_SANDBOX", "codex_cli"),
("CODEX_THREAD_ID", "codex_cli"),
("CODEX_SANDBOX_NETWORK_DISABLED", "codex_cli"),
("CODEX_CI", "codex_cli"),
("CURSOR_AGENT", "cursor"),
("GEMINI_CLI", "gemini_cli"),
("OPENCODE", "open_code"),
# aiAgents: The end of the section generated from our OpenAPI spec
]

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions stripe/_balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class FeeDetail(StripeObject):
The date that the transaction's net funds become available in the Stripe balance.
"""
balance_type: Literal[
"fee_credits",
"issuing",
"payments",
"refund_and_dispute_prefunding",
Expand Down
4 changes: 4 additions & 0 deletions stripe/_dispute.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ class SmartDisputes(StripeObject):
"""
Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed).
"""
amount_to_counter: Optional[int]
"""
The amount you want to contest, in the dispute's currency. Setting this to less than the full dispute amount means accepting the loss on the remaining amount. If not specified, the entire disputed amount is contested.
"""
balance_transactions: List["BalanceTransaction"]
"""
List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute.
Expand Down
4 changes: 4 additions & 0 deletions stripe/_invoice_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ class DiscountAmount(StripeObject):
"""
The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
"""
frozen_fields: Optional[List[Literal["pricing", "quantity"]]]
"""
Array of field names that can't be modified. Attempting to update a frozen field returns an error.
"""
id: str
"""
Unique identifier for the object.
Expand Down
4 changes: 4 additions & 0 deletions stripe/_object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@
"stripe.radar._early_fraud_warning",
"EarlyFraudWarning",
),
"radar.issuing_authorization_evaluation": (
"stripe.radar._issuing_authorization_evaluation",
"IssuingAuthorizationEvaluation",
),
"radar.payment_evaluation": (
"stripe.radar._payment_evaluation",
"PaymentEvaluation",
Expand Down
8 changes: 8 additions & 0 deletions stripe/_radar_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from stripe.radar._early_fraud_warning_service import (
EarlyFraudWarningService,
)
from stripe.radar._issuing_authorization_evaluation_service import (
IssuingAuthorizationEvaluationService,
)
from stripe.radar._payment_evaluation_service import (
PaymentEvaluationService,
)
Expand All @@ -26,6 +29,10 @@
"stripe.radar._early_fraud_warning_service",
"EarlyFraudWarningService",
],
"issuing_authorization_evaluations": [
"stripe.radar._issuing_authorization_evaluation_service",
"IssuingAuthorizationEvaluationService",
],
"payment_evaluations": [
"stripe.radar._payment_evaluation_service",
"PaymentEvaluationService",
Expand All @@ -41,6 +48,7 @@
class RadarService(StripeService):
account_evaluations: "AccountEvaluationService"
early_fraud_warnings: "EarlyFraudWarningService"
issuing_authorization_evaluations: "IssuingAuthorizationEvaluationService"
payment_evaluations: "PaymentEvaluationService"
value_lists: "ValueListService"
value_list_items: "ValueListItemService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def fetch_related_object(self) -> "Meter":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -64,6 +65,7 @@ async def fetch_related_object_async(self) -> "Meter":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -209,6 +211,9 @@ def fetch_related_object(self) -> "Meter":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_cadence_billed_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def fetch_related_object(self) -> "Cadence":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -62,6 +63,7 @@ async def fetch_related_object_async(self) -> "Cadence":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -141,6 +143,9 @@ def fetch_related_object(self) -> "Cadence":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_cadence_canceled_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "Cadence":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -59,6 +60,7 @@ async def fetch_related_object_async(self) -> "Cadence":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -103,6 +105,9 @@ def fetch_related_object(self) -> "Cadence":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_cadence_created_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def fetch_related_object(self) -> "Cadence":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -62,6 +63,7 @@ async def fetch_related_object_async(self) -> "Cadence":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -141,6 +143,9 @@ def fetch_related_object(self) -> "Cadence":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_license_fee_created_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "LicenseFee":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -59,6 +60,7 @@ async def fetch_related_object_async(self) -> "LicenseFee":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -103,6 +105,9 @@ def fetch_related_object(self) -> "LicenseFee":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_license_fee_updated_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "LicenseFee":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -59,6 +60,7 @@ async def fetch_related_object_async(self) -> "LicenseFee":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -103,6 +105,9 @@ def fetch_related_object(self) -> "LicenseFee":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def fetch_related_object(self) -> "LicenseFeeVersion":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -64,6 +65,7 @@ async def fetch_related_object_async(self) -> "LicenseFeeVersion":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -143,6 +145,9 @@ def fetch_related_object(self) -> "LicenseFeeVersion":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_licensed_item_created_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "LicensedItem":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -59,6 +60,7 @@ async def fetch_related_object_async(self) -> "LicensedItem":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -103,6 +105,9 @@ def fetch_related_object(self) -> "LicensedItem":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_licensed_item_updated_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "LicensedItem":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -59,6 +60,7 @@ async def fetch_related_object_async(self) -> "LicensedItem":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -103,6 +105,9 @@ def fetch_related_object(self) -> "LicensedItem":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
7 changes: 6 additions & 1 deletion stripe/events/_v2_billing_metered_item_created_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "MeteredItem":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand All @@ -59,6 +60,7 @@ async def fetch_related_object_async(self) -> "MeteredItem":
"get",
self.related_object.url,
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["fetch_related_object"],
)
return cast(
Expand Down Expand Up @@ -103,6 +105,9 @@ def fetch_related_object(self) -> "MeteredItem":
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
options={
"stripe_context": self.context,
"headers": {"Stripe-Request-Trigger": f"event={self.id}"},
},
),
)
Loading