growsurf-python 0.6.1__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. growsurf_python-0.7.0/.release-please-manifest.json +3 -0
  2. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/CHANGELOG.md +8 -0
  3. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/PKG-INFO +1 -1
  4. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/api.md +4 -1
  5. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/pyproject.toml +1 -1
  6. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_version.py +1 -1
  7. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/resources/campaign/participant.py +295 -0
  8. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/__init__.py +7 -0
  9. growsurf_python-0.7.0/src/growsurf/types/campaign/participant_refund_transaction_params.py +43 -0
  10. growsurf_python-0.7.0/src/growsurf/types/campaign/participant_refund_transaction_response.py +30 -0
  11. growsurf_python-0.7.0/src/growsurf/types/campaign/participant_trigger_referral_params.py +22 -0
  12. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/api_resources/campaign/test_participant.py +285 -0
  13. growsurf_python-0.6.1/.release-please-manifest.json +0 -3
  14. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/.gitignore +0 -0
  15. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/CONTRIBUTING.md +0 -0
  16. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/LICENSE +0 -0
  17. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/README.md +0 -0
  18. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/SECURITY.md +0 -0
  19. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/bin/check-release-environment +0 -0
  20. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/bin/publish-pypi +0 -0
  21. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/examples/.keep +0 -0
  22. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/release-please-config.json +0 -0
  23. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/requirements-dev.lock +0 -0
  24. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/__init__.py +0 -0
  25. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_base_client.py +0 -0
  26. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_client.py +0 -0
  27. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_compat.py +0 -0
  28. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_constants.py +0 -0
  29. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_exceptions.py +0 -0
  30. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_files.py +0 -0
  31. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_models.py +0 -0
  32. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_qs.py +0 -0
  33. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_resource.py +0 -0
  34. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_response.py +0 -0
  35. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_streaming.py +0 -0
  36. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_types.py +0 -0
  37. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/__init__.py +0 -0
  38. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_compat.py +0 -0
  39. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_datetime_parse.py +0 -0
  40. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_json.py +0 -0
  41. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_logs.py +0 -0
  42. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_path.py +0 -0
  43. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_proxy.py +0 -0
  44. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_reflection.py +0 -0
  45. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_resources_proxy.py +0 -0
  46. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_streams.py +0 -0
  47. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_sync.py +0 -0
  48. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_transform.py +0 -0
  49. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_typing.py +0 -0
  50. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/_utils/_utils.py +0 -0
  51. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/lib/.keep +0 -0
  52. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/py.typed +0 -0
  53. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/resources/__init__.py +0 -0
  54. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/resources/campaign/__init__.py +0 -0
  55. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/resources/campaign/campaign.py +0 -0
  56. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/resources/campaign/commission.py +0 -0
  57. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/resources/campaign/reward.py +0 -0
  58. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/__init__.py +0 -0
  59. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/campaign.py +0 -0
  60. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/commission_approve_response.py +0 -0
  61. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/commission_delete_response.py +0 -0
  62. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/fraud_risk_level.py +0 -0
  63. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant.py +0 -0
  64. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_add_params.py +0 -0
  65. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_delete_response.py +0 -0
  66. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_list_commissions_params.py +0 -0
  67. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_list_payouts_params.py +0 -0
  68. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_list_referrals_params.py +0 -0
  69. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_list_rewards_params.py +0 -0
  70. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_list_rewards_response.py +0 -0
  71. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_record_transaction_params.py +0 -0
  72. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_record_transaction_response.py +0 -0
  73. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_reward.py +0 -0
  74. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_send_invites_params.py +0 -0
  75. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_send_invites_response.py +0 -0
  76. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_trigger_referral_response.py +0 -0
  77. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/participant_update_params.py +0 -0
  78. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/referral_source.py +0 -0
  79. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/referral_status.py +0 -0
  80. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/reward_approve_params.py +0 -0
  81. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/reward_approve_response.py +0 -0
  82. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/reward_delete_response.py +0 -0
  83. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign/reward_fulfill_response.py +0 -0
  84. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_create_mobile_participant_token_params.py +0 -0
  85. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_create_mobile_participant_token_response.py +0 -0
  86. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_list_commissions_params.py +0 -0
  87. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_list_leaderboard_params.py +0 -0
  88. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_list_participants_params.py +0 -0
  89. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_list_payouts_params.py +0 -0
  90. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_list_referrals_params.py +0 -0
  91. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_list_response.py +0 -0
  92. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_retrieve_analytics_params.py +0 -0
  93. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/campaign_retrieve_analytics_response.py +0 -0
  94. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/commission_structure.py +0 -0
  95. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/participant_commission_list.py +0 -0
  96. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/participant_list.py +0 -0
  97. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/participant_payout_list.py +0 -0
  98. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/src/growsurf/types/referral_list.py +0 -0
  99. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/__init__.py +0 -0
  100. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/api_resources/__init__.py +0 -0
  101. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/api_resources/campaign/__init__.py +0 -0
  102. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/api_resources/campaign/test_commission.py +0 -0
  103. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/api_resources/campaign/test_reward.py +0 -0
  104. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/api_resources/test_campaign.py +0 -0
  105. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/conftest.py +0 -0
  106. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/sample_file.txt +0 -0
  107. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_client.py +0 -0
  108. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_extract_files.py +0 -0
  109. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_files.py +0 -0
  110. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_models.py +0 -0
  111. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_qs.py +0 -0
  112. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_required_args.py +0 -0
  113. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_response.py +0 -0
  114. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_streaming.py +0 -0
  115. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_transform.py +0 -0
  116. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_utils/test_datetime_parse.py +0 -0
  117. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_utils/test_json.py +0 -0
  118. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_utils/test_path.py +0 -0
  119. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_utils/test_proxy.py +0 -0
  120. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/test_utils/test_typing.py +0 -0
  121. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/tests/utils.py +0 -0
  122. {growsurf_python-0.6.1 → growsurf_python-0.7.0}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.7.0"
