1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919
|
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._list_object import ListObject
from stripe._request_options import RequestOptions
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from stripe._webhook_endpoint import WebhookEndpoint
from typing import Dict, List, cast
from typing_extensions import Literal, NotRequired, TypedDict
class WebhookEndpointService(StripeService):
class CreateParams(TypedDict):
api_version: NotRequired[
Literal[
"2011-01-01",
"2011-06-21",
"2011-06-28",
"2011-08-01",
"2011-09-15",
"2011-11-17",
"2012-02-23",
"2012-03-25",
"2012-06-18",
"2012-06-28",
"2012-07-09",
"2012-09-24",
"2012-10-26",
"2012-11-07",
"2013-02-11",
"2013-02-13",
"2013-07-05",
"2013-08-12",
"2013-08-13",
"2013-10-29",
"2013-12-03",
"2014-01-31",
"2014-03-13",
"2014-03-28",
"2014-05-19",
"2014-06-13",
"2014-06-17",
"2014-07-22",
"2014-07-26",
"2014-08-04",
"2014-08-20",
"2014-09-08",
"2014-10-07",
"2014-11-05",
"2014-11-20",
"2014-12-08",
"2014-12-17",
"2014-12-22",
"2015-01-11",
"2015-01-26",
"2015-02-10",
"2015-02-16",
"2015-02-18",
"2015-03-24",
"2015-04-07",
"2015-06-15",
"2015-07-07",
"2015-07-13",
"2015-07-28",
"2015-08-07",
"2015-08-19",
"2015-09-03",
"2015-09-08",
"2015-09-23",
"2015-10-01",
"2015-10-12",
"2015-10-16",
"2016-02-03",
"2016-02-19",
"2016-02-22",
"2016-02-23",
"2016-02-29",
"2016-03-07",
"2016-06-15",
"2016-07-06",
"2016-10-19",
"2017-01-27",
"2017-02-14",
"2017-04-06",
"2017-05-25",
"2017-06-05",
"2017-08-15",
"2017-12-14",
"2018-01-23",
"2018-02-05",
"2018-02-06",
"2018-02-28",
"2018-05-21",
"2018-07-27",
"2018-08-23",
"2018-09-06",
"2018-09-24",
"2018-10-31",
"2018-11-08",
"2019-02-11",
"2019-02-19",
"2019-03-14",
"2019-05-16",
"2019-08-14",
"2019-09-09",
"2019-10-08",
"2019-10-17",
"2019-11-05",
"2019-12-03",
"2020-03-02",
"2020-08-27",
"2022-08-01",
"2022-11-15",
"2023-08-16",
"2023-10-16",
"2024-04-10",
"2024-06-20",
"2024-09-30.acacia",
"2024-10-28.acacia",
"2024-11-20.acacia",
"2024-12-18.acacia",
"2025-01-27.acacia",
"2025-02-24.acacia",
"2025-03-01.dashboard",
"2025-03-31.basil",
]
]
"""
Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version.
"""
connect: NotRequired[bool]
"""
Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`.
"""
description: NotRequired["Literal['']|str"]
"""
An optional description of what the webhook is used for.
"""
enabled_events: List[
Literal[
"*",
"account.application.authorized",
"account.application.deauthorized",
"account.external_account.created",
"account.external_account.deleted",
"account.external_account.updated",
"account.updated",
"application_fee.created",
"application_fee.refund.updated",
"application_fee.refunded",
"balance.available",
"billing.alert.triggered",
"billing_portal.configuration.created",
"billing_portal.configuration.updated",
"billing_portal.session.created",
"capability.updated",
"cash_balance.funds_available",
"charge.captured",
"charge.dispute.closed",
"charge.dispute.created",
"charge.dispute.funds_reinstated",
"charge.dispute.funds_withdrawn",
"charge.dispute.updated",
"charge.expired",
"charge.failed",
"charge.pending",
"charge.refund.updated",
"charge.refunded",
"charge.succeeded",
"charge.updated",
"checkout.session.async_payment_failed",
"checkout.session.async_payment_succeeded",
"checkout.session.completed",
"checkout.session.expired",
"climate.order.canceled",
"climate.order.created",
"climate.order.delayed",
"climate.order.delivered",
"climate.order.product_substituted",
"climate.product.created",
"climate.product.pricing_updated",
"coupon.created",
"coupon.deleted",
"coupon.updated",
"credit_note.created",
"credit_note.updated",
"credit_note.voided",
"customer.created",
"customer.deleted",
"customer.discount.created",
"customer.discount.deleted",
"customer.discount.updated",
"customer.source.created",
"customer.source.deleted",
"customer.source.expiring",
"customer.source.updated",
"customer.subscription.created",
"customer.subscription.deleted",
"customer.subscription.paused",
"customer.subscription.pending_update_applied",
"customer.subscription.pending_update_expired",
"customer.subscription.resumed",
"customer.subscription.trial_will_end",
"customer.subscription.updated",
"customer.tax_id.created",
"customer.tax_id.deleted",
"customer.tax_id.updated",
"customer.updated",
"customer_cash_balance_transaction.created",
"entitlements.active_entitlement_summary.updated",
"file.created",
"financial_connections.account.created",
"financial_connections.account.deactivated",
"financial_connections.account.disconnected",
"financial_connections.account.reactivated",
"financial_connections.account.refreshed_balance",
"financial_connections.account.refreshed_ownership",
"financial_connections.account.refreshed_transactions",
"identity.verification_session.canceled",
"identity.verification_session.created",
"identity.verification_session.processing",
"identity.verification_session.redacted",
"identity.verification_session.requires_input",
"identity.verification_session.verified",
"invoice.created",
"invoice.deleted",
"invoice.finalization_failed",
"invoice.finalized",
"invoice.marked_uncollectible",
"invoice.overdue",
"invoice.overpaid",
"invoice.paid",
"invoice.payment_action_required",
"invoice.payment_failed",
"invoice.payment_succeeded",
"invoice.sent",
"invoice.upcoming",
"invoice.updated",
"invoice.voided",
"invoice.will_be_due",
"invoiceitem.created",
"invoiceitem.deleted",
"issuing_authorization.created",
"issuing_authorization.request",
"issuing_authorization.updated",
"issuing_card.created",
"issuing_card.updated",
"issuing_cardholder.created",
"issuing_cardholder.updated",
"issuing_dispute.closed",
"issuing_dispute.created",
"issuing_dispute.funds_reinstated",
"issuing_dispute.funds_rescinded",
"issuing_dispute.submitted",
"issuing_dispute.updated",
"issuing_personalization_design.activated",
"issuing_personalization_design.deactivated",
"issuing_personalization_design.rejected",
"issuing_personalization_design.updated",
"issuing_token.created",
"issuing_token.updated",
"issuing_transaction.created",
"issuing_transaction.purchase_details_receipt_updated",
"issuing_transaction.updated",
"mandate.updated",
"payment_intent.amount_capturable_updated",
"payment_intent.canceled",
"payment_intent.created",
"payment_intent.partially_funded",
"payment_intent.payment_failed",
"payment_intent.processing",
"payment_intent.requires_action",
"payment_intent.succeeded",
"payment_link.created",
"payment_link.updated",
"payment_method.attached",
"payment_method.automatically_updated",
"payment_method.detached",
"payment_method.updated",
"payout.canceled",
"payout.created",
"payout.failed",
"payout.paid",
"payout.reconciliation_completed",
"payout.updated",
"person.created",
"person.deleted",
"person.updated",
"plan.created",
"plan.deleted",
"plan.updated",
"price.created",
"price.deleted",
"price.updated",
"product.created",
"product.deleted",
"product.updated",
"promotion_code.created",
"promotion_code.updated",
"quote.accepted",
"quote.canceled",
"quote.created",
"quote.finalized",
"radar.early_fraud_warning.created",
"radar.early_fraud_warning.updated",
"refund.created",
"refund.failed",
"refund.updated",
"reporting.report_run.failed",
"reporting.report_run.succeeded",
"reporting.report_type.updated",
"review.closed",
"review.opened",
"setup_intent.canceled",
"setup_intent.created",
"setup_intent.requires_action",
"setup_intent.setup_failed",
"setup_intent.succeeded",
"sigma.scheduled_query_run.created",
"source.canceled",
"source.chargeable",
"source.failed",
"source.mandate_notification",
"source.refund_attributes_required",
"source.transaction.created",
"source.transaction.updated",
"subscription_schedule.aborted",
"subscription_schedule.canceled",
"subscription_schedule.completed",
"subscription_schedule.created",
"subscription_schedule.expiring",
"subscription_schedule.released",
"subscription_schedule.updated",
"tax.settings.updated",
"tax_rate.created",
"tax_rate.updated",
"terminal.reader.action_failed",
"terminal.reader.action_succeeded",
"test_helpers.test_clock.advancing",
"test_helpers.test_clock.created",
"test_helpers.test_clock.deleted",
"test_helpers.test_clock.internal_failure",
"test_helpers.test_clock.ready",
"topup.canceled",
"topup.created",
"topup.failed",
"topup.reversed",
"topup.succeeded",
"transfer.created",
"transfer.reversed",
"transfer.updated",
"treasury.credit_reversal.created",
"treasury.credit_reversal.posted",
"treasury.debit_reversal.completed",
"treasury.debit_reversal.created",
"treasury.debit_reversal.initial_credit_granted",
"treasury.financial_account.closed",
"treasury.financial_account.created",
"treasury.financial_account.features_status_updated",
"treasury.inbound_transfer.canceled",
"treasury.inbound_transfer.created",
"treasury.inbound_transfer.failed",
"treasury.inbound_transfer.succeeded",
"treasury.outbound_payment.canceled",
"treasury.outbound_payment.created",
"treasury.outbound_payment.expected_arrival_date_updated",
"treasury.outbound_payment.failed",
"treasury.outbound_payment.posted",
"treasury.outbound_payment.returned",
"treasury.outbound_payment.tracking_details_updated",
"treasury.outbound_transfer.canceled",
"treasury.outbound_transfer.created",
"treasury.outbound_transfer.expected_arrival_date_updated",
"treasury.outbound_transfer.failed",
"treasury.outbound_transfer.posted",
"treasury.outbound_transfer.returned",
"treasury.outbound_transfer.tracking_details_updated",
"treasury.received_credit.created",
"treasury.received_credit.failed",
"treasury.received_credit.succeeded",
"treasury.received_debit.created",
"billing.credit_balance_transaction.created",
"billing.credit_grant.created",
"billing.credit_grant.updated",
"billing.meter.created",
"billing.meter.deactivated",
"billing.meter.reactivated",
"billing.meter.updated",
]
]
"""
The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection.
"""
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired["Literal['']|Dict[str, str]"]
"""
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
"""
url: str
"""
The URL of the webhook endpoint.
"""
class DeleteParams(TypedDict):
pass
class ListParams(TypedDict):
ending_before: NotRequired[str]
"""
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
"""
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
limit: NotRequired[int]
"""
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
"""
starting_after: NotRequired[str]
"""
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
"""
class RetrieveParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
class UpdateParams(TypedDict):
description: NotRequired["Literal['']|str"]
"""
An optional description of what the webhook is used for.
"""
disabled: NotRequired[bool]
"""
Disable the webhook endpoint if set to true.
"""
enabled_events: NotRequired[
List[
Literal[
"*",
"account.application.authorized",
"account.application.deauthorized",
"account.external_account.created",
"account.external_account.deleted",
"account.external_account.updated",
"account.updated",
"application_fee.created",
"application_fee.refund.updated",
"application_fee.refunded",
"balance.available",
"billing.alert.triggered",
"billing_portal.configuration.created",
"billing_portal.configuration.updated",
"billing_portal.session.created",
"capability.updated",
"cash_balance.funds_available",
"charge.captured",
"charge.dispute.closed",
"charge.dispute.created",
"charge.dispute.funds_reinstated",
"charge.dispute.funds_withdrawn",
"charge.dispute.updated",
"charge.expired",
"charge.failed",
"charge.pending",
"charge.refund.updated",
"charge.refunded",
"charge.succeeded",
"charge.updated",
"checkout.session.async_payment_failed",
"checkout.session.async_payment_succeeded",
"checkout.session.completed",
"checkout.session.expired",
"climate.order.canceled",
"climate.order.created",
"climate.order.delayed",
"climate.order.delivered",
"climate.order.product_substituted",
"climate.product.created",
"climate.product.pricing_updated",
"coupon.created",
"coupon.deleted",
"coupon.updated",
"credit_note.created",
"credit_note.updated",
"credit_note.voided",
"customer.created",
"customer.deleted",
"customer.discount.created",
"customer.discount.deleted",
"customer.discount.updated",
"customer.source.created",
"customer.source.deleted",
"customer.source.expiring",
"customer.source.updated",
"customer.subscription.created",
"customer.subscription.deleted",
"customer.subscription.paused",
"customer.subscription.pending_update_applied",
"customer.subscription.pending_update_expired",
"customer.subscription.resumed",
"customer.subscription.trial_will_end",
"customer.subscription.updated",
"customer.tax_id.created",
"customer.tax_id.deleted",
"customer.tax_id.updated",
"customer.updated",
"customer_cash_balance_transaction.created",
"entitlements.active_entitlement_summary.updated",
"file.created",
"financial_connections.account.created",
"financial_connections.account.deactivated",
"financial_connections.account.disconnected",
"financial_connections.account.reactivated",
"financial_connections.account.refreshed_balance",
"financial_connections.account.refreshed_ownership",
"financial_connections.account.refreshed_transactions",
"identity.verification_session.canceled",
"identity.verification_session.created",
"identity.verification_session.processing",
"identity.verification_session.redacted",
"identity.verification_session.requires_input",
"identity.verification_session.verified",
"invoice.created",
"invoice.deleted",
"invoice.finalization_failed",
"invoice.finalized",
"invoice.marked_uncollectible",
"invoice.overdue",
"invoice.overpaid",
"invoice.paid",
"invoice.payment_action_required",
"invoice.payment_failed",
"invoice.payment_succeeded",
"invoice.sent",
"invoice.upcoming",
"invoice.updated",
"invoice.voided",
"invoice.will_be_due",
"invoiceitem.created",
"invoiceitem.deleted",
"issuing_authorization.created",
"issuing_authorization.request",
"issuing_authorization.updated",
"issuing_card.created",
"issuing_card.updated",
"issuing_cardholder.created",
"issuing_cardholder.updated",
"issuing_dispute.closed",
"issuing_dispute.created",
"issuing_dispute.funds_reinstated",
"issuing_dispute.funds_rescinded",
"issuing_dispute.submitted",
"issuing_dispute.updated",
"issuing_personalization_design.activated",
"issuing_personalization_design.deactivated",
"issuing_personalization_design.rejected",
"issuing_personalization_design.updated",
"issuing_token.created",
"issuing_token.updated",
"issuing_transaction.created",
"issuing_transaction.purchase_details_receipt_updated",
"issuing_transaction.updated",
"mandate.updated",
"payment_intent.amount_capturable_updated",
"payment_intent.canceled",
"payment_intent.created",
"payment_intent.partially_funded",
"payment_intent.payment_failed",
"payment_intent.processing",
"payment_intent.requires_action",
"payment_intent.succeeded",
"payment_link.created",
"payment_link.updated",
"payment_method.attached",
"payment_method.automatically_updated",
"payment_method.detached",
"payment_method.updated",
"payout.canceled",
"payout.created",
"payout.failed",
"payout.paid",
"payout.reconciliation_completed",
"payout.updated",
"person.created",
"person.deleted",
"person.updated",
"plan.created",
"plan.deleted",
"plan.updated",
"price.created",
"price.deleted",
"price.updated",
"product.created",
"product.deleted",
"product.updated",
"promotion_code.created",
"promotion_code.updated",
"quote.accepted",
"quote.canceled",
"quote.created",
"quote.finalized",
"radar.early_fraud_warning.created",
"radar.early_fraud_warning.updated",
"refund.created",
"refund.failed",
"refund.updated",
"reporting.report_run.failed",
"reporting.report_run.succeeded",
"reporting.report_type.updated",
"review.closed",
"review.opened",
"setup_intent.canceled",
"setup_intent.created",
"setup_intent.requires_action",
"setup_intent.setup_failed",
"setup_intent.succeeded",
"sigma.scheduled_query_run.created",
"source.canceled",
"source.chargeable",
"source.failed",
"source.mandate_notification",
"source.refund_attributes_required",
"source.transaction.created",
"source.transaction.updated",
"subscription_schedule.aborted",
"subscription_schedule.canceled",
"subscription_schedule.completed",
"subscription_schedule.created",
"subscription_schedule.expiring",
"subscription_schedule.released",
"subscription_schedule.updated",
"tax.settings.updated",
"tax_rate.created",
"tax_rate.updated",
"terminal.reader.action_failed",
"terminal.reader.action_succeeded",
"test_helpers.test_clock.advancing",
"test_helpers.test_clock.created",
"test_helpers.test_clock.deleted",
"test_helpers.test_clock.internal_failure",
"test_helpers.test_clock.ready",
"topup.canceled",
"topup.created",
"topup.failed",
"topup.reversed",
"topup.succeeded",
"transfer.created",
"transfer.reversed",
"transfer.updated",
"treasury.credit_reversal.created",
"treasury.credit_reversal.posted",
"treasury.debit_reversal.completed",
"treasury.debit_reversal.created",
"treasury.debit_reversal.initial_credit_granted",
"treasury.financial_account.closed",
"treasury.financial_account.created",
"treasury.financial_account.features_status_updated",
"treasury.inbound_transfer.canceled",
"treasury.inbound_transfer.created",
"treasury.inbound_transfer.failed",
"treasury.inbound_transfer.succeeded",
"treasury.outbound_payment.canceled",
"treasury.outbound_payment.created",
"treasury.outbound_payment.expected_arrival_date_updated",
"treasury.outbound_payment.failed",
"treasury.outbound_payment.posted",
"treasury.outbound_payment.returned",
"treasury.outbound_payment.tracking_details_updated",
"treasury.outbound_transfer.canceled",
"treasury.outbound_transfer.created",
"treasury.outbound_transfer.expected_arrival_date_updated",
"treasury.outbound_transfer.failed",
"treasury.outbound_transfer.posted",
"treasury.outbound_transfer.returned",
"treasury.outbound_transfer.tracking_details_updated",
"treasury.received_credit.created",
"treasury.received_credit.failed",
"treasury.received_credit.succeeded",
"treasury.received_debit.created",
"billing.credit_balance_transaction.created",
"billing.credit_grant.created",
"billing.credit_grant.updated",
"billing.meter.created",
"billing.meter.deactivated",
"billing.meter.reactivated",
"billing.meter.updated",
]
]
]
"""
The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection.
"""
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired["Literal['']|Dict[str, str]"]
"""
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
"""
url: NotRequired[str]
"""
The URL of the webhook endpoint.
"""
def delete(
self,
webhook_endpoint: str,
params: "WebhookEndpointService.DeleteParams" = {},
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
"""
return cast(
WebhookEndpoint,
self._request(
"delete",
"/v1/webhook_endpoints/{webhook_endpoint}".format(
webhook_endpoint=sanitize_id(webhook_endpoint),
),
base_address="api",
params=params,
options=options,
),
)
async def delete_async(
self,
webhook_endpoint: str,
params: "WebhookEndpointService.DeleteParams" = {},
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
"""
return cast(
WebhookEndpoint,
await self._request_async(
"delete",
"/v1/webhook_endpoints/{webhook_endpoint}".format(
webhook_endpoint=sanitize_id(webhook_endpoint),
),
base_address="api",
params=params,
options=options,
),
)
def retrieve(
self,
webhook_endpoint: str,
params: "WebhookEndpointService.RetrieveParams" = {},
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
Retrieves the webhook endpoint with the given ID.
"""
return cast(
WebhookEndpoint,
self._request(
"get",
"/v1/webhook_endpoints/{webhook_endpoint}".format(
webhook_endpoint=sanitize_id(webhook_endpoint),
),
base_address="api",
params=params,
options=options,
),
)
async def retrieve_async(
self,
webhook_endpoint: str,
params: "WebhookEndpointService.RetrieveParams" = {},
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
Retrieves the webhook endpoint with the given ID.
"""
return cast(
WebhookEndpoint,
await self._request_async(
"get",
"/v1/webhook_endpoints/{webhook_endpoint}".format(
webhook_endpoint=sanitize_id(webhook_endpoint),
),
base_address="api",
params=params,
options=options,
),
)
def update(
self,
webhook_endpoint: str,
params: "WebhookEndpointService.UpdateParams" = {},
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint.
"""
return cast(
WebhookEndpoint,
self._request(
"post",
"/v1/webhook_endpoints/{webhook_endpoint}".format(
webhook_endpoint=sanitize_id(webhook_endpoint),
),
base_address="api",
params=params,
options=options,
),
)
async def update_async(
self,
webhook_endpoint: str,
params: "WebhookEndpointService.UpdateParams" = {},
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint.
"""
return cast(
WebhookEndpoint,
await self._request_async(
"post",
"/v1/webhook_endpoints/{webhook_endpoint}".format(
webhook_endpoint=sanitize_id(webhook_endpoint),
),
base_address="api",
params=params,
options=options,
),
)
def list(
self,
params: "WebhookEndpointService.ListParams" = {},
options: RequestOptions = {},
) -> ListObject[WebhookEndpoint]:
"""
Returns a list of your webhook endpoints.
"""
return cast(
ListObject[WebhookEndpoint],
self._request(
"get",
"/v1/webhook_endpoints",
base_address="api",
params=params,
options=options,
),
)
async def list_async(
self,
params: "WebhookEndpointService.ListParams" = {},
options: RequestOptions = {},
) -> ListObject[WebhookEndpoint]:
"""
Returns a list of your webhook endpoints.
"""
return cast(
ListObject[WebhookEndpoint],
await self._request_async(
"get",
"/v1/webhook_endpoints",
base_address="api",
params=params,
options=options,
),
)
def create(
self,
params: "WebhookEndpointService.CreateParams",
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard.
"""
return cast(
WebhookEndpoint,
self._request(
"post",
"/v1/webhook_endpoints",
base_address="api",
params=params,
options=options,
),
)
async def create_async(
self,
params: "WebhookEndpointService.CreateParams",
options: RequestOptions = {},
) -> WebhookEndpoint:
"""
A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard.
"""
return cast(
WebhookEndpoint,
await self._request_async(
"post",
"/v1/webhook_endpoints",
base_address="api",
params=params,
options=options,
),
)
|