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 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179
|
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._createable_api_resource import CreateableAPIResource
from stripe._expandable_field import ExpandableField
from stripe._list_object import ListObject
from stripe._listable_api_resource import ListableAPIResource
from stripe._request_options import RequestOptions
from stripe._stripe_object import StripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from stripe._util import class_method_variant, sanitize_id
from typing import ClassVar, Dict, List, Optional, cast, overload
from typing_extensions import (
Literal,
NotRequired,
TypedDict,
Unpack,
TYPE_CHECKING,
)
if TYPE_CHECKING:
from stripe._balance_transaction import BalanceTransaction
from stripe._file import File
from stripe.issuing._transaction import Transaction
class Dispute(
CreateableAPIResource["Dispute"],
ListableAPIResource["Dispute"],
UpdateableAPIResource["Dispute"],
):
"""
As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with.
Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes)
"""
OBJECT_NAME: ClassVar[Literal["issuing.dispute"]] = "issuing.dispute"
class Evidence(StripeObject):
class Canceled(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
canceled_at: Optional[int]
"""
Date when order was canceled.
"""
cancellation_policy_provided: Optional[bool]
"""
Whether the cardholder was provided with a cancellation policy.
"""
cancellation_reason: Optional[str]
"""
Reason for canceling the order.
"""
expected_at: Optional[int]
"""
Date when the cardholder expected to receive the product.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: Optional[str]
"""
Description of the merchandise or service that was purchased.
"""
product_type: Optional[Literal["merchandise", "service"]]
"""
Whether the product was a merchandise or service.
"""
return_status: Optional[Literal["merchant_rejected", "successful"]]
"""
Result of cardholder's attempt to return the product.
"""
returned_at: Optional[int]
"""
Date when the product was returned or attempted to be returned.
"""
class Duplicate(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
card_statement: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for.
"""
cash_receipt: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash.
"""
check_image: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
original_transaction: Optional[str]
"""
Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one.
"""
class Fraudulent(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
class MerchandiseNotAsDescribed(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
received_at: Optional[int]
"""
Date when the product was received.
"""
return_description: Optional[str]
"""
Description of the cardholder's attempt to return the product.
"""
return_status: Optional[Literal["merchant_rejected", "successful"]]
"""
Result of cardholder's attempt to return the product.
"""
returned_at: Optional[int]
"""
Date when the product was returned or attempted to be returned.
"""
class NoValidAuthorization(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
class NotReceived(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
expected_at: Optional[int]
"""
Date when the cardholder expected to receive the product.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: Optional[str]
"""
Description of the merchandise or service that was purchased.
"""
product_type: Optional[Literal["merchandise", "service"]]
"""
Whether the product was a merchandise or service.
"""
class Other(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: Optional[str]
"""
Description of the merchandise or service that was purchased.
"""
product_type: Optional[Literal["merchandise", "service"]]
"""
Whether the product was a merchandise or service.
"""
class ServiceNotAsDescribed(StripeObject):
additional_documentation: Optional[ExpandableField["File"]]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
canceled_at: Optional[int]
"""
Date when order was canceled.
"""
cancellation_reason: Optional[str]
"""
Reason for canceling the order.
"""
explanation: Optional[str]
"""
Explanation of why the cardholder is disputing this transaction.
"""
received_at: Optional[int]
"""
Date when the product was received.
"""
canceled: Optional[Canceled]
duplicate: Optional[Duplicate]
fraudulent: Optional[Fraudulent]
merchandise_not_as_described: Optional[MerchandiseNotAsDescribed]
no_valid_authorization: Optional[NoValidAuthorization]
not_received: Optional[NotReceived]
other: Optional[Other]
reason: Literal[
"canceled",
"duplicate",
"fraudulent",
"merchandise_not_as_described",
"no_valid_authorization",
"not_received",
"other",
"service_not_as_described",
]
"""
The reason for filing the dispute. Its value will match the field containing the evidence.
"""
service_not_as_described: Optional[ServiceNotAsDescribed]
_inner_class_types = {
"canceled": Canceled,
"duplicate": Duplicate,
"fraudulent": Fraudulent,
"merchandise_not_as_described": MerchandiseNotAsDescribed,
"no_valid_authorization": NoValidAuthorization,
"not_received": NotReceived,
"other": Other,
"service_not_as_described": ServiceNotAsDescribed,
}
class Treasury(StripeObject):
debit_reversal: Optional[str]
"""
The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute
"""
received_debit: str
"""
The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed.
"""
class CreateParams(RequestOptions):
amount: NotRequired[int]
"""
The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount.
"""
evidence: NotRequired["Dispute.CreateParamsEvidence"]
"""
Evidence provided for the dispute.
"""
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired[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`.
"""
transaction: NotRequired[str]
"""
The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`.
"""
treasury: NotRequired["Dispute.CreateParamsTreasury"]
"""
Params for disputes related to Treasury FinancialAccounts
"""
class CreateParamsEvidence(TypedDict):
canceled: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceCanceled"
]
"""
Evidence provided when `reason` is 'canceled'.
"""
duplicate: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceDuplicate"
]
"""
Evidence provided when `reason` is 'duplicate'.
"""
fraudulent: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceFraudulent"
]
"""
Evidence provided when `reason` is 'fraudulent'.
"""
merchandise_not_as_described: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceMerchandiseNotAsDescribed"
]
"""
Evidence provided when `reason` is 'merchandise_not_as_described'.
"""
no_valid_authorization: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceNoValidAuthorization"
]
"""
Evidence provided when `reason` is 'no_valid_authorization'.
"""
not_received: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceNotReceived"
]
"""
Evidence provided when `reason` is 'not_received'.
"""
other: NotRequired["Literal['']|Dispute.CreateParamsEvidenceOther"]
"""
Evidence provided when `reason` is 'other'.
"""
reason: NotRequired[
Literal[
"canceled",
"duplicate",
"fraudulent",
"merchandise_not_as_described",
"no_valid_authorization",
"not_received",
"other",
"service_not_as_described",
]
]
"""
The reason for filing the dispute. The evidence should be submitted in the field of the same name.
"""
service_not_as_described: NotRequired[
"Literal['']|Dispute.CreateParamsEvidenceServiceNotAsDescribed"
]
"""
Evidence provided when `reason` is 'service_not_as_described'.
"""
class CreateParamsEvidenceCanceled(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
canceled_at: NotRequired["Literal['']|int"]
"""
Date when order was canceled.
"""
cancellation_policy_provided: NotRequired["Literal['']|bool"]
"""
Whether the cardholder was provided with a cancellation policy.
"""
cancellation_reason: NotRequired["Literal['']|str"]
"""
Reason for canceling the order.
"""
expected_at: NotRequired["Literal['']|int"]
"""
Date when the cardholder expected to receive the product.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: NotRequired["Literal['']|str"]
"""
Description of the merchandise or service that was purchased.
"""
product_type: NotRequired[
"Literal['']|Literal['merchandise', 'service']"
]
"""
Whether the product was a merchandise or service.
"""
return_status: NotRequired[
"Literal['']|Literal['merchant_rejected', 'successful']"
]
"""
Result of cardholder's attempt to return the product.
"""
returned_at: NotRequired["Literal['']|int"]
"""
Date when the product was returned or attempted to be returned.
"""
class CreateParamsEvidenceDuplicate(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
card_statement: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for.
"""
cash_receipt: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash.
"""
check_image: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
original_transaction: NotRequired[str]
"""
Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one.
"""
class CreateParamsEvidenceFraudulent(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
class CreateParamsEvidenceMerchandiseNotAsDescribed(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
received_at: NotRequired["Literal['']|int"]
"""
Date when the product was received.
"""
return_description: NotRequired["Literal['']|str"]
"""
Description of the cardholder's attempt to return the product.
"""
return_status: NotRequired[
"Literal['']|Literal['merchant_rejected', 'successful']"
]
"""
Result of cardholder's attempt to return the product.
"""
returned_at: NotRequired["Literal['']|int"]
"""
Date when the product was returned or attempted to be returned.
"""
class CreateParamsEvidenceNoValidAuthorization(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
class CreateParamsEvidenceNotReceived(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
expected_at: NotRequired["Literal['']|int"]
"""
Date when the cardholder expected to receive the product.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: NotRequired["Literal['']|str"]
"""
Description of the merchandise or service that was purchased.
"""
product_type: NotRequired[
"Literal['']|Literal['merchandise', 'service']"
]
"""
Whether the product was a merchandise or service.
"""
class CreateParamsEvidenceOther(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: NotRequired["Literal['']|str"]
"""
Description of the merchandise or service that was purchased.
"""
product_type: NotRequired[
"Literal['']|Literal['merchandise', 'service']"
]
"""
Whether the product was a merchandise or service.
"""
class CreateParamsEvidenceServiceNotAsDescribed(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
canceled_at: NotRequired["Literal['']|int"]
"""
Date when order was canceled.
"""
cancellation_reason: NotRequired["Literal['']|str"]
"""
Reason for canceling the order.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
received_at: NotRequired["Literal['']|int"]
"""
Date when the product was received.
"""
class CreateParamsTreasury(TypedDict):
received_debit: str
"""
The ID of the ReceivedDebit to initiate an Issuings dispute for.
"""
class ListParams(RequestOptions):
created: NotRequired["Dispute.ListParamsCreated|int"]
"""
Only return Issuing disputes that were created during the given date interval.
"""
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.
"""
status: NotRequired[
Literal["expired", "lost", "submitted", "unsubmitted", "won"]
]
"""
Select Issuing disputes with the given status.
"""
transaction: NotRequired[str]
"""
Select the Issuing dispute for the given transaction.
"""
class ListParamsCreated(TypedDict):
gt: NotRequired[int]
"""
Minimum value to filter by (exclusive)
"""
gte: NotRequired[int]
"""
Minimum value to filter by (inclusive)
"""
lt: NotRequired[int]
"""
Maximum value to filter by (exclusive)
"""
lte: NotRequired[int]
"""
Maximum value to filter by (inclusive)
"""
class ModifyParams(RequestOptions):
amount: NotRequired[int]
"""
The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
"""
evidence: NotRequired["Dispute.ModifyParamsEvidence"]
"""
Evidence provided for the dispute.
"""
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`.
"""
class ModifyParamsEvidence(TypedDict):
canceled: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceCanceled"
]
"""
Evidence provided when `reason` is 'canceled'.
"""
duplicate: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceDuplicate"
]
"""
Evidence provided when `reason` is 'duplicate'.
"""
fraudulent: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceFraudulent"
]
"""
Evidence provided when `reason` is 'fraudulent'.
"""
merchandise_not_as_described: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceMerchandiseNotAsDescribed"
]
"""
Evidence provided when `reason` is 'merchandise_not_as_described'.
"""
no_valid_authorization: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceNoValidAuthorization"
]
"""
Evidence provided when `reason` is 'no_valid_authorization'.
"""
not_received: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceNotReceived"
]
"""
Evidence provided when `reason` is 'not_received'.
"""
other: NotRequired["Literal['']|Dispute.ModifyParamsEvidenceOther"]
"""
Evidence provided when `reason` is 'other'.
"""
reason: NotRequired[
Literal[
"canceled",
"duplicate",
"fraudulent",
"merchandise_not_as_described",
"no_valid_authorization",
"not_received",
"other",
"service_not_as_described",
]
]
"""
The reason for filing the dispute. The evidence should be submitted in the field of the same name.
"""
service_not_as_described: NotRequired[
"Literal['']|Dispute.ModifyParamsEvidenceServiceNotAsDescribed"
]
"""
Evidence provided when `reason` is 'service_not_as_described'.
"""
class ModifyParamsEvidenceCanceled(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
canceled_at: NotRequired["Literal['']|int"]
"""
Date when order was canceled.
"""
cancellation_policy_provided: NotRequired["Literal['']|bool"]
"""
Whether the cardholder was provided with a cancellation policy.
"""
cancellation_reason: NotRequired["Literal['']|str"]
"""
Reason for canceling the order.
"""
expected_at: NotRequired["Literal['']|int"]
"""
Date when the cardholder expected to receive the product.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: NotRequired["Literal['']|str"]
"""
Description of the merchandise or service that was purchased.
"""
product_type: NotRequired[
"Literal['']|Literal['merchandise', 'service']"
]
"""
Whether the product was a merchandise or service.
"""
return_status: NotRequired[
"Literal['']|Literal['merchant_rejected', 'successful']"
]
"""
Result of cardholder's attempt to return the product.
"""
returned_at: NotRequired["Literal['']|int"]
"""
Date when the product was returned or attempted to be returned.
"""
class ModifyParamsEvidenceDuplicate(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
card_statement: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for.
"""
cash_receipt: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash.
"""
check_image: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
original_transaction: NotRequired[str]
"""
Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one.
"""
class ModifyParamsEvidenceFraudulent(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
class ModifyParamsEvidenceMerchandiseNotAsDescribed(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
received_at: NotRequired["Literal['']|int"]
"""
Date when the product was received.
"""
return_description: NotRequired["Literal['']|str"]
"""
Description of the cardholder's attempt to return the product.
"""
return_status: NotRequired[
"Literal['']|Literal['merchant_rejected', 'successful']"
]
"""
Result of cardholder's attempt to return the product.
"""
returned_at: NotRequired["Literal['']|int"]
"""
Date when the product was returned or attempted to be returned.
"""
class ModifyParamsEvidenceNoValidAuthorization(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
class ModifyParamsEvidenceNotReceived(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
expected_at: NotRequired["Literal['']|int"]
"""
Date when the cardholder expected to receive the product.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: NotRequired["Literal['']|str"]
"""
Description of the merchandise or service that was purchased.
"""
product_type: NotRequired[
"Literal['']|Literal['merchandise', 'service']"
]
"""
Whether the product was a merchandise or service.
"""
class ModifyParamsEvidenceOther(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
product_description: NotRequired["Literal['']|str"]
"""
Description of the merchandise or service that was purchased.
"""
product_type: NotRequired[
"Literal['']|Literal['merchandise', 'service']"
]
"""
Whether the product was a merchandise or service.
"""
class ModifyParamsEvidenceServiceNotAsDescribed(TypedDict):
additional_documentation: NotRequired["Literal['']|str"]
"""
(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute.
"""
canceled_at: NotRequired["Literal['']|int"]
"""
Date when order was canceled.
"""
cancellation_reason: NotRequired["Literal['']|str"]
"""
Reason for canceling the order.
"""
explanation: NotRequired["Literal['']|str"]
"""
Explanation of why the cardholder is disputing this transaction.
"""
received_at: NotRequired["Literal['']|int"]
"""
Date when the product was received.
"""
class RetrieveParams(RequestOptions):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
class SubmitParams(RequestOptions):
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`.
"""
amount: int
"""
Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation).
"""
balance_transactions: Optional[List["BalanceTransaction"]]
"""
List of balance transactions associated with the dispute.
"""
created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
currency: str
"""
The currency the `transaction` was made in.
"""
evidence: Evidence
id: str
"""
Unique identifier for the object.
"""
livemode: bool
"""
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
"""
loss_reason: Optional[
Literal[
"cardholder_authentication_issuer_liability",
"eci5_token_transaction_with_tavv",
"excess_disputes_in_timeframe",
"has_not_met_the_minimum_dispute_amount_requirements",
"invalid_duplicate_dispute",
"invalid_incorrect_amount_dispute",
"invalid_no_authorization",
"invalid_use_of_disputes",
"merchandise_delivered_or_shipped",
"merchandise_or_service_as_described",
"not_cancelled",
"other",
"refund_issued",
"submitted_beyond_allowable_time_limit",
"transaction_3ds_required",
"transaction_approved_after_prior_fraud_dispute",
"transaction_authorized",
"transaction_electronically_read",
"transaction_qualifies_for_visa_easy_payment_service",
"transaction_unattended",
]
]
"""
The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values.
"""
metadata: 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.
"""
object: Literal["issuing.dispute"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
status: Literal["expired", "lost", "submitted", "unsubmitted", "won"]
"""
Current status of the dispute.
"""
transaction: ExpandableField["Transaction"]
"""
The transaction being disputed.
"""
treasury: Optional[Treasury]
"""
[Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
"""
@classmethod
def create(cls, **params: Unpack["Dispute.CreateParams"]) -> "Dispute":
"""
Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
"""
return cast(
"Dispute",
cls._static_request(
"post",
cls.class_url(),
params=params,
),
)
@classmethod
async def create_async(
cls, **params: Unpack["Dispute.CreateParams"]
) -> "Dispute":
"""
Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
"""
return cast(
"Dispute",
await cls._static_request_async(
"post",
cls.class_url(),
params=params,
),
)
@classmethod
def list(
cls, **params: Unpack["Dispute.ListParams"]
) -> ListObject["Dispute"]:
"""
Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
"""
result = cls._static_request(
"get",
cls.class_url(),
params=params,
)
if not isinstance(result, ListObject):
raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)
return result
@classmethod
async def list_async(
cls, **params: Unpack["Dispute.ListParams"]
) -> ListObject["Dispute"]:
"""
Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
"""
result = await cls._static_request_async(
"get",
cls.class_url(),
params=params,
)
if not isinstance(result, ListObject):
raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)
return result
@classmethod
def modify(
cls, id: str, **params: Unpack["Dispute.ModifyParams"]
) -> "Dispute":
"""
Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string.
"""
url = "%s/%s" % (cls.class_url(), sanitize_id(id))
return cast(
"Dispute",
cls._static_request(
"post",
url,
params=params,
),
)
@classmethod
async def modify_async(
cls, id: str, **params: Unpack["Dispute.ModifyParams"]
) -> "Dispute":
"""
Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string.
"""
url = "%s/%s" % (cls.class_url(), sanitize_id(id))
return cast(
"Dispute",
await cls._static_request_async(
"post",
url,
params=params,
),
)
@classmethod
def retrieve(
cls, id: str, **params: Unpack["Dispute.RetrieveParams"]
) -> "Dispute":
"""
Retrieves an Issuing Dispute object.
"""
instance = cls(id, **params)
instance.refresh()
return instance
@classmethod
async def retrieve_async(
cls, id: str, **params: Unpack["Dispute.RetrieveParams"]
) -> "Dispute":
"""
Retrieves an Issuing Dispute object.
"""
instance = cls(id, **params)
await instance.refresh_async()
return instance
@classmethod
def _cls_submit(
cls, dispute: str, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
return cast(
"Dispute",
cls._static_request(
"post",
"/v1/issuing/disputes/{dispute}/submit".format(
dispute=sanitize_id(dispute)
),
params=params,
),
)
@overload
@staticmethod
def submit(
dispute: str, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
...
@overload
def submit(self, **params: Unpack["Dispute.SubmitParams"]) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
...
@class_method_variant("_cls_submit")
def submit( # pyright: ignore[reportGeneralTypeIssues]
self, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
return cast(
"Dispute",
self._request(
"post",
"/v1/issuing/disputes/{dispute}/submit".format(
dispute=sanitize_id(self.get("id"))
),
params=params,
),
)
@classmethod
async def _cls_submit_async(
cls, dispute: str, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
return cast(
"Dispute",
await cls._static_request_async(
"post",
"/v1/issuing/disputes/{dispute}/submit".format(
dispute=sanitize_id(dispute)
),
params=params,
),
)
@overload
@staticmethod
async def submit_async(
dispute: str, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
...
@overload
async def submit_async(
self, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
...
@class_method_variant("_cls_submit_async")
async def submit_async( # pyright: ignore[reportGeneralTypeIssues]
self, **params: Unpack["Dispute.SubmitParams"]
) -> "Dispute":
"""
Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
"""
return cast(
"Dispute",
await self._request_async(
"post",
"/v1/issuing/disputes/{dispute}/submit".format(
dispute=sanitize_id(self.get("id"))
),
params=params,
),
)
_inner_class_types = {"evidence": Evidence, "treasury": Treasury}
|