3
+ }
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0 (2026-06-29)
4
+
5
+ Full Changelog: [v0.6.1...v0.7.0](https://github.com/growsurf/growsurf-python/compare/v0.6.1...v0.7.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** support delayed referral rewards and affiliate refunds ([f0afb36](https://github.com/growsurf/growsurf-python/commit/f0afb361ec64165cbb21134d277e8ad224a57106))
10
+
3
11
  ## 0.6.1 (2026-06-26)
4
12
 
5
13
  Full Changelog: [v0.6.0...v0.6.1](https://github.com/growsurf/growsurf-python/compare/v0.6.0...v0.6.1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: growsurf-python
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Summary: The official Python library for the growsurf API
5
5
  Project-URL: Homepage, https://github.com/growsurf/growsurf-python
6
6
  Project-URL: Repository, https://github.com/growsurf/growsurf-python
@@ -43,6 +43,7 @@ from growsurf.types.campaign import (
43
43
  ParticipantDeleteResponse,
44
44
  ParticipantListRewardsResponse,
45
45
  ParticipantRecordTransactionResponse,
46
+ ParticipantRefundTransactionResponse,
46
47
  ParticipantSendInvitesResponse,
47
48
  ParticipantTriggerReferralResponse,
48
49
  )
@@ -59,8 +60,10 @@ Methods:
59
60
  - <code title="get /campaign/{id}/participant/{participantIdOrEmail}/referrals">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">list_referrals</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_list_referrals_params.py">params</a>) -> <a href="./src/growsurf/types/referral_list.py">ReferralList</a></code>
60
61
  - <code title="get /campaign/{id}/participant/{participantIdOrEmail}/rewards">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">list_rewards</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_list_rewards_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant_list_rewards_response.py">ParticipantListRewardsResponse</a></code>
61
62
  - <code title="post /campaign/{id}/participant/{participantIdOrEmail}/transaction">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">record_transaction</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_record_transaction_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant_record_transaction_response.py">ParticipantRecordTransactionResponse</a></code>
63
+ - <code title="post /campaign/{id}/participant/{participantIdOrEmail}/transaction/refund">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">refund_transaction</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_refund_transaction_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant_refund_transaction_response.py">ParticipantRefundTransactionResponse</a></code>
62
64
  - <code title="post /campaign/{id}/participant/{participantIdOrEmail}/invites">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">send_invites</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_send_invites_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant_send_invites_response.py">ParticipantSendInvitesResponse</a></code>
63
- - <code title="post /campaign/{id}/participant/{participantIdOrEmail}/ref">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">trigger_referral</a>(participant_id_or_email, \*, id) -> <a href="./src/growsurf/types/campaign/participant_trigger_referral_response.py">ParticipantTriggerReferralResponse</a></code>
65
+ - <code title="post /campaign/{id}/participant/{participantIdOrEmail}/ref">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">trigger_referral</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_trigger_referral_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant_trigger_referral_response.py">ParticipantTriggerReferralResponse</a></code>
66
+ - <code title="delete /campaign/{id}/participant/{participantIdOrEmail}/ref">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">cancel_delayed_referral</a>(participant_id_or_email, \*, id) -> <a href="./src/growsurf/types/campaign/participant_trigger_referral_response.py">ParticipantTriggerReferralResponse</a></code>
64
67
 
65
68
  ## Reward
66
69
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "growsurf-python"
3
- version = "0.6.1"
3
+ version = "0.7.0"
4
4
  description = "The official Python library for the growsurf API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "growsurf"
4
- __version__ = "0.6.1" # x-release-please-version
4
+ __version__ = "0.7.0" # x-release-please-version
@@ -27,7 +27,9 @@ from ...types.campaign import (
27
27
  participant_send_invites_params,
28
28
  participant_list_referrals_params,
29
29
  participant_list_commissions_params,
30
+ participant_trigger_referral_params,
30
31
  participant_record_transaction_params,
32
+ participant_refund_transaction_params,
31
33
  )
32
34
  from ...types.referral_list import ReferralList
33
35
  from ...types.campaign.participant import Participant
@@ -39,6 +41,7 @@ from ...types.campaign.participant_list_rewards_response import ParticipantListR
39
41
  from ...types.campaign.participant_send_invites_response import ParticipantSendInvitesResponse
40
42
  from ...types.campaign.participant_trigger_referral_response import ParticipantTriggerReferralResponse
41
43
  from ...types.campaign.participant_record_transaction_response import ParticipantRecordTransactionResponse
44
+ from ...types.campaign.participant_refund_transaction_response import ParticipantRefundTransactionResponse
42
45
 
43
46
  __all__ = ["ParticipantResource", "AsyncParticipantResource"]
44
47
 
@@ -646,6 +649,87 @@ class ParticipantResource(SyncAPIResource):
646
649
  ),
647
650
  )
648
651
 
652
+ def refund_transaction(
653
+ self,
654
+ participant_id_or_email: str,
655
+ *,
656
+ id: str,
657
+ amendment_type: Literal["REFUND", "CHARGEBACK"] | Omit = omit,
658
+ amount: int | Omit = omit,
659
+ amount_refunded: int | Omit = omit,
660
+ charge_id: str | Omit = omit,
661
+ currency: str | Omit = omit,
662
+ description: str | Omit = omit,
663
+ external_id: str | Omit = omit,
664
+ invoice_id: str | Omit = omit,
665
+ order_id: str | Omit = omit,
666
+ payment_id: str | Omit = omit,
667
+ payment_intent_id: str | Omit = omit,
668
+ refund_amount: int | Omit = omit,
669
+ refund_id: str | Omit = omit,
670
+ refund_status: str | Omit = omit,
671
+ transaction_id: str | Omit = omit,
672
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
673
+ # The extra values given here take precedence over values defined on the client or passed to this method.
674
+ extra_headers: Headers | None = None,
675
+ extra_query: Query | None = None,
676
+ extra_body: Body | None = None,
677
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
678
+ ) -> ParticipantRefundTransactionResponse:
679
+ """
680
+ Records an amendment (refund, partial refund, refund cancellation, or
681
+ chargeback) against a previously recorded transaction and reverses or adjusts
682
+ the referrer's commission. The inverse of Record Affiliate Transaction.
683
+ Commissions already paid out are not clawed back; the amendment is recorded for
684
+ tax reporting only.
685
+
686
+ Args:
687
+ extra_headers: Send extra headers
688
+
689
+ extra_query: Add additional query parameters to the request
690
+
691
+ extra_body: Add additional JSON properties to the request
692
+
693
+ timeout: Override the client-level default timeout for this request, in seconds
694
+ """
695
+ if not id:
696
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
697
+ if not participant_id_or_email:
698
+ raise ValueError(
699
+ f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
700
+ )
701
+ return self._post(
702
+ path_template(
703
+ "/campaign/{id}/participant/{participant_id_or_email}/transaction/refund",
704
+ id=id,
705
+ participant_id_or_email=participant_id_or_email,
706
+ ),
707
+ body=maybe_transform(
708
+ {
709
+ "amendment_type": amendment_type,
710
+ "amount": amount,
711
+ "amount_refunded": amount_refunded,
712
+ "charge_id": charge_id,
713
+ "currency": currency,
714
+ "description": description,
715
+ "external_id": external_id,
716
+ "invoice_id": invoice_id,
717
+ "order_id": order_id,
718
+ "payment_id": payment_id,
719
+ "payment_intent_id": payment_intent_id,
720
+ "refund_amount": refund_amount,
721
+ "refund_id": refund_id,
722
+ "refund_status": refund_status,
723
+ "transaction_id": transaction_id,
724
+ },
725
+ participant_refund_transaction_params.ParticipantRefundTransactionParams,
726
+ ),
727
+ options=make_request_options(
728
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
729
+ ),
730
+ cast_to=ParticipantRefundTransactionResponse,
731
+ )
732
+
649
733
  def send_invites(
650
734
  self,
651
735
  participant_id_or_email: str,
@@ -704,6 +788,7 @@ class ParticipantResource(SyncAPIResource):
704
788
  participant_id_or_email: str,
705
789
  *,
706
790
  id: str,
791
+ delay_in_days: int | Omit = omit,
707
792
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
708
793
  # The extra values given here take precedence over values defined on the client or passed to this method.
709
794
  extra_headers: Headers | None = None,
@@ -716,6 +801,12 @@ class ParticipantResource(SyncAPIResource):
716
801
  participant ID or email address.
717
802
 
718
803
  Args:
804
+ delay_in_days: Number of whole days to hold referral credit before it is awarded. Useful for
805
+ honoring a refund window before crediting a referrer. Omit this field to award
806
+ credit immediately. The credit is awarded automatically once the delay elapses,
807
+ and can be cancelled before then with the Cancel delayed referral trigger
808
+ request.
809
+
719
810
  extra_headers: Send extra headers
720
811
 
721
812
  extra_query: Add additional query parameters to the request
@@ -731,6 +822,52 @@ class ParticipantResource(SyncAPIResource):
731
822
  f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
732
823
  )
733
824
  return self._post(
825
+ path_template(
826
+ "/campaign/{id}/participant/{participant_id_or_email}/ref",
827
+ id=id,
828
+ participant_id_or_email=participant_id_or_email,
829
+ ),
830
+ body=maybe_transform(
831
+ {"delay_in_days": delay_in_days}, participant_trigger_referral_params.ParticipantTriggerReferralParams
832
+ ),
833
+ options=make_request_options(
834
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
835
+ ),
836
+ cast_to=ParticipantTriggerReferralResponse,
837
+ )
838
+
839
+ def cancel_delayed_referral(
840
+ self,
841
+ participant_id_or_email: str,
842
+ *,
843
+ id: str,
844
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
845
+ # The extra values given here take precedence over values defined on the client or passed to this method.
846
+ extra_headers: Headers | None = None,
847
+ extra_query: Query | None = None,
848
+ extra_body: Body | None = None,
849
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
850
+ ) -> ParticipantTriggerReferralResponse:
851
+ """
852
+ Cancels a pending delayed referral trigger for a participant by GrowSurf
853
+ participant ID or email address.
854
+
855
+ Args:
856
+ extra_headers: Send extra headers
857
+
858
+ extra_query: Add additional query parameters to the request
859
+
860
+ extra_body: Add additional JSON properties to the request
861
+
862
+ timeout: Override the client-level default timeout for this request, in seconds
863
+ """
864
+ if not id:
865
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
866
+ if not participant_id_or_email:
867
+ raise ValueError(
868
+ f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
869
+ )
870
+ return self._delete(
734
871
  path_template(
735
872
  "/campaign/{id}/participant/{participant_id_or_email}/ref",
736
873
  id=id,
@@ -1346,6 +1483,87 @@ class AsyncParticipantResource(AsyncAPIResource):
1346
1483
  ),
1347
1484
  )
1348
1485
 
1486
+ async def refund_transaction(
1487
+ self,
1488
+ participant_id_or_email: str,
1489
+ *,
1490
+ id: str,
1491
+ amendment_type: Literal["REFUND", "CHARGEBACK"] | Omit = omit,
1492
+ amount: int | Omit = omit,
1493
+ amount_refunded: int | Omit = omit,
1494
+ charge_id: str | Omit = omit,
1495
+ currency: str | Omit = omit,
1496
+ description: str | Omit = omit,
1497
+ external_id: str | Omit = omit,
1498
+ invoice_id: str | Omit = omit,
1499
+ order_id: str | Omit = omit,
1500
+ payment_id: str | Omit = omit,
1501
+ payment_intent_id: str | Omit = omit,
1502
+ refund_amount: int | Omit = omit,
1503
+ refund_id: str | Omit = omit,
1504
+ refund_status: str | Omit = omit,
1505
+ transaction_id: str | Omit = omit,
1506
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1507
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1508
+ extra_headers: Headers | None = None,
1509
+ extra_query: Query | None = None,
1510
+ extra_body: Body | None = None,
1511
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1512
+ ) -> ParticipantRefundTransactionResponse:
1513
+ """
1514
+ Records an amendment (refund, partial refund, refund cancellation, or
1515
+ chargeback) against a previously recorded transaction and reverses or adjusts
1516
+ the referrer's commission. The inverse of Record Affiliate Transaction.
1517
+ Commissions already paid out are not clawed back; the amendment is recorded for
1518
+ tax reporting only.
1519
+
1520
+ Args:
1521
+ extra_headers: Send extra headers
1522
+
1523
+ extra_query: Add additional query parameters to the request
1524
+
1525
+ extra_body: Add additional JSON properties to the request
1526
+
1527
+ timeout: Override the client-level default timeout for this request, in seconds
1528
+ """
1529
+ if not id:
1530
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1531
+ if not participant_id_or_email:
1532
+ raise ValueError(
1533
+ f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
1534
+ )
1535
+ return await self._post(
1536
+ path_template(
1537
+ "/campaign/{id}/participant/{participant_id_or_email}/transaction/refund",
1538
+ id=id,
1539
+ participant_id_or_email=participant_id_or_email,
1540
+ ),
1541
+ body=await async_maybe_transform(
1542
+ {
1543
+ "amendment_type": amendment_type,
1544
+ "amount": amount,
1545
+ "amount_refunded": amount_refunded,
1546
+ "charge_id": charge_id,
1547
+ "currency": currency,
1548
+ "description": description,
1549
+ "external_id": external_id,
1550
+ "invoice_id": invoice_id,
1551
+ "order_id": order_id,
1552
+ "payment_id": payment_id,
1553
+ "payment_intent_id": payment_intent_id,
1554
+ "refund_amount": refund_amount,
1555
+ "refund_id": refund_id,
1556
+ "refund_status": refund_status,
1557
+ "transaction_id": transaction_id,
1558
+ },
1559
+ participant_refund_transaction_params.ParticipantRefundTransactionParams,
1560
+ ),
1561
+ options=make_request_options(
1562
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1563
+ ),
1564
+ cast_to=ParticipantRefundTransactionResponse,
1565
+ )
1566
+
1349
1567
  async def send_invites(
1350
1568
  self,
1351
1569
  participant_id_or_email: str,
@@ -1404,6 +1622,7 @@ class AsyncParticipantResource(AsyncAPIResource):
1404
1622
  participant_id_or_email: str,
1405
1623
  *,
1406
1624
  id: str,
1625
+ delay_in_days: int | Omit = omit,
1407
1626
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1408
1627
  # The extra values given here take precedence over values defined on the client or passed to this method.
1409
1628
  extra_headers: Headers | None = None,
@@ -1416,6 +1635,12 @@ class AsyncParticipantResource(AsyncAPIResource):
1416
1635
  participant ID or email address.
1417
1636
 
1418
1637
  Args:
1638
+ delay_in_days: Number of whole days to hold referral credit before it is awarded. Useful for
1639
+ honoring a refund window before crediting a referrer. Omit this field to award
1640
+ credit immediately. The credit is awarded automatically once the delay elapses,
1641
+ and can be cancelled before then with the Cancel delayed referral trigger
1642
+ request.
1643
+
1419
1644
  extra_headers: Send extra headers
1420
1645
 
1421
1646
  extra_query: Add additional query parameters to the request
@@ -1431,6 +1656,52 @@ class AsyncParticipantResource(AsyncAPIResource):
1431
1656
  f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
1432
1657
  )
1433
1658
  return await self._post(
1659
+ path_template(
1660
+ "/campaign/{id}/participant/{participant_id_or_email}/ref",
1661
+ id=id,
1662
+ participant_id_or_email=participant_id_or_email,
1663
+ ),
1664
+ body=await async_maybe_transform(
1665
+ {"delay_in_days": delay_in_days}, participant_trigger_referral_params.ParticipantTriggerReferralParams
1666
+ ),
1667
+ options=make_request_options(
1668
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1669
+ ),
1670
+ cast_to=ParticipantTriggerReferralResponse,
1671
+ )
1672
+
1673
+ async def cancel_delayed_referral(
1674
+ self,
1675
+ participant_id_or_email: str,
1676
+ *,
1677
+ id: str,
1678
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1679
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1680
+ extra_headers: Headers | None = None,
1681
+ extra_query: Query | None = None,
1682
+ extra_body: Body | None = None,
1683
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1684
+ ) -> ParticipantTriggerReferralResponse:
1685
+ """
1686
+ Cancels a pending delayed referral trigger for a participant by GrowSurf
1687
+ participant ID or email address.
1688
+
1689
+ Args:
1690
+ extra_headers: Send extra headers
1691
+
1692
+ extra_query: Add additional query parameters to the request
1693
+
1694
+ extra_body: Add additional JSON properties to the request
1695
+
1696
+ timeout: Override the client-level default timeout for this request, in seconds
1697
+ """
1698
+ if not id:
1699
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1700
+ if not participant_id_or_email:
1701
+ raise ValueError(
1702
+ f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
1703
+ )
1704
+ return await self._delete(
1434
1705
  path_template(
1435
1706
  "/campaign/{id}/participant/{participant_id_or_email}/ref",
1436
1707
  id=id,
@@ -1474,12 +1745,18 @@ class ParticipantResourceWithRawResponse:
1474
1745
  self.record_transaction = to_raw_response_wrapper(
1475
1746
  participant.record_transaction,
1476
1747
  )
1748
+ self.refund_transaction = to_raw_response_wrapper(
1749
+ participant.refund_transaction,
1750
+ )
1477
1751
  self.send_invites = to_raw_response_wrapper(
1478
1752
  participant.send_invites,
1479
1753
  )
1480
1754
  self.trigger_referral = to_raw_response_wrapper(
1481
1755
  participant.trigger_referral,
1482
1756
  )
1757
+ self.cancel_delayed_referral = to_raw_response_wrapper(
1758
+ participant.cancel_delayed_referral,
1759
+ )
1483
1760
 
1484
1761
 
1485
1762
  class AsyncParticipantResourceWithRawResponse:
@@ -1513,12 +1790,18 @@ class AsyncParticipantResourceWithRawResponse:
1513
1790
  self.record_transaction = async_to_raw_response_wrapper(
1514
1791
  participant.record_transaction,
1515
1792
  )
1793
+ self.refund_transaction = async_to_raw_response_wrapper(
1794
+ participant.refund_transaction,
1795
+ )
1516
1796
  self.send_invites = async_to_raw_response_wrapper(
1517
1797
  participant.send_invites,
1518
1798
  )
1519
1799
  self.trigger_referral = async_to_raw_response_wrapper(
1520
1800
  participant.trigger_referral,
1521
1801
  )
1802
+ self.cancel_delayed_referral = async_to_raw_response_wrapper(
1803
+ participant.cancel_delayed_referral,
1804
+ )
1522
1805
 
1523
1806
 
1524
1807
  class ParticipantResourceWithStreamingResponse:
@@ -1552,12 +1835,18 @@ class ParticipantResourceWithStreamingResponse:
1552
1835
  self.record_transaction = to_streamed_response_wrapper(
1553
1836
  participant.record_transaction,
1554
1837
  )
1838
+ self.refund_transaction = to_streamed_response_wrapper(
1839
+ participant.refund_transaction,
1840
+ )
1555
1841
  self.send_invites = to_streamed_response_wrapper(
1556
1842
  participant.send_invites,
1557
1843
  )
1558
1844
  self.trigger_referral = to_streamed_response_wrapper(
1559
1845
  participant.trigger_referral,
1560
1846
  )
1847
+ self.cancel_delayed_referral = to_streamed_response_wrapper(
1848
+ participant.cancel_delayed_referral,
1849
+ )
1561
1850
 
1562
1851
 
1563
1852
  class AsyncParticipantResourceWithStreamingResponse:
@@ -1591,9 +1880,15 @@ class AsyncParticipantResourceWithStreamingResponse:
1591
1880
  self.record_transaction = async_to_streamed_response_wrapper(
1592
1881
  participant.record_transaction,
1593
1882
  )
1883
+ self.refund_transaction = async_to_streamed_response_wrapper(
1884
+ participant.refund_transaction,
1885
+ )
1594
1886
  self.send_invites = async_to_streamed_response_wrapper(
1595
1887
  participant.send_invites,
1596
1888
  )
1597
1889
  self.trigger_referral = async_to_streamed_response_wrapper(
1598
1890
  participant.trigger_referral,
1599
1891
  )
1892
+ self.cancel_delayed_referral = async_to_streamed_response_wrapper(
1893
+ participant.cancel_delayed_referral,
1894
+ )
@@ -24,12 +24,19 @@ from .participant_list_referrals_params import ParticipantListReferralsParams as
24
24
  from .participant_list_rewards_response import ParticipantListRewardsResponse as ParticipantListRewardsResponse
25
25
  from .participant_send_invites_response import ParticipantSendInvitesResponse as ParticipantSendInvitesResponse
26
26
  from .participant_list_commissions_params import ParticipantListCommissionsParams as ParticipantListCommissionsParams
27
+ from .participant_trigger_referral_params import ParticipantTriggerReferralParams as ParticipantTriggerReferralParams
27
28
  from .participant_record_transaction_params import (
28
29
  ParticipantRecordTransactionParams as ParticipantRecordTransactionParams,
29
30
  )
31
+ from .participant_refund_transaction_params import (
32
+ ParticipantRefundTransactionParams as ParticipantRefundTransactionParams,
33
+ )
30
34
  from .participant_trigger_referral_response import (
31
35
  ParticipantTriggerReferralResponse as ParticipantTriggerReferralResponse,
32
36
  )
33
37
  from .participant_record_transaction_response import (
34
38
  ParticipantRecordTransactionResponse as ParticipantRecordTransactionResponse,
35
39
  )
40
+ from .participant_refund_transaction_response import (
41
+ ParticipantRefundTransactionResponse as ParticipantRefundTransactionResponse,
42
+ )
@@ -0,0 +1,43 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, Annotated, TypedDict
6
+
7
+ from ..._utils import PropertyInfo
8
+
9
+ __all__ = ["ParticipantRefundTransactionParams"]
10
+
11
+
12
+ class ParticipantRefundTransactionParams(TypedDict, total=False):
13
+ id: Required[str]
14
+
15
+ amendment_type: Annotated[Literal["REFUND", "CHARGEBACK"], PropertyInfo(alias="amendmentType")]
16
+
17
+ amount: int
18
+
19
+ amount_refunded: Annotated[int, PropertyInfo(alias="amountRefunded")]
20
+
21
+ charge_id: Annotated[str, PropertyInfo(alias="chargeId")]
22
+
23
+ currency: str
24
+
25
+ description: str
26
+
27
+ external_id: Annotated[str, PropertyInfo(alias="externalId")]
28
+
29
+ invoice_id: Annotated[str, PropertyInfo(alias="invoiceId")]
30
+
31
+ order_id: Annotated[str, PropertyInfo(alias="orderId")]
32
+
33
+ payment_id: Annotated[str, PropertyInfo(alias="paymentId")]
34
+
35
+ payment_intent_id: Annotated[str, PropertyInfo(alias="paymentIntentId")]
36
+
37
+ refund_amount: Annotated[int, PropertyInfo(alias="refundAmount")]
38
+
39
+ refund_id: Annotated[str, PropertyInfo(alias="refundId")]
40
+
41
+ refund_status: Annotated[str, PropertyInfo(alias="refundStatus")]
42
+
43
+ transaction_id: Annotated[str, PropertyInfo(alias="transactionId")]
@@ -0,0 +1,30 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from ..._models import BaseModel
9
+
10
+ __all__ = ["ParticipantRefundTransactionResponse"]
11
+
12
+
13
+ class ParticipantRefundTransactionResponse(BaseModel):
14
+ adjusted: int
15
+
16
+ amendment_type: Literal["REFUND", "CHARGEBACK"] = FieldInfo(alias="amendmentType")
17
+
18
+ deleted: int
19
+
20
+ matched: int
21
+
22
+ matching_commission_ids: List[str] = FieldInfo(alias="matchingCommissionIds")
23
+
24
+ message: str
25
+
26
+ reversed: int
27
+
28
+ success: bool
29
+
30
+ not_found: Optional[bool] = FieldInfo(alias="notFound", default=None)
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, Annotated, TypedDict
6
+
7
+ from ..._utils import PropertyInfo
8
+
9
+ __all__ = ["ParticipantTriggerReferralParams"]
10
+
11
+
12
+ class ParticipantTriggerReferralParams(TypedDict, total=False):
13
+ id: Required[str]
14
+
15
+ delay_in_days: Annotated[int, PropertyInfo(alias="delayInDays")]
16
+ """Number of whole days to hold referral credit before it is awarded.
17
+
18
+ Useful for honoring a refund window before crediting a referrer. Omit this field
19
+ to award credit immediately. The credit is awarded automatically once the delay
20
+ elapses, and can be cancelled before then with the Cancel delayed referral
21
+ trigger request.
22
+ """