From 907b93ef3139643739fa10c945b7c0b0a10305e1 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 00:23:17 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 5.28.0 --- .fern/metadata.json | 2 +- poetry.lock | 8 +- reference.md | 4644 +++++++---------- src/whop_sdk/__init__.py | 554 +- src/whop_sdk/access_tokens/client.py | 4 +- src/whop_sdk/account_links/client.py | 4 +- src/whop_sdk/accounts/client.py | 40 +- src/whop_sdk/accounts/preferences/client.py | 8 +- src/whop_sdk/accounts/raw_client.py | 4 +- src/whop_sdk/accounts/reserves/client.py | 4 +- src/whop_sdk/ad_campaigns/client.py | 36 +- src/whop_sdk/ad_groups/client.py | 44 +- src/whop_sdk/ad_groups/raw_client.py | 4 +- src/whop_sdk/ad_reports/__init__.py | 4 - src/whop_sdk/ad_reports/client.py | 230 - src/whop_sdk/ad_reports/raw_client.py | 368 -- src/whop_sdk/ads/__init__.py | 6 + src/whop_sdk/ads/client.py | 62 +- src/whop_sdk/ads/raw_client.py | 38 +- src/whop_sdk/ads/types/__init__.py | 6 + .../types/create_ads_request_music.py} | 6 +- .../ads/types/update_ads_request_music.py | 26 + src/whop_sdk/affiliates/client.py | 20 +- src/whop_sdk/affiliates/overrides/client.py | 20 +- src/whop_sdk/ai_chats/client.py | 20 +- src/whop_sdk/api_keys/client.py | 28 +- ...reate_api_keys_request_api_version_date.py | 3 + ...pdate_api_keys_request_api_version_date.py | 3 + src/whop_sdk/api_logs/client.py | 4 +- src/whop_sdk/app_builds/client.py | 16 +- src/whop_sdk/apps/client.py | 36 +- src/whop_sdk/audiences/client.py | 20 +- src/whop_sdk/authorized_users/client.py | 16 +- src/whop_sdk/bounties/client.py | 20 +- src/whop_sdk/bounties/submissions/client.py | 8 +- src/whop_sdk/bounty_submissions/client.py | 20 +- src/whop_sdk/card_transactions/client.py | 8 +- src/whop_sdk/cards/client.py | 16 +- src/whop_sdk/chat_channels/client.py | 12 +- .../checkout_configurations/client.py | 16 +- src/whop_sdk/client.py | 46 +- src/whop_sdk/companies/__init__.py | 61 - src/whop_sdk/companies/client.py | 834 --- src/whop_sdk/companies/raw_client.py | 1700 ------ src/whop_sdk/companies/types/__init__.py | 59 - ..._key_companies_request_permissions_item.py | 36 - .../create_api_key_companies_response.py | 36 - .../types/list_companies_response.py | 33 - ...ate_companies_request_social_links_item.py | 53 - .../company_token_transactions/client.py | 12 +- src/whop_sdk/confirmation_tokens/client.py | 8 +- src/whop_sdk/course_chapters/client.py | 20 +- .../course_lesson_interactions/client.py | 8 +- src/whop_sdk/course_lessons/client.py | 32 +- src/whop_sdk/course_students/client.py | 8 +- src/whop_sdk/courses/client.py | 20 +- src/whop_sdk/deposits/client.py | 4 +- src/whop_sdk/dispute_alerts/client.py | 8 +- src/whop_sdk/disputes/client.py | 51 +- src/whop_sdk/disputes/raw_client.py | 33 +- src/whop_sdk/dm_channels/client.py | 20 +- src/whop_sdk/dm_members/client.py | 20 +- src/whop_sdk/entries/client.py | 16 +- src/whop_sdk/events/client.py | 16 +- src/whop_sdk/experiences/client.py | 32 +- src/whop_sdk/exports/client.py | 12 +- src/whop_sdk/fee_markups/client.py | 12 +- src/whop_sdk/files/client.py | 16 +- src/whop_sdk/financial_activity/client.py | 4 +- ...ancial_activity_request_line_types_item.py | 1 + src/whop_sdk/financial_reports/__init__.py | 9 + .../financial_reports/breakdown/__init__.py | 9 + .../financial_reports/breakdown/client.py | 69 +- .../financial_reports/breakdown/raw_client.py | 47 +- .../breakdown/types/__init__.py | 9 + .../retrieve_breakdown_request_bucket.py | 5 +- .../retrieve_breakdown_request_group_by.py | 5 + .../types/retrieve_breakdown_response.py | 1 + .../retrieve_breakdown_response_bucket.py | 5 +- .../retrieve_breakdown_response_items_item.py | 6 + ...ve_breakdown_response_items_item_avatar.py | 24 + ...akdown_response_items_item_avatar_shape.py | 5 + ...ve_breakdown_response_items_item_object.py | 5 +- src/whop_sdk/financial_reports/client.py | 45 +- src/whop_sdk/financial_reports/raw_client.py | 42 +- ...nancial_reports_request_line_types_item.py | 1 + ...eports_response_rows_item_line_category.py | 2 + src/whop_sdk/forum_posts/client.py | 16 +- src/whop_sdk/forums/client.py | 12 +- src/whop_sdk/identity_profiles/client.py | 16 +- src/whop_sdk/invoices/client.py | 36 +- src/whop_sdk/leads/client.py | 16 +- src/whop_sdk/ledger_accounts/client.py | 4 +- src/whop_sdk/media/client.py | 8 +- src/whop_sdk/members/client.py | 26 +- src/whop_sdk/members/logs/client.py | 4 +- src/whop_sdk/members/raw_client.py | 12 + src/whop_sdk/memberships/client.py | 75 +- src/whop_sdk/memberships/raw_client.py | 49 +- src/whop_sdk/messages/client.py | 20 +- src/whop_sdk/notifications/client.py | 20 +- src/whop_sdk/notifications/topics/client.py | 4 +- src/whop_sdk/partners/businesses/client.py | 8 +- .../partners/businesses/earnings/client.py | 4 +- src/whop_sdk/partners/client.py | 12 +- src/whop_sdk/payment_method_domains/client.py | 20 +- src/whop_sdk/payment_methods/client.py | 12 +- src/whop_sdk/payments/__init__.py | 54 +- src/whop_sdk/payments/client.py | 881 ++-- src/whop_sdk/payments/raw_client.py | 1526 ++---- src/whop_sdk/payments/types/__init__.py | 54 +- .../payments/types/create_payments_request.py | 12 - .../types/create_payments_request_one.py | 67 - .../types/create_payments_request_one_plan.py | 100 - ...reate_payments_request_one_plan_product.py | 83 - .../types/create_payments_request_three.py | 66 - .../types/create_payments_request_two.py | 66 - .../types/create_payments_request_zero.py | 67 - .../create_payments_request_zero_plan.py | 100 - ...eate_payments_request_zero_plan_product.py | 83 - .../types/create_payments_response.py | 23 - .../types/list_fees_payments_response.py | 19 +- .../list_fees_payments_response_data_item.py | 43 - .../list_fees_payments_response_page_info.py} | 14 +- .../list_payments_request_billing_reason.py | 10 + .../types/list_payments_request_direction.py | 5 + .../types/list_payments_request_order.py | 5 + .../types/list_payments_request_status.py | 7 + .../payments/types/list_payments_response.py | 19 +- .../list_payments_response_page_info.py} | 14 +- .../types/post_payment_authorized_payload.py | 4 +- .../types/post_payment_canceled_payload.py | 4 +- .../types/post_payment_created_payload.py | 4 +- .../types/post_payment_failed_payload.py | 4 +- .../types/post_payment_pending_payload.py | 4 +- .../types/post_payment_succeeded_payload.py | 4 +- .../types/retrieve_payments_response.py | 23 - src/whop_sdk/payout_accounts/client.py | 4 +- src/whop_sdk/payout_methods/client.py | 8 +- src/whop_sdk/payouts/__init__.py | 18 +- src/whop_sdk/payouts/client.py | 178 +- src/whop_sdk/payouts/methods/__init__.py | 6 + src/whop_sdk/payouts/methods/client.py | 16 +- .../payouts/methods/types/__init__.py | 8 + .../list_methods_response_data_item_quote.py | 10 + ...a_item_quote_instant_unavailable_reason.py | 7 + .../list_methods_response_limits_standard.py | 11 + ...ods_response_limits_standard_error_code.py | 20 + src/whop_sdk/payouts/raw_client.py | 161 +- .../payouts/supported_methods/client.py | 4 +- src/whop_sdk/payouts/types/__init__.py | 14 +- .../payouts/types/cancel_payouts_response.py | 5 + .../types/create_payouts_request_body.py | 5 - .../create_payouts_request_body_speed.py | 5 - .../types/create_payouts_request_speed.py | 5 + .../payouts/types/create_payouts_response.py | 5 + .../types/list_payouts_response_data_item.py | 5 + .../types/post_payout_created_payload_data.py | 5 + ...ayout_method_created_payload_data_quote.py | 10 + ...d_data_quote_instant_unavailable_reason.py | 7 + .../post_payout_reversed_payload_data.py | 5 + .../types/post_payout_updated_payload_data.py | 5 + .../types/retrieve_payouts_response.py | 5 + src/whop_sdk/people/client.py | 8 +- src/whop_sdk/permissions/client.py | 4 +- src/whop_sdk/plans/client.py | 24 +- src/whop_sdk/products/client.py | 28 +- src/whop_sdk/promo_codes/client.py | 24 +- src/whop_sdk/reactions/client.py | 16 +- src/whop_sdk/recommended_actions/client.py | 20 +- .../recommended_actions/raw_client.py | 4 +- .../list_recommended_actions_response.py | 4 + src/whop_sdk/refunds/__init__.py | 9 + src/whop_sdk/refunds/client.py | 233 +- src/whop_sdk/refunds/raw_client.py | 395 +- src/whop_sdk/refunds/types/__init__.py | 9 + .../types/list_refunds_request_direction.py | 5 + .../types/list_refunds_request_order.py | 5 + .../refunds/types/list_refunds_response.py | 19 +- .../types/list_refunds_response_page_info.py} | 14 +- .../types/post_refund_created_payload.py | 4 +- .../types/post_refund_updated_payload.py | 4 +- .../resolution_center_cases/client.py | 44 +- src/whop_sdk/reviews/client.py | 8 +- src/whop_sdk/setup_intents/client.py | 20 +- src/whop_sdk/shipments/client.py | 16 +- src/whop_sdk/social_accounts/client.py | 24 +- src/whop_sdk/stats/client.py | 20 +- src/whop_sdk/support_channels/client.py | 12 +- src/whop_sdk/swaps/client.py | 16 +- src/whop_sdk/team_members/client.py | 20 +- src/whop_sdk/topups/client.py | 4 +- src/whop_sdk/transfers/client.py | 16 +- src/whop_sdk/types/__init__.py | 445 +- src/whop_sdk/types/ad.py | 6 + ...{company_list_item_logo.py => ad_music.py} | 12 +- src/whop_sdk/types/ad_report.py | 39 - .../types/ad_report_breakdown_item.py | 49 - ..._report_breakdown_item_granularity_item.py | 85 - .../types/ad_report_breakdown_item_summary.py | 93 - .../types/ad_report_breakdown_levels.py | 5 - .../types/ad_report_granularity_item.py | 85 - src/whop_sdk/types/ad_report_summary.py | 93 - .../types/api_key_api_version_date.py | 3 + src/whop_sdk/types/app.py | 1 + src/whop_sdk/types/app_list_item.py | 1 + src/whop_sdk/types/card_transaction_legacy.py | 113 + src/whop_sdk/types/company.py | 111 - src/whop_sdk/types/company_list_item.py | 94 - src/whop_sdk/types/countries.py | 251 - src/whop_sdk/types/dispute_alert_legacy.py | 71 + .../types/dispute_alert_legacy_dispute.py | 54 + .../types/dispute_alert_legacy_payment.py | 104 + .../dispute_alert_legacy_payment_member.py | 31 + ...dispute_alert_legacy_payment_membership.py | 32 + .../dispute_alert_legacy_payment_user.py | 41 + src/whop_sdk/types/dispute_legacy.py | 176 + ...e_legacy_cancellation_policy_attachment.py | 41 + src/whop_sdk/types/dispute_legacy_company.py | 31 + ...egacy_customer_communication_attachment.py | 41 + src/whop_sdk/types/dispute_legacy_payment.py | 110 + .../types/dispute_legacy_payment_member.py | 31 + .../dispute_legacy_payment_membership.py | 32 + ...spute_legacy_payment_payment_instrument.py | 42 + ...legacy_payment_payment_instrument_icons.py | 27 + ...payment_payment_instrument_icons_square.py | 37 + ...t_payment_instrument_icons_square_dark.py} | 8 +- ...t_payment_instrument_icons_square_light.py | 26 + .../types/dispute_legacy_payment_user.py | 41 + src/whop_sdk/types/dispute_legacy_plan.py | 26 + ...e_product.py => dispute_legacy_product.py} | 8 +- ...dispute_legacy_refund_policy_attachment.py | 41 + ...dispute_legacy_uncategorized_attachment.py | 41 + src/whop_sdk/types/granularities.py | 5 - src/whop_sdk/types/ledger_account.py | 5 + src/whop_sdk/types/ledger_activity.py | 5 + .../types/ledger_activity_line_type.py | 1 + src/whop_sdk/types/member.py | 5 + src/whop_sdk/types/member_legacy.py | 92 + src/whop_sdk/types/member_legacy_company.py | 36 + src/whop_sdk/types/member_legacy_user.py | 41 + src/whop_sdk/types/membership_legacy.py | 168 + .../types/membership_legacy_company.py | 31 + ...hip_legacy_custom_field_responses_item.py} | 17 +- .../types/membership_legacy_member.py | 26 + src/whop_sdk/types/membership_legacy_plan.py | 31 + .../types/membership_legacy_product.py | 36 + .../types/membership_legacy_promo_code.py | 26 + src/whop_sdk/types/membership_legacy_user.py | 46 + src/whop_sdk/types/payment.py | 254 +- src/whop_sdk/types/payment_address.py | 52 + src/whop_sdk/types/payment_fee.py | 55 + src/whop_sdk/types/payment_fee_origin.py | 42 + src/whop_sdk/types/payment_fee_type.py | 7 + src/whop_sdk/types/payment_legacy.py | 364 ++ ...e.py => payment_legacy_application_fee.py} | 2 +- ...s.py => payment_legacy_billing_address.py} | 2 +- ...t_company.py => payment_legacy_company.py} | 2 +- ...tem.py => payment_legacy_disputes_item.py} | 2 +- ...es_item.py => payment_legacy_fees_item.py} | 2 +- ...ent_legacy_financing_transactions_item.py} | 2 +- ...ent_member.py => payment_legacy_member.py} | 2 +- ...ership.py => payment_legacy_membership.py} | 2 +- ...y => payment_legacy_payment_instrument.py} | 10 +- ...payment_legacy_payment_instrument_card.py} | 2 +- ...ayment_legacy_payment_instrument_icons.py} | 10 +- ...t_legacy_payment_instrument_icons_card.py} | 10 +- ...acy_payment_instrument_icons_card_dark.py} | 2 +- ...cy_payment_instrument_icons_card_light.py} | 2 +- ...legacy_payment_instrument_icons_square.py} | 10 +- ...y_payment_instrument_icons_square_dark.py} | 2 +- ..._payment_instrument_icons_square_light.py} | 2 +- ...od.py => payment_legacy_payment_method.py} | 6 +- ... => payment_legacy_payment_method_card.py} | 2 +- ...payment_plan.py => payment_legacy_plan.py} | 2 +- ...t_product.py => payment_legacy_product.py} | 2 +- ...o_code.py => payment_legacy_promo_code.py} | 2 +- ...item.py => payment_legacy_refunds_item.py} | 2 +- ....py => payment_legacy_resolutions_item.py} | 2 +- ...shipment.py => payment_legacy_shipment.py} | 2 +- ....py => payment_legacy_shipping_address.py} | 2 +- ...payment_user.py => payment_legacy_user.py} | 2 +- .../payment_legacy_verification_checks.py | 41 + .../types/payment_verification_checks.py | 12 +- src/whop_sdk/types/permission_system_roles.py | 7 - src/whop_sdk/types/product_legacy.py | 149 + src/whop_sdk/types/product_legacy_company.py | 36 + .../product_legacy_gallery_images_item.py | 36 + ...r_user.py => product_legacy_owner_user.py} | 4 +- .../types/product_legacy_product_tax_code.py | 37 + src/whop_sdk/types/refund.py | 81 +- src/whop_sdk/types/refund_failure_reason.py | 17 + src/whop_sdk/types/refund_legacy.py | 83 + ...nd_payment.py => refund_legacy_payment.py} | 22 +- ...ber.py => refund_legacy_payment_member.py} | 2 +- ...py => refund_legacy_payment_membership.py} | 2 +- ..._plan.py => refund_legacy_payment_plan.py} | 2 +- ...ct.py => refund_legacy_payment_product.py} | 2 +- ..._user.py => refund_legacy_payment_user.py} | 2 +- src/whop_sdk/types/refund_reason.py | 7 + src/whop_sdk/types/refund_reference_status.py | 5 + src/whop_sdk/types/refund_reference_type.py | 7 + src/whop_sdk/types/refund_status.py | 5 + .../types/resolution_center_case_legacy.py | 112 + .../resolution_center_case_legacy_company.py | 31 + .../resolution_center_case_legacy_member.py | 26 + .../resolution_center_case_legacy_payment.py | 53 + ...nter_case_legacy_resolution_events_item.py | 49 + ... => resolution_center_case_legacy_user.py} | 4 +- src/whop_sdk/types/result_label_keys.py | 43 - src/whop_sdk/types/shipment_legacy.py | 70 + src/whop_sdk/types/shipment_legacy_payment.py | 26 + src/whop_sdk/types/social_link_websites.py | 8 - src/whop_sdk/types/user.py | 2 +- src/whop_sdk/types/user_earnings.py | 5 + src/whop_sdk/users/client.py | 28 +- src/whop_sdk/users/oauth_grants/client.py | 8 +- src/whop_sdk/users/passkeys/client.py | 16 +- src/whop_sdk/users/preferences/client.py | 8 +- .../users/preferences/notifications/client.py | 4 +- .../notifications/experiences/client.py | 4 +- .../notifications/topics/client.py | 4 +- src/whop_sdk/verifications/client.py | 16 +- src/whop_sdk/webhooks/client.py | 40 +- 324 files changed, 8585 insertions(+), 11732 deletions(-) delete mode 100644 src/whop_sdk/ad_reports/__init__.py delete mode 100644 src/whop_sdk/ad_reports/client.py delete mode 100644 src/whop_sdk/ad_reports/raw_client.py rename src/whop_sdk/{companies/types/update_companies_request_banner_image.py => ads/types/create_ads_request_music.py} (67%) create mode 100644 src/whop_sdk/ads/types/update_ads_request_music.py delete mode 100644 src/whop_sdk/companies/__init__.py delete mode 100644 src/whop_sdk/companies/client.py delete mode 100644 src/whop_sdk/companies/raw_client.py delete mode 100644 src/whop_sdk/companies/types/__init__.py delete mode 100644 src/whop_sdk/companies/types/create_api_key_companies_request_permissions_item.py delete mode 100644 src/whop_sdk/companies/types/create_api_key_companies_response.py delete mode 100644 src/whop_sdk/companies/types/list_companies_response.py delete mode 100644 src/whop_sdk/companies/types/update_companies_request_social_links_item.py create mode 100644 src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_group_by.py create mode 100644 src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar.py create mode 100644 src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar_shape.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_one.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_one_plan.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_one_plan_product.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_three.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_two.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_zero.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_zero_plan.py delete mode 100644 src/whop_sdk/payments/types/create_payments_request_zero_plan_product.py delete mode 100644 src/whop_sdk/payments/types/create_payments_response.py delete mode 100644 src/whop_sdk/payments/types/list_fees_payments_response_data_item.py rename src/whop_sdk/{companies/types/update_companies_request_social_links_item_image.py => payments/types/list_fees_payments_response_page_info.py} (68%) create mode 100644 src/whop_sdk/payments/types/list_payments_request_billing_reason.py create mode 100644 src/whop_sdk/payments/types/list_payments_request_direction.py create mode 100644 src/whop_sdk/payments/types/list_payments_request_order.py create mode 100644 src/whop_sdk/payments/types/list_payments_request_status.py rename src/whop_sdk/{companies/types/update_companies_request_logo.py => payments/types/list_payments_response_page_info.py} (67%) delete mode 100644 src/whop_sdk/payments/types/retrieve_payments_response.py create mode 100644 src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote_instant_unavailable_reason.py create mode 100644 src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard_error_code.py delete mode 100644 src/whop_sdk/payouts/types/create_payouts_request_body.py delete mode 100644 src/whop_sdk/payouts/types/create_payouts_request_body_speed.py create mode 100644 src/whop_sdk/payouts/types/create_payouts_request_speed.py create mode 100644 src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote_instant_unavailable_reason.py create mode 100644 src/whop_sdk/refunds/types/list_refunds_request_direction.py create mode 100644 src/whop_sdk/refunds/types/list_refunds_request_order.py rename src/whop_sdk/{companies/types/create_companies_request_logo.py => refunds/types/list_refunds_response_page_info.py} (67%) rename src/whop_sdk/types/{company_list_item_logo.py => ad_music.py} (70%) delete mode 100644 src/whop_sdk/types/ad_report.py delete mode 100644 src/whop_sdk/types/ad_report_breakdown_item.py delete mode 100644 src/whop_sdk/types/ad_report_breakdown_item_granularity_item.py delete mode 100644 src/whop_sdk/types/ad_report_breakdown_item_summary.py delete mode 100644 src/whop_sdk/types/ad_report_breakdown_levels.py delete mode 100644 src/whop_sdk/types/ad_report_granularity_item.py delete mode 100644 src/whop_sdk/types/ad_report_summary.py create mode 100644 src/whop_sdk/types/card_transaction_legacy.py delete mode 100644 src/whop_sdk/types/company.py delete mode 100644 src/whop_sdk/types/company_list_item.py delete mode 100644 src/whop_sdk/types/countries.py create mode 100644 src/whop_sdk/types/dispute_alert_legacy.py create mode 100644 src/whop_sdk/types/dispute_alert_legacy_dispute.py create mode 100644 src/whop_sdk/types/dispute_alert_legacy_payment.py create mode 100644 src/whop_sdk/types/dispute_alert_legacy_payment_member.py create mode 100644 src/whop_sdk/types/dispute_alert_legacy_payment_membership.py create mode 100644 src/whop_sdk/types/dispute_alert_legacy_payment_user.py create mode 100644 src/whop_sdk/types/dispute_legacy.py create mode 100644 src/whop_sdk/types/dispute_legacy_cancellation_policy_attachment.py create mode 100644 src/whop_sdk/types/dispute_legacy_company.py create mode 100644 src/whop_sdk/types/dispute_legacy_customer_communication_attachment.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment_member.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment_membership.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment_payment_instrument.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square.py rename src/whop_sdk/types/{company_logo.py => dispute_legacy_payment_payment_instrument_icons_square_dark.py} (66%) create mode 100644 src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_light.py create mode 100644 src/whop_sdk/types/dispute_legacy_payment_user.py create mode 100644 src/whop_sdk/types/dispute_legacy_plan.py rename src/whop_sdk/types/{company_featured_affiliate_product.py => dispute_legacy_product.py} (66%) create mode 100644 src/whop_sdk/types/dispute_legacy_refund_policy_attachment.py create mode 100644 src/whop_sdk/types/dispute_legacy_uncategorized_attachment.py delete mode 100644 src/whop_sdk/types/granularities.py create mode 100644 src/whop_sdk/types/member_legacy.py create mode 100644 src/whop_sdk/types/member_legacy_company.py create mode 100644 src/whop_sdk/types/member_legacy_user.py create mode 100644 src/whop_sdk/types/membership_legacy.py create mode 100644 src/whop_sdk/types/membership_legacy_company.py rename src/whop_sdk/types/{company_social_links_item.py => membership_legacy_custom_field_responses_item.py} (60%) create mode 100644 src/whop_sdk/types/membership_legacy_member.py create mode 100644 src/whop_sdk/types/membership_legacy_plan.py create mode 100644 src/whop_sdk/types/membership_legacy_product.py create mode 100644 src/whop_sdk/types/membership_legacy_promo_code.py create mode 100644 src/whop_sdk/types/membership_legacy_user.py create mode 100644 src/whop_sdk/types/payment_address.py create mode 100644 src/whop_sdk/types/payment_fee.py create mode 100644 src/whop_sdk/types/payment_fee_origin.py create mode 100644 src/whop_sdk/types/payment_fee_type.py create mode 100644 src/whop_sdk/types/payment_legacy.py rename src/whop_sdk/types/{payment_application_fee.py => payment_legacy_application_fee.py} (95%) rename src/whop_sdk/types/{payment_billing_address.py => payment_legacy_billing_address.py} (95%) rename src/whop_sdk/types/{payment_company.py => payment_legacy_company.py} (94%) rename src/whop_sdk/types/{payment_disputes_item.py => payment_legacy_disputes_item.py} (97%) rename src/whop_sdk/types/{payment_fees_item.py => payment_legacy_fees_item.py} (95%) rename src/whop_sdk/types/{payment_financing_transactions_item.py => payment_legacy_financing_transactions_item.py} (94%) rename src/whop_sdk/types/{payment_member.py => payment_legacy_member.py} (94%) rename src/whop_sdk/types/{payment_membership.py => payment_legacy_membership.py} (94%) rename src/whop_sdk/types/{payment_payment_instrument.py => payment_legacy_payment_instrument.py} (78%) rename src/whop_sdk/types/{payment_payment_instrument_card.py => payment_legacy_payment_instrument_card.py} (93%) rename src/whop_sdk/types/{payment_payment_instrument_icons.py => payment_legacy_payment_instrument_icons.py} (62%) rename src/whop_sdk/types/{payment_payment_instrument_icons_card.py => payment_legacy_payment_instrument_icons_card.py} (59%) rename src/whop_sdk/types/{payment_payment_instrument_icons_square_dark.py => payment_legacy_payment_instrument_icons_card_dark.py} (95%) rename src/whop_sdk/types/{payment_payment_instrument_icons_card_light.py => payment_legacy_payment_instrument_icons_card_light.py} (95%) rename src/whop_sdk/types/{payment_payment_instrument_icons_square.py => payment_legacy_payment_instrument_icons_square.py} (58%) rename src/whop_sdk/types/{payment_payment_instrument_icons_card_dark.py => payment_legacy_payment_instrument_icons_square_dark.py} (95%) rename src/whop_sdk/types/{payment_payment_instrument_icons_square_light.py => payment_legacy_payment_instrument_icons_square_light.py} (95%) rename src/whop_sdk/types/{payment_payment_method.py => payment_legacy_payment_method.py} (83%) rename src/whop_sdk/types/{payment_payment_method_card.py => payment_legacy_payment_method_card.py} (96%) rename src/whop_sdk/types/{payment_plan.py => payment_legacy_plan.py} (96%) rename src/whop_sdk/types/{payment_product.py => payment_legacy_product.py} (96%) rename src/whop_sdk/types/{payment_promo_code.py => payment_legacy_promo_code.py} (96%) rename src/whop_sdk/types/{payment_refunds_item.py => payment_legacy_refunds_item.py} (96%) rename src/whop_sdk/types/{payment_resolutions_item.py => payment_legacy_resolutions_item.py} (97%) rename src/whop_sdk/types/{payment_shipment.py => payment_legacy_shipment.py} (96%) rename src/whop_sdk/types/{payment_shipping_address.py => payment_legacy_shipping_address.py} (96%) rename src/whop_sdk/types/{payment_user.py => payment_legacy_user.py} (95%) create mode 100644 src/whop_sdk/types/payment_legacy_verification_checks.py delete mode 100644 src/whop_sdk/types/permission_system_roles.py create mode 100644 src/whop_sdk/types/product_legacy.py create mode 100644 src/whop_sdk/types/product_legacy_company.py create mode 100644 src/whop_sdk/types/product_legacy_gallery_images_item.py rename src/whop_sdk/types/{company_owner_user.py => product_legacy_owner_user.py} (87%) create mode 100644 src/whop_sdk/types/product_legacy_product_tax_code.py create mode 100644 src/whop_sdk/types/refund_failure_reason.py create mode 100644 src/whop_sdk/types/refund_legacy.py rename src/whop_sdk/types/{refund_payment.py => refund_legacy_payment.py} (83%) rename src/whop_sdk/types/{refund_payment_member.py => refund_legacy_payment_member.py} (93%) rename src/whop_sdk/types/{refund_payment_membership.py => refund_legacy_payment_membership.py} (93%) rename src/whop_sdk/types/{refund_payment_plan.py => refund_legacy_payment_plan.py} (95%) rename src/whop_sdk/types/{refund_payment_product.py => refund_legacy_payment_product.py} (94%) rename src/whop_sdk/types/{refund_payment_user.py => refund_legacy_payment_user.py} (95%) create mode 100644 src/whop_sdk/types/refund_reason.py create mode 100644 src/whop_sdk/types/refund_reference_status.py create mode 100644 src/whop_sdk/types/refund_reference_type.py create mode 100644 src/whop_sdk/types/refund_status.py create mode 100644 src/whop_sdk/types/resolution_center_case_legacy.py create mode 100644 src/whop_sdk/types/resolution_center_case_legacy_company.py create mode 100644 src/whop_sdk/types/resolution_center_case_legacy_member.py create mode 100644 src/whop_sdk/types/resolution_center_case_legacy_payment.py create mode 100644 src/whop_sdk/types/resolution_center_case_legacy_resolution_events_item.py rename src/whop_sdk/types/{company_list_item_owner_user.py => resolution_center_case_legacy_user.py} (86%) delete mode 100644 src/whop_sdk/types/result_label_keys.py create mode 100644 src/whop_sdk/types/shipment_legacy.py create mode 100644 src/whop_sdk/types/shipment_legacy_payment.py delete mode 100644 src/whop_sdk/types/social_link_websites.py diff --git a/.fern/metadata.json b/.fern/metadata.json index 86a25147..a434290e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,7 +15,7 @@ "standardwebhooks": ">=1.0.1,<2" } }, - "originGitCommit": "5b8d46fb7a1e5cd06c30ccb87d0003a44c78f6cb", + "originGitCommit": "6a6a664ec28945b2c9387df1c859db62f3eb9bea", "originGitCommitIsDirty": false, "invokedBy": "ci", "requestedVersion": "1.0.14", diff --git a/poetry.lock b/poetry.lock index fb45b2c7..b55c24cf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -188,20 +188,20 @@ files = [ [[package]] name = "anyio" -version = "4.14.2" +version = "4.15.0" description = "High-level concurrency and networking framework on top of asyncio or Trio" optional = false python-versions = ">=3.10" groups = ["main"] files = [ - {file = "anyio-4.14.2-py3-none-any.whl", hash = "sha256:9f505dda5ac9f0c8309b5e8bd445a8c2bf7246f3ce950121e45ea15bc41d1494"}, - {file = "anyio-4.14.2.tar.gz", hash = "sha256:cfa139f3ed1a23ee8f88a145ddb5ac7605b8bbfd8592baacd7ce3d8bb4313c7f"}, + {file = "anyio-4.15.0-py3-none-any.whl", hash = "sha256:7ecd9937369ffce8bba0b5ccb9b3a9507b101b0ed50256aecfbab27e6c2acb99"}, + {file = "anyio-4.15.0.tar.gz", hash = "sha256:b5c620ed540725e2579c31b17bb995b3bf02c9281c9cace04c7d186380bab85e"}, ] [package.dependencies] exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} idna = ">=2.8" -typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} +typing_extensions = {version = ">=4.16.0", markers = "python_version < \"3.15\""} [package.extras] trio = ["trio (>=0.32.0)"] diff --git a/reference.md b/reference.md index dd9afd55..e475ec0d 100644 --- a/reference.md +++ b/reference.md @@ -1041,7 +1041,7 @@ client.accounts.form_company( entity_suffix="LLC", entity_type="llc", expedite_ein=True, - formation_state="TX", + formation_state="WY", founders=[ FormCompanyAccountsRequestFoundersItem( address=FormCompanyAccountsRequestFoundersItemAddress( @@ -1112,7 +1112,7 @@ client.accounts.form_company(
-**formation_state:** `FormCompanyAccountsRequestFormationState` — Two-letter code of the US state (or `DC`) to form the company in. +**formation_state:** `FormCompanyAccountsRequestFormationState` — Two-letter code of the US state (or `DC`) to form the company in. We recommend `WY` because Wyoming formations are completed the same day.
@@ -2714,7 +2714,7 @@ client.ad_groups.create(
-**dynamic_creative:** `typing.Optional[bool]` — Let the ad platform automatically mix and match this ad group's creatives and copy to find the best-performing combinations. Set at creation; can't be changed afterward. +**dynamic_creative:** `typing.Optional[bool]` — Whether the ad platform automatically mixes and matches this ad group's creatives and copy to find the best-performing combinations. Meta has deprecated it and rejects `true`; ad groups already using it keep it, and it can't be changed afterward.
@@ -3760,150 +3760,6 @@ client.ad_groups.unpause( - - - - -## AdReports -
client.ad_reports.retrieve(...) -> AdReport -
-
- -#### 📝 Description - -
-
- -
-
- -Performance report for a company, ad campaigns, ad groups, or ads. Always returns aggregate `summary` totals summed across the scope. Set `granularity` to additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. - -Required permissions: - - `ad_campaign:stats:read` -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment -import datetime - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ad_reports.retrieve( - company_id="biz_xxxxxxxxxxxxxx", - from_=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - to=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**from:** `datetime.datetime` — Inclusive start of the reporting window. - -
-
- -
-
- -**to:** `datetime.datetime` — Inclusive end of the reporting window. - -
-
- -
-
- -**ad_campaign_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Scope the report to these ad campaigns (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. - -
-
- -
-
- -**ad_group_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Scope the report to these ad groups (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. - -
-
- -
-
- -**ad_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Scope the report to these ads (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. - -
-
- -
-
- -**breakdown:** `typing.Optional[AdReportBreakdownLevels]` - -
-
- -
-
- -**company_id:** `typing.Optional[str]` — The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every campaign, ad group, or ad in the company without paging. - -
-
- -
-
- -**currency:** `typing.Optional[str]` — ISO 4217 currency code to report `spend` in. Defaults to the company's ads reporting currency. - -
-
- -
-
- -**granularity:** `typing.Optional[Granularities]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- -
@@ -4166,828 +4022,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.ads.create() - -``` - - - - - -#### ⚙️ Parameters - -
-
- -
-
- -**ad_group:** `typing.Optional[typing.Dict[str, typing.Any]]` — An inline ad group to create (same shape as POST /ad_groups, including ad_campaign_id). Creates the ad group and the ad together. Provide this OR ad_group_id. - -
-
- -
-
- -**ad_group_id:** `typing.Optional[str]` — The existing ad group to create the ad in. Provide this OR ad_group, not both. - -
-
- -
-
- -**call_to_action:** `typing.Optional[CreateAdsRequestCallToAction]` — The call-to-action button shown on the ad. - -
-
- -
-
- -**creatives:** `typing.Optional[typing.List[CreateAdsRequestCreativesItem]]` — The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Two or more entries with no format become a carousel (2-10 attachments), in order, sharing the ad's copy. - -
-
- -
-
- -**descriptions:** `typing.Optional[typing.List[str]]` — The description variants shown on the ad. - -
-
- -
-
- -**existing_post_id:** `typing.Optional[str]` — Promote a post you already published instead of uploading creatives — a Facebook post or Instagram media id. Mutually exclusive with creatives. Pair with post_source. - -
-
- -
-
- -**headlines:** `typing.Optional[typing.List[str]]` — The headline variants shown on the ad. - -
-
- -
-
- -**lead_form:** `typing.Optional[CreateAdsRequestLeadForm]` — Instant lead form for the ad. Only allowed when the ad group's conversion_location is an instant-form destination (instant_forms, instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with lead_form_id. - -
-
- -
-
- -**lead_form_id:** `typing.Optional[str]` — Use an existing instant form instead of creating one — the form's platform ID, from a form already on the ad's Facebook page. Only allowed when the ad group's conversion_location is an instant-form destination. Mutually exclusive with lead_form. - -
-
- -
-
- -**messaging_config:** `typing.Optional[CreateAdsRequestMessagingConfig]` — Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt (keyword). - -
-
- -
-
- -**multi_advertiser_ads:** `typing.Optional[bool]` — Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. - -
-
- -
-
- -**post_source:** `typing.Optional[CreateAdsRequestPostSource]` — Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. - -
-
- -
-
- -**primary_texts:** `typing.Optional[typing.List[str]]` — The primary text variants shown in the ad body. - -
-
- -
-
- -**social_accounts:** `typing.Optional[typing.List[CreateAdsRequestSocialAccountsItem]]` — The social accounts the ad runs under — a connected Facebook page and, optionally, an Instagram profile. - -
-
- -
-
- -**title:** `typing.Optional[str]` — The display name of the ad. - -
-
- -
-
- -**url:** `typing.Optional[str]` — The URL the ad links to. Query parameters are merged into url_parameters, so the stored URL is always bare. - -
-
- -
-
- -**url_parameters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Query parameters to append to the destination URL, keyed by parameter name. Merged with any query string on `url`. Whop adds its own click-attribution parameters; those are reserved and rejected if you set them. Which keys are reserved depends on the ad's network — Meta: utm_meta_ad_id, utm_meta_adset_id, utm_meta_campaign_id, utm_source, utm_placement, utm_medium, utm_content, utm_adset, utm_whop, wacid, wasid, waid, tw_source, tw_adid; TikTok: waid, wasid, wacid, ad_id, adset_id, campaign_id, utm_source, utm_medium, utm_placement, utm_whop, tw_source, tw_adid. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - - - - - -
client.ads.retrieve(...) -> Ad -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves a single ad with stats over the requested window. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ads.retrieve( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — The ad ID. - -
-
- -
-
- -**stats_from:** `typing.Optional[str]` — Start of the stats window. - -
-
- -
-
- -**stats_to:** `typing.Optional[str]` — End of the stats window. - -
-
- -
-
- -**time_zone:** `typing.Optional[str]` — IANA timezone the stats window is interpreted in. Defaults to UTC. - -
-
- -
-
- -**attribution_model:** `typing.Optional[RetrieveAdsRequestAttributionModel]` — Attribution model the conversion stats count under (defaults to last_touch). Under both models a journey with any whop ad touch attributes to whop; the model picks which whop touch credits the entity and which non-whop source wins otherwise. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.ads.delete(...) -> DeleteAdsResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Deletes an ad. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ads.delete( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — The ad ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.ads.update(...) -> Ad -
-
- -#### 📝 Description - -
-
- -
-
- -Updates an ad's editable fields. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ads.update( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — The ad ID. - -
-
- -
-
- -**call_to_action:** `typing.Optional[UpdateAdsRequestCallToAction]` — The call-to-action button shown on the ad. - -
-
- -
-
- -**creatives:** `typing.Optional[typing.List[UpdateAdsRequestCreativesItem]]` — The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Two or more entries with no format replace it with a carousel (2-10 attachments), in order, sharing the ad's copy. - -
-
- -
-
- -**descriptions:** `typing.Optional[typing.List[str]]` — The description variants shown on the ad. - -
-
- -
-
- -**existing_post_id:** `typing.Optional[str]` — Promote a post you already published instead of uploading creatives — a Facebook post or Instagram media id. Mutually exclusive with creatives. Pair with post_source. - -
-
- -
-
- -**headlines:** `typing.Optional[typing.List[str]]` — The headline variants shown on the ad. - -
-
- -
-
- -**lead_form:** `typing.Optional[UpdateAdsRequestLeadForm]` — Instant lead form for the ad. Only allowed when the ad group's conversion_location is an instant-form destination (instant_forms, instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with lead_form_id. - -
-
- -
-
- -**lead_form_id:** `typing.Optional[str]` — Use an existing instant form instead of creating one — the form's platform ID, from a form already on the ad's Facebook page. Only allowed when the ad group's conversion_location is an instant-form destination. Mutually exclusive with lead_form. Replaces a stored lead_form. - -
-
- -
-
- -**messaging_config:** `typing.Optional[UpdateAdsRequestMessagingConfig]` — Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt (keyword). - -
-
- -
-
- -**multi_advertiser_ads:** `typing.Optional[bool]` — Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. - -
-
- -
-
- -**post_source:** `typing.Optional[UpdateAdsRequestPostSource]` — Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. - -
-
- -
-
- -**primary_texts:** `typing.Optional[typing.List[str]]` — The primary text variants shown in the ad body. - -
-
- -
-
- -**social_accounts:** `typing.Optional[typing.List[UpdateAdsRequestSocialAccountsItem]]` — The social accounts the ad runs under — a connected Facebook page and, optionally, an Instagram profile. - -
-
- -
-
- -**title:** `typing.Optional[str]` — The display name of the ad. - -
-
- -
-
- -**url:** `typing.Optional[str]` — The URL the ad links to. Query parameters are merged into url_parameters, so the stored URL is always bare. - -
-
- -
-
- -**url_parameters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Query parameters to append to the destination URL, keyed by parameter name. Merged with any query string on `url`. Whop adds its own click-attribution parameters; those are reserved and rejected if you set them. Which keys are reserved depends on the ad's network — Meta: utm_meta_ad_id, utm_meta_adset_id, utm_meta_campaign_id, utm_source, utm_placement, utm_medium, utm_content, utm_adset, utm_whop, wacid, wasid, waid, tw_source, tw_adid; TikTok: waid, wasid, wacid, ad_id, adset_id, campaign_id, utm_source, utm_medium, utm_placement, utm_whop, tw_source, tw_adid. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.ads.duplicate(...) -> DuplicateAdsResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Copies the ad into its own ad group, or into target_ad_group_id (which must belong to the same account and be compatible with the ad). Copies keep the source ad's active/paused state. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ads.duplicate( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — The ad ID. - -
-
- -
-
- -**count:** `typing.Optional[int]` — Number of copies to create (1-10). Defaults to 1. - -
-
- -
-
- -**preserve_engagement:** `typing.Optional[bool]` — Whether the copies keep the original post's engagement (likes, comments, shares). Defaults to false. - -
-
- -
-
- -**target_ad_group_id:** `typing.Optional[str]` — Ad group to duplicate into. Defaults to the ad's own ad group. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.ads.pause(...) -> Ad -
-
- -#### 📝 Description - -
-
- -
-
- -Pauses an active ad. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ads.pause( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — The ad ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.ads.unpause(...) -> Ad -
-
- -#### 📝 Description - -
-
- -
-
- -Resumes a paused ad. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.ads.unpause( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` — The ad ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Affiliates -
client.affiliates.list(...) -> ListAffiliatesResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a paginated list of affiliates for the actor in context, with optional filtering by status, search, and sorting. - -Required permissions: - - `affiliate:basic:read` -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.affiliates.list( - first=42, - last=42, - company_id="biz_xxxxxxxxxxxxxx", -) +client.ads.create() ```
@@ -5003,7 +4038,7 @@ client.affiliates.list(
-**company_id:** `str` — The unique identifier of the company to list affiliates for. +**ad_group:** `typing.Optional[typing.Dict[str, typing.Any]]` — An inline ad group to create (same shape as POST /ad_groups, including ad_campaign_id). Creates the ad group and the ad together. Provide this OR ad_group_id.
@@ -5011,7 +4046,7 @@ client.affiliates.list(
-**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. +**ad_group_id:** `typing.Optional[str]` — The existing ad group to create the ad in. Provide this OR ad_group, not both.
@@ -5019,7 +4054,7 @@ client.affiliates.list(
-**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. +**call_to_action:** `typing.Optional[CreateAdsRequestCallToAction]` — The call-to-action button shown on the ad.
@@ -5027,7 +4062,7 @@ client.affiliates.list(
-**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. +**creatives:** `typing.Optional[typing.List[CreateAdsRequestCreativesItem]]` — The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Entries with no format become a carousel's ordered cards, sharing the ad's copy — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel.
@@ -5035,7 +4070,7 @@ client.affiliates.list(
-**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +**descriptions:** `typing.Optional[typing.List[str]]` — The description variants shown on the ad.
@@ -5043,7 +4078,7 @@ client.affiliates.list(
-**direction:** `typing.Optional[Direction]` +**existing_post_id:** `typing.Optional[str]` — Promote a post you already published instead of uploading creatives — a Facebook post or Instagram media id. Mutually exclusive with creatives. Pair with post_source.
@@ -5051,7 +4086,7 @@ client.affiliates.list(
-**order:** `typing.Optional[AffiliatesSortableColumns]` +**headlines:** `typing.Optional[typing.List[str]]` — The headline variants shown on the ad.
@@ -5059,7 +4094,7 @@ client.affiliates.list(
-**query:** `typing.Optional[str]` — Search affiliates by username. +**lead_form:** `typing.Optional[CreateAdsRequestLeadForm]` — Instant lead form for the ad. Only allowed when the ad group's conversion_location is an instant-form destination (instant_forms, instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with lead_form_id.
@@ -5067,7 +4102,7 @@ client.affiliates.list(
-**status:** `typing.Optional[Status]` +**lead_form_id:** `typing.Optional[str]` — Use an existing instant form instead of creating one — the form's platform ID, from a form already on the ad's Facebook page. Only allowed when the ad group's conversion_location is an instant-form destination. Mutually exclusive with lead_form.
@@ -5075,76 +4110,63 @@ client.affiliates.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**messaging_config:** `typing.Optional[CreateAdsRequestMessagingConfig]` — Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt (keyword).
-
-
+
+
+**multi_advertiser_ads:** `typing.Optional[bool]` — Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. +
-
-
client.affiliates.create(...) -> Affiliate
-#### 📝 Description - -
-
+**music:** `typing.Optional[CreateAdsRequestMusic]` — The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. + +
+
-Creates or finds an affiliate for a company and user. - -Required permissions: - - `affiliate:create` -
-
+**post_source:** `typing.Optional[CreateAdsRequestPostSource]` — Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. +
-#### 🔌 Usage -
+**primary_texts:** `typing.Optional[typing.List[str]]` — The primary text variants shown in the ad body. + +
+
+
-```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.affiliates.create( - company_id="biz_xxxxxxxxxxxxxx", - user_identifier="user_identifier", -) - -``` -
-
+**social_accounts:** `typing.Optional[typing.List[CreateAdsRequestSocialAccountsItem]]` — The social accounts the ad runs under — a connected Facebook page and, optionally, an Instagram profile. + -#### ⚙️ Parameters -
+**title:** `typing.Optional[str]` — The display name of the ad. + +
+
+
-**company_id:** `str` — The ID of the company to create the affiliate for. +**url:** `typing.Optional[str]` — The URL the ad links to. Query parameters are merged into url_parameters, so the stored URL is always bare.
@@ -5152,7 +4174,7 @@ client.affiliates.create(
-**user_identifier:** `str` — The user identifier (username, email, user ID, or Discord ID). +**url_parameters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Query parameters to append to the destination URL, keyed by parameter name. Merged with any query string on `url`. Whop adds its own click-attribution parameters; those are reserved and rejected if you set them. Which keys are reserved depends on the ad's network — Meta: utm_meta_ad_id, utm_meta_adset_id, utm_meta_campaign_id, utm_source, utm_placement, utm_medium, utm_content, utm_adset, utm_whop, wacid, wasid, waid, tw_source, tw_adid; TikTok: waid, wasid, wacid, ad_id, adset_id, campaign_id, utm_source, utm_medium, utm_placement, utm_whop, tw_source, tw_adid.
@@ -5172,7 +4194,7 @@ client.affiliates.create(
-
client.affiliates.retrieve(...) -> Affiliate +
client.ads.retrieve(...) -> Ad
@@ -5184,10 +4206,7 @@ client.affiliates.create(
-Retrieves the details of an existing affiliate. - -Required permissions: - - `affiliate:basic:read` +Retrieves a single ad with stats over the requested window.
@@ -5210,8 +4229,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.affiliates.retrieve( - id="aff_xxxxxxxxxxxxxx", +client.ads.retrieve( + id="id", ) ``` @@ -5228,7 +4247,39 @@ client.affiliates.retrieve(
-**id:** `str` — The unique identifier of the affiliate. +**id:** `str` — The ad ID. + +
+
+ +
+
+ +**stats_from:** `typing.Optional[str]` — Start of the stats window. + +
+
+ +
+
+ +**stats_to:** `typing.Optional[str]` — End of the stats window. + +
+
+ +
+
+ +**time_zone:** `typing.Optional[str]` — IANA timezone the stats window is interpreted in. Defaults to UTC. + +
+
+ +
+
+ +**attribution_model:** `typing.Optional[RetrieveAdsRequestAttributionModel]` — Attribution model the conversion stats count under (defaults to last_touch). Under both models a journey with any whop ad touch attributes to whop; the model picks which whop touch credits the entity and which non-whop source wins otherwise.
@@ -5248,7 +4299,7 @@ client.affiliates.retrieve(
-
client.affiliates.archive(...) -> bool +
client.ads.delete(...) -> DeleteAdsResponse
@@ -5260,10 +4311,7 @@ client.affiliates.retrieve(
-Archives an existing Affiliate - -Required permissions: - - `affiliate:update` +Deletes an ad.
@@ -5286,8 +4334,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.affiliates.archive( - id="aff_xxxxxxxxxxxxxx", +client.ads.delete( + id="id", ) ``` @@ -5304,7 +4352,7 @@ client.affiliates.archive(
-**id:** `str` — The internal ID of the affiliate to archive. +**id:** `str` — The ad ID.
@@ -5324,7 +4372,7 @@ client.affiliates.archive(
-
client.affiliates.unarchive(...) -> bool +
client.ads.update(...) -> Ad
@@ -5336,10 +4384,7 @@ client.affiliates.archive(
-Unarchives an existing Affiliate - -Required permissions: - - `affiliate:update` +Updates an ad's editable fields.
@@ -5362,8 +4407,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.affiliates.unarchive( - id="aff_xxxxxxxxxxxxxx", +client.ads.update( + id="id", ) ``` @@ -5380,7 +4425,7 @@ client.affiliates.unarchive(
-**id:** `str` — The internal ID of the affiliate to archive. +**id:** `str` — The ad ID.
@@ -5388,74 +4433,95 @@ client.affiliates.unarchive(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**call_to_action:** `typing.Optional[UpdateAdsRequestCallToAction]` — The call-to-action button shown on the ad.
- -
+
+
+**creatives:** `typing.Optional[typing.List[UpdateAdsRequestCreativesItem]]` — The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Entries with no format replace it with a carousel's ordered cards — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. +
-
-## AiChats -
client.ai_chats.list(...) -> ListAiChatsResponse
-#### 📝 Description +**descriptions:** `typing.Optional[typing.List[str]]` — The description variants shown on the ad. + +
+
+**existing_post_id:** `typing.Optional[str]` — Promote a post you already published instead of uploading creatives — a Facebook post or Instagram media id. Mutually exclusive with creatives. Pair with post_source. + +
+
+
-Returns a paginated list of AI chat threads for the current authenticated user. +**headlines:** `typing.Optional[typing.List[str]]` — The headline variants shown on the ad. +
+ +
+
+ +**lead_form:** `typing.Optional[UpdateAdsRequestLeadForm]` — Instant lead form for the ad. Only allowed when the ad group's conversion_location is an instant-form destination (instant_forms, instant_forms_and_messenger, website_and_instant_forms). Mutually exclusive with lead_form_id. +
-#### 🔌 Usage -
+**lead_form_id:** `typing.Optional[str]` — Use an existing instant form instead of creating one — the form's platform ID, from a form already on the ad's Facebook page. Only allowed when the ad group's conversion_location is an instant-form destination. Mutually exclusive with lead_form. Replaces a stored lead_form. + +
+
+
-```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) +**messaging_config:** `typing.Optional[UpdateAdsRequestMessagingConfig]` — Click-to-message welcome copy: the greeting (message) and the ice-breaker prompt (keyword). + +
+
-client.ai_chats.list( - first=42, - last=42, -) +
+
-``` +**multi_advertiser_ads:** `typing.Optional[bool]` — Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. +
+ +
+
+ +**music:** `typing.Optional[UpdateAdsRequestMusic]` — The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Omitted leaves the ad's music untouched. Null removes it before launch; a submitted carousel takes a replacement track instead. TikTok-only. +
-#### ⚙️ Parameters -
+**post_source:** `typing.Optional[UpdateAdsRequestPostSource]` — Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. + +
+
+
-**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. +**primary_texts:** `typing.Optional[typing.List[str]]` — The primary text variants shown in the ad body.
@@ -5463,7 +4529,7 @@ client.ai_chats.list(
-**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. +**social_accounts:** `typing.Optional[typing.List[UpdateAdsRequestSocialAccountsItem]]` — The social accounts the ad runs under — a connected Facebook page and, optionally, an Instagram profile.
@@ -5471,7 +4537,7 @@ client.ai_chats.list(
-**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. +**title:** `typing.Optional[str]` — The display name of the ad.
@@ -5479,7 +4545,7 @@ client.ai_chats.list(
-**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +**url:** `typing.Optional[str]` — The URL the ad links to. Query parameters are merged into url_parameters, so the stored URL is always bare.
@@ -5487,7 +4553,7 @@ client.ai_chats.list(
-**only_active_crons:** `typing.Optional[bool]` — When true, returns only chats with an active cron schedule +**url_parameters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Query parameters to append to the destination URL, keyed by parameter name. Merged with any query string on `url`. Whop adds its own click-attribution parameters; those are reserved and rejected if you set them. Which keys are reserved depends on the ad's network — Meta: utm_meta_ad_id, utm_meta_adset_id, utm_meta_campaign_id, utm_source, utm_placement, utm_medium, utm_content, utm_adset, utm_whop, wacid, wasid, waid, tw_source, tw_adid; TikTok: waid, wasid, wacid, ad_id, adset_id, campaign_id, utm_source, utm_medium, utm_placement, utm_whop, tw_source, tw_adid.
@@ -5507,7 +4573,7 @@ client.ai_chats.list(
-
client.ai_chats.create(...) -> AiChat +
client.ads.duplicate(...) -> DuplicateAdsResponse
@@ -5519,10 +4585,7 @@ client.ai_chats.list(
-Create a new AI chat thread and send the first message to the AI agent. - -Required permissions: - - `ai_chat:create` +Copies the ad into its own ad group, or into target_ad_group_id (which must belong to the same account and be compatible with the ad). Copies keep the source ad's active/paused state.
@@ -5545,8 +4608,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.ai_chats.create( - message_text="message_text", +client.ads.duplicate( + id="id", ) ``` @@ -5563,23 +4626,7 @@ client.ai_chats.create(
-**message_text:** `str` — The text content of the first message to send to the AI agent. - -
-
- -
-
- -**current_company_id:** `typing.Optional[str]` — The unique identifier of the company to set as context for the AI chat (e.g., "biz_XXXXX"). - -
-
- -
-
- -**message_attachments:** `typing.Optional[typing.List[CreateAiChatsRequestMessageAttachmentsItem]]` — A list of previously uploaded file attachments to include with the first message. +**id:** `str` — The ad ID.
@@ -5587,7 +4634,7 @@ client.ai_chats.create(
-**message_source:** `typing.Optional[AiChatMessageSourceTypes]` — The source of the message. +**count:** `typing.Optional[int]` — Number of copies to create (1-10). Defaults to 1.
@@ -5595,7 +4642,7 @@ client.ai_chats.create(
-**suggestion_type:** `typing.Optional[str]` — The type of suggestion prompt that was clicked, when message_source is 'suggestion'. +**preserve_engagement:** `typing.Optional[bool]` — Whether the copies keep the original post's engagement (likes, comments, shares). Defaults to false.
@@ -5603,7 +4650,7 @@ client.ai_chats.create(
-**title:** `typing.Optional[str]` — An optional display title for the AI chat thread (e.g., "Help with billing"). +**target_ad_group_id:** `typing.Optional[str]` — Ad group to duplicate into. Defaults to the ad's own ad group.
@@ -5623,7 +4670,7 @@ client.ai_chats.create(
-
client.ai_chats.retrieve(...) -> AiChat +
client.ads.pause(...) -> Ad
@@ -5635,7 +4682,7 @@ client.ai_chats.create(
-Retrieves the details of an existing AI chat. +Pauses an active ad.
@@ -5658,8 +4705,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.ai_chats.retrieve( - id="aich_xxxxxxxxxxxxx", +client.ads.pause( + id="id", ) ``` @@ -5676,7 +4723,7 @@ client.ai_chats.retrieve(
-**id:** `str` — The unique identifier of the AI chat to retrieve. +**id:** `str` — The ad ID.
@@ -5696,7 +4743,7 @@ client.ai_chats.retrieve(
-
client.ai_chats.delete(...) -> bool +
client.ads.unpause(...) -> Ad
@@ -5708,10 +4755,7 @@ client.ai_chats.retrieve(
-Delete an AI chat thread so it no longer appears in the user's chat list. - -Required permissions: - - `ai_chat:delete` +Resumes a paused ad.
@@ -5734,8 +4778,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.ai_chats.delete( - id="aich_xxxxxxxxxxxxx", +client.ads.unpause( + id="id", ) ``` @@ -5752,7 +4796,7 @@ client.ai_chats.delete(
-**id:** `str` — The unique identifier of the AI chat to delete (e.g., "ai_chat_XXXXX"). +**id:** `str` — The ad ID.
@@ -5772,7 +4816,8 @@ client.ai_chats.delete(
-
client.ai_chats.update(...) -> AiChat +## Affiliates +
client.affiliates.list(...) -> ListAffiliatesResponse
@@ -5784,10 +4829,10 @@ client.ai_chats.delete(
-Update an AI chat's title, notification preferences, or associated company context. +Returns a paginated list of affiliates for the actor in context, with optional filtering by status, search, and sorting. Required permissions: - - `ai_chat:update` + - `affiliate:basic:read`
@@ -5810,8 +4855,10 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.ai_chats.update( - id="aich_xxxxxxxxxxxxx", +client.affiliates.list( + first=42, + last=42, + company_id="biz_xxxxxxxxxxxxxx", ) ``` @@ -5828,7 +4875,7 @@ client.ai_chats.update(
-**id:** `str` — The unique identifier of the AI chat to update (e.g., "ai_chat_XXXXX"). +**company_id:** `str` — The unique identifier of the company to list affiliates for.
@@ -5836,7 +4883,7 @@ client.ai_chats.update(
-**current_company_id:** `typing.Optional[str]` — The unique identifier of the company to set as context for the AI chat (e.g., "biz_XXXXX"). +**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor.
@@ -5844,7 +4891,7 @@ client.ai_chats.update(
-**notification_preference:** `typing.Optional[AiChatNotificationPreferences]` — The notification preference for the AI chat. +**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor.
@@ -5852,7 +4899,47 @@ client.ai_chats.update(
-**title:** `typing.Optional[str]` — The new display title for the AI chat thread (e.g., "Help with billing"). +**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. + +
+
+ +
+
+ +**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. + +
+
+ +
+
+ +**direction:** `typing.Optional[Direction]` + +
+
+ +
+
+ +**order:** `typing.Optional[AffiliatesSortableColumns]` + +
+
+ +
+
+ +**query:** `typing.Optional[str]` — Search affiliates by username. + +
+
+ +
+
+ +**status:** `typing.Optional[Status]`
@@ -5872,8 +4959,7 @@ client.ai_chats.update(
-## API Keys -
client.api_keys.list(...) -> ListApiKeysResponse +
client.affiliates.create(...) -> Affiliate
@@ -5885,7 +4971,10 @@ client.ai_chats.update(
-Lists the API keys of an account or app, newest first. Responses never include the full secret — only its obfuscated form. +Creates or finds an affiliate for a company and user. + +Required permissions: + - `affiliate:create`
@@ -5908,9 +4997,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_keys.list( - resource_id="resource_id", - resource_type="account", +client.affiliates.create( + company_id="biz_xxxxxxxxxxxxxx", + user_identifier="user_identifier", ) ``` @@ -5927,7 +5016,7 @@ client.api_keys.list(
-**resource_id:** `str` — The account (`biz_`) or app (`app_`) tag to list API keys for. +**company_id:** `str` — The ID of the company to create the affiliate for.
@@ -5935,7 +5024,7 @@ client.api_keys.list(
-**resource_type:** `ListApiKeysRequestResourceType` — The type of resource that owns the API keys. +**user_identifier:** `str` — The user identifier (username, email, user ID, or Discord ID).
@@ -5943,63 +5032,75 @@ client.api_keys.list(
-**created_before:** `typing.Optional[ListApiKeysRequestCreatedBefore]` — Only return API keys created before this ISO 8601 timestamp. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**created_after:** `typing.Optional[ListApiKeysRequestCreatedAfter]` — Only return API keys created after this ISO 8601 timestamp. -
+
+
client.affiliates.retrieve(...) -> Affiliate
-**first:** `typing.Optional[int]` — The number of API keys to return (default 20, max 100). - -
-
+#### 📝 Description
-**after:** `typing.Optional[str]` — A cursor; returns API keys after this position. - -
-
-
-**last:** `typing.Optional[int]` — The number of API keys to return from the end of the range. - +Retrieves the details of an existing affiliate. + +Required permissions: + - `affiliate:basic:read` +
+
+#### 🔌 Usage +
-**before:** `typing.Optional[str]` — A cursor; returns API keys before this position. - -
-
-
-**order:** `typing.Optional[ListApiKeysRequestOrder]` — The field to sort API keys by. - +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.affiliates.retrieve( + id="aff_xxxxxxxxxxxxxx", +) + +``` +
+
+#### ⚙️ Parameters +
-**direction:** `typing.Optional[ListApiKeysRequestDirection]` — Sort direction. +
+
+ +**id:** `str` — The unique identifier of the affiliate.
@@ -6019,7 +5120,7 @@ client.api_keys.list(
-
client.api_keys.create(...) -> ApiKey +
client.affiliates.archive(...) -> bool
@@ -6031,7 +5132,10 @@ client.api_keys.list(
-Creates an API key for an account or app. The response is the only place the full `secret_key` is returned — store it immediately. Requires a user session; API keys cannot manage API keys. +Archives an existing Affiliate + +Required permissions: + - `affiliate:update`
@@ -6048,18 +5152,14 @@ Creates an API key for an account or app. The response is the only place the ful ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -from whop_sdk.api_keys import CreateApiKeysRequestPermissions client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.api_keys.create( - name="Shine Time Booking (production)", - permissions=CreateApiKeysRequestPermissions(), - resource_id="biz_xxxxxxxxxxxxxx", - resource_type="account", +client.affiliates.archive( + id="aff_xxxxxxxxxxxxxx", ) ``` @@ -6076,55 +5176,7 @@ client.api_keys.create(
-**name:** `str` — A human-readable name for the API key, such as 'Production API Key'. - -
-
- -
-
- -**permissions:** `CreateApiKeysRequestPermissions` — The permissions policy for the API key: explicit permission statements, or a system role to inherit from. Statements without a `resources` array default to the owning account (Account API keys) or every key-addressable resource (App API keys). - -
-
- -
-
- -**resource_id:** `str` — The account (`biz_`) or app (`app_`) tag to create the API key for. - -
-
- -
-
- -**resource_type:** `CreateApiKeysRequestResourceType` — The type of resource that will own this API key. - -
-
- -
-
- -**api_version_date:** `typing.Optional[CreateApiKeysRequestApiVersionDate]` — Dated API version used when requests authenticated with this key omit the `Api-Version-Date` header. New keys default to the latest version. - -
-
- -
-
- -**expires_at:** `typing.Optional[str]` — When the API key should stop working, as an ISO 8601 timestamp. Omit (or pass `null` on update) for a key that never expires. - -
-
- -
-
- -**ip_allowlist:** `typing.Optional[typing.List[str]]` — IPv4/IPv6 CIDR ranges allowed to use this key, for example `["203.0.113.0/24"]`. Empty or `null` allows any IP. +**id:** `str` — The internal ID of the affiliate to archive.
@@ -6144,7 +5196,7 @@ client.api_keys.create(
-
client.api_keys.list_permissions() -> ListPermissionsApiKeysResponse +
client.affiliates.unarchive(...) -> bool
@@ -6156,7 +5208,10 @@ client.api_keys.create(
-Lists the catalog of permission actions that can be granted to users, apps, and API keys — the source for the dashboard's permission pickers. Small and returned in full on one page. +Unarchives an existing Affiliate + +Required permissions: + - `affiliate:update`
@@ -6179,7 +5234,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_keys.list_permissions() +client.affiliates.unarchive( + id="aff_xxxxxxxxxxxxxx", +) ``` @@ -6195,6 +5252,14 @@ client.api_keys.list_permissions()
+**id:** `str` — The internal ID of the affiliate to archive. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -6207,7 +5272,8 @@ client.api_keys.list_permissions()
-
client.api_keys.retrieve(...) -> ApiKey +## AiChats +
client.ai_chats.list(...) -> ListAiChatsResponse
@@ -6219,7 +5285,7 @@ client.api_keys.list_permissions()
-Retrieves an API key with its effective permission grants. The full secret is never returned — rotate the key if it was lost. +Returns a paginated list of AI chat threads for the current authenticated user.
@@ -6242,8 +5308,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_keys.retrieve( - id="id", +client.ai_chats.list( + first=42, + last=42, ) ``` @@ -6260,7 +5327,39 @@ client.api_keys.retrieve(
-**id:** `str` — API key ID, prefixed `apik_`. +**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. + +
+
+ +
+
+ +**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. + +
+
+ +
+
+ +**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. + +
+
+ +
+
+ +**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. + +
+
+ +
+
+ +**only_active_crons:** `typing.Optional[bool]` — When true, returns only chats with an active cron schedule
@@ -6280,7 +5379,7 @@ client.api_keys.retrieve(
-
client.api_keys.delete(...) -> DeleteApiKeysResponse +
client.ai_chats.create(...) -> AiChat
@@ -6292,7 +5391,10 @@ client.api_keys.retrieve(
-Permanently revokes an API key; requests using its secret stop authenticating immediately. Default and agent-backend keys cannot be deleted. +Create a new AI chat thread and send the first message to the AI agent. + +Required permissions: + - `ai_chat:create`
@@ -6315,8 +5417,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_keys.delete( - id="id", +client.ai_chats.create( + message_text="message_text", ) ``` @@ -6333,7 +5435,47 @@ client.api_keys.delete(
-**id:** `str` — API key ID, prefixed `apik_`. +**message_text:** `str` — The text content of the first message to send to the AI agent. + +
+
+ +
+
+ +**current_company_id:** `typing.Optional[str]` — The unique identifier of the company to set as context for the AI chat (e.g., "biz_XXXXX"). + +
+
+ +
+
+ +**message_attachments:** `typing.Optional[typing.List[CreateAiChatsRequestMessageAttachmentsItem]]` — A list of previously uploaded file attachments to include with the first message. + +
+
+ +
+
+ +**message_source:** `typing.Optional[AiChatMessageSourceTypes]` — The source of the message. + +
+
+ +
+
+ +**suggestion_type:** `typing.Optional[str]` — The type of suggestion prompt that was clicked, when message_source is 'suggestion'. + +
+
+ +
+
+ +**title:** `typing.Optional[str]` — An optional display title for the AI chat thread (e.g., "Help with billing").
@@ -6353,7 +5495,7 @@ client.api_keys.delete(
-
client.api_keys.update(...) -> ApiKey +
client.ai_chats.retrieve(...) -> AiChat
@@ -6365,7 +5507,7 @@ client.api_keys.delete(
-Updates an API key's name, permissions, API version, expiration, or IP allowlist. Fields that are omitted keep their current value; default keys cannot be modified. +Retrieves the details of an existing AI chat.
@@ -6388,8 +5530,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_keys.update( - id="id", +client.ai_chats.retrieve( + id="aich_xxxxxxxxxxxxx", ) ``` @@ -6406,7 +5548,7 @@ client.api_keys.update(
-**id:** `str` — API key ID, prefixed `apik_`. +**id:** `str` — The unique identifier of the AI chat to retrieve.
@@ -6414,39 +5556,75 @@ client.api_keys.update(
-**api_version_date:** `typing.Optional[UpdateApiKeysRequestApiVersionDate]` — Dated API version used when requests authenticated with this key omit the `Api-Version-Date` header. New keys default to the latest version. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**expires_at:** `typing.Optional[str]` — When the API key should stop working, as an ISO 8601 timestamp. Omit (or pass `null` on update) for a key that never expires. -
+
+
client.ai_chats.delete(...) -> bool
-**ip_allowlist:** `typing.Optional[typing.List[str]]` — IPv4/IPv6 CIDR ranges allowed to use this key, for example `["203.0.113.0/24"]`. Empty or `null` allows any IP. - +#### 📝 Description + +
+
+ +
+
+ +Delete an AI chat thread so it no longer appears in the user's chat list. + +Required permissions: + - `ai_chat:delete` +
+
+#### 🔌 Usage +
-**name:** `typing.Optional[str]` — A new human-readable name for the API key. - +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.ai_chats.delete( + id="aich_xxxxxxxxxxxxx", +) + +```
+
+
+ +#### ⚙️ Parameters
-**permissions:** `typing.Optional[UpdateApiKeysRequestPermissions]` — The permissions policy for the API key: explicit permission statements, or a system role to inherit from. Statements without a `resources` array default to the owning account (Account API keys) or every key-addressable resource (App API keys). +
+
+ +**id:** `str` — The unique identifier of the AI chat to delete (e.g., "ai_chat_XXXXX").
@@ -6466,7 +5644,7 @@ client.api_keys.update(
-
client.api_keys.rotate(...) -> ApiKey +
client.ai_chats.update(...) -> AiChat
@@ -6478,7 +5656,10 @@ client.api_keys.update(
-Rotates the API key's secret, invalidating the previous secret immediately. The response is the only place the new `secret_key` is returned. +Update an AI chat's title, notification preferences, or associated company context. + +Required permissions: + - `ai_chat:update`
@@ -6501,8 +5682,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_keys.rotate( - id="id", +client.ai_chats.update( + id="aich_xxxxxxxxxxxxx", ) ``` @@ -6519,7 +5700,31 @@ client.api_keys.rotate(
-**id:** `str` — API key ID, prefixed `apik_`. +**id:** `str` — The unique identifier of the AI chat to update (e.g., "ai_chat_XXXXX"). + +
+
+ +
+
+ +**current_company_id:** `typing.Optional[str]` — The unique identifier of the company to set as context for the AI chat (e.g., "biz_XXXXX"). + +
+
+ +
+
+ +**notification_preference:** `typing.Optional[AiChatNotificationPreferences]` — The notification preference for the AI chat. + +
+
+ +
+
+ +**title:** `typing.Optional[str]` — The new display title for the AI chat thread (e.g., "Help with billing").
@@ -6539,8 +5744,8 @@ client.api_keys.rotate(
-## Api Logs -
client.api_logs.list(...) -> ListApiLogsResponse +## API Keys +
client.api_keys.list(...) -> ListApiKeysResponse
@@ -6552,7 +5757,7 @@ client.api_keys.rotate(
-Lists the requests served by Whop's API with the account's API keys, newest first — every surface (GraphQL, REST, and native /api/v1), reads and failed requests included. +Lists the API keys of an account or app, newest first. Responses never include the full secret — only its obfuscated form.
@@ -6575,7 +5780,10 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.api_logs.list() +client.api_keys.list( + resource_id="resource_id", + resource_type="account", +) ``` @@ -6591,15 +5799,7 @@ client.api_logs.list()
-**account_id:** `typing.Optional[str]` — The account (biz_*) whose API logs to list. Defaults to the authenticated account. - -
-
- -
-
- -**created_after:** `typing.Optional[str]` — Only return requests served at or after this ISO 8601 timestamp. Defaults to 7 days before created_before, or 7 days ago. +**resource_id:** `str` — The account (`biz_`) or app (`app_`) tag to list API keys for.
@@ -6607,7 +5807,7 @@ client.api_logs.list()
-**created_before:** `typing.Optional[str]` — Only return requests served before this ISO 8601 timestamp. +**resource_type:** `ListApiKeysRequestResourceType` — The type of resource that owns the API keys.
@@ -6615,7 +5815,7 @@ client.api_logs.list()
-**operation_name:** `typing.Optional[str]` — Only return requests for this operation, matched exactly against the operation_name shown on each log row (for example api/v1/products#create). +**created_before:** `typing.Optional[ListApiKeysRequestCreatedBefore]` — Only return API keys created before this ISO 8601 timestamp.
@@ -6623,7 +5823,7 @@ client.api_logs.list()
-**http_method:** `typing.Optional[ListApiLogsRequestHttpMethod]` — Only return requests made with this HTTP method. +**created_after:** `typing.Optional[ListApiKeysRequestCreatedAfter]` — Only return API keys created after this ISO 8601 timestamp.
@@ -6631,7 +5831,7 @@ client.api_logs.list()
-**status:** `typing.Optional[ListApiLogsRequestStatus]` — Only return requests that finished with this status. +**first:** `typing.Optional[int]` — The number of API keys to return (default 20, max 100).
@@ -6639,7 +5839,7 @@ client.api_logs.list()
-**api_key_id:** `typing.Optional[str]` — Only return requests made with this API key (apik_…). +**after:** `typing.Optional[str]` — A cursor; returns API keys after this position.
@@ -6647,7 +5847,7 @@ client.api_logs.list()
-**min_duration_ms:** `typing.Optional[int]` — Only return requests that took at least this many milliseconds. +**last:** `typing.Optional[int]` — The number of API keys to return from the end of the range.
@@ -6655,7 +5855,7 @@ client.api_logs.list()
-**max_duration_ms:** `typing.Optional[int]` — Only return requests that took at most this many milliseconds. +**before:** `typing.Optional[str]` — A cursor; returns API keys before this position.
@@ -6663,7 +5863,7 @@ client.api_logs.list()
-**first:** `typing.Optional[int]` — Number of logs to return. +**order:** `typing.Optional[ListApiKeysRequestOrder]` — The field to sort API keys by.
@@ -6671,7 +5871,7 @@ client.api_logs.list()
-**after:** `typing.Optional[str]` — Cursor to fetch the page after (from page_info.end_cursor). +**direction:** `typing.Optional[ListApiKeysRequestDirection]` — Sort direction.
@@ -6691,8 +5891,7 @@ client.api_logs.list()
-## App Builds -
client.app_builds.list(...) -> ListAppBuildsResponse +
client.api_keys.create(...) -> ApiKey
@@ -6704,7 +5903,7 @@ client.api_logs.list()
-Returns a paginated list of build artifacts for an app, newest first, with optional platform, status, and creation-date filters. +Creates an API key for an account or app. The response is the only place the full `secret_key` is returned — store it immediately. Requires a user session; API keys cannot manage API keys.
@@ -6721,14 +5920,18 @@ Returns a paginated list of build artifacts for an app, newest first, with optio ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment +from whop_sdk.api_keys import CreateApiKeysRequestPermissions client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.app_builds.list( - app_id="app_id", +client.api_keys.create( + name="Shine Time Booking (production)", + permissions=CreateApiKeysRequestPermissions(), + resource_id="biz_xxxxxxxxxxxxxx", + resource_type="account", ) ``` @@ -6745,23 +5948,7 @@ client.app_builds.list(
-**app_id:** `str` — The app to list builds for, prefixed `app_`. - -
-
- -
-
- -**platform:** `typing.Optional[ListAppBuildsRequestPlatform]` — Filter builds by target platform. - -
-
- -
-
- -**status:** `typing.Optional[ListAppBuildsRequestStatus]` — Filter builds by review status. +**name:** `str` — A human-readable name for the API key, such as 'Production API Key'.
@@ -6769,7 +5956,7 @@ client.app_builds.list(
-**created_before:** `typing.Optional[ListAppBuildsRequestCreatedBefore]` — Only return builds created before this ISO 8601 timestamp. +**permissions:** `CreateApiKeysRequestPermissions` — The permissions policy for the API key: explicit permission statements, or a system role to inherit from. Statements without a `resources` array default to the owning account (Account API keys) or every key-addressable resource (App API keys).
@@ -6777,7 +5964,7 @@ client.app_builds.list(
-**created_after:** `typing.Optional[ListAppBuildsRequestCreatedAfter]` — Only return builds created after this ISO 8601 timestamp. +**resource_id:** `str` — The account (`biz_`) or app (`app_`) tag to create the API key for.
@@ -6785,7 +5972,7 @@ client.app_builds.list(
-**first:** `typing.Optional[int]` — The number of builds to return (default 20, max 100). +**resource_type:** `CreateApiKeysRequestResourceType` — The type of resource that will own this API key.
@@ -6793,7 +5980,7 @@ client.app_builds.list(
-**after:** `typing.Optional[str]` — A cursor; returns builds after this position. +**api_version_date:** `typing.Optional[CreateApiKeysRequestApiVersionDate]` — Dated API version used when requests authenticated with this key omit the `Api-Version-Date` header. New keys default to the latest version.
@@ -6801,7 +5988,7 @@ client.app_builds.list(
-**last:** `typing.Optional[int]` — The number of builds to return from the end of the range. +**expires_at:** `typing.Optional[str]` — When the API key should stop working, as an ISO 8601 timestamp. Omit (or pass `null` on update) for a key that never expires.
@@ -6809,7 +5996,7 @@ client.app_builds.list(
-**before:** `typing.Optional[str]` — A cursor; returns builds before this position. +**ip_allowlist:** `typing.Optional[typing.List[str]]` — IPv4/IPv6 CIDR ranges allowed to use this key, for example `["203.0.113.0/24"]`. Empty or `null` allows any IP.
@@ -6829,7 +6016,7 @@ client.app_builds.list(
-
client.app_builds.create(...) -> AppBuild +
client.api_keys.list_permissions() -> ListPermissionsApiKeysResponse
@@ -6841,7 +6028,7 @@ client.app_builds.list(
-Uploads a new build artifact for an app. Upload the file first (POST /files or a direct upload), then reference it here; iOS and Android take a .zip bundle, web takes a JavaScript file or a .zip archive of the hosted site. +Lists the catalog of permission actions that can be granted to users, apps, and API keys — the source for the dashboard's permission pickers. Small and returned in full on one page.
@@ -6858,18 +6045,13 @@ Uploads a new build artifact for an app. Upload the file first (POST /files or a ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -from whop_sdk.app_builds import CreateAppBuildsRequestAttachment client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.app_builds.create( - attachment=CreateAppBuildsRequestAttachment(), - checksum="xxxxxxxxxxxxxxx", - platform="ios", -) +client.api_keys.list_permissions() ``` @@ -6885,55 +6067,72 @@ client.app_builds.create(
-**attachment:** `CreateAppBuildsRequestAttachment` — The uploaded build file: `{ id }` for an existing file or `{ direct_upload_id }` for a completed direct upload. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**checksum:** `str` — A client-generated checksum of the build file, used to verify file integrity when unpacked. -
+
+
client.api_keys.retrieve(...) -> ApiKey
-**platform:** `CreateAppBuildsRequestPlatform` — The target platform for the build. - -
-
+#### 📝 Description
-**ai_prompt_id:** `typing.Optional[str]` — The AI prompt that generated this build, if applicable. - -
-
-
-**app_id:** `typing.Optional[str]` — The app to create the build for, prefixed `app_`. Defaults to the app behind the presented credential. - +Retrieves an API key with its effective permission grants. The full secret is never returned — rotate the key if it was lost.
+ + + +#### 🔌 Usage
-**source_attachment:** `typing.Optional[CreateAppBuildsRequestSourceAttachment]` — An optional compressed archive (.zip or .gz) of the source code that produced this build, stored alongside the build so it can be downloaded later. Referenced like `attachment`, and must be a different file. - +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.api_keys.retrieve( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**supported_app_view_types:** `typing.Optional[typing.List[CreateAppBuildsRequestSupportedAppViewTypesItem]]` — The view types this build supports. Only list the ones its code implements. +
+
+ +**id:** `str` — API key ID, prefixed `apik_`.
@@ -6953,7 +6152,7 @@ client.app_builds.create(
-
client.app_builds.retrieve(...) -> AppBuild +
client.api_keys.delete(...) -> DeleteApiKeysResponse
@@ -6965,7 +6164,7 @@ client.app_builds.create(
-Retrieves the details of an existing app build. +Permanently revokes an API key; requests using its secret stop authenticating immediately. Default and agent-backend keys cannot be deleted.
@@ -6988,7 +6187,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.app_builds.retrieve( +client.api_keys.delete( id="id", ) @@ -7006,7 +6205,7 @@ client.app_builds.retrieve(
-**id:** `str` — App build ID, prefixed `abld_`. +**id:** `str` — API key ID, prefixed `apik_`.
@@ -7026,7 +6225,7 @@ client.app_builds.retrieve(
-
client.app_builds.promote(...) -> AppBuild +
client.api_keys.update(...) -> ApiKey
@@ -7038,7 +6237,7 @@ client.app_builds.retrieve(
-Promotes a draft or approved app build to production so it becomes the active version served to users. Draft builds enter review first. +Updates an API key's name, permissions, API version, expiration, or IP allowlist. Fields that are omitted keep their current value; default keys cannot be modified.
@@ -7061,7 +6260,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.app_builds.promote( +client.api_keys.update( id="id", ) @@ -7079,7 +6278,47 @@ client.app_builds.promote(
-**id:** `str` — App build ID, prefixed `abld_`. +**id:** `str` — API key ID, prefixed `apik_`. + +
+
+ +
+
+ +**api_version_date:** `typing.Optional[UpdateApiKeysRequestApiVersionDate]` — Dated API version used when requests authenticated with this key omit the `Api-Version-Date` header. New keys default to the latest version. + +
+
+ +
+
+ +**expires_at:** `typing.Optional[str]` — When the API key should stop working, as an ISO 8601 timestamp. Omit (or pass `null` on update) for a key that never expires. + +
+
+ +
+
+ +**ip_allowlist:** `typing.Optional[typing.List[str]]` — IPv4/IPv6 CIDR ranges allowed to use this key, for example `["203.0.113.0/24"]`. Empty or `null` allows any IP. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — A new human-readable name for the API key. + +
+
+ +
+
+ +**permissions:** `typing.Optional[UpdateApiKeysRequestPermissions]` — The permissions policy for the API key: explicit permission statements, or a system role to inherit from. Statements without a `resources` array default to the owning account (Account API keys) or every key-addressable resource (App API keys).
@@ -7099,8 +6338,7 @@ client.app_builds.promote(
-## Apps -
client.apps.list(...) -> ListAppsResponse +
client.api_keys.rotate(...) -> ApiKey
@@ -7112,7 +6350,7 @@ client.app_builds.promote(
-Lists apps on the Whop platform: the app store's live apps, or — with `account_id` and developer access to that account — every app the account owns. Requires authentication except for Whop's public app and website discovery lists. Public website discovery includes built official blueprints (verified apps with a product) and built, live community blueprints that Whop recommends. +Rotates the API key's secret, invalidating the previous secret immediately. The response is the only place the new `secret_key` is returned.
@@ -7135,7 +6373,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.apps.list() +client.api_keys.rotate( + id="id", +) ``` @@ -7151,7 +6391,7 @@ client.apps.list()
-**account_id:** `typing.Optional[str]` — Only return apps created by this account (`biz_` tag). With developer access to the account this includes its unlisted and hidden apps. +**id:** `str` — API key ID, prefixed `apik_`.
@@ -7159,15 +6399,71 @@ client.apps.list()
-**app_type:** `typing.Optional[ListAppsRequestAppType]` — Filter apps by the type of end-user they are built for. Apps of type `website` are left out unless you ask for them by name. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + +
+ +## Api Logs +
client.api_logs.list(...) -> ListApiLogsResponse
-**view_type:** `typing.Optional[ListAppsRequestViewType]` — Only return apps supporting this view type, such as `dashboard` or `hub`. +#### 📝 Description + +
+
+ +
+
+ +Lists the requests served by Whop's API with the account's API keys, newest first — every surface (GraphQL, REST, and native /api/v1), reads and failed requests included. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.api_logs.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**account_id:** `typing.Optional[str]` — The account (biz_*) whose API logs to list. Defaults to the authenticated account.
@@ -7175,7 +6471,7 @@ client.apps.list()
-**verified:** `typing.Optional[bool]` — Only return apps whose Whop verification status matches this value. Omit this filter to include every verification status the caller can see. +**created_after:** `typing.Optional[str]` — Only return requests served at or after this ISO 8601 timestamp. Defaults to 7 days before created_before, or 7 days ago.
@@ -7183,7 +6479,7 @@ client.apps.list()
-**verified_apps_only:** `typing.Optional[bool]` — Legacy compatibility filter. Use `verified` for field equality. `true` returns verified apps; clients pinned before `2026-08-25-2` retain the earlier public website discovery behavior. +**created_before:** `typing.Optional[str]` — Only return requests served before this ISO 8601 timestamp.
@@ -7191,7 +6487,7 @@ client.apps.list()
-**recommended:** `typing.Optional[bool]` — Only return apps Whop recommends (or, with `false`, only those it does not), independently of verification status. +**operation_name:** `typing.Optional[str]` — Only return requests for this operation, matched exactly against the operation_name shown on each log row (for example api/v1/products#create).
@@ -7199,7 +6495,7 @@ client.apps.list()
-**query:** `typing.Optional[str]` — A search string matched against app names. +**http_method:** `typing.Optional[ListApiLogsRequestHttpMethod]` — Only return requests made with this HTTP method.
@@ -7207,7 +6503,7 @@ client.apps.list()
-**order:** `typing.Optional[ListAppsRequestOrder]` — The field to sort apps by. Defaults to discoverable_at, showing the most recently published apps first. `template_usage` ranks Whop-verified apps first, then by how many businesses created apps from each app as a template. +**status:** `typing.Optional[ListApiLogsRequestStatus]` — Only return requests that finished with this status.
@@ -7215,7 +6511,7 @@ client.apps.list()
-**direction:** `typing.Optional[ListAppsRequestDirection]` — Sort direction. +**api_key_id:** `typing.Optional[str]` — Only return requests made with this API key (apik_…).
@@ -7223,7 +6519,7 @@ client.apps.list()
-**first:** `typing.Optional[int]` — The number of apps to return (default 20, max 100). +**min_duration_ms:** `typing.Optional[int]` — Only return requests that took at least this many milliseconds.
@@ -7231,7 +6527,7 @@ client.apps.list()
-**after:** `typing.Optional[str]` — A cursor; returns apps after this position. +**max_duration_ms:** `typing.Optional[int]` — Only return requests that took at most this many milliseconds.
@@ -7239,7 +6535,7 @@ client.apps.list()
-**last:** `typing.Optional[int]` — The number of apps to return from the end of the range. +**first:** `typing.Optional[int]` — Number of logs to return.
@@ -7247,7 +6543,7 @@ client.apps.list()
-**before:** `typing.Optional[str]` — A cursor; returns apps before this position. +**after:** `typing.Optional[str]` — Cursor to fetch the page after (from page_info.end_cursor).
@@ -7267,7 +6563,8 @@ client.apps.list()
-
client.apps.create(...) -> App +## App Builds +
client.app_builds.list(...) -> ListAppBuildsResponse
@@ -7279,7 +6576,7 @@ client.apps.list()
-Registers a new app on the Whop developer platform. Apps provide custom experiences that can be added to products. +Returns a paginated list of build artifacts for an app, newest first, with optional platform, status, and creation-date filters.
@@ -7302,8 +6599,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.apps.create( - name="Shine Time Booking", +client.app_builds.list( + app_id="app_id", ) ``` @@ -7320,7 +6617,7 @@ client.apps.create(
-**name:** `str` — The display name for the app, shown to users on the app store and product pages. +**app_id:** `str` — The app to list builds for, prefixed `app_`.
@@ -7328,7 +6625,7 @@ client.apps.create(
-**account_id:** `typing.Optional[str]` — The account to create the app for (`biz_` tag). Defaults to the account behind the presented credential. +**platform:** `typing.Optional[ListAppBuildsRequestPlatform]` — Filter builds by target platform.
@@ -7336,7 +6633,7 @@ client.apps.create(
-**app_type:** `typing.Optional[CreateAppsRequestAppType]` — The type of app to create. Defaults to `b2c_app`. +**status:** `typing.Optional[ListAppBuildsRequestStatus]` — Filter builds by review status.
@@ -7344,7 +6641,7 @@ client.apps.create(
-**base_url:** `typing.Optional[str]` — The base production URL where the app is hosted, such as `https://myapp.example.com`. +**created_before:** `typing.Optional[ListAppBuildsRequestCreatedBefore]` — Only return builds created before this ISO 8601 timestamp.
@@ -7352,7 +6649,7 @@ client.apps.create(
-**icon:** `typing.Optional[CreateAppsRequestIcon]` — The icon image for the app in PNG, JPEG, or GIF format, referencing an uploaded file: `{ id }` for an existing attachment or `{ direct_upload_id }` for a new direct upload. +**created_after:** `typing.Optional[ListAppBuildsRequestCreatedAfter]` — Only return builds created after this ISO 8601 timestamp.
@@ -7360,7 +6657,7 @@ client.apps.create(
-**redirect_uris:** `typing.Optional[typing.List[str]]` — The whitelisted OAuth callback URLs that users are redirected to after authorizing the app. +**first:** `typing.Optional[int]` — The number of builds to return (default 20, max 100).
@@ -7368,7 +6665,23 @@ client.apps.create(
-**route:** `typing.Optional[str]` — The subdomain route where the app's hosted web builds are served, such as `myapp` for myapp.whop.site. +**after:** `typing.Optional[str]` — A cursor; returns builds after this position. + +
+
+ +
+
+ +**last:** `typing.Optional[int]` — The number of builds to return from the end of the range. + +
+
+ +
+
+ +**before:** `typing.Optional[str]` — A cursor; returns builds before this position.
@@ -7388,7 +6701,7 @@ client.apps.create(
-
client.apps.update_permissions_app(...) -> bool +
client.app_builds.create(...) -> AppBuild
@@ -7400,10 +6713,7 @@ client.apps.create(
-Updates the permission requirements for an app - -Required permissions: - - `developer:update_app_authorization` +Uploads a new build artifact for an app. Upload the file first (POST /files or a direct upload), then reference it here; iOS and Android take a .zip bundle, web takes a JavaScript file or a .zip archive of the hosted site.
@@ -7420,22 +6730,17 @@ Required permissions: ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -from whop_sdk.apps import UpdatePermissionsAppRequestRequestedPermissionsItem +from whop_sdk.app_builds import CreateAppBuildsRequestAttachment client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.apps.update_permissions_app( - app_id="app_id", - requested_permissions=[ - UpdatePermissionsAppRequestRequestedPermissionsItem( - action="action", - is_required=True, - justification="justification", - ) - ], +client.app_builds.create( + attachment=CreateAppBuildsRequestAttachment(), + checksum="xxxxxxxxxxxxxxx", + platform="ios", ) ``` @@ -7452,7 +6757,7 @@ client.apps.update_permissions_app(
-**app_id:** `str` — The ID of the app the permission requirements are being updated for +**attachment:** `CreateAppBuildsRequestAttachment` — The uploaded build file: `{ id }` for an existing file or `{ direct_upload_id }` for a completed direct upload.
@@ -7460,7 +6765,7 @@ client.apps.update_permissions_app(
-**requested_permissions:** `typing.List[UpdatePermissionsAppRequestRequestedPermissionsItem]` — The permissions that the app will request off of users when a user installs the app. +**checksum:** `str` — A client-generated checksum of the build file, used to verify file integrity when unpacked.
@@ -7468,72 +6773,39 @@ client.apps.update_permissions_app(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**platform:** `CreateAppBuildsRequestPlatform` — The target platform for the build.
- -
- - - -
- -
client.apps.retrieve(...) -> App
-#### 📝 Description - -
-
+**ai_prompt_id:** `typing.Optional[str]` — The AI prompt that generated this build, if applicable. + +
+
-Retrieves an app by ID, claimed route, or proxy domain id. Credential fields (api_key, default_api_key, secrets) render `null` unless the caller has the corresponding developer permission on the owning account. -
-
+**app_id:** `typing.Optional[str]` — The app to create the build for, prefixed `app_`. Defaults to the app behind the presented credential. +
-#### 🔌 Usage - -
-
-
-```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.apps.retrieve( - id="id", -) - -``` -
-
+**source_attachment:** `typing.Optional[CreateAppBuildsRequestSourceAttachment]` — An optional compressed archive (.zip or .gz) of the source code that produced this build, stored alongside the build so it can be downloaded later. Referenced like `attachment`, and must be a different file. +
-#### ⚙️ Parameters -
-
-
- -**id:** `str` — App ID (prefixed `app_`), the app's claimed route, or its proxy domain id. +**supported_app_view_types:** `typing.Optional[typing.List[CreateAppBuildsRequestSupportedAppViewTypesItem]]` — The view types this build supports. Only list the ones its code implements.
@@ -7553,7 +6825,7 @@ client.apps.retrieve(
-
client.apps.delete(...) -> DeleteAppsResponse +
client.app_builds.retrieve(...) -> AppBuild
@@ -7565,7 +6837,7 @@ client.apps.retrieve(
-Deletes an app. The app stops resolving within seconds — a website's site stops serving, and any claimed subdomain is reserved for a month before it can be claimed again. +Retrieves the details of an existing app build.
@@ -7588,7 +6860,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.apps.delete( +client.app_builds.retrieve( id="id", ) @@ -7606,7 +6878,7 @@ client.apps.delete(
-**id:** `str` — App ID (prefixed `app_`), the app's claimed route, or its proxy domain id. +**id:** `str` — App build ID, prefixed `abld_`.
@@ -7626,7 +6898,7 @@ client.apps.delete(
-
client.apps.update(...) -> App +
client.app_builds.promote(...) -> AppBuild
@@ -7638,7 +6910,7 @@ client.apps.delete(
-Updates the settings, metadata, or status of an app. Fields that are omitted keep their current value. +Promotes a draft or approved app build to production so it becomes the active version served to users. Draft builds enter review first.
@@ -7661,7 +6933,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.apps.update( +client.app_builds.promote( id="id", ) @@ -7679,7 +6951,7 @@ client.apps.update(
-**id:** `str` — App ID (prefixed `app_`), the app's claimed route, or its proxy domain id. +**id:** `str` — App build ID, prefixed `abld_`.
@@ -7687,103 +6959,71 @@ client.apps.update(
-**app_store_description:** `typing.Optional[str]` — The detailed description shown on the app store's in-depth app view page. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**app_type:** `typing.Optional[UpdateAppsRequestAppType]` — The type of end-user the app is built for. Cannot be changed on an app whose type is already `website`. -
-
-
-**base_url:** `typing.Optional[str]` — The base production URL where the app is hosted. Set to `null` to take the app proxy offline. -
+
+## Apps +
client.apps.list(...) -> ListAppsResponse
-**dashboard_path:** `typing.Optional[str]` — The URL path for the account dashboard view. - -
-
+#### 📝 Description
-**description:** `typing.Optional[str]` — A short description of the app shown in listings and search results. - -
-
-
-**discover_path:** `typing.Optional[str]` — The URL path for the discover view. - +Lists apps on the Whop platform: the app store's live apps, or — with `account_id` and developer access to that account — every app the account owns. Requires authentication except for Whop's public app and website discovery lists. Public website discovery includes built official blueprints (verified apps with a product) and built, live community blueprints that Whop recommends.
- -
-
- -**experience_path:** `typing.Optional[str]` — The URL path for the member-facing hub view, such as `/experiences/[experienceId]`. -
+#### 🔌 Usage +
-**icon:** `typing.Optional[UpdateAppsRequestIcon]` — The icon image for the app in PNG, JPEG, or GIF format, referencing an uploaded file: `{ id }` for an existing attachment or `{ direct_upload_id }` for a new direct upload. - -
-
-
-**name:** `typing.Optional[str]` — The display name for the app, shown to users on the app store and product pages. - -
-
+```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment -
-
+client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) -**oauth_client_type:** `typing.Optional[UpdateAppsRequestOauthClientType]` — How the app authenticates at the OAuth token endpoint. - +client.apps.list() + +```
- -
-
- -**openapi_path:** `typing.Optional[str]` — The URL path to the app's OpenAPI spec file (requires the ai_chat capability). -
+#### ⚙️ Parameters +
-**production_android_build_id:** `typing.Optional[str]` — The app build (`abld_` tag) to serve as the Android production build, or `null` to unassign it. Same rules as `production_web_build_id`. - -
-
-
-**production_ios_build_id:** `typing.Optional[str]` — The app build (`abld_` tag) to serve as the iOS production build, or `null` to unassign it. Same rules as `production_web_build_id`. +**account_id:** `typing.Optional[str]` — Only return apps created by this account (`biz_` tag). With developer access to the account this includes its unlisted and hidden apps.
@@ -7791,7 +7031,7 @@ client.apps.update(
-**production_web_build_id:** `typing.Optional[str]` — The app build (`abld_` tag) to serve as the web production build, or `null` to unassign it. The build must belong to this app, target web, and be in the draft or approved status; a draft build is queued for approval and takes over once approved. Requires the `developer:manage_builds` scope. +**app_type:** `typing.Optional[ListAppsRequestAppType]` — Filter apps by the type of end-user they are built for. Apps of type `website` are left out unless you ask for them by name.
@@ -7799,7 +7039,7 @@ client.apps.update(
-**redirect_uris:** `typing.Optional[typing.List[str]]` — The whitelisted OAuth callback URLs users are redirected to after authorizing the app. +**view_type:** `typing.Optional[ListAppsRequestViewType]` — Only return apps supporting this view type, such as `dashboard` or `hub`.
@@ -7807,7 +7047,7 @@ client.apps.update(
-**required_scopes:** `typing.Optional[typing.List[str]]` — The OAuth scopes the app requests from users when they install it. +**verified:** `typing.Optional[bool]` — Only return apps whose Whop verification status matches this value. Omit this filter to include every verification status the caller can see.
@@ -7815,7 +7055,7 @@ client.apps.update(
-**route:** `typing.Optional[str]` — The subdomain route where the app's hosted web builds are served. +**verified_apps_only:** `typing.Optional[bool]` — Legacy compatibility filter. Use `verified` for field equality. `true` returns verified apps; clients pinned before `2026-08-25-2` retain the earlier public website discovery behavior.
@@ -7823,7 +7063,7 @@ client.apps.update(
-**secrets:** `typing.Optional[typing.Dict[str, typing.Any]]` — Secrets to add or overwrite on the app, as an object of string values. Keys not included are left untouched; pass null or an empty string as the value to delete a secret. Encrypted at rest and injected into the app's hosted server runtime. +**recommended:** `typing.Optional[bool]` — Only return apps Whop recommends (or, with `false`, only those it does not), independently of verification status.
@@ -7831,7 +7071,7 @@ client.apps.update(
-**skills_path:** `typing.Optional[str]` — The URL path to the app's skills directory (requires the ai_chat capability). +**query:** `typing.Optional[str]` — A search string matched against app names.
@@ -7839,7 +7079,7 @@ client.apps.update(
-**status:** `typing.Optional[UpdateAppsRequestStatus]` — Controls whether the app is published on Whop discovery or accessible only through its direct link. Publishing requires a name, icon, and description. +**order:** `typing.Optional[ListAppsRequestOrder]` — The field to sort apps by. Defaults to discoverable_at, showing the most recently published apps first. `template_usage` ranks Whop-verified apps first, then by how many businesses created apps from each app as a template.
@@ -7847,72 +7087,31 @@ client.apps.update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**direction:** `typing.Optional[ListAppsRequestDirection]` — Sort direction.
- - - - - - -
- -
client.apps.deploy(...) -> AppDeployment -
-
- -#### 📝 Description - -
-
-Builds the app's current source and ships it. Returns the run it started, so the caller can render progress from this response and then follow it on the app's `deployment` field. Only one deployment runs per app at a time — calling this while one is in flight reports that run rather than starting a second, and calling it with nothing to publish reports that instead of starting one. -
-
+**first:** `typing.Optional[int]` — The number of apps to return (default 20, max 100). +
-#### 🔌 Usage -
-
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.apps.deploy( - id="id", -) - -``` -
-
+**after:** `typing.Optional[str]` — A cursor; returns apps after this position. +
-#### ⚙️ Parameters -
-
-
- -**id:** `str` — The app to deploy, prefixed `app_`. +**last:** `typing.Optional[int]` — The number of apps to return from the end of the range.
@@ -7920,7 +7119,7 @@ client.apps.deploy(
-**draft:** `typing.Optional[bool]` — Upload the build without making it live. Defaults to `false`, which deploys and promotes in one step. +**before:** `typing.Optional[str]` — A cursor; returns apps before this position.
@@ -7940,7 +7139,7 @@ client.apps.deploy(
-
client.apps.logs(...) -> LogsAppsResponse +
client.apps.create(...) -> App
@@ -7952,7 +7151,7 @@ client.apps.deploy(
-Lists a hosted app's server runtime logs, most recent first: console output, uncaught exceptions, and failed-request summaries captured on whop.site hosting. Logs are retained for 7 days. +Registers a new app on the Whop developer platform. Apps provide custom experiences that can be added to products.
@@ -7975,8 +7174,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.apps.logs( - id="id", +client.apps.create( + name="Shine Time Booking", ) ``` @@ -7993,23 +7192,7 @@ client.apps.logs(
-**id:** `str` — The ID of the app, which will look like app_*************. - -
-
- -
-
- -**app_build_id:** `typing.Optional[str]` — Only return logs from this build. - -
-
- -
-
- -**level:** `typing.Optional[LogsAppsRequestLevel]` — Only return console lines of this level. +**name:** `str` — The display name for the app, shown to users on the app store and product pages.
@@ -8017,7 +7200,7 @@ client.apps.logs(
-**query:** `typing.Optional[str]` — Only return logs whose message contains this text (case-insensitive). +**account_id:** `typing.Optional[str]` — The account to create the app for (`biz_` tag). Defaults to the account behind the presented credential.
@@ -8025,7 +7208,7 @@ client.apps.logs(
-**created_after:** `typing.Optional[datetime.datetime]` — Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before created_before. +**app_type:** `typing.Optional[CreateAppsRequestAppType]` — The type of app to create. Defaults to `b2c_app`.
@@ -8033,7 +7216,7 @@ client.apps.logs(
-**created_before:** `typing.Optional[datetime.datetime]` — End of the time window as an ISO 8601 timestamp. Defaults to now. +**base_url:** `typing.Optional[str]` — The base production URL where the app is hosted, such as `https://myapp.example.com`.
@@ -8041,7 +7224,7 @@ client.apps.logs(
-**first:** `typing.Optional[int]` — The number of log lines to return (max 500). +**icon:** `typing.Optional[CreateAppsRequestIcon]` — The icon image for the app in PNG, JPEG, or GIF format, referencing an uploaded file: `{ id }` for an existing attachment or `{ direct_upload_id }` for a new direct upload.
@@ -8049,7 +7232,7 @@ client.apps.logs(
-**after:** `typing.Optional[str]` — A cursor for fetching logs after a previous page. +**redirect_uris:** `typing.Optional[typing.List[str]]` — The whitelisted OAuth callback URLs that users are redirected to after authorizing the app.
@@ -8057,7 +7240,7 @@ client.apps.logs(
-**before:** `typing.Optional[str]` — A cursor for fetching logs before a later page. +**route:** `typing.Optional[str]` — The subdomain route where the app's hosted web builds are served, such as `myapp` for myapp.whop.site.
@@ -8077,7 +7260,7 @@ client.apps.logs(
-
client.apps.update_permissions(...) -> App +
client.apps.update_permissions_app(...) -> bool
@@ -8089,7 +7272,10 @@ client.apps.logs(
-Replaces the set of permissions the app requests from users when they install it. Requires a user session: the `developer:update_app_authorization` scope cannot be delegated to API keys. Sensitive permissions require step-up verification. +Updates the permission requirements for an app + +Required permissions: + - `developer:update_app_authorization`
@@ -8106,20 +7292,20 @@ Replaces the set of permissions the app requests from users when they install it ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -from whop_sdk.apps import UpdatePermissionsAppsRequestRequestedPermissionsItem +from whop_sdk.apps import UpdatePermissionsAppRequestRequestedPermissionsItem client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.apps.update_permissions( - id="id", +client.apps.update_permissions_app( + app_id="app_id", requested_permissions=[ - UpdatePermissionsAppsRequestRequestedPermissionsItem( - action="company:basic:read", + UpdatePermissionsAppRequestRequestedPermissionsItem( + action="action", is_required=True, - justification="Reads basic account info to render the dashboard home.", + justification="justification", ) ], ) @@ -8138,7 +7324,7 @@ client.apps.update_permissions(
-**id:** `str` — App ID, prefixed `app_`. +**app_id:** `str` — The ID of the app the permission requirements are being updated for
@@ -8146,7 +7332,7 @@ client.apps.update_permissions(
-**requested_permissions:** `typing.List[UpdatePermissionsAppsRequestRequestedPermissionsItem]` — The full set of permissions the app requests on install; permissions not listed are removed. +**requested_permissions:** `typing.List[UpdatePermissionsAppRequestRequestedPermissionsItem]` — The permissions that the app will request off of users when a user installs the app.
@@ -8166,8 +7352,7 @@ client.apps.update_permissions(
-## Audiences -
client.audiences.list(...) -> ListAudiencesResponse +
client.apps.retrieve(...) -> App
@@ -8179,7 +7364,7 @@ client.apps.update_permissions(
-Lists uploaded customer-list audiences for an account. Pass `audience_id` to return a specific audience. +Retrieves an app by ID, claimed route, or proxy domain id. Credential fields (api_key, default_api_key, secrets) render `null` unless the caller has the corresponding developer permission on the owning account.
@@ -8202,8 +7387,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.audiences.list( - account_id="account_id", +client.apps.retrieve( + id="id", ) ``` @@ -8220,7 +7405,7 @@ client.audiences.list(
-**account_id:** `str` — Account ID, prefixed `biz_`. +**id:** `str` — App ID (prefixed `app_`), the app's claimed route, or its proxy domain id.
@@ -8228,39 +7413,72 @@ client.audiences.list(
-**audience_id:** `typing.Optional[str]` — Audience ID, prefixed `adaud_`, used to filter the response to one audience. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**audience_type:** `typing.Optional[ListAudiencesRequestAudienceType]` — Filter by audience type: `custom` (uploaded lists) or `lookalike`. -
+
+
client.apps.delete(...) -> DeleteAppsResponse
-**source_type:** `typing.Optional[ListAudiencesRequestSourceType]` — Filter by member source: `csv_upload` (uploaded lists) or `people_filter` (automatic audiences built from saved People filters). - +#### 📝 Description + +
+
+ +
+
+ +Deletes an app. The app stops resolving within seconds — a website's site stops serving, and any claimed subdomain is reserved for a month before it can be claimed again. +
+
+#### 🔌 Usage +
-**first:** `typing.Optional[int]` — Number of audiences to return. Defaults to 20; maximum 100. - +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.apps.delete( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**after:** `typing.Optional[str]` — Cursor for the next page of audiences. +
+
+ +**id:** `str` — App ID (prefixed `app_`), the app's claimed route, or its proxy domain id.
@@ -8280,7 +7498,7 @@ client.audiences.list(
-
client.audiences.create(...) -> CreateAudiencesResponse +
client.apps.update(...) -> App
@@ -8292,7 +7510,7 @@ client.audiences.list(
-Creates an audience. Default (`audience_type` omitted or `custom`): creates one audience from an uploaded customer identity CSV file (`name`, `column_mapping`, and `file_id` required) and starts processing it; responds with the audience object. With `filters`: creates an audience from saved People filters (`name` required) — membership is built from the account's People data, and `auto_refresh` decides whether it keeps tracking the filters or keeps whoever matched at creation. With `audience_type: lookalike`: creates a ladder of Meta lookalike audiences from an existing ready custom audience (`source_audience_id`, `count`, and `percentage` required) — `count` equal similarity bands slicing the top `percentage`% (3 audiences at 6% = 0–2%, 2–4%, 4–6%), each returned as its own audience in a `{ data: [...] }` envelope. +Updates the settings, metadata, or status of an app. Fields that are omitted keep their current value.
@@ -8315,8 +7533,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.audiences.create( - account_id="biz_xxxxxxxxxxxxxx", +client.apps.update( + id="id", ) ``` @@ -8333,7 +7551,7 @@ client.audiences.create(
-**account_id:** `str` — Account ID, prefixed `biz_`. +**id:** `str` — App ID (prefixed `app_`), the app's claimed route, or its proxy domain id.
@@ -8341,7 +7559,7 @@ client.audiences.create(
-**audience_type:** `typing.Optional[CreateAudiencesRequestAudienceType]` — What to create. Defaults to `custom` (CSV upload). +**app_store_description:** `typing.Optional[str]` — The detailed description shown on the app store's in-depth app view page.
@@ -8349,7 +7567,7 @@ client.audiences.create(
-**auto_refresh:** `typing.Optional[bool]` — Filter audiences only, and set only at creation. `true` (the default) rebuilds membership from the filters twice a day. `false` keeps whoever matched at creation and never rebuilds. +**app_type:** `typing.Optional[UpdateAppsRequestAppType]` — The type of end-user the app is built for. Cannot be changed on an app whose type is already `website`.
@@ -8357,7 +7575,7 @@ client.audiences.create(
-**column_mapping:** `typing.Optional[CreateAudiencesRequestColumnMapping]` — Custom audiences only. Maps supported identity fields to CSV column headers. Map at least one of `email` or `phone`. +**base_url:** `typing.Optional[str]` — The base production URL where the app is hosted. Set to `null` to take the app proxy offline.
@@ -8365,7 +7583,7 @@ client.audiences.create(
-**count:** `typing.Optional[int]` — Lookalikes only. Number of lookalike audiences to create (1–6). +**dashboard_path:** `typing.Optional[str]` — The URL path for the account dashboard view.
@@ -8373,7 +7591,7 @@ client.audiences.create(
-**file_id:** `typing.Optional[str]` — Custom audiences only. The uploaded customer CSV — a file id (`file_...`) returned by `POST /files`. +**description:** `typing.Optional[str]` — A short description of the app shown in listings and search results.
@@ -8381,7 +7599,7 @@ client.audiences.create(
-**filters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Filter audiences only. The People filters that define membership, keyed exactly as `GET /people` accepts them — for example `{"os": "iOS", "country": "US"}`. Date filters must be rolling windows — `first_seen_within_days` or `last_seen_within_days` — so the audience re-anchors on every refresh; fixed dates such as `first_seen_after` are rejected. Source values are canonical source paths (`whop:::`, `ext::...`, `referrer:`, `direct`), exact or with a trailing `:*` wildcard. +**discover_path:** `typing.Optional[str]` — The URL path for the discover view.
@@ -8389,7 +7607,7 @@ client.audiences.create(
-**name:** `typing.Optional[str]` — Audience display name. Required for custom audiences; lookalike names are generated from the source audience. +**experience_path:** `typing.Optional[str]` — The URL path for the member-facing hub view, such as `/experiences/[experienceId]`.
@@ -8397,7 +7615,7 @@ client.audiences.create(
-**percentage:** `typing.Optional[int]` — Lookalikes only. Total similarity reach as a whole percent (1–20), sliced evenly across `count` — must be divisible by `count`. +**icon:** `typing.Optional[UpdateAppsRequestIcon]` — The icon image for the app in PNG, JPEG, or GIF format, referencing an uploaded file: `{ id }` for an existing attachment or `{ direct_upload_id }` for a new direct upload.
@@ -8405,7 +7623,7 @@ client.audiences.create(
-**source_audience_id:** `typing.Optional[str]` — Lookalikes only. The ready custom audience (`adaud_`) to build from; it needs at least 100 matched people. +**name:** `typing.Optional[str]` — The display name for the app, shown to users on the app store and product pages.
@@ -8413,72 +7631,87 @@ client.audiences.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**oauth_client_type:** `typing.Optional[UpdateAppsRequestOauthClientType]` — How the app authenticates at the OAuth token endpoint.
- -
+
+
+**openapi_path:** `typing.Optional[str]` — The URL path to the app's OpenAPI spec file (requires the ai_chat capability). +
-
-
client.audiences.delete(...) -> DeleteAudiencesResponse
-#### 📝 Description +**production_android_build_id:** `typing.Optional[str]` — The app build (`abld_` tag) to serve as the Android production build, or `null` to unassign it. Same rules as `production_web_build_id`. + +
+
+**production_ios_build_id:** `typing.Optional[str]` — The app build (`abld_` tag) to serve as the iOS production build, or `null` to unassign it. Same rules as `production_web_build_id`. + +
+
+
-Deletes an audience so it is no longer available for targeting. -
-
+**production_web_build_id:** `typing.Optional[str]` — The app build (`abld_` tag) to serve as the web production build, or `null` to unassign it. The build must belong to this app, target web, and be in the draft or approved status; a draft build is queued for approval and takes over once approved. Requires the `developer:manage_builds` scope. + -#### 🔌 Usage -
+**redirect_uris:** `typing.Optional[typing.List[str]]` — The whitelisted OAuth callback URLs users are redirected to after authorizing the app. + +
+
+
-```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) +**required_scopes:** `typing.Optional[typing.List[str]]` — The OAuth scopes the app requests from users when they install it. + +
+
-client.audiences.delete( - id="id", -) +
+
-``` +**route:** `typing.Optional[str]` — The subdomain route where the app's hosted web builds are served. +
+ +
+
+ +**secrets:** `typing.Optional[typing.Dict[str, typing.Any]]` — Secrets to add or overwrite on the app, as an object of string values. Keys not included are left untouched; pass null or an empty string as the value to delete a secret. Encrypted at rest and injected into the app's hosted server runtime. +
-#### ⚙️ Parameters -
+**skills_path:** `typing.Optional[str]` — The URL path to the app's skills directory (requires the ai_chat capability). + +
+
+
-**id:** `str` — Audience ID, prefixed `adaud_`. +**status:** `typing.Optional[UpdateAppsRequestStatus]` — Controls whether the app is published on Whop discovery or accessible only through its direct link. Publishing requires a name, icon, and description.
@@ -8498,7 +7731,7 @@ client.audiences.delete(
-
client.audiences.update(...) -> Audience +
client.apps.deploy(...) -> AppDeployment
@@ -8510,7 +7743,7 @@ client.audiences.delete(
-Renames an audience. For an audience built from People filters that keeps itself up to date, pass `filters` to replace them, which rebuilds membership immediately. Whether an audience auto refreshes is set when it is created. +Builds the app's current source and ships it. Returns the run it started, so the caller can render progress from this response and then follow it on the app's `deployment` field. Only one deployment runs per app at a time — calling this while one is in flight reports that run rather than starting a second, and calling it with nothing to publish reports that instead of starting one.
@@ -8533,7 +7766,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.audiences.update( +client.apps.deploy( id="id", ) @@ -8551,15 +7784,7 @@ client.audiences.update(
-**id:** `str` — Audience ID, prefixed `adaud_`. - -
-
- -
-
- -**filters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Replaces the People filters that define membership. The whole definition is replaced rather than merged, so send every filter you want to keep — a filter you leave out stops applying. Keys and values are the ones `GET /people` accepts, such as an `os` of `iOS` or a `country` of `US`, and at least one filter is required. Date filters must be rolling windows — `first_seen_within_days` or `last_seen_within_days` — so the audience re-anchors every time it rebuilds; fixed dates such as `first_seen_after` are rejected, as is `audience_id`. An array value holds at most 500 items, and each value at most 10 KB. Only an audience with a `source_type` of `people_filter` and `auto_refresh` of `true` accepts filters: an uploaded list has no filters to replace, and with auto refresh off the audience keeps the people it matched when it was built, so create a new audience instead. +**id:** `str` — The app to deploy, prefixed `app_`.
@@ -8567,7 +7792,7 @@ client.audiences.update(
-**name:** `typing.Optional[str]` — New audience display name. A blank value is ignored rather than clearing the name. +**draft:** `typing.Optional[bool]` — Upload the build without making it live. Defaults to `false`, which deploys and promotes in one step.
@@ -8587,7 +7812,7 @@ client.audiences.update(
-
client.audiences.add_people(...) -> Audience +
client.apps.logs(...) -> LogsAppsResponse
@@ -8599,7 +7824,7 @@ client.audiences.update(
-Adds users from a new CSV file to an existing uploaded custom audience. The file uses the audience's saved column mapping, processing happens in the background, and existing audience members remain unchanged. +Lists a hosted app's server runtime logs, most recent first: console output, uncaught exceptions, and failed-request summaries captured on whop.site hosting. Logs are retained for 7 days.
@@ -8622,9 +7847,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.audiences.add_people( +client.apps.logs( id="id", - file_id="file_xxxxxxxxxxxxxx", ) ``` @@ -8641,7 +7865,7 @@ client.audiences.add_people(
-**id:** `str` — Audience ID, prefixed `adaud_`. +**id:** `str` — The ID of the app, which will look like app_*************.
@@ -8649,7 +7873,63 @@ client.audiences.add_people(
-**file_id:** `str` — The new customer CSV — a file id (`file_...`) returned by `POST /files`. Its headers must match the audience's saved column mapping. +**app_build_id:** `typing.Optional[str]` — Only return logs from this build. + +
+
+ +
+
+ +**level:** `typing.Optional[LogsAppsRequestLevel]` — Only return console lines of this level. + +
+
+ +
+
+ +**query:** `typing.Optional[str]` — Only return logs whose message contains this text (case-insensitive). + +
+
+ +
+
+ +**created_after:** `typing.Optional[datetime.datetime]` — Start of the time window as an ISO 8601 timestamp. Defaults to 7 days before created_before. + +
+
+ +
+
+ +**created_before:** `typing.Optional[datetime.datetime]` — End of the time window as an ISO 8601 timestamp. Defaults to now. + +
+
+ +
+
+ +**first:** `typing.Optional[int]` — The number of log lines to return (max 500). + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — A cursor for fetching logs after a previous page. + +
+
+ +
+
+ +**before:** `typing.Optional[str]` — A cursor for fetching logs before a later page.
@@ -8669,8 +7949,7 @@ client.audiences.add_people(
-## AuthorizedUsers -
client.authorized_users.list(...) -> ListAuthorizedUsersResponse +
client.apps.update_permissions(...) -> App
@@ -8682,11 +7961,7 @@ client.audiences.add_people(
-Returns a paginated list of authorized team members for a company, with optional filtering by user, role, and creation date. - -Required permissions: - - `company:authorized_user:read` - - `member:email:read` +Replaces the set of permissions the app requests from users when they install it. Requires a user session: the `developer:update_app_authorization` scope cannot be delegated to API keys. Sensitive permissions require step-up verification.
@@ -8703,20 +7978,22 @@ Required permissions: ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -import datetime +from whop_sdk.apps import UpdatePermissionsAppsRequestRequestedPermissionsItem client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.authorized_users.list( - first=42, - last=42, - company_id="biz_xxxxxxxxxxxxxx", - user_id="user_xxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - created_after=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), +client.apps.update_permissions( + id="id", + requested_permissions=[ + UpdatePermissionsAppsRequestRequestedPermissionsItem( + action="company:basic:read", + is_required=True, + justification="Reads basic account info to render the dashboard home.", + ) + ], ) ``` @@ -8733,7 +8010,7 @@ client.authorized_users.list(
-**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. +**id:** `str` — App ID, prefixed `app_`.
@@ -8741,7 +8018,7 @@ client.authorized_users.list(
-**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. +**requested_permissions:** `typing.List[UpdatePermissionsAppsRequestRequestedPermissionsItem]` — The full set of permissions the app requests on install; permissions not listed are removed.
@@ -8749,15 +8026,73 @@ client.authorized_users.list(
-**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+## Audiences +
client.audiences.list(...) -> ListAudiencesResponse
-**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +#### 📝 Description + +
+
+ +
+
+ +Lists uploaded customer-list audiences for an account. Pass `audience_id` to return a specific audience. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.audiences.list( + account_id="account_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**account_id:** `str` — Account ID, prefixed `biz_`.
@@ -8765,7 +8100,7 @@ client.authorized_users.list(
-**company_id:** `typing.Optional[str]` — The unique identifier of the company to list authorized users for. +**audience_id:** `typing.Optional[str]` — Audience ID, prefixed `adaud_`, used to filter the response to one audience.
@@ -8773,7 +8108,7 @@ client.authorized_users.list(
-**user_id:** `typing.Optional[str]` — Filter results to a specific user to check if they are an authorized team member. +**audience_type:** `typing.Optional[ListAudiencesRequestAudienceType]` — Filter by audience type: `custom` (uploaded lists) or `lookalike`.
@@ -8781,7 +8116,7 @@ client.authorized_users.list(
-**role:** `typing.Optional[AuthorizedUserRoles]` +**source_type:** `typing.Optional[ListAudiencesRequestSourceType]` — Filter by member source: `csv_upload` (uploaded lists) or `people_filter` (automatic audiences built from saved People filters).
@@ -8789,7 +8124,7 @@ client.authorized_users.list(
-**created_before:** `typing.Optional[datetime.datetime]` — Only return authorized users created before this timestamp. +**first:** `typing.Optional[int]` — Number of audiences to return. Defaults to 20; maximum 100.
@@ -8797,7 +8132,7 @@ client.authorized_users.list(
-**created_after:** `typing.Optional[datetime.datetime]` — Only return authorized users created after this timestamp. +**after:** `typing.Optional[str]` — Cursor for the next page of audiences.
@@ -8817,7 +8152,7 @@ client.authorized_users.list(
-
client.authorized_users.create(...) -> AuthorizedUser +
client.audiences.create(...) -> CreateAudiencesResponse
@@ -8829,11 +8164,7 @@ client.authorized_users.list(
-Add a new authorized user to a company. - -Required permissions: - - `authorized_user:create` - - `member:email:read` +Creates an audience. Default (`audience_type` omitted or `custom`): creates one audience from an uploaded customer identity CSV file (`name`, `column_mapping`, and `file_id` required) and starts processing it; responds with the audience object. With `filters`: creates an audience from saved People filters (`name` required) — membership is built from the account's People data, and `auto_refresh` decides whether it keeps tracking the filters or keeps whoever matched at creation. With `audience_type: lookalike`: creates a ladder of Meta lookalike audiences from an existing ready custom audience (`source_audience_id`, `count`, and `percentage` required) — `count` equal similarity bands slicing the top `percentage`% (3 audiences at 6% = 0–2%, 2–4%, 4–6%), each returned as its own audience in a `{ data: [...] }` envelope.
@@ -8856,10 +8187,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.authorized_users.create( - company_id="biz_xxxxxxxxxxxxxx", - role="owner", - user_id="user_xxxxxxxxxxxxx", +client.audiences.create( + account_id="biz_xxxxxxxxxxxxxx", ) ``` @@ -8876,7 +8205,7 @@ client.authorized_users.create(
-**company_id:** `str` — The ID of the company to add the authorized user to. +**account_id:** `str` — Account ID, prefixed `biz_`.
@@ -8884,7 +8213,7 @@ client.authorized_users.create(
-**role:** `GrantableAuthorizedUserRoles` — The role to assign to the authorized user within the company. Supported roles: 'moderator', 'sales_manager'. +**audience_type:** `typing.Optional[CreateAudiencesRequestAudienceType]` — What to create. Defaults to `custom` (CSV upload).
@@ -8892,7 +8221,7 @@ client.authorized_users.create(
-**user_id:** `str` — The ID of the user to add as an authorized user. +**auto_refresh:** `typing.Optional[bool]` — Filter audiences only, and set only at creation. `true` (the default) rebuilds membership from the filters twice a day. `false` keeps whoever matched at creation and never rebuilds.
@@ -8900,7 +8229,7 @@ client.authorized_users.create(
-**elevation:** `typing.Optional[CreateAuthorizedUsersRequestElevation]` — Re-authentication proof required to perform this sensitive action. +**column_mapping:** `typing.Optional[CreateAudiencesRequestColumnMapping]` — Custom audiences only. Maps supported identity fields to CSV column headers. Map at least one of `email` or `phone`.
@@ -8908,7 +8237,47 @@ client.authorized_users.create(
-**send_emails:** `typing.Optional[bool]` — Whether to send notification emails to the user on creation. +**count:** `typing.Optional[int]` — Lookalikes only. Number of lookalike audiences to create (1–6). + +
+
+ +
+
+ +**file_id:** `typing.Optional[str]` — Custom audiences only. The uploaded customer CSV — a file id (`file_...`) returned by `POST /files`. + +
+
+ +
+
+ +**filters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Filter audiences only. The People filters that define membership, keyed exactly as `GET /people` accepts them — for example `{"os": "iOS", "country": "US"}`. Date filters must be rolling windows — `first_seen_within_days` or `last_seen_within_days` — so the audience re-anchors on every refresh; fixed dates such as `first_seen_after` are rejected. Source values are canonical source paths (`whop:::`, `ext::...`, `referrer:`, `direct`), exact or with a trailing `:*` wildcard. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — Audience display name. Required for custom audiences; lookalike names are generated from the source audience. + +
+
+ +
+
+ +**percentage:** `typing.Optional[int]` — Lookalikes only. Total similarity reach as a whole percent (1–20), sliced evenly across `count` — must be divisible by `count`. + +
+
+ +
+
+ +**source_audience_id:** `typing.Optional[str]` — Lookalikes only. The ready custom audience (`adaud_`) to build from; it needs at least 100 matched people.
@@ -8928,7 +8297,7 @@ client.authorized_users.create(
-
client.authorized_users.retrieve(...) -> AuthorizedUser +
client.audiences.delete(...) -> DeleteAudiencesResponse
@@ -8940,11 +8309,7 @@ client.authorized_users.create(
-Retrieves the details of an existing authorized user. - -Required permissions: - - `company:authorized_user:read` - - `member:email:read` +Deletes an audience so it is no longer available for targeting.
@@ -8967,8 +8332,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.authorized_users.retrieve( - id="ausr_xxxxxxxxxxxxx", +client.audiences.delete( + id="id", ) ``` @@ -8985,7 +8350,7 @@ client.authorized_users.retrieve(
-**id:** `str` — The unique identifier of the authorized user to retrieve. +**id:** `str` — Audience ID, prefixed `adaud_`.
@@ -9005,7 +8370,7 @@ client.authorized_users.retrieve(
-
client.authorized_users.delete(...) -> bool +
client.audiences.update(...) -> Audience
@@ -9017,10 +8382,7 @@ client.authorized_users.retrieve(
-Remove an authorized user from a company. - -Required permissions: - - `authorized_user:delete` +Renames an audience. For an audience built from People filters that keeps itself up to date, pass `filters` to replace them, which rebuilds membership immediately. Whether an audience auto refreshes is set when it is created.
@@ -9043,9 +8405,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.authorized_users.delete( - id="ausr_xxxxxxxxxxxxx", - company_id="biz_xxxxxxxxxxxxxx", +client.audiences.update( + id="id", ) ``` @@ -9062,7 +8423,7 @@ client.authorized_users.delete(
-**id:** `str` — The ID of the authorized user or user to remove. +**id:** `str` — Audience ID, prefixed `adaud_`.
@@ -9070,7 +8431,15 @@ client.authorized_users.delete(
-**company_id:** `typing.Optional[str]` — The ID of the company the authorized user belongs to. Optional if the authorized user ID is provided. +**filters:** `typing.Optional[typing.Dict[str, typing.Any]]` — Replaces the People filters that define membership. The whole definition is replaced rather than merged, so send every filter you want to keep — a filter you leave out stops applying. Keys and values are the ones `GET /people` accepts, such as an `os` of `iOS` or a `country` of `US`, and at least one filter is required. Date filters must be rolling windows — `first_seen_within_days` or `last_seen_within_days` — so the audience re-anchors every time it rebuilds; fixed dates such as `first_seen_after` are rejected, as is `audience_id`. An array value holds at most 500 items, and each value at most 10 KB. Only an audience with a `source_type` of `people_filter` and `auto_refresh` of `true` accepts filters: an uploaded list has no filters to replace, and with auto refresh off the audience keeps the people it matched when it was built, so create a new audience instead. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — New audience display name. A blank value is ignored rather than clearing the name.
@@ -9090,8 +8459,7 @@ client.authorized_users.delete(
-## Bounties -
client.bounties.list(...) -> ListBountiesResponse +
client.audiences.add_people(...) -> Audience
@@ -9103,7 +8471,7 @@ client.authorized_users.delete(
-Lists bounties visible to the credential — for an account API key, the account's bounties including scheduled drafts; for a user token, the bounties the user can see and work. +Adds users from a new CSV file to an existing uploaded custom audience. The file uses the audience's saved column mapping, processing happens in the background, and existing audience members remain unchanged.
@@ -9126,7 +8494,10 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounties.list() +client.audiences.add_people( + id="id", + file_id="file_xxxxxxxxxxxxxx", +) ``` @@ -9142,7 +8513,7 @@ client.bounties.list()
-**account_id:** `typing.Optional[str]` — Scope the list to this account (`biz_` tag). Requires read access to the account; account API keys may pass their own account or a connected account. +**id:** `str` — Audience ID, prefixed `adaud_`.
@@ -9150,7 +8521,7 @@ client.bounties.list()
-**user_id:** `typing.Optional[str]` — List the bounties this user participated in (`user_` tag). Must be the authenticated user. +**file_id:** `str` — The new customer CSV — a file id (`file_...`) returned by `POST /files`. Its headers must match the audience's saved column mapping.
@@ -9158,39 +8529,83 @@ client.bounties.list()
-**status:** `typing.Optional[ListBountiesRequestStatus]` — Filter by lifecycle state. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**business_goal_type:** `typing.Optional[ListBountiesRequestBusinessGoalType]` — Filter by the poster's declared goal. Bounties created before the goal taxonomy carry no goal and never match this filter. -
+
+## AuthorizedUsers +
client.authorized_users.list(...) -> ListAuthorizedUsersResponse
-**country:** `typing.Optional[str]` — Only bounties workable from this country, as an ISO 3166-1 alpha-2 code. Bounties with no country targeting are workable worldwide and always match. - +#### 📝 Description + +
+
+ +
+
+ +Returns a paginated list of authorized team members for a company, with optional filtering by user, role, and creation date. + +Required permissions: + - `company:authorized_user:read` + - `member:email:read` +
+
+#### 🔌 Usage +
-**experience_id:** `typing.Optional[str]` — Only bounties posted to this forum experience, prefixed `exp_`. An unknown experience, or one outside the caller's scope, matches nothing. - +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment +import datetime + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.authorized_users.list( + first=42, + last=42, + company_id="biz_xxxxxxxxxxxxxx", + user_id="user_xxxxxxxxxxxxx", + created_before=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), + created_after=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), +) + +``` +
+
+#### ⚙️ Parameters +
-**query:** `typing.Optional[str]` — Substring match on the bounty title or ID. +
+
+ +**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor.
@@ -9198,7 +8613,7 @@ client.bounties.list()
-**created_after:** `typing.Optional[str]` — Only bounties created after this ISO 8601 timestamp. +**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor.
@@ -9206,7 +8621,7 @@ client.bounties.list()
-**created_before:** `typing.Optional[str]` — Only bounties created before this ISO 8601 timestamp. +**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list.
@@ -9214,7 +8629,7 @@ client.bounties.list()
-**order:** `typing.Optional[ListBountiesRequestOrder]` — Sort field. +**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list.
@@ -9222,7 +8637,7 @@ client.bounties.list()
-**direction:** `typing.Optional[ListBountiesRequestDirection]` — Sort direction. +**company_id:** `typing.Optional[str]` — The unique identifier of the company to list authorized users for.
@@ -9230,7 +8645,7 @@ client.bounties.list()
-**first:** `typing.Optional[int]` — Number of bounties to return from the start of the window. +**user_id:** `typing.Optional[str]` — Filter results to a specific user to check if they are an authorized team member.
@@ -9238,7 +8653,7 @@ client.bounties.list()
-**after:** `typing.Optional[str]` — Cursor to paginate forwards from. +**role:** `typing.Optional[AuthorizedUserRoles]`
@@ -9246,7 +8661,7 @@ client.bounties.list()
-**last:** `typing.Optional[int]` — Number of bounties to return from the end of the window. +**created_before:** `typing.Optional[datetime.datetime]` — Only return authorized users created before this timestamp.
@@ -9254,7 +8669,7 @@ client.bounties.list()
-**before:** `typing.Optional[str]` — Cursor to paginate backwards from. +**created_after:** `typing.Optional[datetime.datetime]` — Only return authorized users created after this timestamp.
@@ -9274,7 +8689,7 @@ client.bounties.list()
-
client.bounties.create(...) -> Bounty +
client.authorized_users.create(...) -> AuthorizedUser
@@ -9286,7 +8701,11 @@ client.bounties.list()
-Creates a bounty and escrows its reward pool. Publishes immediately, or as a scheduled draft when you set `publish_at`. +Add a new authorized user to a company. + +Required permissions: + - `authorized_user:create` + - `member:email:read`
@@ -9309,10 +8728,10 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounties.create( - description="Record one continuous pass of a full interior detail, dash to trunk, on a customer vehicle.", - gross_reward_amount=40, - title="Record interior detailing passes", +client.authorized_users.create( + company_id="biz_xxxxxxxxxxxxxx", + role="owner", + user_id="user_xxxxxxxxxxxxx", ) ``` @@ -9329,7 +8748,7 @@ client.bounties.create(
-**description:** `str` — Full task instructions shown to workers. +**company_id:** `str` — The ID of the company to add the authorized user to.
@@ -9337,7 +8756,7 @@ client.bounties.create(
-**gross_reward_amount:** `float` — Gross bounty-pool amount (USD) escrowed per accepted submission, in whole dollars. Platform fees and affiliate shares are paid from this amount. +**role:** `GrantableAuthorizedUserRoles` — The role to assign to the authorized user within the company. Supported roles: 'moderator', 'sales_manager'.
@@ -9345,7 +8764,7 @@ client.bounties.create(
-**title:** `str` — Short name of the task shown to workers. +**user_id:** `str` — The ID of the user to add as an authorized user.
@@ -9353,7 +8772,7 @@ client.bounties.create(
-**accepted_submissions_limit:** `typing.Optional[int]` — Number of submissions that can be accepted (winner slots). Defaults to 1. The escrowed total is `gross_reward_amount` times this limit and must be at least $5. +**elevation:** `typing.Optional[CreateAuthorizedUsersRequestElevation]` — Re-authentication proof required to perform this sensitive action.
@@ -9361,7 +8780,7 @@ client.bounties.create(
-**accepted_submissions_per_user_limit:** `typing.Optional[int]` — How many winner slots one worker can win. Defaults to `1`. Wins plus proofs awaiting review never exceed this number, and a worker runs one attempt at a time. Cannot exceed `accepted_submissions_limit`. +**send_emails:** `typing.Optional[bool]` — Whether to send notification emails to the user on creation.
@@ -9369,63 +8788,76 @@ client.bounties.create(
-**account_id:** `typing.Optional[str]` — Account whose balance funds the bounty pool (`biz_` tag). Defaults to the caller's personal balance. Requires permission to move the account's funds. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**allowed_country_codes:** `typing.Optional[typing.List[str]]` — Countries whose residents can work the bounty, as ISO 3166 alpha-2 codes. Empty means worldwide. -
+
+
client.authorized_users.retrieve(...) -> AuthorizedUser
-**business_goal_type:** `typing.Optional[CreateBountiesRequestBusinessGoalType]` — What the poster wants the work to achieve, declared once here. - -
-
+#### 📝 Description
-**capture_spec:** `typing.Optional[CreateBountiesRequestCaptureSpec]` — Per-bounty overrides of the served capture contract. Only accepted when `business_goal_type` is `data_capture`; omitted fields keep the platform defaults, and the resulting contract is echoed back as `capture_spec` on the bounty. - -
-
-
-**experience_id:** `typing.Optional[str]` — Experience to host the bounty in (`exp_` tag). Any visibility — public for an open bounty, private for an invited one. Required unless account_id is set, in which case the bounty anchors in that account's public forum. - +Retrieves the details of an existing authorized user. + +Required permissions: + - `company:authorized_user:read` + - `member:email:read` +
+
+#### 🔌 Usage +
-**frequency:** `typing.Optional[CreateBountiesRequestFrequency]` — How often the schedule creates a new bounty. Each occurrence is a separate bounty. Defaults to `once`; only applies with `publish_at`. - -
-
-
-**publish_at:** `typing.Optional[str]` — ISO 8601 time to publish the bounty. When set, the bounty is created as a hidden draft and funded + published at this time instead of immediately. - +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.authorized_users.retrieve( + id="ausr_xxxxxxxxxxxxx", +) + +```
+ + + +#### ⚙️ Parameters
-**publish_at_timezone:** `typing.Optional[str]` — IANA timezone for recurring occurrences. Required when publish_at is set. +
+
+ +**id:** `str` — The unique identifier of the authorized user to retrieve.
@@ -9445,7 +8877,7 @@ client.bounties.create(
-
client.bounties.retrieve(...) -> Bounty +
client.authorized_users.delete(...) -> bool
@@ -9457,7 +8889,10 @@ client.bounties.create(
-Retrieves a bounty by ID. Authentication is optional: a request with no credential reads the bounty when it is publicly visible — published or completed, and not restricted to a private experience's members. Bounties outside the caller's scope, and bounties not publicly visible to an anonymous caller, return `404`. +Remove an authorized user from a company. + +Required permissions: + - `authorized_user:delete`
@@ -9480,8 +8915,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounties.retrieve( - id="id", +client.authorized_users.delete( + id="ausr_xxxxxxxxxxxxx", + company_id="biz_xxxxxxxxxxxxxx", ) ``` @@ -9498,7 +8934,15 @@ client.bounties.retrieve(
-**id:** `str` — Bounty ID (`bnty_` tag). +**id:** `str` — The ID of the authorized user or user to remove. + +
+
+ +
+
+ +**company_id:** `typing.Optional[str]` — The ID of the company the authorized user belongs to. Optional if the authorized user ID is provided.
@@ -9518,7 +8962,8 @@ client.bounties.retrieve(
-
client.bounties.update(...) -> Bounty +## Bounties +
client.bounties.list(...) -> ListBountiesResponse
@@ -9530,7 +8975,7 @@ client.bounties.retrieve(
-Updates a bounty. A published bounty accepts title, description, and country targeting while it is still open with nothing under review. A scheduled (not-yet-published) draft additionally accepts the reward, winner slots, and schedule. +Lists bounties visible to the credential — for an account API key, the account's bounties including scheduled drafts; for a user token, the bounties the user can see and work.
@@ -9553,9 +8998,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounties.update( - id="id", -) +client.bounties.list() ``` @@ -9571,7 +9014,7 @@ client.bounties.update(
-**id:** `str` — Bounty ID (`bnty_` tag). +**account_id:** `typing.Optional[str]` — Scope the list to this account (`biz_` tag). Requires read access to the account; account API keys may pass their own account or a connected account.
@@ -9579,7 +9022,7 @@ client.bounties.update(
-**accepted_submissions_limit:** `typing.Optional[int]` — Scheduled drafts only. Number of submissions that can be accepted (winner slots). +**user_id:** `typing.Optional[str]` — List the bounties this user participated in (`user_` tag). Must be the authenticated user.
@@ -9587,7 +9030,7 @@ client.bounties.update(
-**accepted_submissions_per_user_limit:** `typing.Optional[int]` — How many winner slots one worker can win. Defaults to `1`. Wins plus proofs awaiting review never exceed this number, and a worker runs one attempt at a time. Cannot exceed `accepted_submissions_limit`. Editable while the bounty is still open with nothing under review. +**status:** `typing.Optional[ListBountiesRequestStatus]` — Filter by lifecycle state.
@@ -9595,7 +9038,7 @@ client.bounties.update(
-**allowed_country_codes:** `typing.Optional[typing.List[str]]` — Replace the countries whose residents can work the bounty, as ISO 3166 alpha-2 codes. Empty means worldwide. +**business_goal_type:** `typing.Optional[ListBountiesRequestBusinessGoalType]` — Filter by the poster's declared goal. Bounties created before the goal taxonomy carry no goal and never match this filter.
@@ -9603,7 +9046,7 @@ client.bounties.update(
-**business_goal_type:** `typing.Optional[UpdateBountiesRequestBusinessGoalType]` — What the poster wants the work to achieve, declared once here. +**country:** `typing.Optional[str]` — Only bounties workable from this country, as an ISO 3166-1 alpha-2 code. Bounties with no country targeting are workable worldwide and always match.
@@ -9611,7 +9054,7 @@ client.bounties.update(
-**description:** `typing.Optional[str]` — New full task instructions. +**experience_id:** `typing.Optional[str]` — Only bounties posted to this forum experience, prefixed `exp_`. An unknown experience, or one outside the caller's scope, matches nothing.
@@ -9619,7 +9062,7 @@ client.bounties.update(
-**frequency:** `typing.Optional[UpdateBountiesRequestFrequency]` — Scheduled drafts only. How often the schedule creates a new bounty. +**query:** `typing.Optional[str]` — Substring match on the bounty title or ID.
@@ -9627,7 +9070,7 @@ client.bounties.update(
-**gross_reward_amount:** `typing.Optional[float]` — Scheduled drafts only. Gross bounty-pool amount (USD) escrowed per accepted submission. The escrowed total (this times accepted_submissions_limit) must stay at least $5. +**created_after:** `typing.Optional[str]` — Only bounties created after this ISO 8601 timestamp.
@@ -9635,7 +9078,7 @@ client.bounties.update(
-**publish_at:** `typing.Optional[str]` — Scheduled drafts only. New ISO 8601 time to publish the draft. Must be in the future. +**created_before:** `typing.Optional[str]` — Only bounties created before this ISO 8601 timestamp.
@@ -9643,7 +9086,7 @@ client.bounties.update(
-**publish_at_timezone:** `typing.Optional[str]` — Scheduled drafts only. IANA timezone for recurring occurrences. +**order:** `typing.Optional[ListBountiesRequestOrder]` — Sort field.
@@ -9651,7 +9094,7 @@ client.bounties.update(
-**title:** `typing.Optional[str]` — New short name of the task. +**direction:** `typing.Optional[ListBountiesRequestDirection]` — Sort direction.
@@ -9659,72 +9102,31 @@ client.bounties.update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**first:** `typing.Optional[int]` — Number of bounties to return from the start of the window.
- -
- - - - -
- -
client.bounties.cancel(...) -> Bounty -
-
- -#### 📝 Description
-
-
- -Cancels a bounty. With no in-flight work, it cancels immediately and refunds the funder. Otherwise it stops new submissions and cancels once the in-flight work resolves and pays out. Repeating the request is a no-op. A bounty that already paid out every slot returns `400`. -
-
+**after:** `typing.Optional[str]` — Cursor to paginate forwards from. +
-#### 🔌 Usage - -
-
-
-```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.bounties.cancel( - id="id", -) - -``` -
-
+**last:** `typing.Optional[int]` — Number of bounties to return from the end of the window. +
-#### ⚙️ Parameters -
-
-
- -**id:** `str` — Bounty ID (`bnty_` tag). +**before:** `typing.Optional[str]` — Cursor to paginate backwards from.
@@ -9744,8 +9146,7 @@ client.bounties.cancel(
-## Bounty Submissions -
client.bounty_submissions.list(...) -> ListBountySubmissionsResponse +
client.bounties.create(...) -> Bounty
@@ -9757,7 +9158,7 @@ client.bounties.cancel(
-Lists bounty submissions visible to the credential — for a user token, the submissions they authored plus those on bounties they posted; for an account API key, the submissions on the account's bounties. For the anonymous view of one bounty's reviewed work, use the submissions list under the bounty instead. +Creates a bounty and escrows its reward pool. Publishes immediately, or as a scheduled draft when you set `publish_at`.
@@ -9780,7 +9181,11 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounty_submissions.list() +client.bounties.create( + description="Record one continuous pass of a full interior detail, dash to trunk, on a customer vehicle.", + gross_reward_amount=40, + title="Record interior detailing passes", +) ``` @@ -9796,7 +9201,7 @@ client.bounty_submissions.list()
-**account_id:** `typing.Optional[str]` — Scope the list to submissions on this account's bounties (`biz_` tag). Requires read access to the account. +**description:** `str` — Full task instructions shown to workers.
@@ -9804,7 +9209,7 @@ client.bounty_submissions.list()
-**bounty_id:** `typing.Optional[str]` — Only submissions on this bounty (`bnty_` tag). +**gross_reward_amount:** `float` — Gross bounty-pool amount (USD) escrowed per accepted submission, in whole dollars. Platform fees and affiliate shares are paid from this amount.
@@ -9812,7 +9217,7 @@ client.bounty_submissions.list()
-**status:** `typing.Optional[ListBountySubmissionsRequestStatus]` — Filter by lifecycle state. +**title:** `str` — Short name of the task shown to workers.
@@ -9820,7 +9225,7 @@ client.bounty_submissions.list()
-**created_after:** `typing.Optional[str]` — Only submissions created after this ISO 8601 timestamp. +**accepted_submissions_limit:** `typing.Optional[int]` — Number of submissions that can be accepted (winner slots). Defaults to 1. The escrowed total is `gross_reward_amount` times this limit and must be at least $5.
@@ -9828,7 +9233,7 @@ client.bounty_submissions.list()
-**created_before:** `typing.Optional[str]` — Only submissions created before this ISO 8601 timestamp. +**accepted_submissions_per_user_limit:** `typing.Optional[int]` — How many winner slots one worker can win. Defaults to `1`. Wins plus proofs awaiting review never exceed this number, and a worker runs one attempt at a time. Cannot exceed `accepted_submissions_limit`.
@@ -9836,7 +9241,7 @@ client.bounty_submissions.list()
-**order:** `typing.Optional[ListBountySubmissionsRequestOrder]` — Sort field. +**account_id:** `typing.Optional[str]` — Account whose balance funds the bounty pool (`biz_` tag). Defaults to the caller's personal balance. Requires permission to move the account's funds.
@@ -9844,7 +9249,7 @@ client.bounty_submissions.list()
-**direction:** `typing.Optional[ListBountySubmissionsRequestDirection]` — Sort direction. +**allowed_country_codes:** `typing.Optional[typing.List[str]]` — Countries whose residents can work the bounty, as ISO 3166 alpha-2 codes. Empty means worldwide.
@@ -9852,7 +9257,7 @@ client.bounty_submissions.list()
-**first:** `typing.Optional[int]` — Number of submissions to return from the start of the window. +**business_goal_type:** `typing.Optional[CreateBountiesRequestBusinessGoalType]` — What the poster wants the work to achieve, declared once here.
@@ -9860,7 +9265,7 @@ client.bounty_submissions.list()
-**after:** `typing.Optional[str]` — Cursor to paginate forwards from. +**capture_spec:** `typing.Optional[CreateBountiesRequestCaptureSpec]` — Per-bounty overrides of the served capture contract. Only accepted when `business_goal_type` is `data_capture`; omitted fields keep the platform defaults, and the resulting contract is echoed back as `capture_spec` on the bounty.
@@ -9868,7 +9273,7 @@ client.bounty_submissions.list()
-**last:** `typing.Optional[int]` — Number of submissions to return from the end of the window. +**experience_id:** `typing.Optional[str]` — Experience to host the bounty in (`exp_` tag). Any visibility — public for an open bounty, private for an invited one. Required unless account_id is set, in which case the bounty anchors in that account's public forum.
@@ -9876,7 +9281,23 @@ client.bounty_submissions.list()
-**before:** `typing.Optional[str]` — Cursor to paginate backwards from. +**frequency:** `typing.Optional[CreateBountiesRequestFrequency]` — How often the schedule creates a new bounty. Each occurrence is a separate bounty. Defaults to `once`; only applies with `publish_at`. + +
+
+ +
+
+ +**publish_at:** `typing.Optional[str]` — ISO 8601 time to publish the bounty. When set, the bounty is created as a hidden draft and funded + published at this time instead of immediately. + +
+
+ +
+
+ +**publish_at_timezone:** `typing.Optional[str]` — IANA timezone for recurring occurrences. Required when publish_at is set.
@@ -9896,7 +9317,7 @@ client.bounty_submissions.list()
-
client.bounty_submissions.create(...) -> BountySubmission +
client.bounties.retrieve(...) -> Bounty
@@ -9908,7 +9329,7 @@ client.bounty_submissions.list()
-Creates a submission on a workforce bounty. Include a `deliverable` payload — any combination of links and uploaded files, with at least one of the two — and the submission goes straight to review; create is the only step. For `data_capture` bounties, omit the deliverable: this starts a claimed attempt whose proof accumulates server-side, and the separate submit endpoint sends it to review once complete. Requires a user credential — account API keys cannot author submissions. +Retrieves a bounty by ID. Authentication is optional: a request with no credential reads the bounty when it is publicly visible — published or completed, and not restricted to a private experience's members. Bounties outside the caller's scope, and bounties not publicly visible to an anonymous caller, return `404`.
@@ -9931,8 +9352,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounty_submissions.create( - bounty_id="bnty_xxxxxxxxxxxxxx", +client.bounties.retrieve( + id="id", ) ``` @@ -9949,31 +9370,7 @@ client.bounty_submissions.create(
-**bounty_id:** `str` — The bounty to submit to (`bnty_` tag). - -
-
- -
-
- -**affiliate_code:** `typing.Optional[str]` — Affiliate code crediting the referrer, when the worker arrived through one. - -
-
- -
-
- -**deliverable:** `typing.Optional[CreateBountySubmissionsRequestDeliverable]` — The submitted work. Combine `urls`, `file_ids`, and `caption` freely; at least one link or file is required. - -
-
- -
-
- -**metadata:** `typing.Optional[CreateBountySubmissionsRequestMetadata]` — Optional capture metadata describing where and how the footage was recorded. Persisted on the submission. On a `data_capture` bounty every field except `fov` is required whenever metadata is provided. +**id:** `str` — Bounty ID (`bnty_` tag).
@@ -9993,7 +9390,7 @@ client.bounty_submissions.create(
-
client.bounty_submissions.retrieve(...) -> BountySubmission +
client.bounties.update(...) -> Bounty
@@ -10005,7 +9402,7 @@ client.bounty_submissions.create(
-Retrieves one bounty submission the credential can see — one the caller authored, or one on a bounty they posted or their account owns. Reading another member's work on an account's bounty takes `account_id`, the same way the list does. +Updates a bounty. A published bounty accepts title, description, and country targeting while it is still open with nothing under review. A scheduled (not-yet-published) draft additionally accepts the reward, winner slots, and schedule.
@@ -10028,7 +9425,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounty_submissions.retrieve( +client.bounties.update( id="id", ) @@ -10046,7 +9443,7 @@ client.bounty_submissions.retrieve(
-**id:** `str` — The bounty submission to act on (`btys_` tag). +**id:** `str` — Bounty ID (`bnty_` tag).
@@ -10054,7 +9451,7 @@ client.bounty_submissions.retrieve(
-**account_id:** `typing.Optional[str]` — Read the submission as this account (`biz_` tag), scoping the lookup to its bounties rather than the caller's own work. Requires read access to the account. Without it the lookup covers only what the credential owns — the submissions the caller authored plus those on bounties they posted. +**accepted_submissions_limit:** `typing.Optional[int]` — Scheduled drafts only. Number of submissions that can be accepted (winner slots).
@@ -10062,72 +9459,71 @@ client.bounty_submissions.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**accepted_submissions_per_user_limit:** `typing.Optional[int]` — How many winner slots one worker can win. Defaults to `1`. Wins plus proofs awaiting review never exceed this number, and a worker runs one attempt at a time. Cannot exceed `accepted_submissions_limit`. Editable while the bounty is still open with nothing under review.
- -
+
+
+**allowed_country_codes:** `typing.Optional[typing.List[str]]` — Replace the countries whose residents can work the bounty, as ISO 3166 alpha-2 codes. Empty means worldwide. +
-
-
client.bounty_submissions.delete(...) -> DeleteBountySubmissionsResponse
-#### 📝 Description +**business_goal_type:** `typing.Optional[UpdateBountiesRequestBusinessGoalType]` — What the poster wants the work to achieve, declared once here. + +
+
+**description:** `typing.Optional[str]` — New full task instructions. + +
+
+
-Cancels the caller's own active attempt on a bounty and discards any accumulated capture clips. Only the worker who started the attempt can cancel it — account API keys cannot. -
-
+**frequency:** `typing.Optional[UpdateBountiesRequestFrequency]` — Scheduled drafts only. How often the schedule creates a new bounty. + -#### 🔌 Usage -
+**gross_reward_amount:** `typing.Optional[float]` — Scheduled drafts only. Gross bounty-pool amount (USD) escrowed per accepted submission. The escrowed total (this times accepted_submissions_limit) must stay at least $5. + +
+
+
-```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.bounty_submissions.delete( - id="id", -) - -``` -
-
+**publish_at:** `typing.Optional[str]` — Scheduled drafts only. New ISO 8601 time to publish the draft. Must be in the future. + -#### ⚙️ Parameters -
+**publish_at_timezone:** `typing.Optional[str]` — Scheduled drafts only. IANA timezone for recurring occurrences. + +
+
+
-**id:** `str` — The bounty submission to act on (`btys_` tag). +**title:** `typing.Optional[str]` — New short name of the task.
@@ -10147,7 +9543,7 @@ client.bounty_submissions.delete(
-
client.bounty_submissions.submit(...) -> BountySubmission +
client.bounties.cancel(...) -> Bounty
@@ -10159,7 +9555,7 @@ client.bounty_submissions.delete(
-Submits a claimed attempt for review. A livestream attempt needs an ended proof stream and can attach an optional `deliverable` — links, files, and a caption in any combination; if the attempt already went to review when its stream ended, the payload attaches to it once, until reviewers start voting. A data capture attempt instead needs enough validated clip time and takes no payload. Only the worker who started the attempt can submit it — account API keys cannot. +Cancels a bounty. With no in-flight work, it cancels immediately and refunds the funder. Otherwise it stops new submissions and cancels once the in-flight work resolves and pays out. Repeating the request is a no-op. A bounty that already paid out every slot returns `400`.
@@ -10182,7 +9578,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.bounty_submissions.submit( +client.bounties.cancel( id="id", ) @@ -10200,15 +9596,7 @@ client.bounty_submissions.submit(
-**id:** `str` — The claimed attempt to submit for review (`btys_` tag). - -
-
- -
-
- -**deliverable:** `typing.Optional[SubmitBountySubmissionsRequestDeliverable]` — Work to attach to the submission. Combine `urls`, `file_ids`, and `caption` freely; all are optional. +**id:** `str` — Bounty ID (`bnty_` tag).
@@ -10228,8 +9616,8 @@ client.bounty_submissions.submit(
-## CardTransactions -
client.card_transactions.list(...) -> ListCardTransactionsResponse +## Bounty Submissions +
client.bounty_submissions.list(...) -> ListBountySubmissionsResponse
@@ -10241,7 +9629,7 @@ client.bounty_submissions.submit(
-Lists an account's card transactions, newest first. Defaults to the account the credential belongs to. Covers every card the owner has ever had, including canceled cards and spend that predates a re-application, and team members only see transactions on the cards assigned to them. Pass `transaction_ids` to fetch specific transactions instead of paging for them. +Lists bounty submissions visible to the credential — for a user token, the submissions they authored plus those on bounties they posted; for an account API key, the submissions on the account's bounties. For the anonymous view of one bounty's reviewed work, use the submissions list under the bounty instead.
@@ -10264,17 +9652,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.card_transactions.list( - transaction_ids=[ - "citx_xxxxxxxxxxxxxx" - ], - card_id=[ - "icrd_xxxxxxxxxxxxxx" - ], - cardholder_id=[ - "user_xxxxxxxxxxxxxx" - ], -) +client.bounty_submissions.list() ``` @@ -10290,47 +9668,7 @@ client.card_transactions.list(
-**account_id:** `typing.Optional[str]` — The account whose card transactions to list, prefixed `biz_`. Defaults to the credential's account. - -
-
- -
-
- -**transaction_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Return only these card transactions, each prefixed `citx_`. Repeat the parameter, or pass one comma-separated value. - -
-
- -
-
- -**card_id:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Return only transactions charged to these cards, each prefixed `icrd_`. - -
-
- -
-
- -**cardholder_id:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Return only transactions on cards assigned to these users, each prefixed `user_`. - -
-
- -
-
- -**status:** `typing.Optional[ListCardTransactionsRequestStatus]` — Return only transactions with this status. - -
-
- -
-
- -**created_after:** `typing.Optional[str]` — Return only transactions authorized at or after this ISO 8601 timestamp. +**account_id:** `typing.Optional[str]` — Scope the list to submissions on this account's bounties (`biz_` tag). Requires read access to the account.
@@ -10338,7 +9676,7 @@ client.card_transactions.list(
-**created_before:** `typing.Optional[str]` — Return only transactions authorized at or before this ISO 8601 timestamp. +**bounty_id:** `typing.Optional[str]` — Only submissions on this bounty (`bnty_` tag).
@@ -10346,7 +9684,7 @@ client.card_transactions.list(
-**order:** `typing.Optional[ListCardTransactionsRequestOrder]` — The field to sort by. Defaults to `created_at`. +**status:** `typing.Optional[ListBountySubmissionsRequestStatus]` — Filter by lifecycle state.
@@ -10354,7 +9692,7 @@ client.card_transactions.list(
-**direction:** `typing.Optional[ListCardTransactionsRequestDirection]` — The sort direction. Defaults to `desc`. +**created_after:** `typing.Optional[str]` — Only submissions created after this ISO 8601 timestamp.
@@ -10362,7 +9700,7 @@ client.card_transactions.list(
-**first:** `typing.Optional[int]` — The number of card transactions to return. +**created_before:** `typing.Optional[str]` — Only submissions created before this ISO 8601 timestamp.
@@ -10370,7 +9708,7 @@ client.card_transactions.list(
-**after:** `typing.Optional[str]` — A cursor; returns card transactions after this position. +**order:** `typing.Optional[ListBountySubmissionsRequestOrder]` — Sort field.
@@ -10378,7 +9716,7 @@ client.card_transactions.list(
-**last:** `typing.Optional[int]` — The number of card transactions to return, counting back from the end. +**direction:** `typing.Optional[ListBountySubmissionsRequestDirection]` — Sort direction.
@@ -10386,7 +9724,7 @@ client.card_transactions.list(
-**before:** `typing.Optional[str]` — A cursor; returns card transactions before this position. +**first:** `typing.Optional[int]` — Number of submissions to return from the start of the window.
@@ -10394,72 +9732,15 @@ client.card_transactions.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**after:** `typing.Optional[str]` — Cursor to paginate forwards from.
- -
- - - - -
- -
client.card_transactions.retrieve(...) -> CardTransaction -
-
- -#### 📝 Description - -
-
- -
-
- -Fetches a single card transaction by its `citx_` identifier. The owner defaults to the account the credential belongs to. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.card_transactions.retrieve( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
-**id:** `str` — The card transaction ID, prefixed `citx_`. +**last:** `typing.Optional[int]` — Number of submissions to return from the end of the window.
@@ -10467,7 +9748,7 @@ client.card_transactions.retrieve(
-**account_id:** `typing.Optional[str]` — The account that owns the transaction, prefixed `biz_`. Defaults to the credential's account. +**before:** `typing.Optional[str]` — Cursor to paginate backwards from.
@@ -10487,8 +9768,7 @@ client.card_transactions.retrieve(
-## Cards -
client.cards.list(...) -> ListCardsResponse +
client.bounty_submissions.create(...) -> BountySubmission
@@ -10500,7 +9780,7 @@ client.card_transactions.retrieve(
-Lists the Whop cards of an account or user, including ones still being set up. Team members only see the cards assigned to them. +Creates a submission on a workforce bounty. Include a `deliverable` payload — any combination of links and uploaded files, with at least one of the two — and the submission goes straight to review; create is the only step. For `data_capture` bounties, omit the deliverable: this starts a claimed attempt whose proof accumulates server-side, and the separate submit endpoint sends it to review once complete. Requires a user credential — account API keys cannot author submissions.
@@ -10523,7 +9803,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.cards.list() +client.bounty_submissions.create( + bounty_id="bnty_xxxxxxxxxxxxxx", +) ``` @@ -10539,7 +9821,7 @@ client.cards.list()
-**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id. +**bounty_id:** `str` — The bounty to submit to (`bnty_` tag).
@@ -10547,7 +9829,23 @@ client.cards.list()
-**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id. +**affiliate_code:** `typing.Optional[str]` — Affiliate code crediting the referrer, when the worker arrived through one. + +
+
+ +
+
+ +**deliverable:** `typing.Optional[CreateBountySubmissionsRequestDeliverable]` — The submitted work. Combine `urls`, `file_ids`, and `caption` freely; at least one link or file is required. + +
+
+ +
+
+ +**metadata:** `typing.Optional[CreateBountySubmissionsRequestMetadata]` — Optional capture metadata describing where and how the footage was recorded. Persisted on the submission. On a `data_capture` bounty every field except `fov` is required whenever metadata is provided.
@@ -10567,7 +9865,7 @@ client.cards.list()
-
client.cards.create(...) -> CreateCardsResponse +
client.bounty_submissions.retrieve(...) -> BountySubmission
@@ -10579,7 +9877,7 @@ client.cards.list()
-Issue a virtual card, or apply for card issuing. An account with no application files one here and gets back a `202`; call again to issue the card once it is approved. +Retrieves one bounty submission the credential can see — one the caller authored, or one on a bounty they posted or their account owns. Reading another member's work on an account's bounty takes `account_id`, the same way the list does.
@@ -10602,7 +9900,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.cards.create() +client.bounty_submissions.retrieve( + id="id", +) ``` @@ -10618,7 +9918,7 @@ client.cards.create()
-**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id. +**id:** `str` — The bounty submission to act on (`btys_` tag).
@@ -10626,7 +9926,7 @@ client.cards.create()
-**assigned_user_id:** `typing.Optional[str]` — The account member (a user_ identifier) to assign the card to. Required for business card issuing accounts, and whenever a company API key files an account's first card application. +**account_id:** `typing.Optional[str]` — Read the submission as this account (`biz_` tag), scoping the lookup to its bounties rather than the caller's own work. Requires read access to the account. Without it the lookup covers only what the credential owns — the submissions the caller authored plus those on bounties they posted.
@@ -10634,39 +9934,72 @@ client.cards.create()
-**name:** `typing.Optional[str]` — A display name for the card. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**spend_limit:** `typing.Optional[float]` — Spending limit amount, in dollars. -
+
+
client.bounty_submissions.delete(...) -> DeleteBountySubmissionsResponse
-**spend_limit_frequency:** `typing.Optional[CreateCardsRequestSpendLimitFrequency]` — The window the spend limit applies to. - +#### 📝 Description + +
+
+ +
+
+ +Cancels the caller's own active attempt on a bounty and discards any accumulated capture clips. Only the worker who started the attempt can cancel it — account API keys cannot.
+
+
+ +#### 🔌 Usage
-**transaction_limit:** `typing.Optional[float]` — Per-transaction limit amount, in dollars. - +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.bounty_submissions.delete( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id. +
+
+ +**id:** `str` — The bounty submission to act on (`btys_` tag).
@@ -10686,7 +10019,7 @@ client.cards.create()
-
client.cards.retrieve(...) -> RetrieveCardsResponse +
client.bounty_submissions.submit(...) -> BountySubmission
@@ -10698,7 +10031,7 @@ client.cards.create()
-Retrieve a single card. +Submits a claimed attempt for review. A livestream attempt needs an ended proof stream and can attach an optional `deliverable` — links, files, and a caption in any combination; if the attempt already went to review when its stream ended, the payload attaches to it once, until reviewers start voting. A data capture attempt instead needs enough validated clip time and takes no payload. Only the worker who started the attempt can submit it — account API keys cannot.
@@ -10721,7 +10054,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.cards.retrieve( +client.bounty_submissions.submit( id="id", ) @@ -10739,15 +10072,7 @@ client.cards.retrieve(
-**id:** `str` — Card ID to retrieve, prefixed `icrd_`. - -
-
- -
-
- -**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id. +**id:** `str` — The claimed attempt to submit for review (`btys_` tag).
@@ -10755,7 +10080,7 @@ client.cards.retrieve(
-**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id. +**deliverable:** `typing.Optional[SubmitBountySubmissionsRequestDeliverable]` — Work to attach to the submission. Combine `urls`, `file_ids`, and `caption` freely; all are optional.
@@ -10775,7 +10100,8 @@ client.cards.retrieve(
-
client.cards.update(...) -> UpdateCardsResponse +## CardTransactions +
client.card_transactions.list(...) -> ListCardTransactionsResponse
@@ -10787,7 +10113,7 @@ client.cards.retrieve(
-Update, freeze, or cancel a card. Updating the card's name, billing address, or limits requires both `payout:account:update` and `company:balance:read`; a card's assigned holder may update their own card's pin and frozen state with any user token. +Lists an account's card transactions, newest first. Defaults to the account the credential belongs to. Covers every card the owner has ever had, including canceled cards and spend that predates a re-application, and team members only see transactions on the cards assigned to them. Pass `transaction_ids` to fetch specific transactions instead of paging for them.
@@ -10810,8 +10136,16 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.cards.update( - id="id", +client.card_transactions.list( + transaction_ids=[ + "citx_xxxxxxxxxxxxxx" + ], + card_id=[ + "icrd_xxxxxxxxxxxxxx" + ], + cardholder_id=[ + "user_xxxxxxxxxxxxxx" + ], ) ``` @@ -10828,7 +10162,7 @@ client.cards.update(
-**id:** `str` — Card ID to retrieve, prefixed `icrd_`. +**account_id:** `typing.Optional[str]` — The account whose card transactions to list, prefixed `biz_`. Defaults to the credential's account.
@@ -10836,7 +10170,7 @@ client.cards.update(
-**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id. +**transaction_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Return only these card transactions, each prefixed `citx_`. Repeat the parameter, or pass one comma-separated value.
@@ -10844,7 +10178,7 @@ client.cards.update(
-**billing:** `typing.Optional[UpdateCardsRequestBilling]` — New billing address. Requires line1, city, region, postal_code, and country_code. On an invited card, passing billing alone (as the invited user) completes onboarding and starts card provisioning. +**card_id:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Return only transactions charged to these cards, each prefixed `icrd_`.
@@ -10852,7 +10186,7 @@ client.cards.update(
-**canceled:** `typing.Optional[bool]` — Pass `true` to permanently cancel the card. A canceled card cannot be uncanceled. Cannot be combined with other fields. +**cardholder_id:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Return only transactions on cards assigned to these users, each prefixed `user_`.
@@ -10860,7 +10194,7 @@ client.cards.update(
-**frozen:** `typing.Optional[bool]` — Pass `true` to freeze the card, `false` to unfreeze it. The assigned cardholder may freeze their own card without the payout:account:update scope. +**status:** `typing.Optional[ListCardTransactionsRequestStatus]` — Return only transactions with this status.
@@ -10868,7 +10202,7 @@ client.cards.update(
-**name:** `typing.Optional[str]` — A display name for the card. +**created_after:** `typing.Optional[str]` — Return only transactions authorized at or after this ISO 8601 timestamp.
@@ -10876,7 +10210,7 @@ client.cards.update(
-**pin:** `typing.Optional[str]` — New 4-digit PIN. Can only be set on a card assigned to the acting user, who may set it without the payout:account:update scope. +**created_before:** `typing.Optional[str]` — Return only transactions authorized at or before this ISO 8601 timestamp.
@@ -10884,7 +10218,7 @@ client.cards.update(
-**remove_limit:** `typing.Optional[bool]` — Pass `true` to remove the spending limit (make the card unlimited). +**order:** `typing.Optional[ListCardTransactionsRequestOrder]` — The field to sort by. Defaults to `created_at`.
@@ -10892,7 +10226,7 @@ client.cards.update(
-**spend_limit:** `typing.Optional[float]` — Spending limit amount, in dollars. +**direction:** `typing.Optional[ListCardTransactionsRequestDirection]` — The sort direction. Defaults to `desc`.
@@ -10900,7 +10234,7 @@ client.cards.update(
-**spend_limit_frequency:** `typing.Optional[UpdateCardsRequestSpendLimitFrequency]` — The window the spend limit applies to. +**first:** `typing.Optional[int]` — The number of card transactions to return.
@@ -10908,7 +10242,7 @@ client.cards.update(
-**transaction_limit:** `typing.Optional[float]` — Per-transaction limit amount, in dollars. +**after:** `typing.Optional[str]` — A cursor; returns card transactions after this position.
@@ -10916,7 +10250,15 @@ client.cards.update(
-**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id. +**last:** `typing.Optional[int]` — The number of card transactions to return, counting back from the end. + +
+
+ +
+
+ +**before:** `typing.Optional[str]` — A cursor; returns card transactions before this position.
@@ -10936,8 +10278,7 @@ client.cards.update(
-## ChatChannels -
client.chat_channels.list(...) -> ListChatChannelsResponse +
client.card_transactions.retrieve(...) -> CardTransaction
@@ -10949,10 +10290,7 @@ client.cards.update(
-Returns a paginated list of chat channels within a specific company, with optional filtering by product. - -Required permissions: - - `chat:read` +Fetches a single card transaction by its `citx_` identifier. The owner defaults to the account the credential belongs to.
@@ -10975,11 +10313,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.chat_channels.list( - first=42, - last=42, - company_id="biz_xxxxxxxxxxxxxx", - product_id="prod_xxxxxxxxxxxxx", +client.card_transactions.retrieve( + id="id", ) ``` @@ -10996,39 +10331,7 @@ client.chat_channels.list(
-**company_id:** `str` — The unique identifier of the company to list chat channels for. - -
-
- -
-
- -**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. - -
-
- -
-
- -**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. - -
-
- -
-
- -**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. - -
-
- -
-
- -**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +**id:** `str` — The card transaction ID, prefixed `citx_`.
@@ -11036,7 +10339,7 @@ client.chat_channels.list(
-**product_id:** `typing.Optional[str]` — The unique identifier of a product to filter by. When set, only chat channels connected to this product are returned. +**account_id:** `typing.Optional[str]` — The account that owns the transaction, prefixed `biz_`. Defaults to the credential's account.
@@ -11056,7 +10359,8 @@ client.chat_channels.list(
-
client.chat_channels.retrieve(...) -> ChatChannel +## Cards +
client.cards.list(...) -> ListCardsResponse
@@ -11068,10 +10372,7 @@ client.chat_channels.list(
-Retrieves the details of an existing chat channel. - -Required permissions: - - `chat:read` +Lists the Whop cards of an account or user, including ones still being set up. Team members only see the cards assigned to them.
@@ -11094,9 +10395,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.chat_channels.retrieve( - id="id", -) +client.cards.list() ``` @@ -11112,7 +10411,15 @@ client.chat_channels.retrieve(
-**id:** `str` — The unique identifier of the chat channel or experience to retrieve. +**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id. + +
+
+ +
+
+ +**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id.
@@ -11132,7 +10439,7 @@ client.chat_channels.retrieve(
-
client.chat_channels.update(...) -> ChatChannel +
client.cards.create(...) -> CreateCardsResponse
@@ -11144,10 +10451,7 @@ client.chat_channels.retrieve(
-Update moderation settings for a chat channel, such as who can post, banned words, and media restrictions. - -Required permissions: - - `chat:moderate` +Issue a virtual card, or apply for card issuing. An account with no application files one here and gets back a `202`; call again to issue the card once it is approved.
@@ -11170,9 +10474,7 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.chat_channels.update( - id="id", -) +client.cards.create() ``` @@ -11188,7 +10490,7 @@ client.chat_channels.update(
-**id:** `str` — The unique identifier of the chat channel to update. Accepts either an experience ID (e.g. 'exp_xxxxx') or a chat channel ID. +**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id.
@@ -11196,7 +10498,7 @@ client.chat_channels.update(
-**ban_media:** `typing.Optional[bool]` — Whether media uploads such as images and videos are banned in this chat channel. +**assigned_user_id:** `typing.Optional[str]` — The account member (a user_ identifier) to assign the card to. Required for business card issuing accounts, and whenever a company API key files an account's first card application.
@@ -11204,7 +10506,7 @@ client.chat_channels.update(
-**ban_urls:** `typing.Optional[bool]` — Whether URLs and links are banned from being posted in this chat channel. +**name:** `typing.Optional[str]` — A display name for the card.
@@ -11212,7 +10514,7 @@ client.chat_channels.update(
-**banned_words:** `typing.Optional[typing.List[str]]` — A list of words that are automatically blocked from messages in this chat channel. For example, ['spam', 'scam']. +**spend_limit:** `typing.Optional[float]` — Spending limit amount, in dollars.
@@ -11220,7 +10522,7 @@ client.chat_channels.update(
-**user_posts_cooldown_seconds:** `typing.Optional[int]` — The minimum number of seconds a user must wait between sending messages in this chat channel. +**spend_limit_frequency:** `typing.Optional[CreateCardsRequestSpendLimitFrequency]` — The window the spend limit applies to.
@@ -11228,7 +10530,7 @@ client.chat_channels.update(
-**who_can_post:** `typing.Optional[WhoCanPostTypes]` — Controls which roles are allowed to send messages in this chat channel. +**transaction_limit:** `typing.Optional[float]` — Per-transaction limit amount, in dollars.
@@ -11236,7 +10538,7 @@ client.chat_channels.update(
-**who_can_react:** `typing.Optional[WhoCanReactTypes]` — Controls which roles are allowed to add reactions to messages in this chat channel. +**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id.
@@ -11256,8 +10558,7 @@ client.chat_channels.update(
-## Checkout Configurations -
client.checkout_configurations.list(...) -> ListCheckoutConfigurationsResponse +
client.cards.retrieve(...) -> RetrieveCardsResponse
@@ -11269,7 +10570,7 @@ client.chat_channels.update(
-Lists checkout configurations for an account. +Retrieve a single card.
@@ -11292,8 +10593,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.checkout_configurations.list( - account_id="account_id", +client.cards.retrieve( + id="id", ) ``` @@ -11310,47 +10611,7 @@ client.checkout_configurations.list(
-**account_id:** `str` — Account ID, prefixed `biz_`. - -
-
- -
-
- -**plan_id:** `typing.Optional[str]` — Only return checkout configurations for this plan ID, prefixed `plan_`. - -
-
- -
-
- -**created_before:** `typing.Optional[str]` — Only return checkout configurations created before this ISO 8601 timestamp. - -
-
- -
-
- -**created_after:** `typing.Optional[str]` — Only return checkout configurations created after this ISO 8601 timestamp. - -
-
- -
-
- -**order:** `typing.Optional[ListCheckoutConfigurationsRequestOrder]` — Field used to sort checkout configurations. - -
-
- -
-
- -**direction:** `typing.Optional[ListCheckoutConfigurationsRequestDirection]` — Sort direction. Defaults to `desc`. +**id:** `str` — Card ID to retrieve, prefixed `icrd_`.
@@ -11358,7 +10619,7 @@ client.checkout_configurations.list(
-**first:** `typing.Optional[int]` — Number of checkout configurations to return. +**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id.
@@ -11366,7 +10627,7 @@ client.checkout_configurations.list(
-**after:** `typing.Optional[str]` — Cursor for the next page of results. +**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id.
@@ -11386,7 +10647,7 @@ client.checkout_configurations.list(
-
client.checkout_configurations.create(...) -> CreateCheckoutConfigurationsResponse +
client.cards.update(...) -> UpdateCardsResponse
@@ -11398,7 +10659,7 @@ client.checkout_configurations.list(
-Creates a reusable checkout configuration for an existing or inline plan. +Update, freeze, or cancel a card. Updating the card's name, billing address, or limits requires both `payout:account:update` and `company:balance:read`; a card's assigned holder may update their own card's pin and frozen state with any user token.
@@ -11421,9 +10682,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.checkout_configurations.create( - account_id="biz_xxxxxxxxxxxxxx", - plan_id="plan_xxxxxxxxxxxxx", +client.cards.update( + id="id", ) ``` @@ -11440,7 +10700,7 @@ client.checkout_configurations.create(
-**account_id:** `typing.Optional[str]` — Account ID, prefixed `biz_`. +**id:** `str` — Card ID to retrieve, prefixed `icrd_`.
@@ -11448,7 +10708,7 @@ client.checkout_configurations.create(
-**affiliate_code:** `typing.Optional[str]` — Affiliate code to apply to the checkout. +**account_id:** `typing.Optional[str]` — The owning account ID (a biz_ identifier). Provide this or user_id.
@@ -11456,7 +10716,7 @@ client.checkout_configurations.create(
-**currency:** `typing.Optional[str]` — Currency used for setup-mode payment method availability. +**billing:** `typing.Optional[UpdateCardsRequestBilling]` — New billing address. Requires line1, city, region, postal_code, and country_code. On an invited card, passing billing alone (as the invited user) completes onboarding and starts card provisioning.
@@ -11464,7 +10724,7 @@ client.checkout_configurations.create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` — Custom key-value metadata copied to payments and memberships. +**canceled:** `typing.Optional[bool]` — Pass `true` to permanently cancel the card. A canceled card cannot be uncanceled. Cannot be combined with other fields.
@@ -11472,7 +10732,7 @@ client.checkout_configurations.create(
-**mode:** `typing.Optional[CreateCheckoutConfigurationsRequestMode]` — Controls whether checkout charges the buyer immediately or saves payment details for later. Defaults to `payment`. +**frozen:** `typing.Optional[bool]` — Pass `true` to freeze the card, `false` to unfreeze it. The assigned cardholder may freeze their own card without the payout:account:update scope.
@@ -11480,7 +10740,7 @@ client.checkout_configurations.create(
-**payment_method_configuration:** `typing.Optional[CreateCheckoutConfigurationsRequestPaymentMethodConfiguration]` — Payment method overrides for this checkout. `null` uses the plan or platform defaults. +**name:** `typing.Optional[str]` — A display name for the card.
@@ -11488,7 +10748,7 @@ client.checkout_configurations.create(
-**plan:** `typing.Optional[CreateCheckoutConfigurationsRequestPlan]` — Plan attributes used to create or find a plan for this checkout configuration. Mutually exclusive with `plan_id`. +**pin:** `typing.Optional[str]` — New 4-digit PIN. Can only be set on a card assigned to the acting user, who may set it without the payout:account:update scope.
@@ -11496,7 +10756,7 @@ client.checkout_configurations.create(
-**plan_id:** `typing.Optional[str]` — Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`. +**remove_limit:** `typing.Optional[bool]` — Pass `true` to remove the spending limit (make the card unlimited).
@@ -11504,7 +10764,7 @@ client.checkout_configurations.create(
-**redirect_url:** `typing.Optional[str]` — URL customers are sent to after checkout. +**spend_limit:** `typing.Optional[float]` — Spending limit amount, in dollars.
@@ -11512,7 +10772,23 @@ client.checkout_configurations.create(
-**three_ds_level:** `typing.Optional[CreateCheckoutConfigurationsRequestThreeDsLevel]` — 3D Secure behavior for this checkout. +**spend_limit_frequency:** `typing.Optional[UpdateCardsRequestSpendLimitFrequency]` — The window the spend limit applies to. + +
+
+ +
+
+ +**transaction_limit:** `typing.Optional[float]` — Per-transaction limit amount, in dollars. + +
+
+ +
+
+ +**user_id:** `typing.Optional[str]` — The owning user ID (a user_ identifier). Provide this or account_id.
@@ -11532,7 +10808,8 @@ client.checkout_configurations.create(
-
client.checkout_configurations.retrieve(...) -> RetrieveCheckoutConfigurationsResponse +## ChatChannels +
client.chat_channels.list(...) -> ListChatChannelsResponse
@@ -11544,7 +10821,10 @@ client.checkout_configurations.create(
-Retrieves a checkout configuration by ID. This endpoint is public so a checkout page can load from the configuration URL. +Returns a paginated list of chat channels within a specific company, with optional filtering by product. + +Required permissions: + - `chat:read`
@@ -11567,8 +10847,11 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.checkout_configurations.retrieve( - id="id", +client.chat_channels.list( + first=42, + last=42, + company_id="biz_xxxxxxxxxxxxxx", + product_id="prod_xxxxxxxxxxxxx", ) ``` @@ -11585,7 +10868,7 @@ client.checkout_configurations.retrieve(
-**id:** `str` — The ID of the checkout configuration. +**company_id:** `str` — The unique identifier of the company to list chat channels for.
@@ -11593,72 +10876,39 @@ client.checkout_configurations.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor.
- -
- - - - -
-
client.checkout_configurations.delete(...) -> DeleteCheckoutConfigurationsResponse
-#### 📝 Description - -
-
+**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. + +
+
-Deletes a checkout configuration so its checkout URL can no longer be used. -
-
+**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. +
-#### 🔌 Usage -
-
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.checkout_configurations.delete( - id="id", -) - -``` -
-
+**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +
-#### ⚙️ Parameters -
-
-
- -**id:** `str` — The ID of the checkout configuration. +**product_id:** `typing.Optional[str]` — The unique identifier of a product to filter by. When set, only chat channels connected to this product are returned.
@@ -11678,8 +10928,7 @@ client.checkout_configurations.delete(
-## Companies -
client.companies.list(...) -> ListCompaniesResponse +
client.chat_channels.retrieve(...) -> ChatChannel
@@ -11691,10 +10940,10 @@ client.checkout_configurations.delete(
-Returns a paginated list of companies. When parent_company_id is provided, lists connected accounts under that platform. When omitted, lists companies the current user has access to. +Retrieves the details of an existing chat channel. Required permissions: - - `company:basic:read` + - `chat:read`
@@ -11711,18 +10960,14 @@ Required permissions: ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -import datetime client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.companies.list( - first=42, - last=42, - created_before=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - created_after=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), +client.chat_channels.retrieve( + id="id", ) ``` @@ -11739,63 +10984,7 @@ client.companies.list(
-**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. - -
-
- -
-
- -**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. - -
-
- -
-
- -**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. - -
-
- -
-
- -**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. - -
-
- -
-
- -**parent_company_id:** `typing.Optional[str]` — The unique identifier of the parent platform company. When provided, lists connected accounts under that platform. Omit to list the current user's own companies. - -
-
- -
-
- -**direction:** `typing.Optional[Direction]` - -
-
- -
-
- -**created_before:** `typing.Optional[datetime.datetime]` — Only return companies created before this timestamp. - -
-
- -
-
- -**created_after:** `typing.Optional[datetime.datetime]` — Only return companies created after this timestamp. +**id:** `str` — The unique identifier of the chat channel or experience to retrieve.
@@ -11815,7 +11004,7 @@ client.companies.list(
-
client.companies.create(...) -> Company +
client.chat_channels.update(...) -> ChatChannel
@@ -11827,11 +11016,10 @@ client.companies.list(
-Create a new company. Pass parent_company_id to create a connected account under a platform, or omit it to create a company for the current user. +Update moderation settings for a chat channel, such as who can post, banned words, and media restrictions. Required permissions: - - `company:create` - - `company:basic:read` + - `chat:moderate`
@@ -11854,8 +11042,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.companies.create( - title="title", +client.chat_channels.update( + id="id", ) ``` @@ -11872,15 +11060,7 @@ client.companies.create(
-**title:** `str` — The display name of the company shown to customers. - -
-
- -
-
- -**country:** `typing.Optional[Countries]` — The country the company is located in. Defaults to the parent company's country for connected accounts, or the owner's IP-derived country. +**id:** `str` — The unique identifier of the chat channel to update. Accepts either an experience ID (e.g. 'exp_xxxxx') or a chat channel ID.
@@ -11888,7 +11068,7 @@ client.companies.create(
-**description:** `typing.Optional[str]` — A promotional pitch displayed to potential customers on the company's store page. +**ban_media:** `typing.Optional[bool]` — Whether media uploads such as images and videos are banned in this chat channel.
@@ -11896,7 +11076,7 @@ client.companies.create(
-**email:** `typing.Optional[str]` — The email address of the user who will own the connected account. Required when parent_company_id is provided. +**ban_urls:** `typing.Optional[bool]` — Whether URLs and links are banned from being posted in this chat channel.
@@ -11904,7 +11084,7 @@ client.companies.create(
-**logo:** `typing.Optional[CreateCompaniesRequestLogo]` — The company's logo image. Accepts PNG, JPEG, or GIF format. +**banned_words:** `typing.Optional[typing.List[str]]` — A list of words that are automatically blocked from messages in this chat channel. For example, ['spam', 'scam'].
@@ -11912,7 +11092,7 @@ client.companies.create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` — A key-value JSON object of custom metadata to store on the company. +**user_posts_cooldown_seconds:** `typing.Optional[int]` — The minimum number of seconds a user must wait between sending messages in this chat channel.
@@ -11920,7 +11100,7 @@ client.companies.create(
-**parent_company_id:** `typing.Optional[str]` — The unique identifier of the parent platform company. When provided, creates a connected account under that platform. Omit to create a company for the current user. +**who_can_post:** `typing.Optional[WhoCanPostTypes]` — Controls which roles are allowed to send messages in this chat channel.
@@ -11928,7 +11108,7 @@ client.companies.create(
-**send_customer_emails:** `typing.Optional[bool]` — Whether Whop sends transactional emails to customers on behalf of this company. Only applies when creating a connected account. +**who_can_react:** `typing.Optional[WhoCanReactTypes]` — Controls which roles are allowed to add reactions to messages in this chat channel.
@@ -11948,7 +11128,8 @@ client.companies.create(
-
client.companies.retrieve(...) -> Company +## Checkout Configurations +
client.checkout_configurations.list(...) -> ListCheckoutConfigurationsResponse
@@ -11960,10 +11141,7 @@ client.companies.create(
-Retrieves the details of an existing company. - -Required permissions: - - `company:basic:read` +Lists checkout configurations for an account.
@@ -11986,8 +11164,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.companies.retrieve( - id="biz_xxxxxxxxxxxxxx", +client.checkout_configurations.list( + account_id="account_id", ) ``` @@ -12004,7 +11182,63 @@ client.companies.retrieve(
-**id:** `str` — The unique identifier or route slug of the company. +**account_id:** `str` — Account ID, prefixed `biz_`. + +
+
+ +
+
+ +**plan_id:** `typing.Optional[str]` — Only return checkout configurations for this plan ID, prefixed `plan_`. + +
+
+ +
+
+ +**created_before:** `typing.Optional[str]` — Only return checkout configurations created before this ISO 8601 timestamp. + +
+
+ +
+
+ +**created_after:** `typing.Optional[str]` — Only return checkout configurations created after this ISO 8601 timestamp. + +
+
+ +
+
+ +**order:** `typing.Optional[ListCheckoutConfigurationsRequestOrder]` — Field used to sort checkout configurations. + +
+
+ +
+
+ +**direction:** `typing.Optional[ListCheckoutConfigurationsRequestDirection]` — Sort direction. Defaults to `desc`. + +
+
+ +
+
+ +**first:** `typing.Optional[int]` — Number of checkout configurations to return. + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — Cursor for the next page of results.
@@ -12024,7 +11258,7 @@ client.companies.retrieve(
-
client.companies.update(...) -> Company +
client.checkout_configurations.create(...) -> CreateCheckoutConfigurationsResponse
@@ -12036,11 +11270,7 @@ client.companies.retrieve(
-Update a company's title, description, logo, and other settings. - -Required permissions: - - `company:update` - - `company:basic:read` +Creates a reusable checkout configuration for an existing or inline plan.
@@ -12063,8 +11293,9 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.companies.update( - id="biz_xxxxxxxxxxxxxx", +client.checkout_configurations.create( + account_id="biz_xxxxxxxxxxxxxx", + plan_id="plan_xxxxxxxxxxxxx", ) ``` @@ -12081,23 +11312,7 @@ client.companies.update(
-**id:** `str` — The unique identifier of the company to update. - -
-
- -
-
- -**affiliate_application_required:** `typing.Optional[bool]` — Whether prospective affiliates must submit an application before they can promote this company. - -
-
- -
-
- -**affiliate_instructions:** `typing.Optional[str]` — Guidelines and instructions shown to affiliates explaining how to promote this company's products. +**account_id:** `typing.Optional[str]` — Account ID, prefixed `biz_`.
@@ -12105,7 +11320,7 @@ client.companies.update(
-**banner_image:** `typing.Optional[UpdateCompaniesRequestBannerImage]` — The company's banner image. Accepts PNG or JPEG format. +**affiliate_code:** `typing.Optional[str]` — Affiliate code to apply to the checkout.
@@ -12113,7 +11328,7 @@ client.companies.update(
-**description:** `typing.Optional[str]` — A promotional pitch displayed to potential customers on the company's store page. +**currency:** `typing.Optional[str]` — Currency used for setup-mode payment method availability.
@@ -12121,7 +11336,7 @@ client.companies.update(
-**featured_affiliate_product_id:** `typing.Optional[str]` — The ID of the product to feature on this company's affiliate page. Pass null to clear. +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` — Custom key-value metadata copied to payments and memberships.
@@ -12129,7 +11344,7 @@ client.companies.update(
-**logo:** `typing.Optional[UpdateCompaniesRequestLogo]` — The company's logo image. Accepts PNG, JPEG, or GIF format. +**mode:** `typing.Optional[CreateCheckoutConfigurationsRequestMode]` — Controls whether checkout charges the buyer immediately or saves payment details for later. Defaults to `payment`.
@@ -12137,7 +11352,7 @@ client.companies.update(
-**route:** `typing.Optional[str]` — The unique URL slug for the company's store page. Must be lowercase and can include hyphens (e.g., 'my-company'). If not provided, the route will remain unchanged. +**payment_method_configuration:** `typing.Optional[CreateCheckoutConfigurationsRequestPaymentMethodConfiguration]` — Payment method overrides for this checkout. `null` uses the plan or platform defaults.
@@ -12145,7 +11360,7 @@ client.companies.update(
-**send_customer_emails:** `typing.Optional[bool]` — Whether Whop sends transactional emails (receipts, renewals, cancelations) to customers on behalf of this company. +**plan:** `typing.Optional[CreateCheckoutConfigurationsRequestPlan]` — Plan attributes used to create or find a plan for this checkout configuration. Mutually exclusive with `plan_id`.
@@ -12153,7 +11368,7 @@ client.companies.update(
-**social_links:** `typing.Optional[typing.List[UpdateCompaniesRequestSocialLinksItem]]` — The social media links to display on the company's store page. Pass the full list of desired social links — any existing links not included will be removed. +**plan_id:** `typing.Optional[str]` — Existing plan ID, prefixed `plan_`. Mutually exclusive with `plan`.
@@ -12161,7 +11376,7 @@ client.companies.update(
-**target_audience:** `typing.Optional[str]` — The target audience for this company (e.g., 'beginner day traders aged 18-25 looking to learn options'). +**redirect_url:** `typing.Optional[str]` — URL customers are sent to after checkout.
@@ -12169,7 +11384,7 @@ client.companies.update(
-**title:** `typing.Optional[str]` — The display name of the company shown to customers. +**three_ds_level:** `typing.Optional[CreateCheckoutConfigurationsRequestThreeDsLevel]` — 3D Secure behavior for this checkout.
@@ -12189,7 +11404,7 @@ client.companies.update(
-
client.companies.create_api_key(...) -> CreateApiKeyCompaniesResponse +
client.checkout_configurations.retrieve(...) -> RetrieveCheckoutConfigurationsResponse
@@ -12201,7 +11416,7 @@ client.companies.update(
-Create an API key for a connected account (child company) owned by a parent company. +Retrieves a checkout configuration by ID. This endpoint is public so a checkout page can load from the configuration URL.
@@ -12224,9 +11439,8 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.companies.create_api_key( - parent_company_id="parent_company_id", - child_company_id="child_company_id", +client.checkout_configurations.retrieve( + id="id", ) ``` @@ -12243,7 +11457,7 @@ client.companies.create_api_key(
-**parent_company_id:** `str` — The unique identifier of the parent platform company (e.g. 'biz_xxx'). +**id:** `str` — The ID of the checkout configuration.
@@ -12251,31 +11465,72 @@ client.companies.create_api_key(
-**child_company_id:** `str` — The unique identifier of the connected account to create the API key for (e.g. 'biz_xxx'). +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.checkout_configurations.delete(...) -> DeleteCheckoutConfigurationsResponse
-**name:** `typing.Optional[str]` — A human-readable name for the API key, such as 'Production API Key'. - +#### 📝 Description + +
+
+ +
+
+ +Deletes a checkout configuration so its checkout URL can no longer be used. +
+
+#### 🔌 Usage +
-**permissions:** `typing.Optional[typing.List[CreateApiKeyCompaniesRequestPermissionsItem]]` — Granular permission statements defining which actions this API key can perform. Either permissions or role must be provided. - +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.checkout_configurations.delete( + id="id", +) + +``` +
+
+#### ⚙️ Parameters + +
+
+
-**role:** `typing.Optional[PermissionSystemRoles]` — A system role to inherit permissions from (e.g. owner, admin, moderator). Either role or permissions must be provided. +**id:** `str` — The ID of the checkout configuration.
@@ -15848,7 +15103,7 @@ client.disputes.submit(
-
client.disputes.submit_evidence_dispute(...) -> Dispute +
client.disputes.submit_evidence_dispute(...) -> DisputeLegacy
@@ -15931,7 +15186,7 @@ client.disputes.submit_evidence_dispute(
-
client.disputes.update_evidence_dispute(...) -> Dispute +
client.disputes.update_evidence_dispute(...) -> DisputeLegacy
@@ -20198,7 +19453,7 @@ client.financial_reports.retrieve(
-**from_date:** `typing.Optional[str]` — Start of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. +**from:** `typing.Optional[datetime.datetime]` — Start of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports.
@@ -20206,7 +19461,7 @@ client.financial_reports.retrieve(
-**to_date:** `typing.Optional[str]` — End of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. +**to:** `typing.Optional[datetime.datetime]` — Exclusive end of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports.
@@ -20222,7 +19477,7 @@ client.financial_reports.retrieve(
-**timezone:** `typing.Optional[str]` — IANA timezone (for example `America/New_York`) used to bucket report periods and to interpret calendar-day boundaries for balance snapshots. Defaults to UTC. from_date/to_date remain exact instants regardless of this setting. +**timezone:** `typing.Optional[str]` — IANA timezone (for example `America/New_York`) used to bucket report periods. Defaults to UTC. `from` and `to` remain exact instants.
@@ -20246,7 +19501,7 @@ client.financial_reports.retrieve(
-**cumulative:** `typing.Optional[bool]` — Platform-wide (global) reports only: when true, return cumulative balances as of to_date (all history, no lower bound) instead of activity within the period. +**cumulative:** `typing.Optional[bool]` — Platform-wide (global) reports only: when true, return cumulative balances as of to (all history, no lower bound) instead of activity within the period.
@@ -23120,7 +22375,11 @@ client = Whop( environment=WhopEnvironment.DEFAULT, ) -client.members.list() +client.members.list( + user_ids=[ + "user_xxxxxxxxxxxxxx" + ], +) ```
@@ -23160,6 +22419,14 @@ client.members.list()
+**user_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Only return members whose users match these `user_` identifiers. + +
+
+ +
+
+ **query:** `typing.Optional[str]` — Search members by name or username. An exact email address also matches when the credential holds the member:email:read scope.
@@ -23724,7 +22991,7 @@ client.memberships.update(
-
client.memberships.add_free_days_membership(...) -> Membership +
client.memberships.add_free_days_membership(...) -> MembershipLegacy
@@ -24136,7 +23403,7 @@ client.memberships.resume(
-
client.memberships.resync_access_membership(...) -> Membership +
client.memberships.resync_access_membership(...) -> MembershipLegacy
@@ -24287,7 +23554,7 @@ client.memberships.transfer(
-
client.memberships.uncancel_membership(...) -> Membership +
client.memberships.uncancel_membership(...) -> MembershipLegacy
@@ -26454,17 +25721,7 @@ client.payment_methods.delete_payment_method(
-Returns a paginated list of payments for the actor in context, with optional filtering by product, plan, status, billing reason, currency, and creation date. - -Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` +Lists payments, newest first. Without filters this is every payment the caller can read: a company credential's own account, or for a user every account they can read payments for. Filters narrow by account, buyer, product, plan, membership, status, billing reason, currency, and creation window. Filtering by `billing_reason=subscription_cycle` also matches renewals recorded as `subscription_update`. `settlement_time_at` is null on list rows — retrieve the payment for it.
@@ -26481,22 +25738,13 @@ Required permissions: ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -import datetime client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.payments.list( - first=42, - last=42, - company_id="biz_xxxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - created_after=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - updated_before=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - updated_after=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), -) +client.payments.list() ``` @@ -26512,7 +25760,7 @@ client.payments.list(
-**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. +**account_id:** `typing.Optional[str]` — Only payments charged by this account, prefixed `biz_`.
@@ -26520,7 +25768,7 @@ client.payments.list(
-**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. +**status:** `typing.Optional[ListPaymentsRequestStatus]` — Only payments in this lifecycle state.
@@ -26528,7 +25776,7 @@ client.payments.list(
-**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. +**billing_reason:** `typing.Optional[ListPaymentsRequestBillingReason]` — Only payments charged for this reason.
@@ -26536,7 +25784,7 @@ client.payments.list(
-**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +**currency:** `typing.Optional[str]` — Only payments presented in this three-letter currency, such as `usd`.
@@ -26544,7 +25792,7 @@ client.payments.list(
-**company_id:** `typing.Optional[str]` — The unique identifier of the company to list payments for. +**user_id:** `typing.Optional[str]` — Only payments made by this buyer, prefixed `user_`.
@@ -26552,7 +25800,31 @@ client.payments.list(
-**direction:** `typing.Optional[Direction]` +**query:** `typing.Optional[str]` — Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. + +
+
+ +
+
+ +**member_id:** `typing.Optional[str]` — Only payments made by this member, prefixed `mber_`. + +
+
+ +
+
+ +**membership_id:** `typing.Optional[str]` — Only payments billed under this membership, prefixed `mem_`. + +
+
+ +
+
+ +**product_id:** `typing.Optional[str]` — Only payments for this product, prefixed `prod_`.
@@ -26560,7 +25832,7 @@ client.payments.list(
-**order:** `typing.Optional[ReceiptV2Order]` +**plan_id:** `typing.Optional[str]` — Only payments priced by this plan, prefixed `plan_`.
@@ -26568,7 +25840,7 @@ client.payments.list(
-**product_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter payments to only those associated with these specific product identifiers. +**created_before:** `typing.Optional[datetime.datetime]` — Only payments created before this ISO 8601 timestamp.
@@ -26576,7 +25848,7 @@ client.payments.list(
-**billing_reasons:** `typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]]` — Filter payments by their billing reason. +**created_after:** `typing.Optional[datetime.datetime]` — Only payments created after this ISO 8601 timestamp.
@@ -26584,7 +25856,7 @@ client.payments.list(
-**currencies:** `typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]]` — Filter payments by their currency code. +**order:** `typing.Optional[ListPaymentsRequestOrder]` — The field to sort by.
@@ -26592,7 +25864,7 @@ client.payments.list(
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter payments to only those associated with these specific plan identifiers. +**direction:** `typing.Optional[ListPaymentsRequestDirection]` — The sort direction.
@@ -26600,7 +25872,7 @@ client.payments.list(
-**statuses:** `typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]]` — Filter payments by their current status. +**first:** `typing.Optional[int]` — The number of payments to return.
@@ -26608,7 +25880,7 @@ client.payments.list(
-**substatuses:** `typing.Optional[typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]]]` — Filter payments by their current substatus for more granular filtering. +**after:** `typing.Optional[str]` — A cursor; returns payments after this position.
@@ -26616,7 +25888,7 @@ client.payments.list(
-**include_free:** `typing.Optional[bool]` — Whether to include payments with a zero amount. Defaults to false, so zero-amount payments are omitted unless you set this to true — a company whose sales are all free plans returns an empty list without it. +**last:** `typing.Optional[int]` — The number of payments to return from the end of the range.
@@ -26624,7 +25896,7 @@ client.payments.list(
-**created_before:** `typing.Optional[datetime.datetime]` — Only return payments created before this timestamp. +**before:** `typing.Optional[str]` — A cursor; returns payments before this position.
@@ -26632,7 +25904,73 @@ client.payments.list(
-**created_after:** `typing.Optional[datetime.datetime]` — Only return payments created after this timestamp. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ +
+ + + + +
+ +
client.payments.create(...) -> Payment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Charges a buyer for a plan. Pass a payment method already on file (`member_id` and `payment_method_id`), or a `confirmation_token` describing a method the buyer just supplied. Collection runs in the background: the response is the payment as created, not its outcome — poll Retrieve status for how far it has got and, for a confirmation-token payment, what the buyer must still do. `plan_id` names the plan to charge for. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from whop_sdk import Whop +from whop_sdk.environment import WhopEnvironment + +client = Whop( + token="", + environment=WhopEnvironment.DEFAULT, +) + +client.payments.create( + account_id="biz_xxxxxxxxxxxxxx", + plan_id="plan_xxxxxxxxxxxxxx", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**account_id:** `str` — The account to charge for, prefixed `biz_`.
@@ -26640,7 +25978,7 @@ client.payments.list(
-**updated_before:** `typing.Optional[datetime.datetime]` — Only return payments last updated before this timestamp. +**plan_id:** `str` — The plan to charge for, prefixed `plan_`. It must belong to the account.
@@ -26648,7 +25986,7 @@ client.payments.list(
-**updated_after:** `typing.Optional[datetime.datetime]` — Only return payments last updated after this timestamp. +**capture:** `typing.Optional[bool]` — Whether to capture a card payment immediately. Defaults to true. Pass false to place an authorization hold that must be captured in full within five days via the capture endpoint.
@@ -26656,7 +25994,7 @@ client.payments.list(
-**query:** `typing.Optional[str]` — Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. +**confirmation_token:** `typing.Optional[str]` — A confirmation token describing a payment method the buyer just supplied. Provide this instead of `member_id` and `payment_method_id`; the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete — poll the payment's status for what to do next.
@@ -26664,7 +26002,7 @@ client.payments.list(
-**checkout_configuration_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Only return payments from these checkout configurations. +**email:** `typing.Optional[str]` — Overrides the buyer email carried on the confirmation token, resolving or creating the user the payment belongs to. Ignored unless `confirmation_token` is provided, and when the token was created by a signed-in buyer.
@@ -26672,94 +26010,39 @@ client.payments.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**member_id:** `typing.Optional[str]` — The member to charge, prefixed `mber_`. Required with `payment_method_id` unless `confirmation_token` is provided.
-
-
- - -
-
-
-
client.payments.create(...) -> CreatePaymentsResponse
-#### 📝 Description - -
-
+**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Custom metadata to attach to the payment. + +
+
-Charge a buyer on-session with a `confirmation_token` for the method they selected, or charge an existing member off-session using a stored payment method. You can provide an existing plan or create one inline. The endpoint returns a payment immediately, but processing continues asynchronously. Use webhooks to learn whether it succeeds or fails, and poll the payment's status endpoint for any step the buyer must complete. - -Required permissions: - - `payment:charge` - - `plan:create` - - `access_pass:create` - - `access_pass:update` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` -
-
+**payment_method_id:** `typing.Optional[str]` — The stored payment method to charge, prefixed `payt_`. It must belong to the member. Required unless `confirmation_token` is provided. +
-#### 🔌 Usage -
-
-
- -```python -from whop_sdk import Whop -from whop_sdk.environment import WhopEnvironment -from whop_sdk.payments import CreatePaymentsRequestZero, CreatePaymentsRequestZeroPlan - -client = Whop( - token="", - environment=WhopEnvironment.DEFAULT, -) - -client.payments.create( - request=CreatePaymentsRequestZero( - company_id="biz_xxxxxxxxxxxxxx", - confirmation_token="confirmation_token", - plan=CreatePaymentsRequestZeroPlan( - currency="usd", - ), - ), -) - -``` -
-
+**promo_code_id:** `typing.Optional[str]` — An active promo code to apply, prefixed `promo_`. It must belong to the account and be valid for the plan. +
-#### ⚙️ Parameters - -
-
-
-**request:** `CreatePaymentsRequest` — Parameters for CreatePayment +**return_url:** `typing.Optional[str]` — Where the buyer continues after completing an off-site step. An absolute https URL without credentials, at most 2,048 characters. Ignored unless `confirmation_token` is provided.
@@ -26779,7 +26062,7 @@ client.payments.create(
-
client.payments.retrieve(...) -> RetrievePaymentsResponse +
client.payments.retrieve(...) -> Payment
@@ -26791,19 +26074,7 @@ client.payments.create(
-Retrieves the details of an existing payment. - -Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` +Returns one payment. Related records are ids — resolve a plan, membership, member or shipment on its own endpoint, and list this payment's refunds, disputes or Resolution Center cases with `?payment_id=`.
@@ -26827,7 +26098,7 @@ client = Whop( ) client.payments.retrieve( - id="pay_xxxxxxxxxxxxxx", + id="id", ) ``` @@ -26844,7 +26115,7 @@ client.payments.retrieve(
-**id:** `str` — The unique identifier of the payment. +**id:** `str` — The payment to retrieve, prefixed `pay_`.
@@ -26949,10 +26220,7 @@ client.payments.capture(
-Returns the list of fees associated with a specific payment, including platform fees and processing fees. - -Required permissions: - - `payment:basic:read` +Returns the fee breakdown of one payment — Whop's fee, processing, affiliate and other lines — each in the currency it was collected in and converted to the payment's settlement currency. The list is complete in one page.
@@ -26976,9 +26244,7 @@ client = Whop( ) client.payments.list_fees( - id="pay_xxxxxxxxxxxxxx", - first=42, - last=42, + id="id", ) ``` @@ -26995,39 +26261,7 @@ client.payments.list_fees(
-**id:** `str` — The unique identifier of the payment to list fees for. - -
-
- -
-
- -**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. - -
-
- -
-
- -**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. - -
-
- -
-
- -**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. - -
-
- -
-
- -**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +**id:** `str` — The payment whose fees to list, prefixed `pay_`.
@@ -27059,19 +26293,7 @@ client.payments.list_fees(
-Issue a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. - -Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` +Issues a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly.
@@ -27095,7 +26317,7 @@ client = Whop( ) client.payments.refund( - id="pay_xxxxxxxxxxxxxx", + id="id", ) ``` @@ -27112,7 +26334,7 @@ client.payments.refund(
-**id:** `str` — The unique identifier of the payment to refund. +**id:** `str` — The payment to refund, prefixed `pay_`.
@@ -27152,19 +26374,7 @@ client.payments.refund(
-Retry a failed or pending payment. This re-attempts the charge using the original payment method and plan details. - -Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` +Retries a failed or pending payment. This re-attempts the charge using the original payment method and plan details.
@@ -27188,7 +26398,7 @@ client = Whop( ) client.payments.retry( - id="pay_xxxxxxxxxxxxxx", + id="id", ) ``` @@ -27205,7 +26415,7 @@ client.payments.retry(
-**id:** `str` — The unique identifier of the payment to retry. +**id:** `str` — The payment to retry, prefixed `pay_`.
@@ -27237,19 +26447,7 @@ client.payments.retry(
-Void a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. - -Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` +Voids a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor.
@@ -27273,7 +26471,7 @@ client = Whop( ) client.payments.void( - id="pay_xxxxxxxxxxxxxx", + id="id", ) ``` @@ -27290,7 +26488,7 @@ client.payments.void(
-**id:** `str` — The unique identifier of the payment to void. +**id:** `str` — The payment to void, prefixed `pay_`.
@@ -27925,7 +27123,8 @@ client = Whop( ) client.payouts.create( - request={"key": "value"}, + amount=50, + payout_method_id="potk_xxxxxxxxxxxxxx", ) ``` @@ -27942,7 +27141,95 @@ client.payouts.create(
-**request:** `CreatePayoutsRequestBody` +**amount:** `float` — The amount to pay out in the specified currency. + +
+
+ +
+
+ +**payout_method_id:** `str` — The saved payout method to deliver to (a potk_ identifier). + +
+
+ +
+
+ +**account_id:** `typing.Optional[str]` — Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. + +
+
+ +
+
+ +**acknowledge_bank_warning:** `typing.Optional[bool]` — Set to `true` to continue when the destination bank could not confirm the payout method account holder's name, or `false` to have the payout refused in that case so the account holder can correct the name or link their bank first. Omitting the field skips the warning gate — a client that cannot show the warning keeps its pre-gate behavior. + +
+
+ +
+
+ +**currency:** `typing.Optional[str]` — The currency to pay out. Balances are held per currency and the payout draws only from the balance in this currency, so match the currency the funds arrived in — for example `cad` for an account funded by CAD transfers. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, str]]` — Key-value data to attach to the payout, echoed on every read and in webhook payloads. At most 50 keys, key names up to 40 characters, string values up to 500 characters. Never store secrets or regulated personal data here — webhook bodies are retained for delivery inspection. + +
+
+ +
+
+ +**notes:** `typing.Optional[str]` — Free-form notes to attach to the payout, with a maximum of 255 characters. Omit or pass `null` for no notes. + +
+
+ +
+
+ +**platform_covers_fees:** `typing.Optional[bool]` — Whether the parent platform covers the payout fee instead of the account being paid out. Omit to use the platform's configured fee coverage policy; pass `false` to opt out of it. `true` is only accepted for accounts that belong to a platform, and requires the platform's policy to cover this payout method's category or a caller authorized to manage the platform's child account fees. + +
+
+ +
+
+ +**quote_token:** `typing.Optional[str]` — The server-signed quote_token returned by POST /payouts/quotes. Required when the ledger account's payout_quote_required is true; a payout without it is refused with the invalid_payout_quote error type. When provided, Whop will not commit a provider payout below the destination amount the quote showed. + +
+
+ +
+
+ +**speed:** `typing.Optional[CreatePayoutsRequestSpeed]` — How fast the funds should arrive. `instant` is only accepted when the account and payout method are eligible; otherwise the payout is rejected. + +
+
+ +
+
+ +**statement_descriptor:** `typing.Optional[str]` — Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Without a `quote_token`, omit or pass `null` to use the default descriptor. With a `quote_token`, set this value when creating the quote; the payout request may omit it but cannot add or change it. + +
+
+ +
+
+ +**user_id:** `typing.Optional[str]` — User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`.
@@ -28040,7 +27327,7 @@ client.payouts.create_quote(
-**currency:** `typing.Optional[str]` — The balance currency to pay out. +**currency:** `typing.Optional[str]` — The currency to pay out. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency.
@@ -28064,6 +27351,14 @@ client.payouts.create_quote(
+**statement_descriptor:** `typing.Optional[str]` — Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Omit or pass `null` to use the default descriptor. + +
+
+ +
+
+ **user_id:** `typing.Optional[str]` — User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`.
@@ -31733,7 +31028,7 @@ client.recommended_actions.retrieve(
-Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event. +Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event and a `redirected` execution per step.
@@ -31896,10 +31191,7 @@ client.recommended_actions.list_executions(
-Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date. - -Required permissions: - - `payment:basic:read` +Lists refunds, newest first. Without filters this is every refund the caller can read; narrow it to one payment with `payment_id`, one account with `account_id`, or one buyer with `user_id`.
@@ -31916,22 +31208,13 @@ Required permissions: ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment -import datetime client = Whop( token="", environment=WhopEnvironment.DEFAULT, ) -client.refunds.list( - first=42, - last=42, - payment_id="pay_xxxxxxxxxxxxxx", - company_id="biz_xxxxxxxxxxxxxx", - user_id="user_xxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), - created_after=datetime.datetime.fromisoformat("2023-12-01T05:00:00+00:00"), -) +client.refunds.list() ``` @@ -31947,7 +31230,7 @@ client.refunds.list(
-**after:** `typing.Optional[str]` — Returns the elements in the list that come after the specified cursor. +**account_id:** `typing.Optional[str]` — Only refunds issued by this account, prefixed `biz_`.
@@ -31955,7 +31238,7 @@ client.refunds.list(
-**before:** `typing.Optional[str]` — Returns the elements in the list that come before the specified cursor. +**payment_id:** `typing.Optional[str]` — Only refunds of this payment, prefixed `pay_`.
@@ -31963,7 +31246,7 @@ client.refunds.list(
-**first:** `typing.Optional[int]` — Returns the first _n_ elements from the list. +**user_id:** `typing.Optional[str]` — Only refunds to this buyer, prefixed `user_`.
@@ -31971,7 +31254,7 @@ client.refunds.list(
-**last:** `typing.Optional[int]` — Returns the last _n_ elements from the list. +**created_before:** `typing.Optional[datetime.datetime]` — Only refunds requested before this ISO 8601 timestamp.
@@ -31979,7 +31262,7 @@ client.refunds.list(
-**payment_id:** `typing.Optional[str]` — Filter refunds to those associated with this specific payment. Mutually exclusive with company_id and user_id: provide exactly one. +**created_after:** `typing.Optional[datetime.datetime]` — Only refunds requested after this ISO 8601 timestamp.
@@ -31987,7 +31270,7 @@ client.refunds.list(
-**company_id:** `typing.Optional[str]` — Filter refunds to those belonging to this company. Mutually exclusive with payment_id and user_id: provide exactly one. +**order:** `typing.Optional[ListRefundsRequestOrder]` — The field to sort by.
@@ -31995,7 +31278,7 @@ client.refunds.list(
-**user_id:** `typing.Optional[str]` — Filter refunds to those associated with this specific user. Mutually exclusive with payment_id and company_id: provide exactly one. Requires a credential belonging to that user; any other credential receives 'You are not authorized'. +**direction:** `typing.Optional[ListRefundsRequestDirection]` — The sort direction.
@@ -32003,7 +31286,15 @@ client.refunds.list(
-**direction:** `typing.Optional[Direction]` +**first:** `typing.Optional[int]` — The number of refunds to return. + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — A cursor; returns refunds after this position.
@@ -32011,7 +31302,7 @@ client.refunds.list(
-**created_before:** `typing.Optional[datetime.datetime]` — Only return refunds created before this timestamp. +**last:** `typing.Optional[int]` — The number of refunds to return from the end of the range.
@@ -32019,7 +31310,7 @@ client.refunds.list(
-**created_after:** `typing.Optional[datetime.datetime]` — Only return refunds created after this timestamp. +**before:** `typing.Optional[str]` — A cursor; returns refunds before this position.
@@ -32051,15 +31342,7 @@ client.refunds.list(
-Retrieves the details of an existing refund. - -Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` +Returns one refund.
@@ -32083,7 +31366,7 @@ client = Whop( ) client.refunds.retrieve( - id="rf_xxxxxxxxxxxxxxx", + id="id", ) ``` @@ -32100,7 +31383,7 @@ client.refunds.retrieve(
-**id:** `str` — The unique identifier of the refund. +**id:** `str` — The refund to retrieve, prefixed `rf_`.
@@ -40558,6 +39841,7 @@ Returns the top entities behind one high-level financial report bucket and an ag ```python from whop_sdk import Whop from whop_sdk.environment import WhopEnvironment +import datetime client = Whop( token="", @@ -40569,8 +39853,8 @@ client.financial_reports.breakdown.retrieve( bucket="transfers", direction="money_in", currency="currency", - from_date="from_date", - to_date="to_date", + from_=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + to=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), ) ``` @@ -40619,7 +39903,23 @@ client.financial_reports.breakdown.retrieve(
-**from_date:** `str` — Start of the report window as an ISO 8601 timestamp. +**from:** `datetime.datetime` — Start of the report window as an ISO 8601 timestamp. + +
+
+ +
+
+ +**to:** `datetime.datetime` — Exclusive end of the report window as an ISO 8601 timestamp. + +
+
+ +
+
+ +**group_by:** `typing.Optional[RetrieveBreakdownRequestGroupBy]` — Period grouping used by the parent report.
@@ -40627,7 +39927,7 @@ client.financial_reports.breakdown.retrieve(
-**to_date:** `str` — Exclusive end of the report window as an ISO 8601 timestamp. +**timezone:** `typing.Optional[str]` — IANA timezone used by the parent report to bucket periods. Defaults to UTC.
diff --git a/src/whop_sdk/__init__.py b/src/whop_sdk/__init__.py index 540831e9..66ae85ec 100644 --- a/src/whop_sdk/__init__.py +++ b/src/whop_sdk/__init__.py @@ -162,16 +162,10 @@ AdLeadFormQuestion, AdLeadFormQuestionOption, AdMessagingConfig, + AdMusic, AdPlatformIssue, AdPlatformIssueResourceType, AdPostSource, - AdReport, - AdReportBreakdownItem, - AdReportBreakdownItemGranularityItem, - AdReportBreakdownItemSummary, - AdReportBreakdownLevels, - AdReportGranularityItem, - AdReportSummary, AdResultEvent, AdStatus, Affiliate, @@ -284,6 +278,7 @@ CardFundingTypes, CardIssuingTransactionStatus, CardTransaction, + CardTransactionLegacy, CardTransactionListItem, CardTransactionStatus, CardTransactionTransactionType, @@ -307,14 +302,6 @@ CheckoutModes, CheckoutSessionPaymentMethodConfiguration, CheckoutShapes, - Company, - CompanyFeaturedAffiliateProduct, - CompanyListItem, - CompanyListItemLogo, - CompanyListItemOwnerUser, - CompanyLogo, - CompanyOwnerUser, - CompanySocialLinksItem, CompanyTokenTransaction, CompanyTokenTransactionCompany, CompanyTokenTransactionListItem, @@ -328,7 +315,6 @@ ConfirmationTokenStatus, ConversionEvent, ConversionEventZero, - Countries, Course, CourseChapter, CourseChapterLessonsItem, @@ -391,6 +377,12 @@ Direction, Dispute, DisputeAlert, + DisputeAlertLegacy, + DisputeAlertLegacyDispute, + DisputeAlertLegacyPayment, + DisputeAlertLegacyPaymentMember, + DisputeAlertLegacyPaymentMembership, + DisputeAlertLegacyPaymentUser, DisputeAlertListItem, DisputeAlertListItemDispute, DisputeAlertListItemPayment, @@ -407,6 +399,23 @@ DisputeEvidenceDocumentVisibility, DisputeEvidenceLockedReason, DisputeIssuerComment, + DisputeLegacy, + DisputeLegacyCancellationPolicyAttachment, + DisputeLegacyCompany, + DisputeLegacyCustomerCommunicationAttachment, + DisputeLegacyPayment, + DisputeLegacyPaymentMember, + DisputeLegacyPaymentMembership, + DisputeLegacyPaymentPaymentInstrument, + DisputeLegacyPaymentPaymentInstrumentIcons, + DisputeLegacyPaymentPaymentInstrumentIconsSquare, + DisputeLegacyPaymentPaymentInstrumentIconsSquareDark, + DisputeLegacyPaymentPaymentInstrumentIconsSquareLight, + DisputeLegacyPaymentUser, + DisputeLegacyPlan, + DisputeLegacyProduct, + DisputeLegacyRefundPolicyAttachment, + DisputeLegacyUncategorizedAttachment, DisputeListItem, DisputeListItemCompany, DisputeListItemPayment, @@ -485,7 +494,6 @@ FutureUsageTypes, GlobalAffiliateStatuses, GrantableAuthorizedUserRoles, - Granularities, IdentityProfile, IdentityProfileBusinessAddress, IdentityProfileKinds, @@ -595,6 +603,9 @@ MediaAssetStatus, Member, MemberAccessLevel, + MemberLegacy, + MemberLegacyCompany, + MemberLegacyUser, MemberListItem, MemberListItemUser, MemberMostRecentActions, @@ -603,6 +614,14 @@ MembersSortableColumns, Membership, MembershipCancellationModes, + MembershipLegacy, + MembershipLegacyCompany, + MembershipLegacyCustomFieldResponsesItem, + MembershipLegacyMember, + MembershipLegacyPlan, + MembershipLegacyProduct, + MembershipLegacyPromoCode, + MembershipLegacyUser, MembershipListItem, MembershipListItemCompany, MembershipListItemMember, @@ -651,16 +670,14 @@ Pagination, Passkey, Payment, - PaymentApplicationFee, + PaymentAddress, PaymentBankTransfer, PaymentBankTransferInstructions, - PaymentBillingAddress, PaymentBillingDetailsPreview, - PaymentCompany, PaymentDeclineCodes, - PaymentDisputesItem, - PaymentFeesItem, - PaymentFinancingTransactionsItem, + PaymentFee, + PaymentFeeOrigin, + PaymentFeeType, PaymentInstructions, PaymentInstructions_BankTransfer, PaymentInstructions_Qr, @@ -669,6 +686,35 @@ PaymentInstrumentCard, PaymentLastPaymentError, PaymentLastPaymentErrorDeclineCode, + PaymentLegacy, + PaymentLegacyApplicationFee, + PaymentLegacyBillingAddress, + PaymentLegacyCompany, + PaymentLegacyDisputesItem, + PaymentLegacyFeesItem, + PaymentLegacyFinancingTransactionsItem, + PaymentLegacyMember, + PaymentLegacyMembership, + PaymentLegacyPaymentInstrument, + PaymentLegacyPaymentInstrumentCard, + PaymentLegacyPaymentInstrumentIcons, + PaymentLegacyPaymentInstrumentIconsCard, + PaymentLegacyPaymentInstrumentIconsCardDark, + PaymentLegacyPaymentInstrumentIconsCardLight, + PaymentLegacyPaymentInstrumentIconsSquare, + PaymentLegacyPaymentInstrumentIconsSquareDark, + PaymentLegacyPaymentInstrumentIconsSquareLight, + PaymentLegacyPaymentMethod, + PaymentLegacyPaymentMethodCard, + PaymentLegacyPlan, + PaymentLegacyProduct, + PaymentLegacyPromoCode, + PaymentLegacyRefundsItem, + PaymentLegacyResolutionsItem, + PaymentLegacyShipment, + PaymentLegacyShippingAddress, + PaymentLegacyUser, + PaymentLegacyVerificationChecks, PaymentListItem, PaymentListItemApplicationFee, PaymentListItemBillingAddress, @@ -692,8 +738,6 @@ PaymentListItemShipment, PaymentListItemShippingAddress, PaymentListItemUser, - PaymentMember, - PaymentMembership, PaymentMethod, PaymentMethodBasePaymentMethod, PaymentMethodBasePaymentMethodIcons, @@ -836,36 +880,17 @@ PaymentNextAction_AwaitConfirmation, PaymentNextAction_DisplayInstructions, PaymentNextAction_Redirect, - PaymentPaymentInstrument, - PaymentPaymentInstrumentCard, - PaymentPaymentInstrumentIcons, - PaymentPaymentInstrumentIconsCard, - PaymentPaymentInstrumentIconsCardDark, - PaymentPaymentInstrumentIconsCardLight, - PaymentPaymentInstrumentIconsSquare, - PaymentPaymentInstrumentIconsSquareDark, - PaymentPaymentInstrumentIconsSquareLight, - PaymentPaymentMethod, - PaymentPaymentMethodCard, - PaymentPlan, PaymentProcessingDetails, - PaymentProduct, - PaymentPromoCode, PaymentProviders, PaymentQr, PaymentQrInstructions, - PaymentRefundsItem, PaymentRequiredErrorBody, PaymentRequiredErrorBodyError, PaymentRequiredErrorBodyErrorType, - PaymentResolutionsItem, - PaymentShipment, - PaymentShippingAddress, PaymentStatus, PaymentStatusStatus, PaymentTransactionStatuses, PaymentTransactionTypes, - PaymentUser, PaymentVerificationChecks, PaymentVoucher, PaymentVoucherInstructions, @@ -885,7 +910,6 @@ Permission, PermissionAction, PermissionGrantedToSystemRolesItem, - PermissionSystemRoles, PixelValidation, Plan, PlanCurrency, @@ -907,6 +931,11 @@ ProductCustomCta, ProductGalleryImage, ProductGlobalAffiliateStatus, + ProductLegacy, + ProductLegacyCompany, + ProductLegacyGalleryImagesItem, + ProductLegacyOwnerUser, + ProductLegacyProductTaxCode, ProductListItem, ProductMarketplaceStatus, ProductMemberAffiliateStatus, @@ -941,16 +970,22 @@ RecommendedActionExecution, RecommendedActionExecutionStatus, Refund, + RefundFailureReason, + RefundLegacy, + RefundLegacyPayment, + RefundLegacyPaymentMember, + RefundLegacyPaymentMembership, + RefundLegacyPaymentPlan, + RefundLegacyPaymentProduct, + RefundLegacyPaymentUser, RefundListItem, RefundListItemPayment, - RefundPayment, - RefundPaymentMember, - RefundPaymentMembership, - RefundPaymentPlan, - RefundPaymentProduct, - RefundPaymentUser, + RefundReason, + RefundReferenceStatus, RefundReferenceStatuses, + RefundReferenceType, RefundReferenceTypes, + RefundStatus, RefundStatuses, ReleaseMethod, ResolutionAttachment, @@ -960,6 +995,12 @@ ResolutionCenterCaseAvailableActionsItem, ResolutionCenterCaseCustomerResponses, ResolutionCenterCaseIssueTypes, + ResolutionCenterCaseLegacy, + ResolutionCenterCaseLegacyCompany, + ResolutionCenterCaseLegacyMember, + ResolutionCenterCaseLegacyPayment, + ResolutionCenterCaseLegacyResolutionEventsItem, + ResolutionCenterCaseLegacyUser, ResolutionCenterCaseListItem, ResolutionCenterCaseListItemCompany, ResolutionCenterCaseListItemPayment, @@ -976,7 +1017,6 @@ ResolutionEventAction, ResolutionEventReporterType, ResolutionPayment, - ResultLabelKeys, Review, ReviewAttachmentsItem, ReviewCompany, @@ -1010,6 +1050,8 @@ Shipment, ShipmentCheckpoint, ShipmentCheckpointStatus, + ShipmentLegacy, + ShipmentLegacyPayment, ShipmentListItem, ShipmentListItemPayment, ShipmentStatus, @@ -1024,7 +1066,6 @@ SocialAccountPost, SocialAccountPostCallToAction, SocialAccountPostRestrictionsItem, - SocialLinkWebsites, SpecificFeeOrigins, Status, Statuses, @@ -1123,7 +1164,6 @@ accounts, ad_campaigns, ad_groups, - ad_reports, ads, affiliates, ai_chats, @@ -1139,7 +1179,6 @@ cards, chat_channels, checkout_configurations, - companies, company_token_transactions, confirmation_tokens, course_chapters, @@ -1324,6 +1363,7 @@ CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction, CreateAdsRequestLeadFormQuestionsItemType, CreateAdsRequestMessagingConfig, + CreateAdsRequestMusic, CreateAdsRequestPostSource, CreateAdsRequestSocialAccountsItem, DeleteAdsResponse, @@ -1353,6 +1393,7 @@ UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction, UpdateAdsRequestLeadFormQuestionsItemType, UpdateAdsRequestMessagingConfig, + UpdateAdsRequestMusic, UpdateAdsRequestPostSource, UpdateAdsRequestSocialAccountsItem, ) @@ -1633,16 +1674,6 @@ RetrieveCheckoutConfigurationsResponseThreeDsLevel, ) from .client import AsyncWhop, Whop - from .companies import ( - CreateApiKeyCompaniesRequestPermissionsItem, - CreateApiKeyCompaniesResponse, - CreateCompaniesRequestLogo, - ListCompaniesResponse, - UpdateCompaniesRequestBannerImage, - UpdateCompaniesRequestLogo, - UpdateCompaniesRequestSocialLinksItem, - UpdateCompaniesRequestSocialLinksItemImage, - ) from .company_token_transactions import ( CreateCompanyTokenTransactionsRequest, CreateCompanyTokenTransactionsRequestAdd, @@ -1996,19 +2027,14 @@ ) from .payment_methods import ListPaymentMethodsResponse from .payments import ( - CreatePaymentsRequest, - CreatePaymentsRequestOne, - CreatePaymentsRequestOnePlan, - CreatePaymentsRequestOnePlanProduct, - CreatePaymentsRequestThree, - CreatePaymentsRequestTwo, - CreatePaymentsRequestZero, - CreatePaymentsRequestZeroPlan, - CreatePaymentsRequestZeroPlanProduct, - CreatePaymentsResponse, ListFeesPaymentsResponse, - ListFeesPaymentsResponseDataItem, + ListFeesPaymentsResponsePageInfo, + ListPaymentsRequestBillingReason, + ListPaymentsRequestDirection, + ListPaymentsRequestOrder, + ListPaymentsRequestStatus, ListPaymentsResponse, + ListPaymentsResponsePageInfo, PostPaymentAuthorizedPayload, PostPaymentAuthorizedPayloadApiVersion, PostPaymentAuthorizedPayloadType, @@ -2027,7 +2053,6 @@ PostPaymentSucceededPayload, PostPaymentSucceededPayloadApiVersion, PostPaymentSucceededPayloadType, - RetrievePaymentsResponse, ) from .payout_accounts import ( PostPayoutAccountStatusUpdatedPayload, @@ -2046,8 +2071,7 @@ CancelPayoutsResponseSource, CancelPayoutsResponseSpeed, CancelPayoutsResponseStatus, - CreatePayoutsRequestBody, - CreatePayoutsRequestBodySpeed, + CreatePayoutsRequestSpeed, CreatePayoutsResponse, CreatePayoutsResponseFailure, CreatePayoutsResponseFeePaidBy, @@ -2097,6 +2121,7 @@ PostPayoutMethodCreatedPayloadDataObject, PostPayoutMethodCreatedPayloadDataQuote, PostPayoutMethodCreatedPayloadDataQuoteInstant, + PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason, PostPayoutMethodCreatedPayloadDataQuoteStandard, PostPayoutMethodCreatedPayloadDataStatus, PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod, @@ -2279,7 +2304,10 @@ RunRecommendedActionsResponseExecution, ) from .refunds import ( + ListRefundsRequestDirection, + ListRefundsRequestOrder, ListRefundsResponse, + ListRefundsResponsePageInfo, PostRefundCreatedPayload, PostRefundCreatedPayloadApiVersion, PostRefundCreatedPayloadType, @@ -2794,16 +2822,10 @@ "AdLeadFormQuestion": ".types", "AdLeadFormQuestionOption": ".types", "AdMessagingConfig": ".types", + "AdMusic": ".types", "AdPlatformIssue": ".types", "AdPlatformIssueResourceType": ".types", "AdPostSource": ".types", - "AdReport": ".types", - "AdReportBreakdownItem": ".types", - "AdReportBreakdownItemGranularityItem": ".types", - "AdReportBreakdownItemSummary": ".types", - "AdReportBreakdownLevels": ".types", - "AdReportGranularityItem": ".types", - "AdReportSummary": ".types", "AdResultEvent": ".types", "AdStatus": ".types", "Affiliate": ".types", @@ -2937,6 +2959,7 @@ "CardFundingTypes": ".types", "CardIssuingTransactionStatus": ".types", "CardTransaction": ".types", + "CardTransactionLegacy": ".types", "CardTransactionListItem": ".types", "CardTransactionStatus": ".types", "CardTransactionTransactionType": ".types", @@ -2962,14 +2985,6 @@ "CheckoutModes": ".types", "CheckoutSessionPaymentMethodConfiguration": ".types", "CheckoutShapes": ".types", - "Company": ".types", - "CompanyFeaturedAffiliateProduct": ".types", - "CompanyListItem": ".types", - "CompanyListItemLogo": ".types", - "CompanyListItemOwnerUser": ".types", - "CompanyLogo": ".types", - "CompanyOwnerUser": ".types", - "CompanySocialLinksItem": ".types", "CompanyTokenTransaction": ".types", "CompanyTokenTransactionCompany": ".types", "CompanyTokenTransactionListItem": ".types", @@ -2988,7 +3003,6 @@ "ConnectSocialAccountsResponse": ".social_accounts", "ConversionEvent": ".types", "ConversionEventZero": ".types", - "Countries": ".types", "Course": ".types", "CourseChapter": ".types", "CourseChapterLessonsItem": ".types", @@ -3065,11 +3079,10 @@ "CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction": ".ads", "CreateAdsRequestLeadFormQuestionsItemType": ".ads", "CreateAdsRequestMessagingConfig": ".ads", + "CreateAdsRequestMusic": ".ads", "CreateAdsRequestPostSource": ".ads", "CreateAdsRequestSocialAccountsItem": ".ads", "CreateAiChatsRequestMessageAttachmentsItem": ".ai_chats", - "CreateApiKeyCompaniesRequestPermissionsItem": ".companies", - "CreateApiKeyCompaniesResponse": ".companies", "CreateApiKeysRequestApiVersionDate": ".api_keys", "CreateApiKeysRequestPermissions": ".api_keys", "CreateApiKeysRequestPermissionsStatementsItem": ".api_keys", @@ -3121,7 +3134,6 @@ "CreateCheckoutConfigurationsResponsePlanThreeDsLevel": ".checkout_configurations", "CreateCheckoutConfigurationsResponsePlanVisibility": ".checkout_configurations", "CreateCheckoutConfigurationsResponseThreeDsLevel": ".checkout_configurations", - "CreateCompaniesRequestLogo": ".companies", "CreateCompanyTokenTransactionsRequest": ".company_token_transactions", "CreateCompanyTokenTransactionsRequestAdd": ".company_token_transactions", "CreateCompanyTokenTransactionsRequestSubtract": ".company_token_transactions", @@ -3188,18 +3200,7 @@ "CreateMessagesRequestPollOptionsItem": ".messages", "CreateNotificationsResponse": ".notifications", "CreatePartnersResponse": ".partners", - "CreatePaymentsRequest": ".payments", - "CreatePaymentsRequestOne": ".payments", - "CreatePaymentsRequestOnePlan": ".payments", - "CreatePaymentsRequestOnePlanProduct": ".payments", - "CreatePaymentsRequestThree": ".payments", - "CreatePaymentsRequestTwo": ".payments", - "CreatePaymentsRequestZero": ".payments", - "CreatePaymentsRequestZeroPlan": ".payments", - "CreatePaymentsRequestZeroPlanProduct": ".payments", - "CreatePaymentsResponse": ".payments", - "CreatePayoutsRequestBody": ".payouts", - "CreatePayoutsRequestBodySpeed": ".payouts", + "CreatePayoutsRequestSpeed": ".payouts", "CreatePayoutsResponse": ".payouts", "CreatePayoutsResponseFailure": ".payouts", "CreatePayoutsResponseFeePaidBy": ".payouts", @@ -3338,6 +3339,12 @@ "Direction": ".types", "Dispute": ".types", "DisputeAlert": ".types", + "DisputeAlertLegacy": ".types", + "DisputeAlertLegacyDispute": ".types", + "DisputeAlertLegacyPayment": ".types", + "DisputeAlertLegacyPaymentMember": ".types", + "DisputeAlertLegacyPaymentMembership": ".types", + "DisputeAlertLegacyPaymentUser": ".types", "DisputeAlertListItem": ".types", "DisputeAlertListItemDispute": ".types", "DisputeAlertListItemPayment": ".types", @@ -3354,6 +3361,23 @@ "DisputeEvidenceDocumentVisibility": ".types", "DisputeEvidenceLockedReason": ".types", "DisputeIssuerComment": ".types", + "DisputeLegacy": ".types", + "DisputeLegacyCancellationPolicyAttachment": ".types", + "DisputeLegacyCompany": ".types", + "DisputeLegacyCustomerCommunicationAttachment": ".types", + "DisputeLegacyPayment": ".types", + "DisputeLegacyPaymentMember": ".types", + "DisputeLegacyPaymentMembership": ".types", + "DisputeLegacyPaymentPaymentInstrument": ".types", + "DisputeLegacyPaymentPaymentInstrumentIcons": ".types", + "DisputeLegacyPaymentPaymentInstrumentIconsSquare": ".types", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareDark": ".types", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareLight": ".types", + "DisputeLegacyPaymentUser": ".types", + "DisputeLegacyPlan": ".types", + "DisputeLegacyProduct": ".types", + "DisputeLegacyRefundPolicyAttachment": ".types", + "DisputeLegacyUncategorizedAttachment": ".types", "DisputeListItem": ".types", "DisputeListItemCompany": ".types", "DisputeListItemPayment": ".types", @@ -3450,7 +3474,6 @@ "GenerateMediaRequestType": ".media", "GlobalAffiliateStatuses": ".types", "GrantableAuthorizedUserRoles": ".types", - "Granularities": ".types", "IdentityProfile": ".types", "IdentityProfileBusinessAddress": ".types", "IdentityProfileKinds": ".types", @@ -3654,7 +3677,6 @@ "ListCheckoutConfigurationsResponseDataItemPlanVisibility": ".checkout_configurations", "ListCheckoutConfigurationsResponseDataItemThreeDsLevel": ".checkout_configurations", "ListCheckoutConfigurationsResponsePageInfo": ".checkout_configurations", - "ListCompaniesResponse": ".companies", "ListCompanyTokenTransactionsResponse": ".company_token_transactions", "ListCourseChaptersResponse": ".course_chapters", "ListCourseLessonInteractionsResponse": ".course_lesson_interactions", @@ -3708,7 +3730,7 @@ "ListExportsResponsePageInfo": ".exports", "ListFeeMarkupsResponse": ".fee_markups", "ListFeesPaymentsResponse": ".payments", - "ListFeesPaymentsResponseDataItem": ".payments", + "ListFeesPaymentsResponsePageInfo": ".payments", "ListFilesRequestDirection": ".files", "ListFilesRequestOrder": ".files", "ListFilesResponse": ".files", @@ -3743,7 +3765,12 @@ "ListPaymentMethodDomainsResponse": ".payment_method_domains", "ListPaymentMethodDomainsResponsePageInfo": ".payment_method_domains", "ListPaymentMethodsResponse": ".payment_methods", + "ListPaymentsRequestBillingReason": ".payments", + "ListPaymentsRequestDirection": ".payments", + "ListPaymentsRequestOrder": ".payments", + "ListPaymentsRequestStatus": ".payments", "ListPaymentsResponse": ".payments", + "ListPaymentsResponsePageInfo": ".payments", "ListPayoutMethodResponse": ".payout_methods", "ListPayoutsRequestSource": ".payouts", "ListPayoutsRequestStatus": ".payouts", @@ -3805,7 +3832,10 @@ "ListRecipientsTransfersResponseDataItem_User": ".transfers", "ListRecipientsTransfersResponsePageInfo": ".transfers", "ListRecommendedActionsResponse": ".recommended_actions", + "ListRefundsRequestDirection": ".refunds", + "ListRefundsRequestOrder": ".refunds", "ListRefundsResponse": ".refunds", + "ListRefundsResponsePageInfo": ".refunds", "ListResolutionCenterCasesRequestDirection": ".resolution_center_cases", "ListResolutionCenterCasesRequestOrder": ".resolution_center_cases", "ListResolutionCenterCasesRequestOutcomeItem": ".resolution_center_cases", @@ -3885,6 +3915,9 @@ "MediaAssetStatus": ".types", "Member": ".types", "MemberAccessLevel": ".types", + "MemberLegacy": ".types", + "MemberLegacyCompany": ".types", + "MemberLegacyUser": ".types", "MemberListItem": ".types", "MemberListItemUser": ".types", "MemberMostRecentActions": ".types", @@ -3893,6 +3926,14 @@ "MembersSortableColumns": ".types", "Membership": ".types", "MembershipCancellationModes": ".types", + "MembershipLegacy": ".types", + "MembershipLegacyCompany": ".types", + "MembershipLegacyCustomFieldResponsesItem": ".types", + "MembershipLegacyMember": ".types", + "MembershipLegacyPlan": ".types", + "MembershipLegacyProduct": ".types", + "MembershipLegacyPromoCode": ".types", + "MembershipLegacyUser": ".types", "MembershipListItem": ".types", "MembershipListItemCompany": ".types", "MembershipListItemMember": ".types", @@ -3946,16 +3987,14 @@ "Pagination": ".types", "Passkey": ".types", "Payment": ".types", - "PaymentApplicationFee": ".types", + "PaymentAddress": ".types", "PaymentBankTransfer": ".types", "PaymentBankTransferInstructions": ".types", - "PaymentBillingAddress": ".types", "PaymentBillingDetailsPreview": ".types", - "PaymentCompany": ".types", "PaymentDeclineCodes": ".types", - "PaymentDisputesItem": ".types", - "PaymentFeesItem": ".types", - "PaymentFinancingTransactionsItem": ".types", + "PaymentFee": ".types", + "PaymentFeeOrigin": ".types", + "PaymentFeeType": ".types", "PaymentInstructions": ".types", "PaymentInstructions_BankTransfer": ".types", "PaymentInstructions_Qr": ".types", @@ -3964,6 +4003,35 @@ "PaymentInstrumentCard": ".types", "PaymentLastPaymentError": ".types", "PaymentLastPaymentErrorDeclineCode": ".types", + "PaymentLegacy": ".types", + "PaymentLegacyApplicationFee": ".types", + "PaymentLegacyBillingAddress": ".types", + "PaymentLegacyCompany": ".types", + "PaymentLegacyDisputesItem": ".types", + "PaymentLegacyFeesItem": ".types", + "PaymentLegacyFinancingTransactionsItem": ".types", + "PaymentLegacyMember": ".types", + "PaymentLegacyMembership": ".types", + "PaymentLegacyPaymentInstrument": ".types", + "PaymentLegacyPaymentInstrumentCard": ".types", + "PaymentLegacyPaymentInstrumentIcons": ".types", + "PaymentLegacyPaymentInstrumentIconsCard": ".types", + "PaymentLegacyPaymentInstrumentIconsCardDark": ".types", + "PaymentLegacyPaymentInstrumentIconsCardLight": ".types", + "PaymentLegacyPaymentInstrumentIconsSquare": ".types", + "PaymentLegacyPaymentInstrumentIconsSquareDark": ".types", + "PaymentLegacyPaymentInstrumentIconsSquareLight": ".types", + "PaymentLegacyPaymentMethod": ".types", + "PaymentLegacyPaymentMethodCard": ".types", + "PaymentLegacyPlan": ".types", + "PaymentLegacyProduct": ".types", + "PaymentLegacyPromoCode": ".types", + "PaymentLegacyRefundsItem": ".types", + "PaymentLegacyResolutionsItem": ".types", + "PaymentLegacyShipment": ".types", + "PaymentLegacyShippingAddress": ".types", + "PaymentLegacyUser": ".types", + "PaymentLegacyVerificationChecks": ".types", "PaymentListItem": ".types", "PaymentListItemApplicationFee": ".types", "PaymentListItemBillingAddress": ".types", @@ -3987,8 +4055,6 @@ "PaymentListItemShipment": ".types", "PaymentListItemShippingAddress": ".types", "PaymentListItemUser": ".types", - "PaymentMember": ".types", - "PaymentMembership": ".types", "PaymentMethod": ".types", "PaymentMethodBasePaymentMethod": ".types", "PaymentMethodBasePaymentMethodIcons": ".types", @@ -4131,37 +4197,18 @@ "PaymentNextAction_AwaitConfirmation": ".types", "PaymentNextAction_DisplayInstructions": ".types", "PaymentNextAction_Redirect": ".types", - "PaymentPaymentInstrument": ".types", - "PaymentPaymentInstrumentCard": ".types", - "PaymentPaymentInstrumentIcons": ".types", - "PaymentPaymentInstrumentIconsCard": ".types", - "PaymentPaymentInstrumentIconsCardDark": ".types", - "PaymentPaymentInstrumentIconsCardLight": ".types", - "PaymentPaymentInstrumentIconsSquare": ".types", - "PaymentPaymentInstrumentIconsSquareDark": ".types", - "PaymentPaymentInstrumentIconsSquareLight": ".types", - "PaymentPaymentMethod": ".types", - "PaymentPaymentMethodCard": ".types", - "PaymentPlan": ".types", "PaymentProcessingDetails": ".types", - "PaymentProduct": ".types", - "PaymentPromoCode": ".types", "PaymentProviders": ".types", "PaymentQr": ".types", "PaymentQrInstructions": ".types", - "PaymentRefundsItem": ".types", "PaymentRequiredError": ".errors", "PaymentRequiredErrorBody": ".types", "PaymentRequiredErrorBodyError": ".types", "PaymentRequiredErrorBodyErrorType": ".types", - "PaymentResolutionsItem": ".types", - "PaymentShipment": ".types", - "PaymentShippingAddress": ".types", "PaymentStatus": ".types", "PaymentStatusStatus": ".types", "PaymentTransactionStatuses": ".types", "PaymentTransactionTypes": ".types", - "PaymentUser": ".types", "PaymentVerificationChecks": ".types", "PaymentVoucher": ".types", "PaymentVoucherInstructions": ".types", @@ -4181,7 +4228,6 @@ "Permission": ".types", "PermissionAction": ".types", "PermissionGrantedToSystemRolesItem": ".types", - "PermissionSystemRoles": ".types", "PixelValidation": ".types", "Plan": ".types", "PlanCurrency": ".types", @@ -4417,6 +4463,7 @@ "PostPayoutMethodCreatedPayloadDataObject": ".payouts", "PostPayoutMethodCreatedPayloadDataQuote": ".payouts", "PostPayoutMethodCreatedPayloadDataQuoteInstant": ".payouts", + "PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason": ".payouts", "PostPayoutMethodCreatedPayloadDataQuoteStandard": ".payouts", "PostPayoutMethodCreatedPayloadDataStatus": ".payouts", "PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod": ".payouts", @@ -4566,6 +4613,11 @@ "ProductCustomCta": ".types", "ProductGalleryImage": ".types", "ProductGlobalAffiliateStatus": ".types", + "ProductLegacy": ".types", + "ProductLegacyCompany": ".types", + "ProductLegacyGalleryImagesItem": ".types", + "ProductLegacyOwnerUser": ".types", + "ProductLegacyProductTaxCode": ".types", "ProductListItem": ".types", "ProductMarketplaceStatus": ".types", "ProductMemberAffiliateStatus": ".types", @@ -4615,16 +4667,22 @@ "ReferredUsersPartnersResponseDataItemUserProfilePicture": ".partners", "ReferredUsersPartnersResponsePageInfo": ".partners", "Refund": ".types", + "RefundFailureReason": ".types", + "RefundLegacy": ".types", + "RefundLegacyPayment": ".types", + "RefundLegacyPaymentMember": ".types", + "RefundLegacyPaymentMembership": ".types", + "RefundLegacyPaymentPlan": ".types", + "RefundLegacyPaymentProduct": ".types", + "RefundLegacyPaymentUser": ".types", "RefundListItem": ".types", "RefundListItemPayment": ".types", - "RefundPayment": ".types", - "RefundPaymentMember": ".types", - "RefundPaymentMembership": ".types", - "RefundPaymentPlan": ".types", - "RefundPaymentProduct": ".types", - "RefundPaymentUser": ".types", + "RefundReason": ".types", + "RefundReferenceStatus": ".types", "RefundReferenceStatuses": ".types", + "RefundReferenceType": ".types", "RefundReferenceTypes": ".types", + "RefundStatus": ".types", "RefundStatuses": ".types", "ReleaseMethod": ".types", "ReplayDeliveryWebhooksResponse": ".webhooks", @@ -4638,6 +4696,12 @@ "ResolutionCenterCaseAvailableActionsItem": ".types", "ResolutionCenterCaseCustomerResponses": ".types", "ResolutionCenterCaseIssueTypes": ".types", + "ResolutionCenterCaseLegacy": ".types", + "ResolutionCenterCaseLegacyCompany": ".types", + "ResolutionCenterCaseLegacyMember": ".types", + "ResolutionCenterCaseLegacyPayment": ".types", + "ResolutionCenterCaseLegacyResolutionEventsItem": ".types", + "ResolutionCenterCaseLegacyUser": ".types", "ResolutionCenterCaseListItem": ".types", "ResolutionCenterCaseListItemCompany": ".types", "ResolutionCenterCaseListItemPayment": ".types", @@ -4654,7 +4718,6 @@ "ResolutionEventAction": ".types", "ResolutionEventReporterType": ".types", "ResolutionPayment": ".types", - "ResultLabelKeys": ".types", "RetrieveAdCampaignsRequestAttributionModel": ".ad_campaigns", "RetrieveAdGroupsRequestAttributionModel": ".ad_groups", "RetrieveAdsRequestAttributionModel": ".ads", @@ -4688,7 +4751,6 @@ "RetrieveFinancialReportsResponseRowsItemGrouping": ".financial_reports", "RetrieveFinancialReportsResponseRowsItemLineCategory": ".financial_reports", "RetrieveFinancialReportsResponseRowsItemProfitAndLossSection": ".financial_reports", - "RetrievePaymentsResponse": ".payments", "RetrievePayoutsResponse": ".payouts", "RetrievePayoutsResponseFailure": ".payouts", "RetrievePayoutsResponseFeePaidBy": ".payouts", @@ -4804,6 +4866,8 @@ "Shipment": ".types", "ShipmentCheckpoint": ".types", "ShipmentCheckpointStatus": ".types", + "ShipmentLegacy": ".types", + "ShipmentLegacyPayment": ".types", "ShipmentListItem": ".types", "ShipmentListItemPayment": ".types", "ShipmentStatus": ".types", @@ -4818,7 +4882,6 @@ "SocialAccountPost": ".types", "SocialAccountPostCallToAction": ".types", "SocialAccountPostRestrictionsItem": ".types", - "SocialLinkWebsites": ".types", "SpecificFeeOrigins": ".types", "Status": ".types", "Statuses": ".types", @@ -4932,6 +4995,7 @@ "UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction": ".ads", "UpdateAdsRequestLeadFormQuestionsItemType": ".ads", "UpdateAdsRequestMessagingConfig": ".ads", + "UpdateAdsRequestMusic": ".ads", "UpdateAdsRequestPostSource": ".ads", "UpdateAdsRequestSocialAccountsItem": ".ads", "UpdateApiKeysRequestApiVersionDate": ".api_keys", @@ -4954,10 +5018,6 @@ "UpdateCardsResponseSecrets": ".cards", "UpdateCardsResponseStatus": ".cards", "UpdateCardsResponseType": ".cards", - "UpdateCompaniesRequestBannerImage": ".companies", - "UpdateCompaniesRequestLogo": ".companies", - "UpdateCompaniesRequestSocialLinksItem": ".companies", - "UpdateCompaniesRequestSocialLinksItemImage": ".companies", "UpdateCourseLessonsRequestAssessmentCompletionRequirement": ".course_lessons", "UpdateCourseLessonsRequestAssessmentQuestionsItem": ".course_lessons", "UpdateCourseLessonsRequestAssessmentQuestionsItemImage": ".course_lessons", @@ -5075,7 +5135,6 @@ "accounts": ".accounts", "ad_campaigns": ".ad_campaigns", "ad_groups": ".ad_groups", - "ad_reports": ".ad_reports", "ads": ".ads", "affiliates": ".affiliates", "ai_chats": ".ai_chats", @@ -5091,7 +5150,6 @@ "cards": ".cards", "chat_channels": ".chat_channels", "checkout_configurations": ".checkout_configurations", - "companies": ".companies", "company_token_transactions": ".company_token_transactions", "confirmation_tokens": ".confirmation_tokens", "course_chapters": ".course_chapters", @@ -5333,16 +5391,10 @@ def __dir__(): "AdLeadFormQuestion", "AdLeadFormQuestionOption", "AdMessagingConfig", + "AdMusic", "AdPlatformIssue", "AdPlatformIssueResourceType", "AdPostSource", - "AdReport", - "AdReportBreakdownItem", - "AdReportBreakdownItemGranularityItem", - "AdReportBreakdownItemSummary", - "AdReportBreakdownLevels", - "AdReportGranularityItem", - "AdReportSummary", "AdResultEvent", "AdStatus", "Affiliate", @@ -5476,6 +5528,7 @@ def __dir__(): "CardFundingTypes", "CardIssuingTransactionStatus", "CardTransaction", + "CardTransactionLegacy", "CardTransactionListItem", "CardTransactionStatus", "CardTransactionTransactionType", @@ -5501,14 +5554,6 @@ def __dir__(): "CheckoutModes", "CheckoutSessionPaymentMethodConfiguration", "CheckoutShapes", - "Company", - "CompanyFeaturedAffiliateProduct", - "CompanyListItem", - "CompanyListItemLogo", - "CompanyListItemOwnerUser", - "CompanyLogo", - "CompanyOwnerUser", - "CompanySocialLinksItem", "CompanyTokenTransaction", "CompanyTokenTransactionCompany", "CompanyTokenTransactionListItem", @@ -5527,7 +5572,6 @@ def __dir__(): "ConnectSocialAccountsResponse", "ConversionEvent", "ConversionEventZero", - "Countries", "Course", "CourseChapter", "CourseChapterLessonsItem", @@ -5604,11 +5648,10 @@ def __dir__(): "CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction", "CreateAdsRequestLeadFormQuestionsItemType", "CreateAdsRequestMessagingConfig", + "CreateAdsRequestMusic", "CreateAdsRequestPostSource", "CreateAdsRequestSocialAccountsItem", "CreateAiChatsRequestMessageAttachmentsItem", - "CreateApiKeyCompaniesRequestPermissionsItem", - "CreateApiKeyCompaniesResponse", "CreateApiKeysRequestApiVersionDate", "CreateApiKeysRequestPermissions", "CreateApiKeysRequestPermissionsStatementsItem", @@ -5660,7 +5703,6 @@ def __dir__(): "CreateCheckoutConfigurationsResponsePlanThreeDsLevel", "CreateCheckoutConfigurationsResponsePlanVisibility", "CreateCheckoutConfigurationsResponseThreeDsLevel", - "CreateCompaniesRequestLogo", "CreateCompanyTokenTransactionsRequest", "CreateCompanyTokenTransactionsRequestAdd", "CreateCompanyTokenTransactionsRequestSubtract", @@ -5727,18 +5769,7 @@ def __dir__(): "CreateMessagesRequestPollOptionsItem", "CreateNotificationsResponse", "CreatePartnersResponse", - "CreatePaymentsRequest", - "CreatePaymentsRequestOne", - "CreatePaymentsRequestOnePlan", - "CreatePaymentsRequestOnePlanProduct", - "CreatePaymentsRequestThree", - "CreatePaymentsRequestTwo", - "CreatePaymentsRequestZero", - "CreatePaymentsRequestZeroPlan", - "CreatePaymentsRequestZeroPlanProduct", - "CreatePaymentsResponse", - "CreatePayoutsRequestBody", - "CreatePayoutsRequestBodySpeed", + "CreatePayoutsRequestSpeed", "CreatePayoutsResponse", "CreatePayoutsResponseFailure", "CreatePayoutsResponseFeePaidBy", @@ -5877,6 +5908,12 @@ def __dir__(): "Direction", "Dispute", "DisputeAlert", + "DisputeAlertLegacy", + "DisputeAlertLegacyDispute", + "DisputeAlertLegacyPayment", + "DisputeAlertLegacyPaymentMember", + "DisputeAlertLegacyPaymentMembership", + "DisputeAlertLegacyPaymentUser", "DisputeAlertListItem", "DisputeAlertListItemDispute", "DisputeAlertListItemPayment", @@ -5893,6 +5930,23 @@ def __dir__(): "DisputeEvidenceDocumentVisibility", "DisputeEvidenceLockedReason", "DisputeIssuerComment", + "DisputeLegacy", + "DisputeLegacyCancellationPolicyAttachment", + "DisputeLegacyCompany", + "DisputeLegacyCustomerCommunicationAttachment", + "DisputeLegacyPayment", + "DisputeLegacyPaymentMember", + "DisputeLegacyPaymentMembership", + "DisputeLegacyPaymentPaymentInstrument", + "DisputeLegacyPaymentPaymentInstrumentIcons", + "DisputeLegacyPaymentPaymentInstrumentIconsSquare", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareDark", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareLight", + "DisputeLegacyPaymentUser", + "DisputeLegacyPlan", + "DisputeLegacyProduct", + "DisputeLegacyRefundPolicyAttachment", + "DisputeLegacyUncategorizedAttachment", "DisputeListItem", "DisputeListItemCompany", "DisputeListItemPayment", @@ -5989,7 +6043,6 @@ def __dir__(): "GenerateMediaRequestType", "GlobalAffiliateStatuses", "GrantableAuthorizedUserRoles", - "Granularities", "IdentityProfile", "IdentityProfileBusinessAddress", "IdentityProfileKinds", @@ -6193,7 +6246,6 @@ def __dir__(): "ListCheckoutConfigurationsResponseDataItemPlanVisibility", "ListCheckoutConfigurationsResponseDataItemThreeDsLevel", "ListCheckoutConfigurationsResponsePageInfo", - "ListCompaniesResponse", "ListCompanyTokenTransactionsResponse", "ListCourseChaptersResponse", "ListCourseLessonInteractionsResponse", @@ -6247,7 +6299,7 @@ def __dir__(): "ListExportsResponsePageInfo", "ListFeeMarkupsResponse", "ListFeesPaymentsResponse", - "ListFeesPaymentsResponseDataItem", + "ListFeesPaymentsResponsePageInfo", "ListFilesRequestDirection", "ListFilesRequestOrder", "ListFilesResponse", @@ -6282,7 +6334,12 @@ def __dir__(): "ListPaymentMethodDomainsResponse", "ListPaymentMethodDomainsResponsePageInfo", "ListPaymentMethodsResponse", + "ListPaymentsRequestBillingReason", + "ListPaymentsRequestDirection", + "ListPaymentsRequestOrder", + "ListPaymentsRequestStatus", "ListPaymentsResponse", + "ListPaymentsResponsePageInfo", "ListPayoutMethodResponse", "ListPayoutsRequestSource", "ListPayoutsRequestStatus", @@ -6344,7 +6401,10 @@ def __dir__(): "ListRecipientsTransfersResponseDataItem_User", "ListRecipientsTransfersResponsePageInfo", "ListRecommendedActionsResponse", + "ListRefundsRequestDirection", + "ListRefundsRequestOrder", "ListRefundsResponse", + "ListRefundsResponsePageInfo", "ListResolutionCenterCasesRequestDirection", "ListResolutionCenterCasesRequestOrder", "ListResolutionCenterCasesRequestOutcomeItem", @@ -6424,6 +6484,9 @@ def __dir__(): "MediaAssetStatus", "Member", "MemberAccessLevel", + "MemberLegacy", + "MemberLegacyCompany", + "MemberLegacyUser", "MemberListItem", "MemberListItemUser", "MemberMostRecentActions", @@ -6432,6 +6495,14 @@ def __dir__(): "MembersSortableColumns", "Membership", "MembershipCancellationModes", + "MembershipLegacy", + "MembershipLegacyCompany", + "MembershipLegacyCustomFieldResponsesItem", + "MembershipLegacyMember", + "MembershipLegacyPlan", + "MembershipLegacyProduct", + "MembershipLegacyPromoCode", + "MembershipLegacyUser", "MembershipListItem", "MembershipListItemCompany", "MembershipListItemMember", @@ -6485,16 +6556,14 @@ def __dir__(): "Pagination", "Passkey", "Payment", - "PaymentApplicationFee", + "PaymentAddress", "PaymentBankTransfer", "PaymentBankTransferInstructions", - "PaymentBillingAddress", "PaymentBillingDetailsPreview", - "PaymentCompany", "PaymentDeclineCodes", - "PaymentDisputesItem", - "PaymentFeesItem", - "PaymentFinancingTransactionsItem", + "PaymentFee", + "PaymentFeeOrigin", + "PaymentFeeType", "PaymentInstructions", "PaymentInstructions_BankTransfer", "PaymentInstructions_Qr", @@ -6503,6 +6572,35 @@ def __dir__(): "PaymentInstrumentCard", "PaymentLastPaymentError", "PaymentLastPaymentErrorDeclineCode", + "PaymentLegacy", + "PaymentLegacyApplicationFee", + "PaymentLegacyBillingAddress", + "PaymentLegacyCompany", + "PaymentLegacyDisputesItem", + "PaymentLegacyFeesItem", + "PaymentLegacyFinancingTransactionsItem", + "PaymentLegacyMember", + "PaymentLegacyMembership", + "PaymentLegacyPaymentInstrument", + "PaymentLegacyPaymentInstrumentCard", + "PaymentLegacyPaymentInstrumentIcons", + "PaymentLegacyPaymentInstrumentIconsCard", + "PaymentLegacyPaymentInstrumentIconsCardDark", + "PaymentLegacyPaymentInstrumentIconsCardLight", + "PaymentLegacyPaymentInstrumentIconsSquare", + "PaymentLegacyPaymentInstrumentIconsSquareDark", + "PaymentLegacyPaymentInstrumentIconsSquareLight", + "PaymentLegacyPaymentMethod", + "PaymentLegacyPaymentMethodCard", + "PaymentLegacyPlan", + "PaymentLegacyProduct", + "PaymentLegacyPromoCode", + "PaymentLegacyRefundsItem", + "PaymentLegacyResolutionsItem", + "PaymentLegacyShipment", + "PaymentLegacyShippingAddress", + "PaymentLegacyUser", + "PaymentLegacyVerificationChecks", "PaymentListItem", "PaymentListItemApplicationFee", "PaymentListItemBillingAddress", @@ -6526,8 +6624,6 @@ def __dir__(): "PaymentListItemShipment", "PaymentListItemShippingAddress", "PaymentListItemUser", - "PaymentMember", - "PaymentMembership", "PaymentMethod", "PaymentMethodBasePaymentMethod", "PaymentMethodBasePaymentMethodIcons", @@ -6670,37 +6766,18 @@ def __dir__(): "PaymentNextAction_AwaitConfirmation", "PaymentNextAction_DisplayInstructions", "PaymentNextAction_Redirect", - "PaymentPaymentInstrument", - "PaymentPaymentInstrumentCard", - "PaymentPaymentInstrumentIcons", - "PaymentPaymentInstrumentIconsCard", - "PaymentPaymentInstrumentIconsCardDark", - "PaymentPaymentInstrumentIconsCardLight", - "PaymentPaymentInstrumentIconsSquare", - "PaymentPaymentInstrumentIconsSquareDark", - "PaymentPaymentInstrumentIconsSquareLight", - "PaymentPaymentMethod", - "PaymentPaymentMethodCard", - "PaymentPlan", "PaymentProcessingDetails", - "PaymentProduct", - "PaymentPromoCode", "PaymentProviders", "PaymentQr", "PaymentQrInstructions", - "PaymentRefundsItem", "PaymentRequiredError", "PaymentRequiredErrorBody", "PaymentRequiredErrorBodyError", "PaymentRequiredErrorBodyErrorType", - "PaymentResolutionsItem", - "PaymentShipment", - "PaymentShippingAddress", "PaymentStatus", "PaymentStatusStatus", "PaymentTransactionStatuses", "PaymentTransactionTypes", - "PaymentUser", "PaymentVerificationChecks", "PaymentVoucher", "PaymentVoucherInstructions", @@ -6720,7 +6797,6 @@ def __dir__(): "Permission", "PermissionAction", "PermissionGrantedToSystemRolesItem", - "PermissionSystemRoles", "PixelValidation", "Plan", "PlanCurrency", @@ -6956,6 +7032,7 @@ def __dir__(): "PostPayoutMethodCreatedPayloadDataObject", "PostPayoutMethodCreatedPayloadDataQuote", "PostPayoutMethodCreatedPayloadDataQuoteInstant", + "PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason", "PostPayoutMethodCreatedPayloadDataQuoteStandard", "PostPayoutMethodCreatedPayloadDataStatus", "PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod", @@ -7105,6 +7182,11 @@ def __dir__(): "ProductCustomCta", "ProductGalleryImage", "ProductGlobalAffiliateStatus", + "ProductLegacy", + "ProductLegacyCompany", + "ProductLegacyGalleryImagesItem", + "ProductLegacyOwnerUser", + "ProductLegacyProductTaxCode", "ProductListItem", "ProductMarketplaceStatus", "ProductMemberAffiliateStatus", @@ -7154,16 +7236,22 @@ def __dir__(): "ReferredUsersPartnersResponseDataItemUserProfilePicture", "ReferredUsersPartnersResponsePageInfo", "Refund", + "RefundFailureReason", + "RefundLegacy", + "RefundLegacyPayment", + "RefundLegacyPaymentMember", + "RefundLegacyPaymentMembership", + "RefundLegacyPaymentPlan", + "RefundLegacyPaymentProduct", + "RefundLegacyPaymentUser", "RefundListItem", "RefundListItemPayment", - "RefundPayment", - "RefundPaymentMember", - "RefundPaymentMembership", - "RefundPaymentPlan", - "RefundPaymentProduct", - "RefundPaymentUser", + "RefundReason", + "RefundReferenceStatus", "RefundReferenceStatuses", + "RefundReferenceType", "RefundReferenceTypes", + "RefundStatus", "RefundStatuses", "ReleaseMethod", "ReplayDeliveryWebhooksResponse", @@ -7177,6 +7265,12 @@ def __dir__(): "ResolutionCenterCaseAvailableActionsItem", "ResolutionCenterCaseCustomerResponses", "ResolutionCenterCaseIssueTypes", + "ResolutionCenterCaseLegacy", + "ResolutionCenterCaseLegacyCompany", + "ResolutionCenterCaseLegacyMember", + "ResolutionCenterCaseLegacyPayment", + "ResolutionCenterCaseLegacyResolutionEventsItem", + "ResolutionCenterCaseLegacyUser", "ResolutionCenterCaseListItem", "ResolutionCenterCaseListItemCompany", "ResolutionCenterCaseListItemPayment", @@ -7193,7 +7287,6 @@ def __dir__(): "ResolutionEventAction", "ResolutionEventReporterType", "ResolutionPayment", - "ResultLabelKeys", "RetrieveAdCampaignsRequestAttributionModel", "RetrieveAdGroupsRequestAttributionModel", "RetrieveAdsRequestAttributionModel", @@ -7227,7 +7320,6 @@ def __dir__(): "RetrieveFinancialReportsResponseRowsItemGrouping", "RetrieveFinancialReportsResponseRowsItemLineCategory", "RetrieveFinancialReportsResponseRowsItemProfitAndLossSection", - "RetrievePaymentsResponse", "RetrievePayoutsResponse", "RetrievePayoutsResponseFailure", "RetrievePayoutsResponseFeePaidBy", @@ -7343,6 +7435,8 @@ def __dir__(): "Shipment", "ShipmentCheckpoint", "ShipmentCheckpointStatus", + "ShipmentLegacy", + "ShipmentLegacyPayment", "ShipmentListItem", "ShipmentListItemPayment", "ShipmentStatus", @@ -7357,7 +7451,6 @@ def __dir__(): "SocialAccountPost", "SocialAccountPostCallToAction", "SocialAccountPostRestrictionsItem", - "SocialLinkWebsites", "SpecificFeeOrigins", "Status", "Statuses", @@ -7471,6 +7564,7 @@ def __dir__(): "UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction", "UpdateAdsRequestLeadFormQuestionsItemType", "UpdateAdsRequestMessagingConfig", + "UpdateAdsRequestMusic", "UpdateAdsRequestPostSource", "UpdateAdsRequestSocialAccountsItem", "UpdateApiKeysRequestApiVersionDate", @@ -7493,10 +7587,6 @@ def __dir__(): "UpdateCardsResponseSecrets", "UpdateCardsResponseStatus", "UpdateCardsResponseType", - "UpdateCompaniesRequestBannerImage", - "UpdateCompaniesRequestLogo", - "UpdateCompaniesRequestSocialLinksItem", - "UpdateCompaniesRequestSocialLinksItemImage", "UpdateCourseLessonsRequestAssessmentCompletionRequirement", "UpdateCourseLessonsRequestAssessmentQuestionsItem", "UpdateCourseLessonsRequestAssessmentQuestionsItemImage", @@ -7614,7 +7704,6 @@ def __dir__(): "accounts", "ad_campaigns", "ad_groups", - "ad_reports", "ads", "affiliates", "ai_chats", @@ -7630,7 +7719,6 @@ def __dir__(): "cards", "chat_channels", "checkout_configurations", - "companies", "company_token_transactions", "confirmation_tokens", "course_chapters", diff --git a/src/whop_sdk/access_tokens/client.py b/src/whop_sdk/access_tokens/client.py index cde753f8..d8ca7f44 100644 --- a/src/whop_sdk/access_tokens/client.py +++ b/src/whop_sdk/access_tokens/client.py @@ -66,7 +66,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -138,7 +138,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/account_links/client.py b/src/whop_sdk/account_links/client.py index 94243f37..900e51cd 100644 --- a/src/whop_sdk/account_links/client.py +++ b/src/whop_sdk/account_links/client.py @@ -66,7 +66,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -143,7 +143,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/accounts/client.py b/src/whop_sdk/accounts/client.py index 0fa1c8a8..c046acfc 100644 --- a/src/whop_sdk/accounts/client.py +++ b/src/whop_sdk/accounts/client.py @@ -140,7 +140,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -215,7 +215,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -251,7 +251,7 @@ def me(self, *, request_options: typing.Optional[RequestOptions] = None) -> Acco from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -282,7 +282,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -474,7 +474,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -561,7 +561,7 @@ def form_company( High-level business category, from the Whop business taxonomy. Valid values are listed on [business types and industries glossary](/api-reference/beta/accounts/account#business-types-and-industries-glossary). formation_state : FormCompanyAccountsRequestFormationState - Two-letter code of the US state (or `DC`) to form the company in. + Two-letter code of the US state (or `DC`) to form the company in. We recommend `WY` because Wyoming formations are completed the same day. founders : typing.Sequence[FormCompanyAccountsRequestFoundersItem] The company's founders. Exactly one must be marked `is_primary` — the responsible party for the filing. @@ -615,7 +615,7 @@ def form_company( ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -636,7 +636,7 @@ def form_company( entity_suffix="LLC", entity_type="llc", expedite_ein=True, - formation_state="TX", + formation_state="WY", founders=[ FormCompanyAccountsRequestFoundersItem( address=FormCompanyAccountsRequestFoundersItemAddress( @@ -709,7 +709,7 @@ def suspend(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -759,7 +759,7 @@ def transfer_ownership( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -885,7 +885,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -969,7 +969,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1013,7 +1013,7 @@ async def me(self, *, request_options: typing.Optional[RequestOptions] = None) - from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1052,7 +1052,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1252,7 +1252,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1345,7 +1345,7 @@ async def form_company( High-level business category, from the Whop business taxonomy. Valid values are listed on [business types and industries glossary](/api-reference/beta/accounts/account#business-types-and-industries-glossary). formation_state : FormCompanyAccountsRequestFormationState - Two-letter code of the US state (or `DC`) to form the company in. + Two-letter code of the US state (or `DC`) to form the company in. We recommend `WY` because Wyoming formations are completed the same day. founders : typing.Sequence[FormCompanyAccountsRequestFoundersItem] The company's founders. Exactly one must be marked `is_primary` — the responsible party for the filing. @@ -1401,7 +1401,7 @@ async def form_company( ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1425,7 +1425,7 @@ async def main() -> None: entity_suffix="LLC", entity_type="llc", expedite_ein=True, - formation_state="TX", + formation_state="WY", founders=[ FormCompanyAccountsRequestFoundersItem( address=FormCompanyAccountsRequestFoundersItemAddress( @@ -1503,7 +1503,7 @@ async def suspend(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1561,7 +1561,7 @@ async def transfer_ownership( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/accounts/preferences/client.py b/src/whop_sdk/accounts/preferences/client.py index b8fb441a..9f345817 100644 --- a/src/whop_sdk/accounts/preferences/client.py +++ b/src/whop_sdk/accounts/preferences/client.py @@ -55,7 +55,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -117,7 +117,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -179,7 +179,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -249,7 +249,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/accounts/raw_client.py b/src/whop_sdk/accounts/raw_client.py index 167af66e..029e98d5 100644 --- a/src/whop_sdk/accounts/raw_client.py +++ b/src/whop_sdk/accounts/raw_client.py @@ -823,7 +823,7 @@ def form_company( High-level business category, from the Whop business taxonomy. Valid values are listed on [business types and industries glossary](/api-reference/beta/accounts/account#business-types-and-industries-glossary). formation_state : FormCompanyAccountsRequestFormationState - Two-letter code of the US state (or `DC`) to form the company in. + Two-letter code of the US state (or `DC`) to form the company in. We recommend `WY` because Wyoming formations are completed the same day. founders : typing.Sequence[FormCompanyAccountsRequestFoundersItem] The company's founders. Exactly one must be marked `is_primary` — the responsible party for the filing. @@ -1920,7 +1920,7 @@ async def form_company( High-level business category, from the Whop business taxonomy. Valid values are listed on [business types and industries glossary](/api-reference/beta/accounts/account#business-types-and-industries-glossary). formation_state : FormCompanyAccountsRequestFormationState - Two-letter code of the US state (or `DC`) to form the company in. + Two-letter code of the US state (or `DC`) to form the company in. We recommend `WY` because Wyoming formations are completed the same day. founders : typing.Sequence[FormCompanyAccountsRequestFoundersItem] The company's founders. Exactly one must be marked `is_primary` — the responsible party for the filing. diff --git a/src/whop_sdk/accounts/reserves/client.py b/src/whop_sdk/accounts/reserves/client.py index 1d85f2e6..90b83393 100644 --- a/src/whop_sdk/accounts/reserves/client.py +++ b/src/whop_sdk/accounts/reserves/client.py @@ -45,7 +45,7 @@ def list(self, account_id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -98,7 +98,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/ad_campaigns/client.py b/src/whop_sdk/ad_campaigns/client.py index 5aa7246a..22460be2 100644 --- a/src/whop_sdk/ad_campaigns/client.py +++ b/src/whop_sdk/ad_campaigns/client.py @@ -133,7 +133,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -234,7 +234,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -304,7 +304,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -344,7 +344,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -418,7 +418,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -476,7 +476,7 @@ def duplicate( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -511,7 +511,7 @@ def pause(self, id: str, *, request_options: typing.Optional[RequestOptions] = N from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -544,7 +544,7 @@ def retry_payment(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -577,7 +577,7 @@ def unpause(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -689,7 +689,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -799,7 +799,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -877,7 +877,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -927,7 +927,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1009,7 +1009,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1075,7 +1075,7 @@ async def duplicate( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1118,7 +1118,7 @@ async def pause(self, id: str, *, request_options: typing.Optional[RequestOption from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1159,7 +1159,7 @@ async def retry_payment(self, id: str, *, request_options: typing.Optional[Reque from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1200,7 +1200,7 @@ async def unpause(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/ad_groups/client.py b/src/whop_sdk/ad_groups/client.py index ce890c8b..5c03a37f 100644 --- a/src/whop_sdk/ad_groups/client.py +++ b/src/whop_sdk/ad_groups/client.py @@ -159,7 +159,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -259,7 +259,7 @@ def create( Device platforms and operating systems to target. dynamic_creative : typing.Optional[bool] - Let the ad platform automatically mix and match this ad group's creatives and copy to find the best-performing combinations. Set at creation; can't be changed afterward. + Whether the ad platform automatically mixes and matches this ad group's creatives and copy to find the best-performing combinations. Meta has deprecated it and rejects `true`; ad groups already using it keep it, and it can't be changed afterward. ends_at : typing.Optional[str] When the ad group stops delivering, as an ISO 8601 timestamp. Omit to run until paused. @@ -316,7 +316,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -407,7 +407,7 @@ def estimate_reach( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -498,7 +498,7 @@ def search_targeting_options( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -562,7 +562,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -602,7 +602,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -732,7 +732,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -806,7 +806,7 @@ def duplicate( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -845,7 +845,7 @@ def pause(self, id: str, *, request_options: typing.Optional[RequestOptions] = N from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -878,7 +878,7 @@ def unpause(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -998,7 +998,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1105,7 +1105,7 @@ async def create( Device platforms and operating systems to target. dynamic_creative : typing.Optional[bool] - Let the ad platform automatically mix and match this ad group's creatives and copy to find the best-performing combinations. Set at creation; can't be changed afterward. + Whether the ad platform automatically mixes and matches this ad group's creatives and copy to find the best-performing combinations. Meta has deprecated it and rejects `true`; ad groups already using it keep it, and it can't be changed afterward. ends_at : typing.Optional[str] When the ad group stops delivering, as an ISO 8601 timestamp. Omit to run until paused. @@ -1164,7 +1164,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1263,7 +1263,7 @@ async def estimate_reach( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1362,7 +1362,7 @@ async def search_targeting_options( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1434,7 +1434,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1484,7 +1484,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1622,7 +1622,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1704,7 +1704,7 @@ async def duplicate( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1751,7 +1751,7 @@ async def pause(self, id: str, *, request_options: typing.Optional[RequestOption from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1792,7 +1792,7 @@ async def unpause(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/ad_groups/raw_client.py b/src/whop_sdk/ad_groups/raw_client.py index d9121843..096cd71a 100644 --- a/src/whop_sdk/ad_groups/raw_client.py +++ b/src/whop_sdk/ad_groups/raw_client.py @@ -291,7 +291,7 @@ def create( Device platforms and operating systems to target. dynamic_creative : typing.Optional[bool] - Let the ad platform automatically mix and match this ad group's creatives and copy to find the best-performing combinations. Set at creation; can't be changed afterward. + Whether the ad platform automatically mixes and matches this ad group's creatives and copy to find the best-performing combinations. Meta has deprecated it and rejects `true`; ad groups already using it keep it, and it can't be changed afterward. ends_at : typing.Optional[str] When the ad group stops delivering, as an ISO 8601 timestamp. Omit to run until paused. @@ -1455,7 +1455,7 @@ async def create( Device platforms and operating systems to target. dynamic_creative : typing.Optional[bool] - Let the ad platform automatically mix and match this ad group's creatives and copy to find the best-performing combinations. Set at creation; can't be changed afterward. + Whether the ad platform automatically mixes and matches this ad group's creatives and copy to find the best-performing combinations. Meta has deprecated it and rejects `true`; ad groups already using it keep it, and it can't be changed afterward. ends_at : typing.Optional[str] When the ad group stops delivering, as an ISO 8601 timestamp. Omit to run until paused. diff --git a/src/whop_sdk/ad_reports/__init__.py b/src/whop_sdk/ad_reports/__init__.py deleted file mode 100644 index 5cde0202..00000000 --- a/src/whop_sdk/ad_reports/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/src/whop_sdk/ad_reports/client.py b/src/whop_sdk/ad_reports/client.py deleted file mode 100644 index fe455657..00000000 --- a/src/whop_sdk/ad_reports/client.py +++ /dev/null @@ -1,230 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.ad_report import AdReport -from ..types.ad_report_breakdown_levels import AdReportBreakdownLevels -from ..types.granularities import Granularities -from .raw_client import AsyncRawAdReportsClient, RawAdReportsClient - - -class AdReportsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawAdReportsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawAdReportsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawAdReportsClient - """ - return self._raw_client - - def retrieve( - self, - *, - from_: dt.datetime, - to: dt.datetime, - ad_campaign_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_group_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - breakdown: typing.Optional[AdReportBreakdownLevels] = None, - company_id: typing.Optional[str] = None, - currency: typing.Optional[str] = None, - granularity: typing.Optional[Granularities] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AdReport: - """ - Performance report for a company, ad campaigns, ad groups, or ads. Always returns aggregate `summary` totals summed across the scope. Set `granularity` to additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. - - Required permissions: - - `ad_campaign:stats:read` - - Parameters - ---------- - from_ : dt.datetime - Inclusive start of the reporting window. - - to : dt.datetime - Inclusive end of the reporting window. - - ad_campaign_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad campaigns (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. - - ad_group_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad groups (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. - - ad_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ads (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. - - breakdown : typing.Optional[AdReportBreakdownLevels] - - company_id : typing.Optional[str] - The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every campaign, ad group, or ad in the company without paging. - - currency : typing.Optional[str] - ISO 4217 currency code to report `spend` in. Defaults to the company's ads reporting currency. - - granularity : typing.Optional[Granularities] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AdReport - A successful response - - Examples - -------- - import datetime - - from whop_sdk import Whop - - client = Whop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - client.ad_reports.retrieve( - company_id="biz_xxxxxxxxxxxxxx", - from_=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - to=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) - """ - _response = self._raw_client.retrieve( - from_=from_, - to=to, - ad_campaign_ids=ad_campaign_ids, - ad_group_ids=ad_group_ids, - ad_ids=ad_ids, - breakdown=breakdown, - company_id=company_id, - currency=currency, - granularity=granularity, - request_options=request_options, - ) - return _response.data - - -class AsyncAdReportsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawAdReportsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawAdReportsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawAdReportsClient - """ - return self._raw_client - - async def retrieve( - self, - *, - from_: dt.datetime, - to: dt.datetime, - ad_campaign_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_group_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - breakdown: typing.Optional[AdReportBreakdownLevels] = None, - company_id: typing.Optional[str] = None, - currency: typing.Optional[str] = None, - granularity: typing.Optional[Granularities] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AdReport: - """ - Performance report for a company, ad campaigns, ad groups, or ads. Always returns aggregate `summary` totals summed across the scope. Set `granularity` to additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. - - Required permissions: - - `ad_campaign:stats:read` - - Parameters - ---------- - from_ : dt.datetime - Inclusive start of the reporting window. - - to : dt.datetime - Inclusive end of the reporting window. - - ad_campaign_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad campaigns (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. - - ad_group_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad groups (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. - - ad_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ads (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. - - breakdown : typing.Optional[AdReportBreakdownLevels] - - company_id : typing.Optional[str] - The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every campaign, ad group, or ad in the company without paging. - - currency : typing.Optional[str] - ISO 4217 currency code to report `spend` in. Defaults to the company's ads reporting currency. - - granularity : typing.Optional[Granularities] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AdReport - A successful response - - Examples - -------- - import asyncio - import datetime - - from whop_sdk import AsyncWhop - - client = AsyncWhop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.ad_reports.retrieve( - company_id="biz_xxxxxxxxxxxxxx", - from_=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - to=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.retrieve( - from_=from_, - to=to, - ad_campaign_ids=ad_campaign_ids, - ad_group_ids=ad_group_ids, - ad_ids=ad_ids, - breakdown=breakdown, - company_id=company_id, - currency=currency, - granularity=granularity, - request_options=request_options, - ) - return _response.data diff --git a/src/whop_sdk/ad_reports/raw_client.py b/src/whop_sdk/ad_reports/raw_client.py deleted file mode 100644 index a1a629c7..00000000 --- a/src/whop_sdk/ad_reports/raw_client.py +++ /dev/null @@ -1,368 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.datetime_utils import serialize_datetime -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.parse_error import ParsingError -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from ..errors.bad_request_error import BadRequestError -from ..errors.forbidden_error import ForbiddenError -from ..errors.internal_server_error import InternalServerError -from ..errors.not_found_error import NotFoundError -from ..errors.too_many_requests_error import TooManyRequestsError -from ..errors.unauthorized_error import UnauthorizedError -from ..errors.unprocessable_entity_error import UnprocessableEntityError -from ..types.ad_report import AdReport -from ..types.ad_report_breakdown_levels import AdReportBreakdownLevels -from ..types.granularities import Granularities -from pydantic import ValidationError - - -class RawAdReportsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def retrieve( - self, - *, - from_: dt.datetime, - to: dt.datetime, - ad_campaign_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_group_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - breakdown: typing.Optional[AdReportBreakdownLevels] = None, - company_id: typing.Optional[str] = None, - currency: typing.Optional[str] = None, - granularity: typing.Optional[Granularities] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[AdReport]: - """ - Performance report for a company, ad campaigns, ad groups, or ads. Always returns aggregate `summary` totals summed across the scope. Set `granularity` to additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. - - Required permissions: - - `ad_campaign:stats:read` - - Parameters - ---------- - from_ : dt.datetime - Inclusive start of the reporting window. - - to : dt.datetime - Inclusive end of the reporting window. - - ad_campaign_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad campaigns (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. - - ad_group_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad groups (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. - - ad_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ads (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. - - breakdown : typing.Optional[AdReportBreakdownLevels] - - company_id : typing.Optional[str] - The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every campaign, ad group, or ad in the company without paging. - - currency : typing.Optional[str] - ISO 4217 currency code to report `spend` in. Defaults to the company's ads reporting currency. - - granularity : typing.Optional[Granularities] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[AdReport] - A successful response - """ - _response = self._client_wrapper.httpx_client.request( - "ad_reports", - method="GET", - params={ - "ad_campaign_ids": ad_campaign_ids, - "ad_group_ids": ad_group_ids, - "ad_ids": ad_ids, - "breakdown": breakdown, - "company_id": company_id, - "currency": currency, - "from": serialize_datetime(from_), - "granularity": granularity, - "to": serialize_datetime(to), - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - AdReport, - parse_obj_as( - type_=AdReport, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawAdReportsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def retrieve( - self, - *, - from_: dt.datetime, - to: dt.datetime, - ad_campaign_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_group_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ad_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - breakdown: typing.Optional[AdReportBreakdownLevels] = None, - company_id: typing.Optional[str] = None, - currency: typing.Optional[str] = None, - granularity: typing.Optional[Granularities] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[AdReport]: - """ - Performance report for a company, ad campaigns, ad groups, or ads. Always returns aggregate `summary` totals summed across the scope. Set `granularity` to additionally get a time series, or set `breakdown` (`campaign`/`ad_group`/`ad`) to additionally get per-entity rows inside the requested scope. Exactly one of `companyId`, `adCampaignIds`, `adGroupIds`, or `adIds` must be provided. - - Required permissions: - - `ad_campaign:stats:read` - - Parameters - ---------- - from_ : dt.datetime - Inclusive start of the reporting window. - - to : dt.datetime - Inclusive end of the reporting window. - - ad_campaign_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad campaigns (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adGroupIds`, and `adIds`. - - ad_group_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ad groups (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adIds`. - - ad_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Scope the report to these ads (max 100); stats are summed across them. Mutually exclusive with `companyId`, `adCampaignIds`, and `adGroupIds`. - - breakdown : typing.Optional[AdReportBreakdownLevels] - - company_id : typing.Optional[str] - The unique identifier of a company. Mutually exclusive with `adCampaignIds`, `adGroupIds`, and `adIds`. Use with `breakdown` to fan out across every campaign, ad group, or ad in the company without paging. - - currency : typing.Optional[str] - ISO 4217 currency code to report `spend` in. Defaults to the company's ads reporting currency. - - granularity : typing.Optional[Granularities] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[AdReport] - A successful response - """ - _response = await self._client_wrapper.httpx_client.request( - "ad_reports", - method="GET", - params={ - "ad_campaign_ids": ad_campaign_ids, - "ad_group_ids": ad_group_ids, - "ad_ids": ad_ids, - "breakdown": breakdown, - "company_id": company_id, - "currency": currency, - "from": serialize_datetime(from_), - "granularity": granularity, - "to": serialize_datetime(to), - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - AdReport, - parse_obj_as( - type_=AdReport, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/whop_sdk/ads/__init__.py b/src/whop_sdk/ads/__init__.py index f80653b7..50bc1576 100644 --- a/src/whop_sdk/ads/__init__.py +++ b/src/whop_sdk/ads/__init__.py @@ -25,6 +25,7 @@ CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction, CreateAdsRequestLeadFormQuestionsItemType, CreateAdsRequestMessagingConfig, + CreateAdsRequestMusic, CreateAdsRequestPostSource, CreateAdsRequestSocialAccountsItem, DeleteAdsResponse, @@ -54,6 +55,7 @@ UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction, UpdateAdsRequestLeadFormQuestionsItemType, UpdateAdsRequestMessagingConfig, + UpdateAdsRequestMusic, UpdateAdsRequestPostSource, UpdateAdsRequestSocialAccountsItem, ) @@ -76,6 +78,7 @@ "CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction": ".types", "CreateAdsRequestLeadFormQuestionsItemType": ".types", "CreateAdsRequestMessagingConfig": ".types", + "CreateAdsRequestMusic": ".types", "CreateAdsRequestPostSource": ".types", "CreateAdsRequestSocialAccountsItem": ".types", "DeleteAdsResponse": ".types", @@ -105,6 +108,7 @@ "UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction": ".types", "UpdateAdsRequestLeadFormQuestionsItemType": ".types", "UpdateAdsRequestMessagingConfig": ".types", + "UpdateAdsRequestMusic": ".types", "UpdateAdsRequestPostSource": ".types", "UpdateAdsRequestSocialAccountsItem": ".types", } @@ -150,6 +154,7 @@ def __dir__(): "CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction", "CreateAdsRequestLeadFormQuestionsItemType", "CreateAdsRequestMessagingConfig", + "CreateAdsRequestMusic", "CreateAdsRequestPostSource", "CreateAdsRequestSocialAccountsItem", "DeleteAdsResponse", @@ -179,6 +184,7 @@ def __dir__(): "UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction", "UpdateAdsRequestLeadFormQuestionsItemType", "UpdateAdsRequestMessagingConfig", + "UpdateAdsRequestMusic", "UpdateAdsRequestPostSource", "UpdateAdsRequestSocialAccountsItem", ] diff --git a/src/whop_sdk/ads/client.py b/src/whop_sdk/ads/client.py index 03932f55..7227d389 100644 --- a/src/whop_sdk/ads/client.py +++ b/src/whop_sdk/ads/client.py @@ -11,6 +11,7 @@ from .types.create_ads_request_creatives_item import CreateAdsRequestCreativesItem from .types.create_ads_request_lead_form import CreateAdsRequestLeadForm from .types.create_ads_request_messaging_config import CreateAdsRequestMessagingConfig +from .types.create_ads_request_music import CreateAdsRequestMusic from .types.create_ads_request_post_source import CreateAdsRequestPostSource from .types.create_ads_request_social_accounts_item import CreateAdsRequestSocialAccountsItem from .types.delete_ads_response import DeleteAdsResponse @@ -25,6 +26,7 @@ from .types.update_ads_request_creatives_item import UpdateAdsRequestCreativesItem from .types.update_ads_request_lead_form import UpdateAdsRequestLeadForm from .types.update_ads_request_messaging_config import UpdateAdsRequestMessagingConfig +from .types.update_ads_request_music import UpdateAdsRequestMusic from .types.update_ads_request_post_source import UpdateAdsRequestPostSource from .types.update_ads_request_social_accounts_item import UpdateAdsRequestSocialAccountsItem @@ -146,7 +148,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -197,6 +199,7 @@ def create( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[CreateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[CreateAdsRequestMusic] = OMIT, post_source: typing.Optional[CreateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[CreateAdsRequestSocialAccountsItem]] = OMIT, @@ -220,7 +223,7 @@ def create( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[CreateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Two or more entries with no format become a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Entries with no format become a carousel's ordered cards, sharing the ad's copy — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -243,6 +246,9 @@ def create( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[CreateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. + post_source : typing.Optional[CreateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -274,7 +280,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -292,6 +298,7 @@ def create( lead_form_id=lead_form_id, messaging_config=messaging_config, multi_advertiser_ads=multi_advertiser_ads, + music=music, post_source=post_source, primary_texts=primary_texts, social_accounts=social_accounts, @@ -345,7 +352,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -385,7 +392,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -409,6 +416,7 @@ def update( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[UpdateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[UpdateAdsRequestMusic] = OMIT, post_source: typing.Optional[UpdateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[UpdateAdsRequestSocialAccountsItem]] = OMIT, @@ -429,7 +437,7 @@ def update( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[UpdateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Two or more entries with no format replace it with a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Entries with no format replace it with a carousel's ordered cards — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -452,6 +460,9 @@ def update( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[UpdateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Omitted leaves the ad's music untouched. Null removes it before launch; a submitted carousel takes a replacement track instead. TikTok-only. + post_source : typing.Optional[UpdateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -483,7 +494,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -502,6 +513,7 @@ def update( lead_form_id=lead_form_id, messaging_config=messaging_config, multi_advertiser_ads=multi_advertiser_ads, + music=music, post_source=post_source, primary_texts=primary_texts, social_accounts=social_accounts, @@ -551,7 +563,7 @@ def duplicate( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -590,7 +602,7 @@ def pause(self, id: str, *, request_options: typing.Optional[RequestOptions] = N from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -623,7 +635,7 @@ def unpause(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -751,7 +763,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -809,6 +821,7 @@ async def create( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[CreateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[CreateAdsRequestMusic] = OMIT, post_source: typing.Optional[CreateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[CreateAdsRequestSocialAccountsItem]] = OMIT, @@ -832,7 +845,7 @@ async def create( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[CreateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Two or more entries with no format become a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Entries with no format become a carousel's ordered cards, sharing the ad's copy — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -855,6 +868,9 @@ async def create( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[CreateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. + post_source : typing.Optional[CreateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -888,7 +904,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -912,6 +928,7 @@ async def main() -> None: lead_form_id=lead_form_id, messaging_config=messaging_config, multi_advertiser_ads=multi_advertiser_ads, + music=music, post_source=post_source, primary_texts=primary_texts, social_accounts=social_accounts, @@ -967,7 +984,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1015,7 +1032,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1045,6 +1062,7 @@ async def update( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[UpdateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[UpdateAdsRequestMusic] = OMIT, post_source: typing.Optional[UpdateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[UpdateAdsRequestSocialAccountsItem]] = OMIT, @@ -1065,7 +1083,7 @@ async def update( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[UpdateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Two or more entries with no format replace it with a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Entries with no format replace it with a carousel's ordered cards — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -1088,6 +1106,9 @@ async def update( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[UpdateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Omitted leaves the ad's music untouched. Null removes it before launch; a submitted carousel takes a replacement track instead. TikTok-only. + post_source : typing.Optional[UpdateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -1121,7 +1142,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1146,6 +1167,7 @@ async def main() -> None: lead_form_id=lead_form_id, messaging_config=messaging_config, multi_advertiser_ads=multi_advertiser_ads, + music=music, post_source=post_source, primary_texts=primary_texts, social_accounts=social_accounts, @@ -1197,7 +1219,7 @@ async def duplicate( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1244,7 +1266,7 @@ async def pause(self, id: str, *, request_options: typing.Optional[RequestOption from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1285,7 +1307,7 @@ async def unpause(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/ads/raw_client.py b/src/whop_sdk/ads/raw_client.py index 12dcf2be..88210bd6 100644 --- a/src/whop_sdk/ads/raw_client.py +++ b/src/whop_sdk/ads/raw_client.py @@ -22,6 +22,7 @@ from .types.create_ads_request_creatives_item import CreateAdsRequestCreativesItem from .types.create_ads_request_lead_form import CreateAdsRequestLeadForm from .types.create_ads_request_messaging_config import CreateAdsRequestMessagingConfig +from .types.create_ads_request_music import CreateAdsRequestMusic from .types.create_ads_request_post_source import CreateAdsRequestPostSource from .types.create_ads_request_social_accounts_item import CreateAdsRequestSocialAccountsItem from .types.delete_ads_response import DeleteAdsResponse @@ -36,6 +37,7 @@ from .types.update_ads_request_creatives_item import UpdateAdsRequestCreativesItem from .types.update_ads_request_lead_form import UpdateAdsRequestLeadForm from .types.update_ads_request_messaging_config import UpdateAdsRequestMessagingConfig +from .types.update_ads_request_music import UpdateAdsRequestMusic from .types.update_ads_request_post_source import UpdateAdsRequestPostSource from .types.update_ads_request_social_accounts_item import UpdateAdsRequestSocialAccountsItem from pydantic import ValidationError @@ -251,6 +253,7 @@ def create( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[CreateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[CreateAdsRequestMusic] = OMIT, post_source: typing.Optional[CreateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[CreateAdsRequestSocialAccountsItem]] = OMIT, @@ -274,7 +277,7 @@ def create( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[CreateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Two or more entries with no format become a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Entries with no format become a carousel's ordered cards, sharing the ad's copy — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -297,6 +300,9 @@ def create( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[CreateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. + post_source : typing.Optional[CreateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -344,6 +350,9 @@ def create( object_=messaging_config, annotation=CreateAdsRequestMessagingConfig, direction="write" ), "multi_advertiser_ads": multi_advertiser_ads, + "music": convert_and_respect_annotation_metadata( + object_=music, annotation=typing.Optional[CreateAdsRequestMusic], direction="write" + ), "post_source": post_source, "primary_texts": primary_texts, "social_accounts": convert_and_respect_annotation_metadata( @@ -559,6 +568,7 @@ def update( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[UpdateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[UpdateAdsRequestMusic] = OMIT, post_source: typing.Optional[UpdateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[UpdateAdsRequestSocialAccountsItem]] = OMIT, @@ -579,7 +589,7 @@ def update( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[UpdateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Two or more entries with no format replace it with a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Entries with no format replace it with a carousel's ordered cards — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -602,6 +612,9 @@ def update( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[UpdateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Omitted leaves the ad's music untouched. Null removes it before launch; a submitted carousel takes a replacement track instead. TikTok-only. + post_source : typing.Optional[UpdateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -647,6 +660,9 @@ def update( object_=messaging_config, annotation=UpdateAdsRequestMessagingConfig, direction="write" ), "multi_advertiser_ads": multi_advertiser_ads, + "music": convert_and_respect_annotation_metadata( + object_=music, annotation=typing.Optional[UpdateAdsRequestMusic], direction="write" + ), "post_source": post_source, "primary_texts": primary_texts, "social_accounts": convert_and_respect_annotation_metadata( @@ -1098,6 +1114,7 @@ async def create( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[CreateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[CreateAdsRequestMusic] = OMIT, post_source: typing.Optional[CreateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[CreateAdsRequestSocialAccountsItem]] = OMIT, @@ -1121,7 +1138,7 @@ async def create( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[CreateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Two or more entries with no format become a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Entries with no format become a carousel's ordered cards, sharing the ad's copy — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -1144,6 +1161,9 @@ async def create( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[CreateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. + post_source : typing.Optional[CreateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -1191,6 +1211,9 @@ async def create( object_=messaging_config, annotation=CreateAdsRequestMessagingConfig, direction="write" ), "multi_advertiser_ads": multi_advertiser_ads, + "music": convert_and_respect_annotation_metadata( + object_=music, annotation=typing.Optional[CreateAdsRequestMusic], direction="write" + ), "post_source": post_source, "primary_texts": primary_texts, "social_accounts": convert_and_respect_annotation_metadata( @@ -1406,6 +1429,7 @@ async def update( lead_form_id: typing.Optional[str] = OMIT, messaging_config: typing.Optional[UpdateAdsRequestMessagingConfig] = OMIT, multi_advertiser_ads: typing.Optional[bool] = OMIT, + music: typing.Optional[UpdateAdsRequestMusic] = OMIT, post_source: typing.Optional[UpdateAdsRequestPostSource] = OMIT, primary_texts: typing.Optional[typing.Sequence[str]] = OMIT, social_accounts: typing.Optional[typing.Sequence[UpdateAdsRequestSocialAccountsItem]] = OMIT, @@ -1426,7 +1450,7 @@ async def update( The call-to-action button shown on the ad. creatives : typing.Optional[typing.Sequence[UpdateAdsRequestCreativesItem]] - The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Two or more entries with no format replace it with a carousel (2-10 attachments), in order, sharing the ad's copy. + The ad's creative assets. Each entry is an uploaded file id with an optional format; omit format for the original asset. Replaces a live ad's creative on the platform. Entries with no format replace it with a carousel's ordered cards — 2-10 of them on Meta, while TikTok runs even a single image as a one-card carousel. descriptions : typing.Optional[typing.Sequence[str]] The description variants shown on the ad. @@ -1449,6 +1473,9 @@ async def update( multi_advertiser_ads : typing.Optional[bool] Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. + music : typing.Optional[UpdateAdsRequestMusic] + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Omitted leaves the ad's music untouched. Null removes it before launch; a submitted carousel takes a replacement track instead. TikTok-only. + post_source : typing.Optional[UpdateAdsRequestPostSource] Identifies the network that owns `existing_post_id`. The source is inferred from the ID shape when omitted. @@ -1494,6 +1521,9 @@ async def update( object_=messaging_config, annotation=UpdateAdsRequestMessagingConfig, direction="write" ), "multi_advertiser_ads": multi_advertiser_ads, + "music": convert_and_respect_annotation_metadata( + object_=music, annotation=typing.Optional[UpdateAdsRequestMusic], direction="write" + ), "post_source": post_source, "primary_texts": primary_texts, "social_accounts": convert_and_respect_annotation_metadata( diff --git a/src/whop_sdk/ads/types/__init__.py b/src/whop_sdk/ads/types/__init__.py index 83f8c54b..b59ba6ee 100644 --- a/src/whop_sdk/ads/types/__init__.py +++ b/src/whop_sdk/ads/types/__init__.py @@ -32,6 +32,7 @@ ) from .create_ads_request_lead_form_questions_item_type import CreateAdsRequestLeadFormQuestionsItemType from .create_ads_request_messaging_config import CreateAdsRequestMessagingConfig + from .create_ads_request_music import CreateAdsRequestMusic from .create_ads_request_post_source import CreateAdsRequestPostSource from .create_ads_request_social_accounts_item import CreateAdsRequestSocialAccountsItem from .delete_ads_response import DeleteAdsResponse @@ -69,6 +70,7 @@ ) from .update_ads_request_lead_form_questions_item_type import UpdateAdsRequestLeadFormQuestionsItemType from .update_ads_request_messaging_config import UpdateAdsRequestMessagingConfig + from .update_ads_request_music import UpdateAdsRequestMusic from .update_ads_request_post_source import UpdateAdsRequestPostSource from .update_ads_request_social_accounts_item import UpdateAdsRequestSocialAccountsItem _dynamic_imports: typing.Dict[str, str] = { @@ -90,6 +92,7 @@ "CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction": ".create_ads_request_lead_form_questions_item_options_item_logic_action", "CreateAdsRequestLeadFormQuestionsItemType": ".create_ads_request_lead_form_questions_item_type", "CreateAdsRequestMessagingConfig": ".create_ads_request_messaging_config", + "CreateAdsRequestMusic": ".create_ads_request_music", "CreateAdsRequestPostSource": ".create_ads_request_post_source", "CreateAdsRequestSocialAccountsItem": ".create_ads_request_social_accounts_item", "DeleteAdsResponse": ".delete_ads_response", @@ -119,6 +122,7 @@ "UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction": ".update_ads_request_lead_form_questions_item_options_item_logic_action", "UpdateAdsRequestLeadFormQuestionsItemType": ".update_ads_request_lead_form_questions_item_type", "UpdateAdsRequestMessagingConfig": ".update_ads_request_messaging_config", + "UpdateAdsRequestMusic": ".update_ads_request_music", "UpdateAdsRequestPostSource": ".update_ads_request_post_source", "UpdateAdsRequestSocialAccountsItem": ".update_ads_request_social_accounts_item", } @@ -164,6 +168,7 @@ def __dir__(): "CreateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction", "CreateAdsRequestLeadFormQuestionsItemType", "CreateAdsRequestMessagingConfig", + "CreateAdsRequestMusic", "CreateAdsRequestPostSource", "CreateAdsRequestSocialAccountsItem", "DeleteAdsResponse", @@ -193,6 +198,7 @@ def __dir__(): "UpdateAdsRequestLeadFormQuestionsItemOptionsItemLogicAction", "UpdateAdsRequestLeadFormQuestionsItemType", "UpdateAdsRequestMessagingConfig", + "UpdateAdsRequestMusic", "UpdateAdsRequestPostSource", "UpdateAdsRequestSocialAccountsItem", ] diff --git a/src/whop_sdk/companies/types/update_companies_request_banner_image.py b/src/whop_sdk/ads/types/create_ads_request_music.py similarity index 67% rename from src/whop_sdk/companies/types/update_companies_request_banner_image.py rename to src/whop_sdk/ads/types/create_ads_request_music.py index 1b5eba00..56558433 100644 --- a/src/whop_sdk/companies/types/update_companies_request_banner_image.py +++ b/src/whop_sdk/ads/types/create_ads_request_music.py @@ -6,14 +6,14 @@ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class UpdateCompaniesRequestBannerImage(UniversalBaseModel): +class CreateAdsRequestMusic(UniversalBaseModel): """ - The company's banner image. Accepts PNG or JPEG format. + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Required for TikTok carousels (image creatives); TikTok-only. """ id: str = pydantic.Field() """ - The ID of an existing file object. + Uploaded MP3 file ID, prefixed `file_`. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/ads/types/update_ads_request_music.py b/src/whop_sdk/ads/types/update_ads_request_music.py new file mode 100644 index 00000000..99bea827 --- /dev/null +++ b/src/whop_sdk/ads/types/update_ads_request_music.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UpdateAdsRequestMusic(UniversalBaseModel): + """ + The looping track a TikTok carousel ad plays — an MP3 you uploaded, no larger than 10MB. Omitted leaves the ad's music untouched. Null removes it before launch; a submitted carousel takes a replacement track instead. TikTok-only. + """ + + id: str = pydantic.Field() + """ + Uploaded MP3 file ID, prefixed `file_`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/affiliates/client.py b/src/whop_sdk/affiliates/client.py index 2b3adade..f2679de3 100644 --- a/src/whop_sdk/affiliates/client.py +++ b/src/whop_sdk/affiliates/client.py @@ -97,7 +97,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -155,7 +155,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -194,7 +194,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -230,7 +230,7 @@ def archive(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -266,7 +266,7 @@ def unarchive(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -364,7 +364,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -431,7 +431,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -478,7 +478,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -522,7 +522,7 @@ async def archive(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -566,7 +566,7 @@ async def unarchive(self, id: str, *, request_options: typing.Optional[RequestOp from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/affiliates/overrides/client.py b/src/whop_sdk/affiliates/overrides/client.py index 279eaff4..2111fcd4 100644 --- a/src/whop_sdk/affiliates/overrides/client.py +++ b/src/whop_sdk/affiliates/overrides/client.py @@ -85,7 +85,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -140,7 +140,7 @@ def create( from whop_sdk.affiliates.overrides import CreateOverridesRequestBody_Standard client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -186,7 +186,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -226,7 +226,7 @@ def delete(self, id: str, override_id: str, *, request_options: typing.Optional[ from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -288,7 +288,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -375,7 +375,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -439,7 +439,7 @@ async def create( from whop_sdk.affiliates.overrides import CreateOverridesRequestBody_Standard client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -493,7 +493,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -543,7 +543,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -613,7 +613,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/ai_chats/client.py b/src/whop_sdk/ai_chats/client.py index dc5e861a..28f58987 100644 --- a/src/whop_sdk/ai_chats/client.py +++ b/src/whop_sdk/ai_chats/client.py @@ -75,7 +75,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -148,7 +148,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -189,7 +189,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -225,7 +225,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -278,7 +278,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -356,7 +356,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -438,7 +438,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -487,7 +487,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -531,7 +531,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -592,7 +592,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/api_keys/client.py b/src/whop_sdk/api_keys/client.py index f6e189ff..f9ea405e 100644 --- a/src/whop_sdk/api_keys/client.py +++ b/src/whop_sdk/api_keys/client.py @@ -103,7 +103,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -183,7 +183,7 @@ def create( from whop_sdk.api_keys import CreateApiKeysRequestPermissions client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -227,7 +227,7 @@ def list_permissions( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -258,7 +258,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -291,7 +291,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -349,7 +349,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -390,7 +390,7 @@ def rotate(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -482,7 +482,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -571,7 +571,7 @@ async def create( from whop_sdk.api_keys import CreateApiKeysRequestPermissions client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -623,7 +623,7 @@ async def list_permissions( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -662,7 +662,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -705,7 +705,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -771,7 +771,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -820,7 +820,7 @@ async def rotate(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/api_keys/types/create_api_keys_request_api_version_date.py b/src/whop_sdk/api_keys/types/create_api_keys_request_api_version_date.py index f7b84da9..1ecbd0f6 100644 --- a/src/whop_sdk/api_keys/types/create_api_keys_request_api_version_date.py +++ b/src/whop_sdk/api_keys/types/create_api_keys_request_api_version_date.py @@ -33,6 +33,9 @@ "2026-08-25", "2026-08-25-1", "2026-08-25-2", + "2026-08-31", + "2026-09-02", + "2026-09-02-1", ], typing.Any, ] diff --git a/src/whop_sdk/api_keys/types/update_api_keys_request_api_version_date.py b/src/whop_sdk/api_keys/types/update_api_keys_request_api_version_date.py index 87bedbf9..0e782560 100644 --- a/src/whop_sdk/api_keys/types/update_api_keys_request_api_version_date.py +++ b/src/whop_sdk/api_keys/types/update_api_keys_request_api_version_date.py @@ -33,6 +33,9 @@ "2026-08-25", "2026-08-25-1", "2026-08-25-2", + "2026-08-31", + "2026-09-02", + "2026-09-02-1", ], typing.Any, ] diff --git a/src/whop_sdk/api_logs/client.py b/src/whop_sdk/api_logs/client.py index 1be92500..114d486d 100644 --- a/src/whop_sdk/api_logs/client.py +++ b/src/whop_sdk/api_logs/client.py @@ -94,7 +94,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -205,7 +205,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/app_builds/client.py b/src/whop_sdk/app_builds/client.py index d64ef9cf..60efc233 100644 --- a/src/whop_sdk/app_builds/client.py +++ b/src/whop_sdk/app_builds/client.py @@ -97,7 +97,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -177,7 +177,7 @@ def create( from whop_sdk.app_builds import CreateAppBuildsRequestAttachment client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -221,7 +221,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -254,7 +254,7 @@ def promote(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -342,7 +342,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -431,7 +431,7 @@ async def create( from whop_sdk.app_builds import CreateAppBuildsRequestAttachment client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -483,7 +483,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -524,7 +524,7 @@ async def promote(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/apps/client.py b/src/whop_sdk/apps/client.py index 782aa9b7..fb777c90 100644 --- a/src/whop_sdk/apps/client.py +++ b/src/whop_sdk/apps/client.py @@ -126,7 +126,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -205,7 +205,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -260,7 +260,7 @@ def update_permissions_app( from whop_sdk.apps import UpdatePermissionsAppRequestRequestedPermissionsItem client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -302,7 +302,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -335,7 +335,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -453,7 +453,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -514,7 +514,7 @@ def deploy( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -584,7 +584,7 @@ def logs( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -642,7 +642,7 @@ def update_permissions( from whop_sdk.apps import UpdatePermissionsAppsRequestRequestedPermissionsItem client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -755,7 +755,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -843,7 +843,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -906,7 +906,7 @@ async def update_permissions_app( from whop_sdk.apps import UpdatePermissionsAppRequestRequestedPermissionsItem client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -956,7 +956,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -997,7 +997,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1123,7 +1123,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1192,7 +1192,7 @@ async def deploy( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1270,7 +1270,7 @@ async def logs( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1337,7 +1337,7 @@ async def update_permissions( from whop_sdk.apps import UpdatePermissionsAppsRequestRequestedPermissionsItem client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/audiences/client.py b/src/whop_sdk/audiences/client.py index e29f4585..8df4db20 100644 --- a/src/whop_sdk/audiences/client.py +++ b/src/whop_sdk/audiences/client.py @@ -81,7 +81,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -167,7 +167,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -212,7 +212,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -258,7 +258,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -294,7 +294,7 @@ def add_people(self, id: str, *, file_id: str, request_options: typing.Optional[ from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -371,7 +371,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -466,7 +466,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -521,7 +521,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -575,7 +575,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -621,7 +621,7 @@ async def add_people( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/authorized_users/client.py b/src/whop_sdk/authorized_users/client.py index d21c2293..6a45dad8 100644 --- a/src/whop_sdk/authorized_users/client.py +++ b/src/whop_sdk/authorized_users/client.py @@ -97,7 +97,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -179,7 +179,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -225,7 +225,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -270,7 +270,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -363,7 +363,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -454,7 +454,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -508,7 +508,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -561,7 +561,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/bounties/client.py b/src/whop_sdk/bounties/client.py index e731ba7a..5482f5a7 100644 --- a/src/whop_sdk/bounties/client.py +++ b/src/whop_sdk/bounties/client.py @@ -127,7 +127,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -232,7 +232,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -282,7 +282,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -360,7 +360,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -406,7 +406,7 @@ def cancel(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -528,7 +528,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -642,7 +642,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -700,7 +700,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -786,7 +786,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -840,7 +840,7 @@ async def cancel(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/bounties/submissions/client.py b/src/whop_sdk/bounties/submissions/client.py index 29c254b7..46109001 100644 --- a/src/whop_sdk/bounties/submissions/client.py +++ b/src/whop_sdk/bounties/submissions/client.py @@ -91,7 +91,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -145,7 +145,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -238,7 +238,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -301,7 +301,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/bounty_submissions/client.py b/src/whop_sdk/bounty_submissions/client.py index 276a1366..a6856dee 100644 --- a/src/whop_sdk/bounty_submissions/client.py +++ b/src/whop_sdk/bounty_submissions/client.py @@ -102,7 +102,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -167,7 +167,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -215,7 +215,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -250,7 +250,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -292,7 +292,7 @@ def submit( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -388,7 +388,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -462,7 +462,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -518,7 +518,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -561,7 +561,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -611,7 +611,7 @@ async def submit( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/card_transactions/client.py b/src/whop_sdk/card_transactions/client.py index 5e2309dd..446d1217 100644 --- a/src/whop_sdk/card_transactions/client.py +++ b/src/whop_sdk/card_transactions/client.py @@ -103,7 +103,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -166,7 +166,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -270,7 +270,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -342,7 +342,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/cards/client.py b/src/whop_sdk/cards/client.py index 50218498..f18a16c1 100644 --- a/src/whop_sdk/cards/client.py +++ b/src/whop_sdk/cards/client.py @@ -63,7 +63,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -123,7 +123,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -176,7 +176,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -260,7 +260,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -334,7 +334,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -402,7 +402,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -463,7 +463,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -555,7 +555,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/chat_channels/client.py b/src/whop_sdk/chat_channels/client.py index 9dea7a2a..71fcd07e 100644 --- a/src/whop_sdk/chat_channels/client.py +++ b/src/whop_sdk/chat_channels/client.py @@ -81,7 +81,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -132,7 +132,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -197,7 +197,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -285,7 +285,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -345,7 +345,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -418,7 +418,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/checkout_configurations/client.py b/src/whop_sdk/checkout_configurations/client.py index 193419b3..468866f9 100644 --- a/src/whop_sdk/checkout_configurations/client.py +++ b/src/whop_sdk/checkout_configurations/client.py @@ -94,7 +94,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -184,7 +184,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -232,7 +232,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -267,7 +267,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -351,7 +351,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -450,7 +450,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -506,7 +506,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -549,7 +549,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/client.py b/src/whop_sdk/client.py index bfb4bb79..0d673c03 100644 --- a/src/whop_sdk/client.py +++ b/src/whop_sdk/client.py @@ -15,7 +15,6 @@ from .accounts.client import AccountsClient, AsyncAccountsClient from .ad_campaigns.client import AdCampaignsClient, AsyncAdCampaignsClient from .ad_groups.client import AdGroupsClient, AsyncAdGroupsClient - from .ad_reports.client import AdReportsClient, AsyncAdReportsClient from .ads.client import AdsClient, AsyncAdsClient from .affiliates.client import AffiliatesClient, AsyncAffiliatesClient from .ai_chats.client import AiChatsClient, AsyncAiChatsClient @@ -31,7 +30,6 @@ from .cards.client import AsyncCardsClient, CardsClient from .chat_channels.client import AsyncChatChannelsClient, ChatChannelsClient from .checkout_configurations.client import AsyncCheckoutConfigurationsClient, CheckoutConfigurationsClient - from .companies.client import AsyncCompaniesClient, CompaniesClient from .company_token_transactions.client import AsyncCompanyTokenTransactionsClient, CompanyTokenTransactionsClient from .confirmation_tokens.client import AsyncConfirmationTokensClient, ConfirmationTokensClient from .course_chapters.client import AsyncCourseChaptersClient, CourseChaptersClient @@ -144,7 +142,7 @@ class Whop: from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -155,7 +153,7 @@ def __init__( *, base_url: typing.Optional[str] = None, environment: WhopEnvironment = WhopEnvironment.DEFAULT, - api_version_date: typing.Optional[str] = "2026-08-25-2", + api_version_date: typing.Optional[str] = "2026-09-02-1", idempotency_key: typing.Optional[str] = None, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, headers: typing.Optional[typing.Dict[str, str]] = None, @@ -191,7 +189,6 @@ def __init__( self._accounts: typing.Optional[AccountsClient] = None self._ad_campaigns: typing.Optional[AdCampaignsClient] = None self._ad_groups: typing.Optional[AdGroupsClient] = None - self._ad_reports: typing.Optional[AdReportsClient] = None self._ads: typing.Optional[AdsClient] = None self._affiliates: typing.Optional[AffiliatesClient] = None self._ai_chats: typing.Optional[AiChatsClient] = None @@ -207,7 +204,6 @@ def __init__( self._cards: typing.Optional[CardsClient] = None self._chat_channels: typing.Optional[ChatChannelsClient] = None self._checkout_configurations: typing.Optional[CheckoutConfigurationsClient] = None - self._companies: typing.Optional[CompaniesClient] = None self._company_token_transactions: typing.Optional[CompanyTokenTransactionsClient] = None self._confirmation_tokens: typing.Optional[ConfirmationTokensClient] = None self._course_chapters: typing.Optional[CourseChaptersClient] = None @@ -309,14 +305,6 @@ def ad_groups(self): self._ad_groups = AdGroupsClient(client_wrapper=self._client_wrapper) return self._ad_groups - @property - def ad_reports(self): - if self._ad_reports is None: - from .ad_reports.client import AdReportsClient # noqa: E402 - - self._ad_reports = AdReportsClient(client_wrapper=self._client_wrapper) - return self._ad_reports - @property def ads(self): if self._ads is None: @@ -437,14 +425,6 @@ def checkout_configurations(self): self._checkout_configurations = CheckoutConfigurationsClient(client_wrapper=self._client_wrapper) return self._checkout_configurations - @property - def companies(self): - if self._companies is None: - from .companies.client import CompaniesClient # noqa: E402 - - self._companies = CompaniesClient(client_wrapper=self._client_wrapper) - return self._companies - @property def company_token_transactions(self): if self._company_token_transactions is None: @@ -997,7 +977,7 @@ class AsyncWhop: from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1008,7 +988,7 @@ def __init__( *, base_url: typing.Optional[str] = None, environment: WhopEnvironment = WhopEnvironment.DEFAULT, - api_version_date: typing.Optional[str] = "2026-08-25-2", + api_version_date: typing.Optional[str] = "2026-09-02-1", idempotency_key: typing.Optional[str] = None, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, headers: typing.Optional[typing.Dict[str, str]] = None, @@ -1044,7 +1024,6 @@ def __init__( self._accounts: typing.Optional[AsyncAccountsClient] = None self._ad_campaigns: typing.Optional[AsyncAdCampaignsClient] = None self._ad_groups: typing.Optional[AsyncAdGroupsClient] = None - self._ad_reports: typing.Optional[AsyncAdReportsClient] = None self._ads: typing.Optional[AsyncAdsClient] = None self._affiliates: typing.Optional[AsyncAffiliatesClient] = None self._ai_chats: typing.Optional[AsyncAiChatsClient] = None @@ -1060,7 +1039,6 @@ def __init__( self._cards: typing.Optional[AsyncCardsClient] = None self._chat_channels: typing.Optional[AsyncChatChannelsClient] = None self._checkout_configurations: typing.Optional[AsyncCheckoutConfigurationsClient] = None - self._companies: typing.Optional[AsyncCompaniesClient] = None self._company_token_transactions: typing.Optional[AsyncCompanyTokenTransactionsClient] = None self._confirmation_tokens: typing.Optional[AsyncConfirmationTokensClient] = None self._course_chapters: typing.Optional[AsyncCourseChaptersClient] = None @@ -1162,14 +1140,6 @@ def ad_groups(self): self._ad_groups = AsyncAdGroupsClient(client_wrapper=self._client_wrapper) return self._ad_groups - @property - def ad_reports(self): - if self._ad_reports is None: - from .ad_reports.client import AsyncAdReportsClient # noqa: E402 - - self._ad_reports = AsyncAdReportsClient(client_wrapper=self._client_wrapper) - return self._ad_reports - @property def ads(self): if self._ads is None: @@ -1290,14 +1260,6 @@ def checkout_configurations(self): self._checkout_configurations = AsyncCheckoutConfigurationsClient(client_wrapper=self._client_wrapper) return self._checkout_configurations - @property - def companies(self): - if self._companies is None: - from .companies.client import AsyncCompaniesClient # noqa: E402 - - self._companies = AsyncCompaniesClient(client_wrapper=self._client_wrapper) - return self._companies - @property def company_token_transactions(self): if self._company_token_transactions is None: diff --git a/src/whop_sdk/companies/__init__.py b/src/whop_sdk/companies/__init__.py deleted file mode 100644 index 51dd4d77..00000000 --- a/src/whop_sdk/companies/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - CreateApiKeyCompaniesRequestPermissionsItem, - CreateApiKeyCompaniesResponse, - CreateCompaniesRequestLogo, - ListCompaniesResponse, - UpdateCompaniesRequestBannerImage, - UpdateCompaniesRequestLogo, - UpdateCompaniesRequestSocialLinksItem, - UpdateCompaniesRequestSocialLinksItemImage, - ) -_dynamic_imports: typing.Dict[str, str] = { - "CreateApiKeyCompaniesRequestPermissionsItem": ".types", - "CreateApiKeyCompaniesResponse": ".types", - "CreateCompaniesRequestLogo": ".types", - "ListCompaniesResponse": ".types", - "UpdateCompaniesRequestBannerImage": ".types", - "UpdateCompaniesRequestLogo": ".types", - "UpdateCompaniesRequestSocialLinksItem": ".types", - "UpdateCompaniesRequestSocialLinksItemImage": ".types", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "CreateApiKeyCompaniesRequestPermissionsItem", - "CreateApiKeyCompaniesResponse", - "CreateCompaniesRequestLogo", - "ListCompaniesResponse", - "UpdateCompaniesRequestBannerImage", - "UpdateCompaniesRequestLogo", - "UpdateCompaniesRequestSocialLinksItem", - "UpdateCompaniesRequestSocialLinksItemImage", -] diff --git a/src/whop_sdk/companies/client.py b/src/whop_sdk/companies/client.py deleted file mode 100644 index 275037da..00000000 --- a/src/whop_sdk/companies/client.py +++ /dev/null @@ -1,834 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..types.company import Company -from ..types.company_list_item import CompanyListItem -from ..types.countries import Countries -from ..types.direction import Direction -from ..types.permission_system_roles import PermissionSystemRoles -from .raw_client import AsyncRawCompaniesClient, RawCompaniesClient -from .types.create_api_key_companies_request_permissions_item import CreateApiKeyCompaniesRequestPermissionsItem -from .types.create_api_key_companies_response import CreateApiKeyCompaniesResponse -from .types.create_companies_request_logo import CreateCompaniesRequestLogo -from .types.list_companies_response import ListCompaniesResponse -from .types.update_companies_request_banner_image import UpdateCompaniesRequestBannerImage -from .types.update_companies_request_logo import UpdateCompaniesRequestLogo -from .types.update_companies_request_social_links_item import UpdateCompaniesRequestSocialLinksItem - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class CompaniesClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawCompaniesClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawCompaniesClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawCompaniesClient - """ - return self._raw_client - - def list( - self, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - parent_company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - created_before: typing.Optional[dt.datetime] = None, - created_after: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CompanyListItem, ListCompaniesResponse]: - """ - Returns a paginated list of companies. When parent_company_id is provided, lists connected accounts under that platform. When omitted, lists companies the current user has access to. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, lists connected accounts under that platform. Omit to list the current user's own companies. - - direction : typing.Optional[Direction] - - created_before : typing.Optional[dt.datetime] - Only return companies created before this timestamp. - - created_after : typing.Optional[dt.datetime] - Only return companies created after this timestamp. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CompanyListItem, ListCompaniesResponse] - A successful response - - Examples - -------- - import datetime - - from whop_sdk import Whop - - client = Whop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - response = client.companies.list( - first=42, - last=42, - created_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - created_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) - for item in response: - yield item - # alternatively, you can paginate page-by-page - for page in response.iter_pages(): - yield page - """ - return self._raw_client.list( - after=after, - before=before, - first=first, - last=last, - parent_company_id=parent_company_id, - direction=direction, - created_before=created_before, - created_after=created_after, - request_options=request_options, - ) - - def create( - self, - *, - title: str, - country: typing.Optional[Countries] = OMIT, - description: typing.Optional[str] = OMIT, - email: typing.Optional[str] = OMIT, - logo: typing.Optional[CreateCompaniesRequestLogo] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - parent_company_id: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Company: - """ - Create a new company. Pass parent_company_id to create a connected account under a platform, or omit it to create a company for the current user. - - Required permissions: - - `company:create` - - `company:basic:read` - - Parameters - ---------- - title : str - The display name of the company shown to customers. - - country : typing.Optional[Countries] - The country the company is located in. Defaults to the parent company's country for connected accounts, or the owner's IP-derived country. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - email : typing.Optional[str] - The email address of the user who will own the connected account. Required when parent_company_id is provided. - - logo : typing.Optional[CreateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - A key-value JSON object of custom metadata to store on the company. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, creates a connected account under that platform. Omit to create a company for the current user. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails to customers on behalf of this company. Only applies when creating a connected account. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Company - A successful response - - Examples - -------- - from whop_sdk import Whop - - client = Whop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - client.companies.create( - title="title", - ) - """ - _response = self._raw_client.create( - title=title, - country=country, - description=description, - email=email, - logo=logo, - metadata=metadata, - parent_company_id=parent_company_id, - send_customer_emails=send_customer_emails, - request_options=request_options, - ) - return _response.data - - def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Company: - """ - Retrieves the details of an existing company. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier or route slug of the company. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Company - A successful response - - Examples - -------- - from whop_sdk import Whop - - client = Whop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - client.companies.retrieve( - id="biz_xxxxxxxxxxxxxx", - ) - """ - _response = self._raw_client.retrieve(id, request_options=request_options) - return _response.data - - def update( - self, - id: str, - *, - affiliate_application_required: typing.Optional[bool] = OMIT, - affiliate_instructions: typing.Optional[str] = OMIT, - banner_image: typing.Optional[UpdateCompaniesRequestBannerImage] = OMIT, - description: typing.Optional[str] = OMIT, - featured_affiliate_product_id: typing.Optional[str] = OMIT, - logo: typing.Optional[UpdateCompaniesRequestLogo] = OMIT, - route: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - social_links: typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] = OMIT, - target_audience: typing.Optional[str] = OMIT, - title: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Company: - """ - Update a company's title, description, logo, and other settings. - - Required permissions: - - `company:update` - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier of the company to update. - - affiliate_application_required : typing.Optional[bool] - Whether prospective affiliates must submit an application before they can promote this company. - - affiliate_instructions : typing.Optional[str] - Guidelines and instructions shown to affiliates explaining how to promote this company's products. - - banner_image : typing.Optional[UpdateCompaniesRequestBannerImage] - The company's banner image. Accepts PNG or JPEG format. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - featured_affiliate_product_id : typing.Optional[str] - The ID of the product to feature on this company's affiliate page. Pass null to clear. - - logo : typing.Optional[UpdateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - route : typing.Optional[str] - The unique URL slug for the company's store page. Must be lowercase and can include hyphens (e.g., 'my-company'). If not provided, the route will remain unchanged. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails (receipts, renewals, cancelations) to customers on behalf of this company. - - social_links : typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] - The social media links to display on the company's store page. Pass the full list of desired social links — any existing links not included will be removed. - - target_audience : typing.Optional[str] - The target audience for this company (e.g., 'beginner day traders aged 18-25 looking to learn options'). - - title : typing.Optional[str] - The display name of the company shown to customers. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Company - A successful response - - Examples - -------- - from whop_sdk import Whop - - client = Whop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - client.companies.update( - id="biz_xxxxxxxxxxxxxx", - ) - """ - _response = self._raw_client.update( - id, - affiliate_application_required=affiliate_application_required, - affiliate_instructions=affiliate_instructions, - banner_image=banner_image, - description=description, - featured_affiliate_product_id=featured_affiliate_product_id, - logo=logo, - route=route, - send_customer_emails=send_customer_emails, - social_links=social_links, - target_audience=target_audience, - title=title, - request_options=request_options, - ) - return _response.data - - def create_api_key( - self, - parent_company_id: str, - *, - child_company_id: str, - name: typing.Optional[str] = OMIT, - permissions: typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] = OMIT, - role: typing.Optional[PermissionSystemRoles] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CreateApiKeyCompaniesResponse: - """ - Create an API key for a connected account (child company) owned by a parent company. - - Parameters - ---------- - parent_company_id : str - The unique identifier of the parent platform company (e.g. 'biz_xxx'). - - child_company_id : str - The unique identifier of the connected account to create the API key for (e.g. 'biz_xxx'). - - name : typing.Optional[str] - A human-readable name for the API key, such as 'Production API Key'. - - permissions : typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] - Granular permission statements defining which actions this API key can perform. Either permissions or role must be provided. - - role : typing.Optional[PermissionSystemRoles] - A system role to inherit permissions from (e.g. owner, admin, moderator). Either role or permissions must be provided. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CreateApiKeyCompaniesResponse - A successful response - - Examples - -------- - from whop_sdk import Whop - - client = Whop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - client.companies.create_api_key( - parent_company_id="parent_company_id", - child_company_id="child_company_id", - ) - """ - _response = self._raw_client.create_api_key( - parent_company_id, - child_company_id=child_company_id, - name=name, - permissions=permissions, - role=role, - request_options=request_options, - ) - return _response.data - - -class AsyncCompaniesClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawCompaniesClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawCompaniesClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawCompaniesClient - """ - return self._raw_client - - async def list( - self, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - parent_company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - created_before: typing.Optional[dt.datetime] = None, - created_after: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CompanyListItem, ListCompaniesResponse]: - """ - Returns a paginated list of companies. When parent_company_id is provided, lists connected accounts under that platform. When omitted, lists companies the current user has access to. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, lists connected accounts under that platform. Omit to list the current user's own companies. - - direction : typing.Optional[Direction] - - created_before : typing.Optional[dt.datetime] - Only return companies created before this timestamp. - - created_after : typing.Optional[dt.datetime] - Only return companies created after this timestamp. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CompanyListItem, ListCompaniesResponse] - A successful response - - Examples - -------- - import asyncio - import datetime - - from whop_sdk import AsyncWhop - - client = AsyncWhop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - - - async def main() -> None: - response = await client.companies.list( - first=42, - last=42, - created_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - created_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) - async for item in response: - yield item - - # alternatively, you can paginate page-by-page - async for page in response.iter_pages(): - yield page - - - asyncio.run(main()) - """ - return await self._raw_client.list( - after=after, - before=before, - first=first, - last=last, - parent_company_id=parent_company_id, - direction=direction, - created_before=created_before, - created_after=created_after, - request_options=request_options, - ) - - async def create( - self, - *, - title: str, - country: typing.Optional[Countries] = OMIT, - description: typing.Optional[str] = OMIT, - email: typing.Optional[str] = OMIT, - logo: typing.Optional[CreateCompaniesRequestLogo] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - parent_company_id: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Company: - """ - Create a new company. Pass parent_company_id to create a connected account under a platform, or omit it to create a company for the current user. - - Required permissions: - - `company:create` - - `company:basic:read` - - Parameters - ---------- - title : str - The display name of the company shown to customers. - - country : typing.Optional[Countries] - The country the company is located in. Defaults to the parent company's country for connected accounts, or the owner's IP-derived country. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - email : typing.Optional[str] - The email address of the user who will own the connected account. Required when parent_company_id is provided. - - logo : typing.Optional[CreateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - A key-value JSON object of custom metadata to store on the company. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, creates a connected account under that platform. Omit to create a company for the current user. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails to customers on behalf of this company. Only applies when creating a connected account. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Company - A successful response - - Examples - -------- - import asyncio - - from whop_sdk import AsyncWhop - - client = AsyncWhop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.companies.create( - title="title", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.create( - title=title, - country=country, - description=description, - email=email, - logo=logo, - metadata=metadata, - parent_company_id=parent_company_id, - send_customer_emails=send_customer_emails, - request_options=request_options, - ) - return _response.data - - async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Company: - """ - Retrieves the details of an existing company. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier or route slug of the company. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Company - A successful response - - Examples - -------- - import asyncio - - from whop_sdk import AsyncWhop - - client = AsyncWhop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.companies.retrieve( - id="biz_xxxxxxxxxxxxxx", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.retrieve(id, request_options=request_options) - return _response.data - - async def update( - self, - id: str, - *, - affiliate_application_required: typing.Optional[bool] = OMIT, - affiliate_instructions: typing.Optional[str] = OMIT, - banner_image: typing.Optional[UpdateCompaniesRequestBannerImage] = OMIT, - description: typing.Optional[str] = OMIT, - featured_affiliate_product_id: typing.Optional[str] = OMIT, - logo: typing.Optional[UpdateCompaniesRequestLogo] = OMIT, - route: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - social_links: typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] = OMIT, - target_audience: typing.Optional[str] = OMIT, - title: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Company: - """ - Update a company's title, description, logo, and other settings. - - Required permissions: - - `company:update` - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier of the company to update. - - affiliate_application_required : typing.Optional[bool] - Whether prospective affiliates must submit an application before they can promote this company. - - affiliate_instructions : typing.Optional[str] - Guidelines and instructions shown to affiliates explaining how to promote this company's products. - - banner_image : typing.Optional[UpdateCompaniesRequestBannerImage] - The company's banner image. Accepts PNG or JPEG format. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - featured_affiliate_product_id : typing.Optional[str] - The ID of the product to feature on this company's affiliate page. Pass null to clear. - - logo : typing.Optional[UpdateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - route : typing.Optional[str] - The unique URL slug for the company's store page. Must be lowercase and can include hyphens (e.g., 'my-company'). If not provided, the route will remain unchanged. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails (receipts, renewals, cancelations) to customers on behalf of this company. - - social_links : typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] - The social media links to display on the company's store page. Pass the full list of desired social links — any existing links not included will be removed. - - target_audience : typing.Optional[str] - The target audience for this company (e.g., 'beginner day traders aged 18-25 looking to learn options'). - - title : typing.Optional[str] - The display name of the company shown to customers. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Company - A successful response - - Examples - -------- - import asyncio - - from whop_sdk import AsyncWhop - - client = AsyncWhop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.companies.update( - id="biz_xxxxxxxxxxxxxx", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.update( - id, - affiliate_application_required=affiliate_application_required, - affiliate_instructions=affiliate_instructions, - banner_image=banner_image, - description=description, - featured_affiliate_product_id=featured_affiliate_product_id, - logo=logo, - route=route, - send_customer_emails=send_customer_emails, - social_links=social_links, - target_audience=target_audience, - title=title, - request_options=request_options, - ) - return _response.data - - async def create_api_key( - self, - parent_company_id: str, - *, - child_company_id: str, - name: typing.Optional[str] = OMIT, - permissions: typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] = OMIT, - role: typing.Optional[PermissionSystemRoles] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CreateApiKeyCompaniesResponse: - """ - Create an API key for a connected account (child company) owned by a parent company. - - Parameters - ---------- - parent_company_id : str - The unique identifier of the parent platform company (e.g. 'biz_xxx'). - - child_company_id : str - The unique identifier of the connected account to create the API key for (e.g. 'biz_xxx'). - - name : typing.Optional[str] - A human-readable name for the API key, such as 'Production API Key'. - - permissions : typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] - Granular permission statements defining which actions this API key can perform. Either permissions or role must be provided. - - role : typing.Optional[PermissionSystemRoles] - A system role to inherit permissions from (e.g. owner, admin, moderator). Either role or permissions must be provided. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CreateApiKeyCompaniesResponse - A successful response - - Examples - -------- - import asyncio - - from whop_sdk import AsyncWhop - - client = AsyncWhop( - "2026-08-25-2", - idempotency_key="YOUR_IDEMPOTENCY_KEY", - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.companies.create_api_key( - parent_company_id="parent_company_id", - child_company_id="child_company_id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.create_api_key( - parent_company_id, - child_company_id=child_company_id, - name=name, - permissions=permissions, - role=role, - request_options=request_options, - ) - return _response.data diff --git a/src/whop_sdk/companies/raw_client.py b/src/whop_sdk/companies/raw_client.py deleted file mode 100644 index 51a04ef1..00000000 --- a/src/whop_sdk/companies/raw_client.py +++ /dev/null @@ -1,1700 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.datetime_utils import serialize_datetime -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import encode_path_param -from ..core.pagination import AsyncPager, SyncPager -from ..core.parse_error import ParsingError -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..errors.bad_request_error import BadRequestError -from ..errors.forbidden_error import ForbiddenError -from ..errors.internal_server_error import InternalServerError -from ..errors.not_found_error import NotFoundError -from ..errors.too_many_requests_error import TooManyRequestsError -from ..errors.unauthorized_error import UnauthorizedError -from ..errors.unprocessable_entity_error import UnprocessableEntityError -from ..types.company import Company -from ..types.company_list_item import CompanyListItem -from ..types.countries import Countries -from ..types.direction import Direction -from ..types.permission_system_roles import PermissionSystemRoles -from .types.create_api_key_companies_request_permissions_item import CreateApiKeyCompaniesRequestPermissionsItem -from .types.create_api_key_companies_response import CreateApiKeyCompaniesResponse -from .types.create_companies_request_logo import CreateCompaniesRequestLogo -from .types.list_companies_response import ListCompaniesResponse -from .types.update_companies_request_banner_image import UpdateCompaniesRequestBannerImage -from .types.update_companies_request_logo import UpdateCompaniesRequestLogo -from .types.update_companies_request_social_links_item import UpdateCompaniesRequestSocialLinksItem -from pydantic import ValidationError - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawCompaniesClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def list( - self, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - parent_company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - created_before: typing.Optional[dt.datetime] = None, - created_after: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CompanyListItem, ListCompaniesResponse]: - """ - Returns a paginated list of companies. When parent_company_id is provided, lists connected accounts under that platform. When omitted, lists companies the current user has access to. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, lists connected accounts under that platform. Omit to list the current user's own companies. - - direction : typing.Optional[Direction] - - created_before : typing.Optional[dt.datetime] - Only return companies created before this timestamp. - - created_after : typing.Optional[dt.datetime] - Only return companies created after this timestamp. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[CompanyListItem, ListCompaniesResponse] - A successful response - """ - _response = self._client_wrapper.httpx_client.request( - "companies", - method="GET", - params={ - "after": after, - "before": before, - "first": first, - "last": last, - "parent_company_id": parent_company_id, - "direction": direction, - "created_before": serialize_datetime(created_before) if created_before is not None else None, - "created_after": serialize_datetime(created_after) if created_after is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCompaniesResponse, - parse_obj_as( - type_=ListCompaniesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.data - _has_next = False - _get_next = None - if _parsed_response.page_info is not None: - _parsed_next = _parsed_response.page_info.end_cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list( - after=_parsed_next, - before=before, - first=first, - last=last, - parent_company_id=parent_company_id, - direction=direction, - created_before=created_before, - created_after=created_after, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def create( - self, - *, - title: str, - country: typing.Optional[Countries] = OMIT, - description: typing.Optional[str] = OMIT, - email: typing.Optional[str] = OMIT, - logo: typing.Optional[CreateCompaniesRequestLogo] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - parent_company_id: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[Company]: - """ - Create a new company. Pass parent_company_id to create a connected account under a platform, or omit it to create a company for the current user. - - Required permissions: - - `company:create` - - `company:basic:read` - - Parameters - ---------- - title : str - The display name of the company shown to customers. - - country : typing.Optional[Countries] - The country the company is located in. Defaults to the parent company's country for connected accounts, or the owner's IP-derived country. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - email : typing.Optional[str] - The email address of the user who will own the connected account. Required when parent_company_id is provided. - - logo : typing.Optional[CreateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - A key-value JSON object of custom metadata to store on the company. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, creates a connected account under that platform. Omit to create a company for the current user. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails to customers on behalf of this company. Only applies when creating a connected account. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Company] - A successful response - """ - _response = self._client_wrapper.httpx_client.request( - "companies", - method="POST", - json={ - "country": country, - "description": description, - "email": email, - "logo": convert_and_respect_annotation_metadata( - object_=logo, annotation=typing.Optional[CreateCompaniesRequestLogo], direction="write" - ), - "metadata": metadata, - "parent_company_id": parent_company_id, - "send_customer_emails": send_customer_emails, - "title": title, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Company, - parse_obj_as( - type_=Company, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Company]: - """ - Retrieves the details of an existing company. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier or route slug of the company. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Company] - A successful response - """ - _response = self._client_wrapper.httpx_client.request( - f"companies/{encode_path_param(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Company, - parse_obj_as( - type_=Company, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def update( - self, - id: str, - *, - affiliate_application_required: typing.Optional[bool] = OMIT, - affiliate_instructions: typing.Optional[str] = OMIT, - banner_image: typing.Optional[UpdateCompaniesRequestBannerImage] = OMIT, - description: typing.Optional[str] = OMIT, - featured_affiliate_product_id: typing.Optional[str] = OMIT, - logo: typing.Optional[UpdateCompaniesRequestLogo] = OMIT, - route: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - social_links: typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] = OMIT, - target_audience: typing.Optional[str] = OMIT, - title: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[Company]: - """ - Update a company's title, description, logo, and other settings. - - Required permissions: - - `company:update` - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier of the company to update. - - affiliate_application_required : typing.Optional[bool] - Whether prospective affiliates must submit an application before they can promote this company. - - affiliate_instructions : typing.Optional[str] - Guidelines and instructions shown to affiliates explaining how to promote this company's products. - - banner_image : typing.Optional[UpdateCompaniesRequestBannerImage] - The company's banner image. Accepts PNG or JPEG format. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - featured_affiliate_product_id : typing.Optional[str] - The ID of the product to feature on this company's affiliate page. Pass null to clear. - - logo : typing.Optional[UpdateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - route : typing.Optional[str] - The unique URL slug for the company's store page. Must be lowercase and can include hyphens (e.g., 'my-company'). If not provided, the route will remain unchanged. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails (receipts, renewals, cancelations) to customers on behalf of this company. - - social_links : typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] - The social media links to display on the company's store page. Pass the full list of desired social links — any existing links not included will be removed. - - target_audience : typing.Optional[str] - The target audience for this company (e.g., 'beginner day traders aged 18-25 looking to learn options'). - - title : typing.Optional[str] - The display name of the company shown to customers. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Company] - A successful response - """ - _response = self._client_wrapper.httpx_client.request( - f"companies/{encode_path_param(id)}", - method="PATCH", - json={ - "affiliate_application_required": affiliate_application_required, - "affiliate_instructions": affiliate_instructions, - "banner_image": convert_and_respect_annotation_metadata( - object_=banner_image, - annotation=typing.Optional[UpdateCompaniesRequestBannerImage], - direction="write", - ), - "description": description, - "featured_affiliate_product_id": featured_affiliate_product_id, - "logo": convert_and_respect_annotation_metadata( - object_=logo, annotation=typing.Optional[UpdateCompaniesRequestLogo], direction="write" - ), - "route": route, - "send_customer_emails": send_customer_emails, - "social_links": convert_and_respect_annotation_metadata( - object_=social_links, - annotation=typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]], - direction="write", - ), - "target_audience": target_audience, - "title": title, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Company, - parse_obj_as( - type_=Company, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def create_api_key( - self, - parent_company_id: str, - *, - child_company_id: str, - name: typing.Optional[str] = OMIT, - permissions: typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] = OMIT, - role: typing.Optional[PermissionSystemRoles] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CreateApiKeyCompaniesResponse]: - """ - Create an API key for a connected account (child company) owned by a parent company. - - Parameters - ---------- - parent_company_id : str - The unique identifier of the parent platform company (e.g. 'biz_xxx'). - - child_company_id : str - The unique identifier of the connected account to create the API key for (e.g. 'biz_xxx'). - - name : typing.Optional[str] - A human-readable name for the API key, such as 'Production API Key'. - - permissions : typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] - Granular permission statements defining which actions this API key can perform. Either permissions or role must be provided. - - role : typing.Optional[PermissionSystemRoles] - A system role to inherit permissions from (e.g. owner, admin, moderator). Either role or permissions must be provided. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[CreateApiKeyCompaniesResponse] - A successful response - """ - _response = self._client_wrapper.httpx_client.request( - f"companies/{encode_path_param(parent_company_id)}/api_keys", - method="POST", - json={ - "child_company_id": child_company_id, - "name": name, - "permissions": convert_and_respect_annotation_metadata( - object_=permissions, - annotation=typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]], - direction="write", - ), - "role": role, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CreateApiKeyCompaniesResponse, - parse_obj_as( - type_=CreateApiKeyCompaniesResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawCompaniesClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def list( - self, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - parent_company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - created_before: typing.Optional[dt.datetime] = None, - created_after: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CompanyListItem, ListCompaniesResponse]: - """ - Returns a paginated list of companies. When parent_company_id is provided, lists connected accounts under that platform. When omitted, lists companies the current user has access to. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, lists connected accounts under that platform. Omit to list the current user's own companies. - - direction : typing.Optional[Direction] - - created_before : typing.Optional[dt.datetime] - Only return companies created before this timestamp. - - created_after : typing.Optional[dt.datetime] - Only return companies created after this timestamp. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[CompanyListItem, ListCompaniesResponse] - A successful response - """ - _response = await self._client_wrapper.httpx_client.request( - "companies", - method="GET", - params={ - "after": after, - "before": before, - "first": first, - "last": last, - "parent_company_id": parent_company_id, - "direction": direction, - "created_before": serialize_datetime(created_before) if created_before is not None else None, - "created_after": serialize_datetime(created_after) if created_after is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - ListCompaniesResponse, - parse_obj_as( - type_=ListCompaniesResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.data - _has_next = False - _get_next = None - if _parsed_response.page_info is not None: - _parsed_next = _parsed_response.page_info.end_cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list( - after=_parsed_next, - before=before, - first=first, - last=last, - parent_company_id=parent_company_id, - direction=direction, - created_before=created_before, - created_after=created_after, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def create( - self, - *, - title: str, - country: typing.Optional[Countries] = OMIT, - description: typing.Optional[str] = OMIT, - email: typing.Optional[str] = OMIT, - logo: typing.Optional[CreateCompaniesRequestLogo] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - parent_company_id: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[Company]: - """ - Create a new company. Pass parent_company_id to create a connected account under a platform, or omit it to create a company for the current user. - - Required permissions: - - `company:create` - - `company:basic:read` - - Parameters - ---------- - title : str - The display name of the company shown to customers. - - country : typing.Optional[Countries] - The country the company is located in. Defaults to the parent company's country for connected accounts, or the owner's IP-derived country. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - email : typing.Optional[str] - The email address of the user who will own the connected account. Required when parent_company_id is provided. - - logo : typing.Optional[CreateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - A key-value JSON object of custom metadata to store on the company. - - parent_company_id : typing.Optional[str] - The unique identifier of the parent platform company. When provided, creates a connected account under that platform. Omit to create a company for the current user. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails to customers on behalf of this company. Only applies when creating a connected account. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Company] - A successful response - """ - _response = await self._client_wrapper.httpx_client.request( - "companies", - method="POST", - json={ - "country": country, - "description": description, - "email": email, - "logo": convert_and_respect_annotation_metadata( - object_=logo, annotation=typing.Optional[CreateCompaniesRequestLogo], direction="write" - ), - "metadata": metadata, - "parent_company_id": parent_company_id, - "send_customer_emails": send_customer_emails, - "title": title, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Company, - parse_obj_as( - type_=Company, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def retrieve( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Company]: - """ - Retrieves the details of an existing company. - - Required permissions: - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier or route slug of the company. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Company] - A successful response - """ - _response = await self._client_wrapper.httpx_client.request( - f"companies/{encode_path_param(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Company, - parse_obj_as( - type_=Company, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def update( - self, - id: str, - *, - affiliate_application_required: typing.Optional[bool] = OMIT, - affiliate_instructions: typing.Optional[str] = OMIT, - banner_image: typing.Optional[UpdateCompaniesRequestBannerImage] = OMIT, - description: typing.Optional[str] = OMIT, - featured_affiliate_product_id: typing.Optional[str] = OMIT, - logo: typing.Optional[UpdateCompaniesRequestLogo] = OMIT, - route: typing.Optional[str] = OMIT, - send_customer_emails: typing.Optional[bool] = OMIT, - social_links: typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] = OMIT, - target_audience: typing.Optional[str] = OMIT, - title: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[Company]: - """ - Update a company's title, description, logo, and other settings. - - Required permissions: - - `company:update` - - `company:basic:read` - - Parameters - ---------- - id : str - The unique identifier of the company to update. - - affiliate_application_required : typing.Optional[bool] - Whether prospective affiliates must submit an application before they can promote this company. - - affiliate_instructions : typing.Optional[str] - Guidelines and instructions shown to affiliates explaining how to promote this company's products. - - banner_image : typing.Optional[UpdateCompaniesRequestBannerImage] - The company's banner image. Accepts PNG or JPEG format. - - description : typing.Optional[str] - A promotional pitch displayed to potential customers on the company's store page. - - featured_affiliate_product_id : typing.Optional[str] - The ID of the product to feature on this company's affiliate page. Pass null to clear. - - logo : typing.Optional[UpdateCompaniesRequestLogo] - The company's logo image. Accepts PNG, JPEG, or GIF format. - - route : typing.Optional[str] - The unique URL slug for the company's store page. Must be lowercase and can include hyphens (e.g., 'my-company'). If not provided, the route will remain unchanged. - - send_customer_emails : typing.Optional[bool] - Whether Whop sends transactional emails (receipts, renewals, cancelations) to customers on behalf of this company. - - social_links : typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]] - The social media links to display on the company's store page. Pass the full list of desired social links — any existing links not included will be removed. - - target_audience : typing.Optional[str] - The target audience for this company (e.g., 'beginner day traders aged 18-25 looking to learn options'). - - title : typing.Optional[str] - The display name of the company shown to customers. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Company] - A successful response - """ - _response = await self._client_wrapper.httpx_client.request( - f"companies/{encode_path_param(id)}", - method="PATCH", - json={ - "affiliate_application_required": affiliate_application_required, - "affiliate_instructions": affiliate_instructions, - "banner_image": convert_and_respect_annotation_metadata( - object_=banner_image, - annotation=typing.Optional[UpdateCompaniesRequestBannerImage], - direction="write", - ), - "description": description, - "featured_affiliate_product_id": featured_affiliate_product_id, - "logo": convert_and_respect_annotation_metadata( - object_=logo, annotation=typing.Optional[UpdateCompaniesRequestLogo], direction="write" - ), - "route": route, - "send_customer_emails": send_customer_emails, - "social_links": convert_and_respect_annotation_metadata( - object_=social_links, - annotation=typing.Optional[typing.Sequence[UpdateCompaniesRequestSocialLinksItem]], - direction="write", - ), - "target_audience": target_audience, - "title": title, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Company, - parse_obj_as( - type_=Company, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def create_api_key( - self, - parent_company_id: str, - *, - child_company_id: str, - name: typing.Optional[str] = OMIT, - permissions: typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] = OMIT, - role: typing.Optional[PermissionSystemRoles] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CreateApiKeyCompaniesResponse]: - """ - Create an API key for a connected account (child company) owned by a parent company. - - Parameters - ---------- - parent_company_id : str - The unique identifier of the parent platform company (e.g. 'biz_xxx'). - - child_company_id : str - The unique identifier of the connected account to create the API key for (e.g. 'biz_xxx'). - - name : typing.Optional[str] - A human-readable name for the API key, such as 'Production API Key'. - - permissions : typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]] - Granular permission statements defining which actions this API key can perform. Either permissions or role must be provided. - - role : typing.Optional[PermissionSystemRoles] - A system role to inherit permissions from (e.g. owner, admin, moderator). Either role or permissions must be provided. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CreateApiKeyCompaniesResponse] - A successful response - """ - _response = await self._client_wrapper.httpx_client.request( - f"companies/{encode_path_param(parent_company_id)}/api_keys", - method="POST", - json={ - "child_company_id": child_company_id, - "name": name, - "permissions": convert_and_respect_annotation_metadata( - object_=permissions, - annotation=typing.Optional[typing.Sequence[CreateApiKeyCompaniesRequestPermissionsItem]], - direction="write", - ), - "role": role, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CreateApiKeyCompaniesResponse, - parse_obj_as( - type_=CreateApiKeyCompaniesResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - except ValidationError as e: - raise ParsingError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e - ) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/whop_sdk/companies/types/__init__.py b/src/whop_sdk/companies/types/__init__.py deleted file mode 100644 index 7ffed9cb..00000000 --- a/src/whop_sdk/companies/types/__init__.py +++ /dev/null @@ -1,59 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .create_api_key_companies_request_permissions_item import CreateApiKeyCompaniesRequestPermissionsItem - from .create_api_key_companies_response import CreateApiKeyCompaniesResponse - from .create_companies_request_logo import CreateCompaniesRequestLogo - from .list_companies_response import ListCompaniesResponse - from .update_companies_request_banner_image import UpdateCompaniesRequestBannerImage - from .update_companies_request_logo import UpdateCompaniesRequestLogo - from .update_companies_request_social_links_item import UpdateCompaniesRequestSocialLinksItem - from .update_companies_request_social_links_item_image import UpdateCompaniesRequestSocialLinksItemImage -_dynamic_imports: typing.Dict[str, str] = { - "CreateApiKeyCompaniesRequestPermissionsItem": ".create_api_key_companies_request_permissions_item", - "CreateApiKeyCompaniesResponse": ".create_api_key_companies_response", - "CreateCompaniesRequestLogo": ".create_companies_request_logo", - "ListCompaniesResponse": ".list_companies_response", - "UpdateCompaniesRequestBannerImage": ".update_companies_request_banner_image", - "UpdateCompaniesRequestLogo": ".update_companies_request_logo", - "UpdateCompaniesRequestSocialLinksItem": ".update_companies_request_social_links_item", - "UpdateCompaniesRequestSocialLinksItemImage": ".update_companies_request_social_links_item_image", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "CreateApiKeyCompaniesRequestPermissionsItem", - "CreateApiKeyCompaniesResponse", - "CreateCompaniesRequestLogo", - "ListCompaniesResponse", - "UpdateCompaniesRequestBannerImage", - "UpdateCompaniesRequestLogo", - "UpdateCompaniesRequestSocialLinksItem", - "UpdateCompaniesRequestSocialLinksItemImage", -] diff --git a/src/whop_sdk/companies/types/create_api_key_companies_request_permissions_item.py b/src/whop_sdk/companies/types/create_api_key_companies_request_permissions_item.py deleted file mode 100644 index a54f3b8c..00000000 --- a/src/whop_sdk/companies/types/create_api_key_companies_request_permissions_item.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class CreateApiKeyCompaniesRequestPermissionsItem(UniversalBaseModel): - """ - Input for a single permissions statement - """ - - actions: typing.List[str] = pydantic.Field() - """ - Actions covered by this statement - """ - - grant: bool = pydantic.Field() - """ - Whether the actions are granted or denied - """ - - resources: typing.List[str] = pydantic.Field() - """ - Resource identifiers. Can look like 'biz_xxxx' or 'biz_xxx|pass_*|exp_xxx' or 'biz_xxx|app_xxx' or 'biz_xxx|pass_xxx|exp_xxx' or 'biz_xxx|pass_xxx' or 'biz_xxx|pass_*' - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/companies/types/create_api_key_companies_response.py b/src/whop_sdk/companies/types/create_api_key_companies_response.py deleted file mode 100644 index a5d99403..00000000 --- a/src/whop_sdk/companies/types/create_api_key_companies_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class CreateApiKeyCompaniesResponse(UniversalBaseModel): - """ - An API key created for a child company, including the one-time secret key. - """ - - id: str = pydantic.Field() - """ - The unique identifier for the authorized api key. - """ - - name: typing.Optional[str] = pydantic.Field(default=None) - """ - A user set name to identify an API key - """ - - secret_key: str = pydantic.Field() - """ - The secret key used to authenticate requests. Only returned at creation time. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/companies/types/list_companies_response.py b/src/whop_sdk/companies/types/list_companies_response.py deleted file mode 100644 index f8cb1d43..00000000 --- a/src/whop_sdk/companies/types/list_companies_response.py +++ /dev/null @@ -1,33 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.company_list_item import CompanyListItem -from ...types.page_info import PageInfo - - -class ListCompaniesResponse(UniversalBaseModel): - """ - The connection type for PublicCompany. - """ - - data: typing.List[CompanyListItem] = pydantic.Field() - """ - A list of nodes. - """ - - page_info: PageInfo = pydantic.Field() - """ - Information to aid in pagination. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/companies/types/update_companies_request_social_links_item.py b/src/whop_sdk/companies/types/update_companies_request_social_links_item.py deleted file mode 100644 index c2a32d9b..00000000 --- a/src/whop_sdk/companies/types/update_companies_request_social_links_item.py +++ /dev/null @@ -1,53 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.social_link_websites import SocialLinkWebsites -from .update_companies_request_social_links_item_image import UpdateCompaniesRequestSocialLinksItemImage - - -class UpdateCompaniesRequestSocialLinksItem(UniversalBaseModel): - """ - Input for creating a social link for a company - """ - - image: typing.Optional[UpdateCompaniesRequestSocialLinksItemImage] = pydantic.Field(default=None) - """ - The custom image for the social link - """ - - order: typing.Optional[str] = pydantic.Field(default=None) - """ - The order of the social link - """ - - title: typing.Optional[str] = pydantic.Field(default=None) - """ - The title of the social link - """ - - url: str = pydantic.Field() - """ - The URL of the social link - """ - - website: SocialLinkWebsites = pydantic.Field() - """ - The website this link is for - """ - - website_order: typing.Optional[str] = pydantic.Field(default=None) - """ - The order of the website social link - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/company_token_transactions/client.py b/src/whop_sdk/company_token_transactions/client.py index dc941e03..ce6d6d99 100644 --- a/src/whop_sdk/company_token_transactions/client.py +++ b/src/whop_sdk/company_token_transactions/client.py @@ -86,7 +86,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -144,7 +144,7 @@ def create( ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -187,7 +187,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -271,7 +271,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -338,7 +338,7 @@ async def create( ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -391,7 +391,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/confirmation_tokens/client.py b/src/whop_sdk/confirmation_tokens/client.py index b9f7caae..366a16c9 100644 --- a/src/whop_sdk/confirmation_tokens/client.py +++ b/src/whop_sdk/confirmation_tokens/client.py @@ -81,7 +81,7 @@ def create( ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -147,7 +147,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -229,7 +229,7 @@ async def create( ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -303,7 +303,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/course_chapters/client.py b/src/whop_sdk/course_chapters/client.py index a291f1ba..0594618f 100644 --- a/src/whop_sdk/course_chapters/client.py +++ b/src/whop_sdk/course_chapters/client.py @@ -75,7 +75,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -128,7 +128,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -164,7 +164,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -200,7 +200,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -239,7 +239,7 @@ def update(self, id: str, *, title: str, request_options: typing.Optional[Reques from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -315,7 +315,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -377,7 +377,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -421,7 +421,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -465,7 +465,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -514,7 +514,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/course_lesson_interactions/client.py b/src/whop_sdk/course_lesson_interactions/client.py index f89f2d38..5b11ab99 100644 --- a/src/whop_sdk/course_lesson_interactions/client.py +++ b/src/whop_sdk/course_lesson_interactions/client.py @@ -85,7 +85,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -140,7 +140,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -228,7 +228,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -294,7 +294,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/course_lessons/client.py b/src/whop_sdk/course_lessons/client.py index d2790c4a..1d0c97a1 100644 --- a/src/whop_sdk/course_lessons/client.py +++ b/src/whop_sdk/course_lessons/client.py @@ -94,7 +94,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -178,7 +178,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -225,7 +225,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -261,7 +261,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -362,7 +362,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -412,7 +412,7 @@ def mark_as_completed(self, lesson_id: str, *, request_options: typing.Optional[ from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -445,7 +445,7 @@ def start(self, lesson_id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -490,7 +490,7 @@ def submit_assessment( ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -574,7 +574,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -667,7 +667,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -722,7 +722,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -766,7 +766,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -875,7 +875,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -935,7 +935,7 @@ async def mark_as_completed( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -976,7 +976,7 @@ async def start(self, lesson_id: str, *, request_options: typing.Optional[Reques from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1029,7 +1029,7 @@ async def submit_assessment( ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/course_students/client.py b/src/whop_sdk/course_students/client.py index 3d3e1e01..0cbed2e1 100644 --- a/src/whop_sdk/course_students/client.py +++ b/src/whop_sdk/course_students/client.py @@ -77,7 +77,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -128,7 +128,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -208,7 +208,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -268,7 +268,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/courses/client.py b/src/whop_sdk/courses/client.py index 5fb13743..bad8acc7 100644 --- a/src/whop_sdk/courses/client.py +++ b/src/whop_sdk/courses/client.py @@ -84,7 +84,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -168,7 +168,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -215,7 +215,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -251,7 +251,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -332,7 +332,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -424,7 +424,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -517,7 +517,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -572,7 +572,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -616,7 +616,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -705,7 +705,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/deposits/client.py b/src/whop_sdk/deposits/client.py index 97655456..bcb17a65 100644 --- a/src/whop_sdk/deposits/client.py +++ b/src/whop_sdk/deposits/client.py @@ -67,7 +67,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -137,7 +137,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/dispute_alerts/client.py b/src/whop_sdk/dispute_alerts/client.py index 69d1ed9f..841dabf1 100644 --- a/src/whop_sdk/dispute_alerts/client.py +++ b/src/whop_sdk/dispute_alerts/client.py @@ -95,7 +95,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -143,7 +143,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -239,7 +239,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -296,7 +296,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/disputes/client.py b/src/whop_sdk/disputes/client.py index 8fa2809b..b31f7a37 100644 --- a/src/whop_sdk/disputes/client.py +++ b/src/whop_sdk/disputes/client.py @@ -6,6 +6,7 @@ from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions from ..types.dispute import Dispute +from ..types.dispute_legacy import DisputeLegacy from .raw_client import AsyncRawDisputesClient, RawDisputesClient from .types.list_disputes_request_direction import ListDisputesRequestDirection from .types.list_disputes_request_order import ListDisputesRequestOrder @@ -117,7 +118,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -194,7 +195,7 @@ def summary( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -233,7 +234,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -275,7 +276,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -308,7 +309,7 @@ def submit(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -319,7 +320,9 @@ def submit(self, id: str, *, request_options: typing.Optional[RequestOptions] = _response = self._raw_client.submit(id, request_options=request_options) return _response.data - def submit_evidence_dispute(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Dispute: + def submit_evidence_dispute( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DisputeLegacy: """ Submit a payment dispute to the payment processor for review. Once submitted, no further edits can be made. @@ -343,7 +346,7 @@ def submit_evidence_dispute(self, id: str, *, request_options: typing.Optional[R Returns ------- - Dispute + DisputeLegacy A successful response Examples @@ -351,7 +354,7 @@ def submit_evidence_dispute(self, id: str, *, request_options: typing.Optional[R from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -385,7 +388,7 @@ def update_evidence_dispute( service_date: typing.Optional[str] = OMIT, uncategorized_attachment: typing.Optional[UpdateEvidenceDisputeRequestUncategorizedAttachment] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> Dispute: + ) -> DisputeLegacy: """ Update a dispute with evidence data to attempt to win the dispute. @@ -451,7 +454,7 @@ def update_evidence_dispute( Returns ------- - Dispute + DisputeLegacy A successful response Examples @@ -459,7 +462,7 @@ def update_evidence_dispute( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -519,7 +522,7 @@ def upload_evidence( from whop_sdk.disputes import UploadEvidenceDisputesRequestDocumentsItem client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -622,7 +625,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -708,7 +711,7 @@ async def summary( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -755,7 +758,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -805,7 +808,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -846,7 +849,7 @@ async def submit(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -865,7 +868,7 @@ async def main() -> None: async def submit_evidence_dispute( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Dispute: + ) -> DisputeLegacy: """ Submit a payment dispute to the payment processor for review. Once submitted, no further edits can be made. @@ -889,7 +892,7 @@ async def submit_evidence_dispute( Returns ------- - Dispute + DisputeLegacy A successful response Examples @@ -899,7 +902,7 @@ async def submit_evidence_dispute( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -939,7 +942,7 @@ async def update_evidence_dispute( service_date: typing.Optional[str] = OMIT, uncategorized_attachment: typing.Optional[UpdateEvidenceDisputeRequestUncategorizedAttachment] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> Dispute: + ) -> DisputeLegacy: """ Update a dispute with evidence data to attempt to win the dispute. @@ -1005,7 +1008,7 @@ async def update_evidence_dispute( Returns ------- - Dispute + DisputeLegacy A successful response Examples @@ -1015,7 +1018,7 @@ async def update_evidence_dispute( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1083,7 +1086,7 @@ async def upload_evidence( from whop_sdk.disputes import UploadEvidenceDisputesRequestDocumentsItem client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/disputes/raw_client.py b/src/whop_sdk/disputes/raw_client.py index b2082a97..ddc8fb2d 100644 --- a/src/whop_sdk/disputes/raw_client.py +++ b/src/whop_sdk/disputes/raw_client.py @@ -21,6 +21,7 @@ from ..errors.unauthorized_error import UnauthorizedError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.dispute import Dispute +from ..types.dispute_legacy import DisputeLegacy from ..types.v1error_response import V1ErrorResponse from .types.list_disputes_request_direction import ListDisputesRequestDirection from .types.list_disputes_request_order import ListDisputesRequestOrder @@ -549,7 +550,7 @@ def submit(self, id: str, *, request_options: typing.Optional[RequestOptions] = def submit_evidence_dispute( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[Dispute]: + ) -> HttpResponse[DisputeLegacy]: """ Submit a payment dispute to the payment processor for review. Once submitted, no further edits can be made. @@ -573,7 +574,7 @@ def submit_evidence_dispute( Returns ------- - HttpResponse[Dispute] + HttpResponse[DisputeLegacy] A successful response """ _response = self._client_wrapper.httpx_client.request( @@ -584,9 +585,9 @@ def submit_evidence_dispute( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Dispute, + DisputeLegacy, parse_obj_as( - type_=Dispute, # type: ignore + type_=DisputeLegacy, # type: ignore object_=_response.json(), ), ) @@ -700,7 +701,7 @@ def update_evidence_dispute( service_date: typing.Optional[str] = OMIT, uncategorized_attachment: typing.Optional[UpdateEvidenceDisputeRequestUncategorizedAttachment] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[Dispute]: + ) -> HttpResponse[DisputeLegacy]: """ Update a dispute with evidence data to attempt to win the dispute. @@ -766,7 +767,7 @@ def update_evidence_dispute( Returns ------- - HttpResponse[Dispute] + HttpResponse[DisputeLegacy] A successful response """ _response = self._client_wrapper.httpx_client.request( @@ -813,9 +814,9 @@ def update_evidence_dispute( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Dispute, + DisputeLegacy, parse_obj_as( - type_=Dispute, # type: ignore + type_=DisputeLegacy, # type: ignore object_=_response.json(), ), ) @@ -1519,7 +1520,7 @@ async def submit( async def submit_evidence_dispute( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Dispute]: + ) -> AsyncHttpResponse[DisputeLegacy]: """ Submit a payment dispute to the payment processor for review. Once submitted, no further edits can be made. @@ -1543,7 +1544,7 @@ async def submit_evidence_dispute( Returns ------- - AsyncHttpResponse[Dispute] + AsyncHttpResponse[DisputeLegacy] A successful response """ _response = await self._client_wrapper.httpx_client.request( @@ -1554,9 +1555,9 @@ async def submit_evidence_dispute( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Dispute, + DisputeLegacy, parse_obj_as( - type_=Dispute, # type: ignore + type_=DisputeLegacy, # type: ignore object_=_response.json(), ), ) @@ -1670,7 +1671,7 @@ async def update_evidence_dispute( service_date: typing.Optional[str] = OMIT, uncategorized_attachment: typing.Optional[UpdateEvidenceDisputeRequestUncategorizedAttachment] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[Dispute]: + ) -> AsyncHttpResponse[DisputeLegacy]: """ Update a dispute with evidence data to attempt to win the dispute. @@ -1736,7 +1737,7 @@ async def update_evidence_dispute( Returns ------- - AsyncHttpResponse[Dispute] + AsyncHttpResponse[DisputeLegacy] A successful response """ _response = await self._client_wrapper.httpx_client.request( @@ -1783,9 +1784,9 @@ async def update_evidence_dispute( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Dispute, + DisputeLegacy, parse_obj_as( - type_=Dispute, # type: ignore + type_=DisputeLegacy, # type: ignore object_=_response.json(), ), ) diff --git a/src/whop_sdk/dm_channels/client.py b/src/whop_sdk/dm_channels/client.py index 1197f122..654ddfe8 100644 --- a/src/whop_sdk/dm_channels/client.py +++ b/src/whop_sdk/dm_channels/client.py @@ -75,7 +75,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -136,7 +136,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -179,7 +179,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -216,7 +216,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -262,7 +262,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -337,7 +337,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -407,7 +407,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -458,7 +458,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -503,7 +503,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -557,7 +557,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/dm_members/client.py b/src/whop_sdk/dm_members/client.py index 36b1a200..e3587321 100644 --- a/src/whop_sdk/dm_members/client.py +++ b/src/whop_sdk/dm_members/client.py @@ -78,7 +78,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -128,7 +128,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -166,7 +166,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -203,7 +203,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -253,7 +253,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -331,7 +331,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -390,7 +390,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -438,7 +438,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -483,7 +483,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -541,7 +541,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/entries/client.py b/src/whop_sdk/entries/client.py index 53dc7b86..d6bb3712 100644 --- a/src/whop_sdk/entries/client.py +++ b/src/whop_sdk/entries/client.py @@ -106,7 +106,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -169,7 +169,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -205,7 +205,7 @@ def approve(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -243,7 +243,7 @@ def deny(self, id: str, *, request_options: typing.Optional[RequestOptions] = No from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -346,7 +346,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -418,7 +418,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -464,7 +464,7 @@ async def approve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -510,7 +510,7 @@ async def deny(self, id: str, *, request_options: typing.Optional[RequestOptions from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/events/client.py b/src/whop_sdk/events/client.py index 7ff819b0..8b2e3d6d 100644 --- a/src/whop_sdk/events/client.py +++ b/src/whop_sdk/events/client.py @@ -138,7 +138,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -277,7 +277,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -350,7 +350,7 @@ def pulse( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -396,7 +396,7 @@ def validate_pixel( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -522,7 +522,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -670,7 +670,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -751,7 +751,7 @@ async def pulse( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -806,7 +806,7 @@ async def validate_pixel( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/experiences/client.py b/src/whop_sdk/experiences/client.py index 5ba0b11c..19870511 100644 --- a/src/whop_sdk/experiences/client.py +++ b/src/whop_sdk/experiences/client.py @@ -94,7 +94,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -182,7 +182,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -225,7 +225,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -259,7 +259,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -326,7 +326,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -377,7 +377,7 @@ def attach( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -419,7 +419,7 @@ def detach( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -464,7 +464,7 @@ def duplicate( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -553,7 +553,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -650,7 +650,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -701,7 +701,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -743,7 +743,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -818,7 +818,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -877,7 +877,7 @@ async def attach( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -927,7 +927,7 @@ async def detach( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -980,7 +980,7 @@ async def duplicate( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/exports/client.py b/src/whop_sdk/exports/client.py index ad8f2e80..626a61a3 100644 --- a/src/whop_sdk/exports/client.py +++ b/src/whop_sdk/exports/client.py @@ -83,7 +83,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -144,7 +144,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -184,7 +184,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -264,7 +264,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -333,7 +333,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -381,7 +381,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/fee_markups/client.py b/src/whop_sdk/fee_markups/client.py index 8e2ff1c5..77bacb4c 100644 --- a/src/whop_sdk/fee_markups/client.py +++ b/src/whop_sdk/fee_markups/client.py @@ -76,7 +76,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -145,7 +145,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -190,7 +190,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -265,7 +265,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -343,7 +343,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -396,7 +396,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/files/client.py b/src/whop_sdk/files/client.py index db6694e3..c085ca57 100644 --- a/src/whop_sdk/files/client.py +++ b/src/whop_sdk/files/client.py @@ -83,7 +83,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -146,7 +146,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -185,7 +185,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -232,7 +232,7 @@ def complete( from whop_sdk.files import CompleteFilesRequestMultipartPartsItem client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -324,7 +324,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -396,7 +396,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -443,7 +443,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -498,7 +498,7 @@ async def complete( from whop_sdk.files import CompleteFilesRequestMultipartPartsItem client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/financial_activity/client.py b/src/whop_sdk/financial_activity/client.py index caae0d8c..f186d648 100644 --- a/src/whop_sdk/financial_activity/client.py +++ b/src/whop_sdk/financial_activity/client.py @@ -113,7 +113,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -244,7 +244,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/financial_activity/types/list_financial_activity_request_line_types_item.py b/src/whop_sdk/financial_activity/types/list_financial_activity_request_line_types_item.py index 9ba06ad1..905c1c2f 100644 --- a/src/whop_sdk/financial_activity/types/list_financial_activity_request_line_types_item.py +++ b/src/whop_sdk/financial_activity/types/list_financial_activity_request_line_types_item.py @@ -67,6 +67,7 @@ "misc_purchase", "misc_refund", "misc_reversal", + "onboarding_reward", "onchain_deposit", "onchain_swap_source", "onchain_swap_target", diff --git a/src/whop_sdk/financial_reports/__init__.py b/src/whop_sdk/financial_reports/__init__.py index aaf95aa4..09bb1eaf 100644 --- a/src/whop_sdk/financial_reports/__init__.py +++ b/src/whop_sdk/financial_reports/__init__.py @@ -24,23 +24,29 @@ from .breakdown import ( RetrieveBreakdownRequestBucket, RetrieveBreakdownRequestDirection, + RetrieveBreakdownRequestGroupBy, RetrieveBreakdownResponse, RetrieveBreakdownResponseActivityFilters, RetrieveBreakdownResponseActivityFiltersDirection, RetrieveBreakdownResponseBucket, RetrieveBreakdownResponseDirection, RetrieveBreakdownResponseItemsItem, + RetrieveBreakdownResponseItemsItemAvatar, + RetrieveBreakdownResponseItemsItemAvatarShape, RetrieveBreakdownResponseItemsItemObject, ) _dynamic_imports: typing.Dict[str, str] = { "RetrieveBreakdownRequestBucket": ".breakdown", "RetrieveBreakdownRequestDirection": ".breakdown", + "RetrieveBreakdownRequestGroupBy": ".breakdown", "RetrieveBreakdownResponse": ".breakdown", "RetrieveBreakdownResponseActivityFilters": ".breakdown", "RetrieveBreakdownResponseActivityFiltersDirection": ".breakdown", "RetrieveBreakdownResponseBucket": ".breakdown", "RetrieveBreakdownResponseDirection": ".breakdown", "RetrieveBreakdownResponseItemsItem": ".breakdown", + "RetrieveBreakdownResponseItemsItemAvatar": ".breakdown", + "RetrieveBreakdownResponseItemsItemAvatarShape": ".breakdown", "RetrieveBreakdownResponseItemsItemObject": ".breakdown", "RetrieveFinancialReportsRequestDirection": ".types", "RetrieveFinancialReportsRequestGroupBy": ".types", @@ -82,12 +88,15 @@ def __dir__(): __all__ = [ "RetrieveBreakdownRequestBucket", "RetrieveBreakdownRequestDirection", + "RetrieveBreakdownRequestGroupBy", "RetrieveBreakdownResponse", "RetrieveBreakdownResponseActivityFilters", "RetrieveBreakdownResponseActivityFiltersDirection", "RetrieveBreakdownResponseBucket", "RetrieveBreakdownResponseDirection", "RetrieveBreakdownResponseItemsItem", + "RetrieveBreakdownResponseItemsItemAvatar", + "RetrieveBreakdownResponseItemsItemAvatarShape", "RetrieveBreakdownResponseItemsItemObject", "RetrieveFinancialReportsRequestDirection", "RetrieveFinancialReportsRequestGroupBy", diff --git a/src/whop_sdk/financial_reports/breakdown/__init__.py b/src/whop_sdk/financial_reports/breakdown/__init__.py index 363136d3..86c28078 100644 --- a/src/whop_sdk/financial_reports/breakdown/__init__.py +++ b/src/whop_sdk/financial_reports/breakdown/__init__.py @@ -9,23 +9,29 @@ from .types import ( RetrieveBreakdownRequestBucket, RetrieveBreakdownRequestDirection, + RetrieveBreakdownRequestGroupBy, RetrieveBreakdownResponse, RetrieveBreakdownResponseActivityFilters, RetrieveBreakdownResponseActivityFiltersDirection, RetrieveBreakdownResponseBucket, RetrieveBreakdownResponseDirection, RetrieveBreakdownResponseItemsItem, + RetrieveBreakdownResponseItemsItemAvatar, + RetrieveBreakdownResponseItemsItemAvatarShape, RetrieveBreakdownResponseItemsItemObject, ) _dynamic_imports: typing.Dict[str, str] = { "RetrieveBreakdownRequestBucket": ".types", "RetrieveBreakdownRequestDirection": ".types", + "RetrieveBreakdownRequestGroupBy": ".types", "RetrieveBreakdownResponse": ".types", "RetrieveBreakdownResponseActivityFilters": ".types", "RetrieveBreakdownResponseActivityFiltersDirection": ".types", "RetrieveBreakdownResponseBucket": ".types", "RetrieveBreakdownResponseDirection": ".types", "RetrieveBreakdownResponseItemsItem": ".types", + "RetrieveBreakdownResponseItemsItemAvatar": ".types", + "RetrieveBreakdownResponseItemsItemAvatarShape": ".types", "RetrieveBreakdownResponseItemsItemObject": ".types", } @@ -54,11 +60,14 @@ def __dir__(): __all__ = [ "RetrieveBreakdownRequestBucket", "RetrieveBreakdownRequestDirection", + "RetrieveBreakdownRequestGroupBy", "RetrieveBreakdownResponse", "RetrieveBreakdownResponseActivityFilters", "RetrieveBreakdownResponseActivityFiltersDirection", "RetrieveBreakdownResponseBucket", "RetrieveBreakdownResponseDirection", "RetrieveBreakdownResponseItemsItem", + "RetrieveBreakdownResponseItemsItemAvatar", + "RetrieveBreakdownResponseItemsItemAvatarShape", "RetrieveBreakdownResponseItemsItemObject", ] diff --git a/src/whop_sdk/financial_reports/breakdown/client.py b/src/whop_sdk/financial_reports/breakdown/client.py index 7a0f1535..ee35a2f9 100644 --- a/src/whop_sdk/financial_reports/breakdown/client.py +++ b/src/whop_sdk/financial_reports/breakdown/client.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper @@ -7,6 +8,7 @@ from .raw_client import AsyncRawBreakdownClient, RawBreakdownClient from .types.retrieve_breakdown_request_bucket import RetrieveBreakdownRequestBucket from .types.retrieve_breakdown_request_direction import RetrieveBreakdownRequestDirection +from .types.retrieve_breakdown_request_group_by import RetrieveBreakdownRequestGroupBy from .types.retrieve_breakdown_response import RetrieveBreakdownResponse @@ -32,8 +34,10 @@ def retrieve( bucket: RetrieveBreakdownRequestBucket, direction: RetrieveBreakdownRequestDirection, currency: str, - from_date: str, - to_date: str, + from_: dt.datetime, + to: dt.datetime, + group_by: typing.Optional[RetrieveBreakdownRequestGroupBy] = None, + timezone: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> RetrieveBreakdownResponse: """ @@ -53,12 +57,18 @@ def retrieve( currency : str The report currency to explain. - from_date : str + from_ : dt.datetime Start of the report window as an ISO 8601 timestamp. - to_date : str + to : dt.datetime Exclusive end of the report window as an ISO 8601 timestamp. + group_by : typing.Optional[RetrieveBreakdownRequestGroupBy] + Period grouping used by the parent report. + + timezone : typing.Optional[str] + IANA timezone used by the parent report to bucket periods. Defaults to UTC. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -69,10 +79,12 @@ def retrieve( Examples -------- + import datetime + from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -81,8 +93,12 @@ def retrieve( bucket="transfers", direction="money_in", currency="currency", - from_date="from_date", - to_date="to_date", + from_=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + to=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), ) """ _response = self._raw_client.retrieve( @@ -90,8 +106,10 @@ def retrieve( bucket=bucket, direction=direction, currency=currency, - from_date=from_date, - to_date=to_date, + from_=from_, + to=to, + group_by=group_by, + timezone=timezone, request_options=request_options, ) return _response.data @@ -119,8 +137,10 @@ async def retrieve( bucket: RetrieveBreakdownRequestBucket, direction: RetrieveBreakdownRequestDirection, currency: str, - from_date: str, - to_date: str, + from_: dt.datetime, + to: dt.datetime, + group_by: typing.Optional[RetrieveBreakdownRequestGroupBy] = None, + timezone: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> RetrieveBreakdownResponse: """ @@ -140,12 +160,18 @@ async def retrieve( currency : str The report currency to explain. - from_date : str + from_ : dt.datetime Start of the report window as an ISO 8601 timestamp. - to_date : str + to : dt.datetime Exclusive end of the report window as an ISO 8601 timestamp. + group_by : typing.Optional[RetrieveBreakdownRequestGroupBy] + Period grouping used by the parent report. + + timezone : typing.Optional[str] + IANA timezone used by the parent report to bucket periods. Defaults to UTC. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -157,11 +183,12 @@ async def retrieve( Examples -------- import asyncio + import datetime from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -173,8 +200,12 @@ async def main() -> None: bucket="transfers", direction="money_in", currency="currency", - from_date="from_date", - to_date="to_date", + from_=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + to=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), ) @@ -185,8 +216,10 @@ async def main() -> None: bucket=bucket, direction=direction, currency=currency, - from_date=from_date, - to_date=to_date, + from_=from_, + to=to, + group_by=group_by, + timezone=timezone, request_options=request_options, ) return _response.data diff --git a/src/whop_sdk/financial_reports/breakdown/raw_client.py b/src/whop_sdk/financial_reports/breakdown/raw_client.py index 940d60ff..c8f49d31 100644 --- a/src/whop_sdk/financial_reports/breakdown/raw_client.py +++ b/src/whop_sdk/financial_reports/breakdown/raw_client.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from json.decoder import JSONDecodeError from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.datetime_utils import serialize_datetime from ...core.http_response import AsyncHttpResponse, HttpResponse from ...core.parse_error import ParsingError from ...core.pydantic_utilities import parse_obj_as @@ -14,6 +16,7 @@ from ...errors.unauthorized_error import UnauthorizedError from .types.retrieve_breakdown_request_bucket import RetrieveBreakdownRequestBucket from .types.retrieve_breakdown_request_direction import RetrieveBreakdownRequestDirection +from .types.retrieve_breakdown_request_group_by import RetrieveBreakdownRequestGroupBy from .types.retrieve_breakdown_response import RetrieveBreakdownResponse from pydantic import ValidationError @@ -29,8 +32,10 @@ def retrieve( bucket: RetrieveBreakdownRequestBucket, direction: RetrieveBreakdownRequestDirection, currency: str, - from_date: str, - to_date: str, + from_: dt.datetime, + to: dt.datetime, + group_by: typing.Optional[RetrieveBreakdownRequestGroupBy] = None, + timezone: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[RetrieveBreakdownResponse]: """ @@ -50,12 +55,18 @@ def retrieve( currency : str The report currency to explain. - from_date : str + from_ : dt.datetime Start of the report window as an ISO 8601 timestamp. - to_date : str + to : dt.datetime Exclusive end of the report window as an ISO 8601 timestamp. + group_by : typing.Optional[RetrieveBreakdownRequestGroupBy] + Period grouping used by the parent report. + + timezone : typing.Optional[str] + IANA timezone used by the parent report to bucket periods. Defaults to UTC. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -72,8 +83,10 @@ def retrieve( "bucket": bucket, "direction": direction, "currency": currency, - "from_date": from_date, - "to_date": to_date, + "from": serialize_datetime(from_), + "to": serialize_datetime(to), + "group_by": group_by, + "timezone": timezone, }, request_options=request_options, ) @@ -141,8 +154,10 @@ async def retrieve( bucket: RetrieveBreakdownRequestBucket, direction: RetrieveBreakdownRequestDirection, currency: str, - from_date: str, - to_date: str, + from_: dt.datetime, + to: dt.datetime, + group_by: typing.Optional[RetrieveBreakdownRequestGroupBy] = None, + timezone: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[RetrieveBreakdownResponse]: """ @@ -162,12 +177,18 @@ async def retrieve( currency : str The report currency to explain. - from_date : str + from_ : dt.datetime Start of the report window as an ISO 8601 timestamp. - to_date : str + to : dt.datetime Exclusive end of the report window as an ISO 8601 timestamp. + group_by : typing.Optional[RetrieveBreakdownRequestGroupBy] + Period grouping used by the parent report. + + timezone : typing.Optional[str] + IANA timezone used by the parent report to bucket periods. Defaults to UTC. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -184,8 +205,10 @@ async def retrieve( "bucket": bucket, "direction": direction, "currency": currency, - "from_date": from_date, - "to_date": to_date, + "from": serialize_datetime(from_), + "to": serialize_datetime(to), + "group_by": group_by, + "timezone": timezone, }, request_options=request_options, ) diff --git a/src/whop_sdk/financial_reports/breakdown/types/__init__.py b/src/whop_sdk/financial_reports/breakdown/types/__init__.py index 2c36ed09..90101b77 100644 --- a/src/whop_sdk/financial_reports/breakdown/types/__init__.py +++ b/src/whop_sdk/financial_reports/breakdown/types/__init__.py @@ -8,6 +8,7 @@ if typing.TYPE_CHECKING: from .retrieve_breakdown_request_bucket import RetrieveBreakdownRequestBucket from .retrieve_breakdown_request_direction import RetrieveBreakdownRequestDirection + from .retrieve_breakdown_request_group_by import RetrieveBreakdownRequestGroupBy from .retrieve_breakdown_response import RetrieveBreakdownResponse from .retrieve_breakdown_response_activity_filters import RetrieveBreakdownResponseActivityFilters from .retrieve_breakdown_response_activity_filters_direction import ( @@ -16,16 +17,21 @@ from .retrieve_breakdown_response_bucket import RetrieveBreakdownResponseBucket from .retrieve_breakdown_response_direction import RetrieveBreakdownResponseDirection from .retrieve_breakdown_response_items_item import RetrieveBreakdownResponseItemsItem + from .retrieve_breakdown_response_items_item_avatar import RetrieveBreakdownResponseItemsItemAvatar + from .retrieve_breakdown_response_items_item_avatar_shape import RetrieveBreakdownResponseItemsItemAvatarShape from .retrieve_breakdown_response_items_item_object import RetrieveBreakdownResponseItemsItemObject _dynamic_imports: typing.Dict[str, str] = { "RetrieveBreakdownRequestBucket": ".retrieve_breakdown_request_bucket", "RetrieveBreakdownRequestDirection": ".retrieve_breakdown_request_direction", + "RetrieveBreakdownRequestGroupBy": ".retrieve_breakdown_request_group_by", "RetrieveBreakdownResponse": ".retrieve_breakdown_response", "RetrieveBreakdownResponseActivityFilters": ".retrieve_breakdown_response_activity_filters", "RetrieveBreakdownResponseActivityFiltersDirection": ".retrieve_breakdown_response_activity_filters_direction", "RetrieveBreakdownResponseBucket": ".retrieve_breakdown_response_bucket", "RetrieveBreakdownResponseDirection": ".retrieve_breakdown_response_direction", "RetrieveBreakdownResponseItemsItem": ".retrieve_breakdown_response_items_item", + "RetrieveBreakdownResponseItemsItemAvatar": ".retrieve_breakdown_response_items_item_avatar", + "RetrieveBreakdownResponseItemsItemAvatarShape": ".retrieve_breakdown_response_items_item_avatar_shape", "RetrieveBreakdownResponseItemsItemObject": ".retrieve_breakdown_response_items_item_object", } @@ -54,11 +60,14 @@ def __dir__(): __all__ = [ "RetrieveBreakdownRequestBucket", "RetrieveBreakdownRequestDirection", + "RetrieveBreakdownRequestGroupBy", "RetrieveBreakdownResponse", "RetrieveBreakdownResponseActivityFilters", "RetrieveBreakdownResponseActivityFiltersDirection", "RetrieveBreakdownResponseBucket", "RetrieveBreakdownResponseDirection", "RetrieveBreakdownResponseItemsItem", + "RetrieveBreakdownResponseItemsItemAvatar", + "RetrieveBreakdownResponseItemsItemAvatarShape", "RetrieveBreakdownResponseItemsItemObject", ] diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_bucket.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_bucket.py index d3378213..453964fb 100644 --- a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_bucket.py +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_bucket.py @@ -3,5 +3,8 @@ import typing RetrieveBreakdownRequestBucket = typing.Union[ - typing.Literal["transfers", "payments", "card_spend", "withdrawals", "swaps"], typing.Any + typing.Literal[ + "transfers", "payments", "refunds", "ads", "card_spend", "card_authorization_releases", "withdrawals", "swaps" + ], + typing.Any, ] diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_group_by.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_group_by.py new file mode 100644 index 00000000..d967f70b --- /dev/null +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_request_group_by.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RetrieveBreakdownRequestGroupBy = typing.Union[typing.Literal["day", "week", "month"], typing.Any] diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response.py index dc6b9472..90aae3f9 100644 --- a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response.py +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response.py @@ -18,6 +18,7 @@ class RetrieveBreakdownResponse(UniversalBaseModel): direction: RetrieveBreakdownResponseDirection items: typing.List[RetrieveBreakdownResponseItemsItem] other_amount: typing.Optional[Money] = None + other_name: str if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_bucket.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_bucket.py index d7962e1c..c77c7f73 100644 --- a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_bucket.py +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_bucket.py @@ -3,5 +3,8 @@ import typing RetrieveBreakdownResponseBucket = typing.Union[ - typing.Literal["transfers", "payments", "card_spend", "withdrawals", "swaps"], typing.Any + typing.Literal[ + "transfers", "payments", "refunds", "ads", "card_spend", "card_authorization_releases", "withdrawals", "swaps" + ], + typing.Any, ] diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item.py index 1a9b7489..930620a9 100644 --- a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item.py +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item.py @@ -5,11 +5,17 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ....types.money import Money +from .retrieve_breakdown_response_items_item_avatar import RetrieveBreakdownResponseItemsItemAvatar from .retrieve_breakdown_response_items_item_object import RetrieveBreakdownResponseItemsItemObject class RetrieveBreakdownResponseItemsItem(UniversalBaseModel): amount: Money + avatar: typing.Optional[RetrieveBreakdownResponseItemsItemAvatar] = pydantic.Field(default=None) + """ + How to draw the row's icon. `null` when the row has nothing to show (balances, adjustments, ad campaigns), so clients render no icon rather than a placeholder. + """ + image_url: typing.Optional[str] = None key: str = pydantic.Field() """ diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar.py new file mode 100644 index 00000000..4550158f --- /dev/null +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .retrieve_breakdown_response_items_item_avatar_shape import RetrieveBreakdownResponseItemsItemAvatarShape + + +class RetrieveBreakdownResponseItemsItemAvatar(UniversalBaseModel): + shape: RetrieveBreakdownResponseItemsItemAvatarShape + url: typing.Optional[str] = pydantic.Field(default=None) + """ + The image to show, or `null` to fall back to the row's initials. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar_shape.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar_shape.py new file mode 100644 index 00000000..bfe9fe0c --- /dev/null +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_avatar_shape.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RetrieveBreakdownResponseItemsItemAvatarShape = typing.Union[typing.Literal["circle", "square"], typing.Any] diff --git a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_object.py b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_object.py index 68d7923a..810452f2 100644 --- a/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_object.py +++ b/src/whop_sdk/financial_reports/breakdown/types/retrieve_breakdown_response_items_item_object.py @@ -3,5 +3,8 @@ import typing RetrieveBreakdownResponseItemsItemObject = typing.Union[ - typing.Literal["user", "account", "merchant", "payout_destination", "balance"], typing.Any + typing.Literal[ + "user", "account", "merchant", "payout_destination", "balance", "withdrawal_adjustment", "ad_campaign" + ], + typing.Any, ] diff --git a/src/whop_sdk/financial_reports/client.py b/src/whop_sdk/financial_reports/client.py index 9c30c92b..49a34880 100644 --- a/src/whop_sdk/financial_reports/client.py +++ b/src/whop_sdk/financial_reports/client.py @@ -2,6 +2,7 @@ from __future__ import annotations +import datetime as dt import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper @@ -41,8 +42,8 @@ def retrieve( report_type: RetrieveFinancialReportsRequestReportType, currency: typing.Optional[str] = None, in_currency: typing.Optional[str] = None, - from_date: typing.Optional[str] = None, - to_date: typing.Optional[str] = None, + from_: typing.Optional[dt.datetime] = None, + to: typing.Optional[dt.datetime] = None, group_by: typing.Optional[RetrieveFinancialReportsRequestGroupBy] = None, timezone: typing.Optional[str] = None, line_types: typing.Optional[ @@ -74,17 +75,17 @@ def retrieve( in_currency : typing.Optional[str] Aggregate all activity into this display currency via FX conversion. - from_date : typing.Optional[str] - Start of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + from_ : typing.Optional[dt.datetime] + Start of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. - to_date : typing.Optional[str] - End of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + to : typing.Optional[dt.datetime] + Exclusive end of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. group_by : typing.Optional[RetrieveFinancialReportsRequestGroupBy] Grouping granularity for report rows. timezone : typing.Optional[str] - IANA timezone (for example `America/New_York`) used to bucket report periods and to interpret calendar-day boundaries for balance snapshots. Defaults to UTC. from_date/to_date remain exact instants regardless of this setting. + IANA timezone (for example `America/New_York`) used to bucket report periods. Defaults to UTC. `from` and `to` remain exact instants. line_types : typing.Optional[typing.Union[RetrieveFinancialReportsRequestLineTypesItem, typing.Sequence[RetrieveFinancialReportsRequestLineTypesItem]]] Account-level balance activity only: ledger line categories to include. @@ -93,7 +94,7 @@ def retrieve( Account-level balance activity only: include money moving in or money moving out. cumulative : typing.Optional[bool] - Platform-wide (global) reports only: when true, return cumulative balances as of to_date (all history, no lower bound) instead of activity within the period. + Platform-wide (global) reports only: when true, return cumulative balances as of to (all history, no lower bound) instead of activity within the period. scope_account_id : typing.Optional[str] Platform-wide (global) reports only: narrow the report to ledger lines on the ledger account owned by this account ID (a biz_ identifier). Ignored unless account_id is `global`. @@ -114,7 +115,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -128,8 +129,8 @@ def retrieve( report_type=report_type, currency=currency, in_currency=in_currency, - from_date=from_date, - to_date=to_date, + from_=from_, + to=to, group_by=group_by, timezone=timezone, line_types=line_types, @@ -174,8 +175,8 @@ async def retrieve( report_type: RetrieveFinancialReportsRequestReportType, currency: typing.Optional[str] = None, in_currency: typing.Optional[str] = None, - from_date: typing.Optional[str] = None, - to_date: typing.Optional[str] = None, + from_: typing.Optional[dt.datetime] = None, + to: typing.Optional[dt.datetime] = None, group_by: typing.Optional[RetrieveFinancialReportsRequestGroupBy] = None, timezone: typing.Optional[str] = None, line_types: typing.Optional[ @@ -207,17 +208,17 @@ async def retrieve( in_currency : typing.Optional[str] Aggregate all activity into this display currency via FX conversion. - from_date : typing.Optional[str] - Start of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + from_ : typing.Optional[dt.datetime] + Start of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. - to_date : typing.Optional[str] - End of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + to : typing.Optional[dt.datetime] + Exclusive end of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. group_by : typing.Optional[RetrieveFinancialReportsRequestGroupBy] Grouping granularity for report rows. timezone : typing.Optional[str] - IANA timezone (for example `America/New_York`) used to bucket report periods and to interpret calendar-day boundaries for balance snapshots. Defaults to UTC. from_date/to_date remain exact instants regardless of this setting. + IANA timezone (for example `America/New_York`) used to bucket report periods. Defaults to UTC. `from` and `to` remain exact instants. line_types : typing.Optional[typing.Union[RetrieveFinancialReportsRequestLineTypesItem, typing.Sequence[RetrieveFinancialReportsRequestLineTypesItem]]] Account-level balance activity only: ledger line categories to include. @@ -226,7 +227,7 @@ async def retrieve( Account-level balance activity only: include money moving in or money moving out. cumulative : typing.Optional[bool] - Platform-wide (global) reports only: when true, return cumulative balances as of to_date (all history, no lower bound) instead of activity within the period. + Platform-wide (global) reports only: when true, return cumulative balances as of to (all history, no lower bound) instead of activity within the period. scope_account_id : typing.Optional[str] Platform-wide (global) reports only: narrow the report to ledger lines on the ledger account owned by this account ID (a biz_ identifier). Ignored unless account_id is `global`. @@ -249,7 +250,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -269,8 +270,8 @@ async def main() -> None: report_type=report_type, currency=currency, in_currency=in_currency, - from_date=from_date, - to_date=to_date, + from_=from_, + to=to, group_by=group_by, timezone=timezone, line_types=line_types, diff --git a/src/whop_sdk/financial_reports/raw_client.py b/src/whop_sdk/financial_reports/raw_client.py index cef8b771..afa8b870 100644 --- a/src/whop_sdk/financial_reports/raw_client.py +++ b/src/whop_sdk/financial_reports/raw_client.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.datetime_utils import serialize_datetime from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.parse_error import ParsingError from ..core.pydantic_utilities import parse_obj_as @@ -32,8 +34,8 @@ def retrieve( report_type: RetrieveFinancialReportsRequestReportType, currency: typing.Optional[str] = None, in_currency: typing.Optional[str] = None, - from_date: typing.Optional[str] = None, - to_date: typing.Optional[str] = None, + from_: typing.Optional[dt.datetime] = None, + to: typing.Optional[dt.datetime] = None, group_by: typing.Optional[RetrieveFinancialReportsRequestGroupBy] = None, timezone: typing.Optional[str] = None, line_types: typing.Optional[ @@ -65,17 +67,17 @@ def retrieve( in_currency : typing.Optional[str] Aggregate all activity into this display currency via FX conversion. - from_date : typing.Optional[str] - Start of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + from_ : typing.Optional[dt.datetime] + Start of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. - to_date : typing.Optional[str] - End of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + to : typing.Optional[dt.datetime] + Exclusive end of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. group_by : typing.Optional[RetrieveFinancialReportsRequestGroupBy] Grouping granularity for report rows. timezone : typing.Optional[str] - IANA timezone (for example `America/New_York`) used to bucket report periods and to interpret calendar-day boundaries for balance snapshots. Defaults to UTC. from_date/to_date remain exact instants regardless of this setting. + IANA timezone (for example `America/New_York`) used to bucket report periods. Defaults to UTC. `from` and `to` remain exact instants. line_types : typing.Optional[typing.Union[RetrieveFinancialReportsRequestLineTypesItem, typing.Sequence[RetrieveFinancialReportsRequestLineTypesItem]]] Account-level balance activity only: ledger line categories to include. @@ -84,7 +86,7 @@ def retrieve( Account-level balance activity only: include money moving in or money moving out. cumulative : typing.Optional[bool] - Platform-wide (global) reports only: when true, return cumulative balances as of to_date (all history, no lower bound) instead of activity within the period. + Platform-wide (global) reports only: when true, return cumulative balances as of to (all history, no lower bound) instead of activity within the period. scope_account_id : typing.Optional[str] Platform-wide (global) reports only: narrow the report to ledger lines on the ledger account owned by this account ID (a biz_ identifier). Ignored unless account_id is `global`. @@ -108,8 +110,8 @@ def retrieve( "report_type": report_type, "currency": currency, "in_currency": in_currency, - "from_date": from_date, - "to_date": to_date, + "from": serialize_datetime(from_) if from_ is not None else None, + "to": serialize_datetime(to) if to is not None else None, "group_by": group_by, "timezone": timezone, "line_types": line_types, @@ -195,8 +197,8 @@ async def retrieve( report_type: RetrieveFinancialReportsRequestReportType, currency: typing.Optional[str] = None, in_currency: typing.Optional[str] = None, - from_date: typing.Optional[str] = None, - to_date: typing.Optional[str] = None, + from_: typing.Optional[dt.datetime] = None, + to: typing.Optional[dt.datetime] = None, group_by: typing.Optional[RetrieveFinancialReportsRequestGroupBy] = None, timezone: typing.Optional[str] = None, line_types: typing.Optional[ @@ -228,17 +230,17 @@ async def retrieve( in_currency : typing.Optional[str] Aggregate all activity into this display currency via FX conversion. - from_date : typing.Optional[str] - Start of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + from_ : typing.Optional[dt.datetime] + Start of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. - to_date : typing.Optional[str] - End of the report window as an ISO 8601 timestamp (UTC). Required for platform-wide (global) reports. + to : typing.Optional[dt.datetime] + Exclusive end of the report window as an ISO 8601 timestamp. Required for platform-wide (global) reports. group_by : typing.Optional[RetrieveFinancialReportsRequestGroupBy] Grouping granularity for report rows. timezone : typing.Optional[str] - IANA timezone (for example `America/New_York`) used to bucket report periods and to interpret calendar-day boundaries for balance snapshots. Defaults to UTC. from_date/to_date remain exact instants regardless of this setting. + IANA timezone (for example `America/New_York`) used to bucket report periods. Defaults to UTC. `from` and `to` remain exact instants. line_types : typing.Optional[typing.Union[RetrieveFinancialReportsRequestLineTypesItem, typing.Sequence[RetrieveFinancialReportsRequestLineTypesItem]]] Account-level balance activity only: ledger line categories to include. @@ -247,7 +249,7 @@ async def retrieve( Account-level balance activity only: include money moving in or money moving out. cumulative : typing.Optional[bool] - Platform-wide (global) reports only: when true, return cumulative balances as of to_date (all history, no lower bound) instead of activity within the period. + Platform-wide (global) reports only: when true, return cumulative balances as of to (all history, no lower bound) instead of activity within the period. scope_account_id : typing.Optional[str] Platform-wide (global) reports only: narrow the report to ledger lines on the ledger account owned by this account ID (a biz_ identifier). Ignored unless account_id is `global`. @@ -271,8 +273,8 @@ async def retrieve( "report_type": report_type, "currency": currency, "in_currency": in_currency, - "from_date": from_date, - "to_date": to_date, + "from": serialize_datetime(from_) if from_ is not None else None, + "to": serialize_datetime(to) if to is not None else None, "group_by": group_by, "timezone": timezone, "line_types": line_types, diff --git a/src/whop_sdk/financial_reports/types/retrieve_financial_reports_request_line_types_item.py b/src/whop_sdk/financial_reports/types/retrieve_financial_reports_request_line_types_item.py index 632293c2..3d37fe34 100644 --- a/src/whop_sdk/financial_reports/types/retrieve_financial_reports_request_line_types_item.py +++ b/src/whop_sdk/financial_reports/types/retrieve_financial_reports_request_line_types_item.py @@ -67,6 +67,7 @@ "misc_purchase", "misc_refund", "misc_reversal", + "onboarding_reward", "onchain_deposit", "onchain_swap_source", "onchain_swap_target", diff --git a/src/whop_sdk/financial_reports/types/retrieve_financial_reports_response_rows_item_line_category.py b/src/whop_sdk/financial_reports/types/retrieve_financial_reports_response_rows_item_line_category.py index adf30f09..fc9411c4 100644 --- a/src/whop_sdk/financial_reports/types/retrieve_financial_reports_response_rows_item_line_category.py +++ b/src/whop_sdk/financial_reports/types/retrieve_financial_reports_response_rows_item_line_category.py @@ -18,6 +18,7 @@ "ad_publisher_payout_received", "ad_spend_charge", "ad_spend_margin", + "ad_spend_purchase", "ads_card_spread", "affiliate_fee", "aggregated_fee", @@ -117,6 +118,7 @@ "misc_purchase", "misc_refund", "misc_reversal", + "onboarding_reward", "onchain_deposit", "onchain_deposit_offset", "onchain_swap_offset", diff --git a/src/whop_sdk/forum_posts/client.py b/src/whop_sdk/forum_posts/client.py index c7db6e66..495ac728 100644 --- a/src/whop_sdk/forum_posts/client.py +++ b/src/whop_sdk/forum_posts/client.py @@ -92,7 +92,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -197,7 +197,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -248,7 +248,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -306,7 +306,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -401,7 +401,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -515,7 +515,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -574,7 +574,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -640,7 +640,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/forums/client.py b/src/whop_sdk/forums/client.py index ce5735b9..06f368b4 100644 --- a/src/whop_sdk/forums/client.py +++ b/src/whop_sdk/forums/client.py @@ -83,7 +83,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -134,7 +134,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -195,7 +195,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -282,7 +282,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -342,7 +342,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -411,7 +411,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/identity_profiles/client.py b/src/whop_sdk/identity_profiles/client.py index 2a68f420..e996a1ed 100644 --- a/src/whop_sdk/identity_profiles/client.py +++ b/src/whop_sdk/identity_profiles/client.py @@ -84,7 +84,7 @@ def list_identity_profile( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -137,7 +137,7 @@ def retrieve_identity_profile( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -175,7 +175,7 @@ def unlink_identity_profile( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -235,7 +235,7 @@ def list_verifications_identity_profile( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -324,7 +324,7 @@ async def list_identity_profile( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -386,7 +386,7 @@ async def retrieve_identity_profile( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -432,7 +432,7 @@ async def unlink_identity_profile( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -500,7 +500,7 @@ async def list_verifications_identity_profile( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/invoices/client.py b/src/whop_sdk/invoices/client.py index 39bf4e38..bd5b54ea 100644 --- a/src/whop_sdk/invoices/client.py +++ b/src/whop_sdk/invoices/client.py @@ -114,7 +114,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -185,7 +185,7 @@ def create( ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -231,7 +231,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -267,7 +267,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -367,7 +367,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -420,7 +420,7 @@ def mark_paid(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -456,7 +456,7 @@ def mark_uncollectible(self, id: str, *, request_options: typing.Optional[Reques from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -492,7 +492,7 @@ def resend(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -528,7 +528,7 @@ def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = No from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -632,7 +632,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -712,7 +712,7 @@ async def create( ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -766,7 +766,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -810,7 +810,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -918,7 +918,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -979,7 +979,7 @@ async def mark_paid(self, id: str, *, request_options: typing.Optional[RequestOp from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1023,7 +1023,7 @@ async def mark_uncollectible(self, id: str, *, request_options: typing.Optional[ from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1067,7 +1067,7 @@ async def resend(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1111,7 +1111,7 @@ async def void(self, id: str, *, request_options: typing.Optional[RequestOptions from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/leads/client.py b/src/whop_sdk/leads/client.py index f094eb8f..914a3294 100644 --- a/src/whop_sdk/leads/client.py +++ b/src/whop_sdk/leads/client.py @@ -93,7 +93,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -175,7 +175,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -221,7 +221,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -273,7 +273,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -364,7 +364,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -455,7 +455,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -509,7 +509,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -569,7 +569,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/ledger_accounts/client.py b/src/whop_sdk/ledger_accounts/client.py index 50d26202..1b12354c 100644 --- a/src/whop_sdk/ledger_accounts/client.py +++ b/src/whop_sdk/ledger_accounts/client.py @@ -49,7 +49,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -104,7 +104,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/media/client.py b/src/whop_sdk/media/client.py index 272b1ea6..2c2c3ea7 100644 --- a/src/whop_sdk/media/client.py +++ b/src/whop_sdk/media/client.py @@ -75,7 +75,7 @@ def generate( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -117,7 +117,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -193,7 +193,7 @@ async def generate( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -243,7 +243,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/members/client.py b/src/whop_sdk/members/client.py index 63b1b091..03df2881 100644 --- a/src/whop_sdk/members/client.py +++ b/src/whop_sdk/members/client.py @@ -42,6 +42,7 @@ def list( account_id: typing.Optional[str] = None, access_level: typing.Optional[ListMembersRequestAccessLevel] = None, status: typing.Optional[ListMembersRequestStatus] = None, + user_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, query: typing.Optional[str] = None, created_after: typing.Optional[str] = None, created_before: typing.Optional[str] = None, @@ -67,6 +68,9 @@ def list( status : typing.Optional[ListMembersRequestStatus] Filter by whether the member is still part of the account. + user_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Only return members whose users match these `user_` identifiers. + query : typing.Optional[str] Search members by name or username. An exact email address also matches when the credential holds the member:email:read scope. @@ -107,11 +111,13 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) - response = client.members.list() + response = client.members.list( + user_ids=["user_xxxxxxxxxxxxxx"], + ) for item in response: yield item # alternatively, you can paginate page-by-page @@ -122,6 +128,7 @@ def list( account_id=account_id, access_level=access_level, status=status, + user_ids=user_ids, query=query, created_after=created_after, created_before=created_before, @@ -156,7 +163,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -199,6 +206,7 @@ async def list( account_id: typing.Optional[str] = None, access_level: typing.Optional[ListMembersRequestAccessLevel] = None, status: typing.Optional[ListMembersRequestStatus] = None, + user_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, query: typing.Optional[str] = None, created_after: typing.Optional[str] = None, created_before: typing.Optional[str] = None, @@ -224,6 +232,9 @@ async def list( status : typing.Optional[ListMembersRequestStatus] Filter by whether the member is still part of the account. + user_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Only return members whose users match these `user_` identifiers. + query : typing.Optional[str] Search members by name or username. An exact email address also matches when the credential holds the member:email:read scope. @@ -266,14 +277,16 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) async def main() -> None: - response = await client.members.list() + response = await client.members.list( + user_ids=["user_xxxxxxxxxxxxxx"], + ) async for item in response: yield item @@ -288,6 +301,7 @@ async def main() -> None: account_id=account_id, access_level=access_level, status=status, + user_ids=user_ids, query=query, created_after=created_after, created_before=created_before, @@ -324,7 +338,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/members/logs/client.py b/src/whop_sdk/members/logs/client.py index f0525953..e283664f 100644 --- a/src/whop_sdk/members/logs/client.py +++ b/src/whop_sdk/members/logs/client.py @@ -68,7 +68,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -146,7 +146,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/members/raw_client.py b/src/whop_sdk/members/raw_client.py index cef79b02..7d37663f 100644 --- a/src/whop_sdk/members/raw_client.py +++ b/src/whop_sdk/members/raw_client.py @@ -34,6 +34,7 @@ def list( account_id: typing.Optional[str] = None, access_level: typing.Optional[ListMembersRequestAccessLevel] = None, status: typing.Optional[ListMembersRequestStatus] = None, + user_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, query: typing.Optional[str] = None, created_after: typing.Optional[str] = None, created_before: typing.Optional[str] = None, @@ -59,6 +60,9 @@ def list( status : typing.Optional[ListMembersRequestStatus] Filter by whether the member is still part of the account. + user_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Only return members whose users match these `user_` identifiers. + query : typing.Optional[str] Search members by name or username. An exact email address also matches when the credential holds the member:email:read scope. @@ -101,6 +105,7 @@ def list( "account_id": account_id, "access_level": access_level, "status": status, + "user_ids": user_ids, "query": query, "created_after": created_after, "created_before": created_before, @@ -132,6 +137,7 @@ def list( account_id=account_id, access_level=access_level, status=status, + user_ids=user_ids, query=query, created_after=created_after, created_before=created_before, @@ -260,6 +266,7 @@ async def list( account_id: typing.Optional[str] = None, access_level: typing.Optional[ListMembersRequestAccessLevel] = None, status: typing.Optional[ListMembersRequestStatus] = None, + user_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, query: typing.Optional[str] = None, created_after: typing.Optional[str] = None, created_before: typing.Optional[str] = None, @@ -285,6 +292,9 @@ async def list( status : typing.Optional[ListMembersRequestStatus] Filter by whether the member is still part of the account. + user_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Only return members whose users match these `user_` identifiers. + query : typing.Optional[str] Search members by name or username. An exact email address also matches when the credential holds the member:email:read scope. @@ -327,6 +337,7 @@ async def list( "account_id": account_id, "access_level": access_level, "status": status, + "user_ids": user_ids, "query": query, "created_after": created_after, "created_before": created_before, @@ -360,6 +371,7 @@ async def _get_next(): account_id=account_id, access_level=access_level, status=status, + user_ids=user_ids, query=query, created_after=created_after, created_before=created_before, diff --git a/src/whop_sdk/memberships/client.py b/src/whop_sdk/memberships/client.py index cf7e3dab..8e535c11 100644 --- a/src/whop_sdk/memberships/client.py +++ b/src/whop_sdk/memberships/client.py @@ -6,6 +6,7 @@ from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions from ..types.membership import Membership +from ..types.membership_legacy import MembershipLegacy from .raw_client import AsyncRawMembershipsClient, RawMembershipsClient from .types.invite_memberships_request_body import InviteMembershipsRequestBody from .types.invite_memberships_response import InviteMembershipsResponse @@ -109,7 +110,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -161,7 +162,7 @@ def invite( from whop_sdk.memberships import InviteMembershipsRequestBodyUserId client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -197,7 +198,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -243,7 +244,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -258,7 +259,7 @@ def update( def add_free_days_membership( self, id: str, *, free_days: int, request_options: typing.Optional[RequestOptions] = None - ) -> Membership: + ) -> MembershipLegacy: """ Add free days to extend a membership's current billing period, expiration date, or Stripe trial. @@ -280,7 +281,7 @@ def add_free_days_membership( Returns ------- - Membership + MembershipLegacy A successful response Examples @@ -288,7 +289,7 @@ def add_free_days_membership( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -335,7 +336,7 @@ def cancel( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -373,7 +374,7 @@ def extend(self, id: str, *, days: int, request_options: typing.Optional[Request from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -412,7 +413,7 @@ def pause( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -445,7 +446,7 @@ def resume(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -458,7 +459,7 @@ def resume(self, id: str, *, request_options: typing.Optional[RequestOptions] = def resync_access_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Membership: + ) -> MembershipLegacy: """ Re-run access fulfillment for a membership. Recomputes the member's content access on Whop, re-validates their Discord link (re-adding them to the server and re-assigning roles if needed), and re-fulfills TradingView indicator access. Telegram access is invite-based and cannot be resynced here. The outcome is written to the membership's logs. @@ -477,7 +478,7 @@ def resync_access_membership( Returns ------- - Membership + MembershipLegacy A successful response Examples @@ -485,7 +486,7 @@ def resync_access_membership( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -520,7 +521,7 @@ def transfer( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -531,7 +532,9 @@ def transfer( _response = self._raw_client.transfer(id, request_options=request_options) return _response.data - def uncancel_membership(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Membership: + def uncancel_membership( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> MembershipLegacy: """ Reverse a pending cancellation for a membership that was scheduled to cancel at period end. @@ -550,7 +553,7 @@ def uncancel_membership(self, id: str, *, request_options: typing.Optional[Reque Returns ------- - Membership + MembershipLegacy A successful response Examples @@ -558,7 +561,7 @@ def uncancel_membership(self, id: str, *, request_options: typing.Optional[Reque from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -662,7 +665,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -723,7 +726,7 @@ async def invite( from whop_sdk.memberships import InviteMembershipsRequestBodyUserId client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -767,7 +770,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -821,7 +824,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -842,7 +845,7 @@ async def main() -> None: async def add_free_days_membership( self, id: str, *, free_days: int, request_options: typing.Optional[RequestOptions] = None - ) -> Membership: + ) -> MembershipLegacy: """ Add free days to extend a membership's current billing period, expiration date, or Stripe trial. @@ -864,7 +867,7 @@ async def add_free_days_membership( Returns ------- - Membership + MembershipLegacy A successful response Examples @@ -874,7 +877,7 @@ async def add_free_days_membership( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -931,7 +934,7 @@ async def cancel( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -979,7 +982,7 @@ async def extend( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1026,7 +1029,7 @@ async def pause( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1067,7 +1070,7 @@ async def resume(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1086,7 +1089,7 @@ async def main() -> None: async def resync_access_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Membership: + ) -> MembershipLegacy: """ Re-run access fulfillment for a membership. Recomputes the member's content access on Whop, re-validates their Discord link (re-adding them to the server and re-assigning roles if needed), and re-fulfills TradingView indicator access. Telegram access is invite-based and cannot be resynced here. The outcome is written to the membership's logs. @@ -1105,7 +1108,7 @@ async def resync_access_membership( Returns ------- - Membership + MembershipLegacy A successful response Examples @@ -1115,7 +1118,7 @@ async def resync_access_membership( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1158,7 +1161,7 @@ async def transfer( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1177,7 +1180,7 @@ async def main() -> None: async def uncancel_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Membership: + ) -> MembershipLegacy: """ Reverse a pending cancellation for a membership that was scheduled to cancel at period end. @@ -1196,7 +1199,7 @@ async def uncancel_membership( Returns ------- - Membership + MembershipLegacy A successful response Examples @@ -1206,7 +1209,7 @@ async def uncancel_membership( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/memberships/raw_client.py b/src/whop_sdk/memberships/raw_client.py index 2c9c6ed4..81efe77b 100644 --- a/src/whop_sdk/memberships/raw_client.py +++ b/src/whop_sdk/memberships/raw_client.py @@ -21,6 +21,7 @@ from ..errors.unauthorized_error import UnauthorizedError from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.membership import Membership +from ..types.membership_legacy import MembershipLegacy from ..types.v1error_response import V1ErrorResponse from .types.invite_memberships_request_body import InviteMembershipsRequestBody from .types.invite_memberships_response import InviteMembershipsResponse @@ -464,7 +465,7 @@ def update( def add_free_days_membership( self, id: str, *, free_days: int, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[Membership]: + ) -> HttpResponse[MembershipLegacy]: """ Add free days to extend a membership's current billing period, expiration date, or Stripe trial. @@ -486,7 +487,7 @@ def add_free_days_membership( Returns ------- - HttpResponse[Membership] + HttpResponse[MembershipLegacy] A successful response """ _response = self._client_wrapper.httpx_client.request( @@ -504,9 +505,9 @@ def add_free_days_membership( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Membership, + MembershipLegacy, parse_obj_as( - type_=Membership, # type: ignore + type_=MembershipLegacy, # type: ignore object_=_response.json(), ), ) @@ -940,7 +941,7 @@ def resume(self, id: str, *, request_options: typing.Optional[RequestOptions] = def resync_access_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[Membership]: + ) -> HttpResponse[MembershipLegacy]: """ Re-run access fulfillment for a membership. Recomputes the member's content access on Whop, re-validates their Discord link (re-adding them to the server and re-assigning roles if needed), and re-fulfills TradingView indicator access. Telegram access is invite-based and cannot be resynced here. The outcome is written to the membership's logs. @@ -959,7 +960,7 @@ def resync_access_membership( Returns ------- - HttpResponse[Membership] + HttpResponse[MembershipLegacy] A successful response """ _response = self._client_wrapper.httpx_client.request( @@ -970,9 +971,9 @@ def resync_access_membership( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Membership, + MembershipLegacy, parse_obj_as( - type_=Membership, # type: ignore + type_=MembershipLegacy, # type: ignore object_=_response.json(), ), ) @@ -1152,7 +1153,7 @@ def transfer( def uncancel_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[Membership]: + ) -> HttpResponse[MembershipLegacy]: """ Reverse a pending cancellation for a membership that was scheduled to cancel at period end. @@ -1171,7 +1172,7 @@ def uncancel_membership( Returns ------- - HttpResponse[Membership] + HttpResponse[MembershipLegacy] A successful response """ _response = self._client_wrapper.httpx_client.request( @@ -1182,9 +1183,9 @@ def uncancel_membership( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Membership, + MembershipLegacy, parse_obj_as( - type_=Membership, # type: ignore + type_=MembershipLegacy, # type: ignore object_=_response.json(), ), ) @@ -1710,7 +1711,7 @@ async def update( async def add_free_days_membership( self, id: str, *, free_days: int, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Membership]: + ) -> AsyncHttpResponse[MembershipLegacy]: """ Add free days to extend a membership's current billing period, expiration date, or Stripe trial. @@ -1732,7 +1733,7 @@ async def add_free_days_membership( Returns ------- - AsyncHttpResponse[Membership] + AsyncHttpResponse[MembershipLegacy] A successful response """ _response = await self._client_wrapper.httpx_client.request( @@ -1750,9 +1751,9 @@ async def add_free_days_membership( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Membership, + MembershipLegacy, parse_obj_as( - type_=Membership, # type: ignore + type_=MembershipLegacy, # type: ignore object_=_response.json(), ), ) @@ -2188,7 +2189,7 @@ async def resume( async def resync_access_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Membership]: + ) -> AsyncHttpResponse[MembershipLegacy]: """ Re-run access fulfillment for a membership. Recomputes the member's content access on Whop, re-validates their Discord link (re-adding them to the server and re-assigning roles if needed), and re-fulfills TradingView indicator access. Telegram access is invite-based and cannot be resynced here. The outcome is written to the membership's logs. @@ -2207,7 +2208,7 @@ async def resync_access_membership( Returns ------- - AsyncHttpResponse[Membership] + AsyncHttpResponse[MembershipLegacy] A successful response """ _response = await self._client_wrapper.httpx_client.request( @@ -2218,9 +2219,9 @@ async def resync_access_membership( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Membership, + MembershipLegacy, parse_obj_as( - type_=Membership, # type: ignore + type_=MembershipLegacy, # type: ignore object_=_response.json(), ), ) @@ -2400,7 +2401,7 @@ async def transfer( async def uncancel_membership( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Membership]: + ) -> AsyncHttpResponse[MembershipLegacy]: """ Reverse a pending cancellation for a membership that was scheduled to cancel at period end. @@ -2419,7 +2420,7 @@ async def uncancel_membership( Returns ------- - AsyncHttpResponse[Membership] + AsyncHttpResponse[MembershipLegacy] A successful response """ _response = await self._client_wrapper.httpx_client.request( @@ -2430,9 +2431,9 @@ async def uncancel_membership( try: if 200 <= _response.status_code < 300: _data = typing.cast( - Membership, + MembershipLegacy, parse_obj_as( - type_=Membership, # type: ignore + type_=MembershipLegacy, # type: ignore object_=_response.json(), ), ) diff --git a/src/whop_sdk/messages/client.py b/src/whop_sdk/messages/client.py index 5ec43759..2266fa44 100644 --- a/src/whop_sdk/messages/client.py +++ b/src/whop_sdk/messages/client.py @@ -84,7 +84,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -162,7 +162,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -210,7 +210,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -249,7 +249,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -305,7 +305,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -387,7 +387,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -474,7 +474,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -530,7 +530,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -577,7 +577,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -641,7 +641,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/notifications/client.py b/src/whop_sdk/notifications/client.py index cc17dee9..d13c780f 100644 --- a/src/whop_sdk/notifications/client.py +++ b/src/whop_sdk/notifications/client.py @@ -84,7 +84,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -160,7 +160,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -213,7 +213,7 @@ def badges( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -257,7 +257,7 @@ def mark_read( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -288,7 +288,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -374,7 +374,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -459,7 +459,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -520,7 +520,7 @@ async def badges( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -572,7 +572,7 @@ async def mark_read( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -613,7 +613,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/notifications/topics/client.py b/src/whop_sdk/notifications/topics/client.py index def6df53..3708a9ff 100644 --- a/src/whop_sdk/notifications/topics/client.py +++ b/src/whop_sdk/notifications/topics/client.py @@ -61,7 +61,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -127,7 +127,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/partners/businesses/client.py b/src/whop_sdk/partners/businesses/client.py index 5a52c172..4c840af1 100644 --- a/src/whop_sdk/partners/businesses/client.py +++ b/src/whop_sdk/partners/businesses/client.py @@ -112,7 +112,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -164,7 +164,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -278,7 +278,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -339,7 +339,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/partners/businesses/earnings/client.py b/src/whop_sdk/partners/businesses/earnings/client.py index e0255f31..e5463ab8 100644 --- a/src/whop_sdk/partners/businesses/earnings/client.py +++ b/src/whop_sdk/partners/businesses/earnings/client.py @@ -94,7 +94,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -205,7 +205,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/partners/client.py b/src/whop_sdk/partners/client.py index a8321955..1ba58f5a 100644 --- a/src/whop_sdk/partners/client.py +++ b/src/whop_sdk/partners/client.py @@ -54,7 +54,7 @@ def create(self, *, request_options: typing.Optional[RequestOptions] = None) -> from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -90,7 +90,7 @@ def leaderboard( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -146,7 +146,7 @@ def referred_users( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -214,7 +214,7 @@ async def create(self, *, request_options: typing.Optional[RequestOptions] = Non from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -258,7 +258,7 @@ async def leaderboard( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -322,7 +322,7 @@ async def referred_users( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payment_method_domains/client.py b/src/whop_sdk/payment_method_domains/client.py index e6f4b635..34ea4311 100644 --- a/src/whop_sdk/payment_method_domains/client.py +++ b/src/whop_sdk/payment_method_domains/client.py @@ -105,7 +105,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -163,7 +163,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -196,7 +196,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -231,7 +231,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -264,7 +264,7 @@ def verify(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -364,7 +364,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -431,7 +431,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -476,7 +476,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -519,7 +519,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -560,7 +560,7 @@ async def verify(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payment_methods/client.py b/src/whop_sdk/payment_methods/client.py index 4aad3a2f..9c8582b4 100644 --- a/src/whop_sdk/payment_methods/client.py +++ b/src/whop_sdk/payment_methods/client.py @@ -124,7 +124,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -204,7 +204,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -257,7 +257,7 @@ def delete_payment_method( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -381,7 +381,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -470,7 +470,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -531,7 +531,7 @@ async def delete_payment_method( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payments/__init__.py b/src/whop_sdk/payments/__init__.py index cc89313e..8668919a 100644 --- a/src/whop_sdk/payments/__init__.py +++ b/src/whop_sdk/payments/__init__.py @@ -7,19 +7,14 @@ if typing.TYPE_CHECKING: from .types import ( - CreatePaymentsRequest, - CreatePaymentsRequestOne, - CreatePaymentsRequestOnePlan, - CreatePaymentsRequestOnePlanProduct, - CreatePaymentsRequestThree, - CreatePaymentsRequestTwo, - CreatePaymentsRequestZero, - CreatePaymentsRequestZeroPlan, - CreatePaymentsRequestZeroPlanProduct, - CreatePaymentsResponse, ListFeesPaymentsResponse, - ListFeesPaymentsResponseDataItem, + ListFeesPaymentsResponsePageInfo, + ListPaymentsRequestBillingReason, + ListPaymentsRequestDirection, + ListPaymentsRequestOrder, + ListPaymentsRequestStatus, ListPaymentsResponse, + ListPaymentsResponsePageInfo, PostPaymentAuthorizedPayload, PostPaymentAuthorizedPayloadApiVersion, PostPaymentAuthorizedPayloadType, @@ -38,22 +33,16 @@ PostPaymentSucceededPayload, PostPaymentSucceededPayloadApiVersion, PostPaymentSucceededPayloadType, - RetrievePaymentsResponse, ) _dynamic_imports: typing.Dict[str, str] = { - "CreatePaymentsRequest": ".types", - "CreatePaymentsRequestOne": ".types", - "CreatePaymentsRequestOnePlan": ".types", - "CreatePaymentsRequestOnePlanProduct": ".types", - "CreatePaymentsRequestThree": ".types", - "CreatePaymentsRequestTwo": ".types", - "CreatePaymentsRequestZero": ".types", - "CreatePaymentsRequestZeroPlan": ".types", - "CreatePaymentsRequestZeroPlanProduct": ".types", - "CreatePaymentsResponse": ".types", "ListFeesPaymentsResponse": ".types", - "ListFeesPaymentsResponseDataItem": ".types", + "ListFeesPaymentsResponsePageInfo": ".types", + "ListPaymentsRequestBillingReason": ".types", + "ListPaymentsRequestDirection": ".types", + "ListPaymentsRequestOrder": ".types", + "ListPaymentsRequestStatus": ".types", "ListPaymentsResponse": ".types", + "ListPaymentsResponsePageInfo": ".types", "PostPaymentAuthorizedPayload": ".types", "PostPaymentAuthorizedPayloadApiVersion": ".types", "PostPaymentAuthorizedPayloadType": ".types", @@ -72,7 +61,6 @@ "PostPaymentSucceededPayload": ".types", "PostPaymentSucceededPayloadApiVersion": ".types", "PostPaymentSucceededPayloadType": ".types", - "RetrievePaymentsResponse": ".types", } @@ -98,19 +86,14 @@ def __dir__(): __all__ = [ - "CreatePaymentsRequest", - "CreatePaymentsRequestOne", - "CreatePaymentsRequestOnePlan", - "CreatePaymentsRequestOnePlanProduct", - "CreatePaymentsRequestThree", - "CreatePaymentsRequestTwo", - "CreatePaymentsRequestZero", - "CreatePaymentsRequestZeroPlan", - "CreatePaymentsRequestZeroPlanProduct", - "CreatePaymentsResponse", "ListFeesPaymentsResponse", - "ListFeesPaymentsResponseDataItem", + "ListFeesPaymentsResponsePageInfo", + "ListPaymentsRequestBillingReason", + "ListPaymentsRequestDirection", + "ListPaymentsRequestOrder", + "ListPaymentsRequestStatus", "ListPaymentsResponse", + "ListPaymentsResponsePageInfo", "PostPaymentAuthorizedPayload", "PostPaymentAuthorizedPayloadApiVersion", "PostPaymentAuthorizedPayloadType", @@ -129,5 +112,4 @@ def __dir__(): "PostPaymentSucceededPayload", "PostPaymentSucceededPayloadApiVersion", "PostPaymentSucceededPayloadType", - "RetrievePaymentsResponse", ] diff --git a/src/whop_sdk/payments/client.py b/src/whop_sdk/payments/client.py index 3361b7b4..b4ceb411 100644 --- a/src/whop_sdk/payments/client.py +++ b/src/whop_sdk/payments/client.py @@ -6,22 +6,15 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..types.billing_reasons import BillingReasons -from ..types.currencies import Currencies -from ..types.direction import Direction -from ..types.friendly_receipt_status import FriendlyReceiptStatus from ..types.payment import Payment -from ..types.payment_list_item import PaymentListItem from ..types.payment_status import PaymentStatus -from ..types.receipt_status import ReceiptStatus -from ..types.receipt_v2order import ReceiptV2Order from .raw_client import AsyncRawPaymentsClient, RawPaymentsClient -from .types.create_payments_request import CreatePaymentsRequest -from .types.create_payments_response import CreatePaymentsResponse from .types.list_fees_payments_response import ListFeesPaymentsResponse -from .types.list_fees_payments_response_data_item import ListFeesPaymentsResponseDataItem +from .types.list_payments_request_billing_reason import ListPaymentsRequestBillingReason +from .types.list_payments_request_direction import ListPaymentsRequestDirection +from .types.list_payments_request_order import ListPaymentsRequestOrder +from .types.list_payments_request_status import ListPaymentsRequestStatus from .types.list_payments_response import ListPaymentsResponse -from .types.retrieve_payments_response import RetrievePaymentsResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -45,139 +38,103 @@ def with_raw_response(self) -> RawPaymentsClient: def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - order: typing.Optional[ReceiptV2Order] = None, - product_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - billing_reasons: typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] = None, - currencies: typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - statuses: typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] = None, - substatuses: typing.Optional[ - typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]] - ] = None, - include_free: typing.Optional[bool] = None, + account_id: typing.Optional[str] = None, + status: typing.Optional[ListPaymentsRequestStatus] = None, + billing_reason: typing.Optional[ListPaymentsRequestBillingReason] = None, + currency: typing.Optional[str] = None, + user_id: typing.Optional[str] = None, + query: typing.Optional[str] = None, + member_id: typing.Optional[str] = None, + membership_id: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, + plan_id: typing.Optional[str] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, - updated_before: typing.Optional[dt.datetime] = None, - updated_after: typing.Optional[dt.datetime] = None, - query: typing.Optional[str] = None, - checkout_configuration_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order: typing.Optional[ListPaymentsRequestOrder] = None, + direction: typing.Optional[ListPaymentsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentListItem, ListPaymentsResponse]: + ) -> SyncPager[Payment, ListPaymentsResponse]: """ - Returns a paginated list of payments for the actor in context, with optional filtering by product, plan, status, billing reason, currency, and creation date. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` + Lists payments, newest first. Without filters this is every payment the caller can read: a company credential's own account, or for a user every account they can read payments for. Filters narrow by account, buyer, product, plan, membership, status, billing reason, currency, and creation window. Filtering by `billing_reason=subscription_cycle` also matches renewals recorded as `subscription_update`. `settlement_time_at` is null on list rows — retrieve the payment for it. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - company_id : typing.Optional[str] - The unique identifier of the company to list payments for. + account_id : typing.Optional[str] + Only payments charged by this account, prefixed `biz_`. - direction : typing.Optional[Direction] + status : typing.Optional[ListPaymentsRequestStatus] + Only payments in this lifecycle state. - order : typing.Optional[ReceiptV2Order] + billing_reason : typing.Optional[ListPaymentsRequestBillingReason] + Only payments charged for this reason. - product_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific product identifiers. + currency : typing.Optional[str] + Only payments presented in this three-letter currency, such as `usd`. - billing_reasons : typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] - Filter payments by their billing reason. + user_id : typing.Optional[str] + Only payments made by this buyer, prefixed `user_`. - currencies : typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] - Filter payments by their currency code. + query : typing.Optional[str] + Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific plan identifiers. + member_id : typing.Optional[str] + Only payments made by this member, prefixed `mber_`. - statuses : typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] - Filter payments by their current status. + membership_id : typing.Optional[str] + Only payments billed under this membership, prefixed `mem_`. - substatuses : typing.Optional[typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]]] - Filter payments by their current substatus for more granular filtering. + product_id : typing.Optional[str] + Only payments for this product, prefixed `prod_`. - include_free : typing.Optional[bool] - Whether to include payments with a zero amount. Defaults to false, so zero-amount payments are omitted unless you set this to true — a company whose sales are all free plans returns an empty list without it. + plan_id : typing.Optional[str] + Only payments priced by this plan, prefixed `plan_`. created_before : typing.Optional[dt.datetime] - Only return payments created before this timestamp. + Only payments created before this ISO 8601 timestamp. created_after : typing.Optional[dt.datetime] - Only return payments created after this timestamp. + Only payments created after this ISO 8601 timestamp. - updated_before : typing.Optional[dt.datetime] - Only return payments last updated before this timestamp. + order : typing.Optional[ListPaymentsRequestOrder] + The field to sort by. - updated_after : typing.Optional[dt.datetime] - Only return payments last updated after this timestamp. + direction : typing.Optional[ListPaymentsRequestDirection] + The sort direction. - query : typing.Optional[str] - Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. + first : typing.Optional[int] + The number of payments to return. - checkout_configuration_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Only return payments from these checkout configurations. + after : typing.Optional[str] + A cursor; returns payments after this position. + + last : typing.Optional[int] + The number of payments to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns payments before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[PaymentListItem, ListPaymentsResponse] - A successful response + SyncPager[Payment, ListPaymentsResponse] + payments listed Examples -------- - import datetime - from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) - response = client.payments.list( - first=42, - last=42, - company_id="biz_xxxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - created_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - updated_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - updated_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) + response = client.payments.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -185,128 +142,142 @@ def list( yield page """ return self._raw_client.list( - after=after, - before=before, - first=first, - last=last, - company_id=company_id, - direction=direction, - order=order, - product_ids=product_ids, - billing_reasons=billing_reasons, - currencies=currencies, - plan_ids=plan_ids, - statuses=statuses, - substatuses=substatuses, - include_free=include_free, + account_id=account_id, + status=status, + billing_reason=billing_reason, + currency=currency, + user_id=user_id, + query=query, + member_id=member_id, + membership_id=membership_id, + product_id=product_id, + plan_id=plan_id, created_before=created_before, created_after=created_after, - updated_before=updated_before, - updated_after=updated_after, - query=query, - checkout_configuration_ids=checkout_configuration_ids, + order=order, + direction=direction, + first=first, + after=after, + last=last, + before=before, request_options=request_options, ) def create( - self, *, request: CreatePaymentsRequest, request_options: typing.Optional[RequestOptions] = None - ) -> CreatePaymentsResponse: + self, + *, + account_id: str, + plan_id: str, + capture: typing.Optional[bool] = OMIT, + confirmation_token: typing.Optional[str] = OMIT, + email: typing.Optional[str] = OMIT, + member_id: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + payment_method_id: typing.Optional[str] = OMIT, + promo_code_id: typing.Optional[str] = OMIT, + return_url: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Payment: """ - Charge a buyer on-session with a `confirmation_token` for the method they selected, or charge an existing member off-session using a stored payment method. You can provide an existing plan or create one inline. The endpoint returns a payment immediately, but processing continues asynchronously. Use webhooks to learn whether it succeeds or fails, and poll the payment's status endpoint for any step the buyer must complete. - - Required permissions: - - `payment:charge` - - `plan:create` - - `access_pass:create` - - `access_pass:update` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Charges a buyer for a plan. Pass a payment method already on file (`member_id` and `payment_method_id`), or a `confirmation_token` describing a method the buyer just supplied. Collection runs in the background: the response is the payment as created, not its outcome — poll Retrieve status for how far it has got and, for a confirmation-token payment, what the buyer must still do. `plan_id` names the plan to charge for. Parameters ---------- - request : CreatePaymentsRequest + account_id : str + The account to charge for, prefixed `biz_`. + + plan_id : str + The plan to charge for, prefixed `plan_`. It must belong to the account. + + capture : typing.Optional[bool] + Whether to capture a card payment immediately. Defaults to true. Pass false to place an authorization hold that must be captured in full within five days via the capture endpoint. + + confirmation_token : typing.Optional[str] + A confirmation token describing a payment method the buyer just supplied. Provide this instead of `member_id` and `payment_method_id`; the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete — poll the payment's status for what to do next. + + email : typing.Optional[str] + Overrides the buyer email carried on the confirmation token, resolving or creating the user the payment belongs to. Ignored unless `confirmation_token` is provided, and when the token was created by a signed-in buyer. + + member_id : typing.Optional[str] + The member to charge, prefixed `mber_`. Required with `payment_method_id` unless `confirmation_token` is provided. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Custom metadata to attach to the payment. + + payment_method_id : typing.Optional[str] + The stored payment method to charge, prefixed `payt_`. It must belong to the member. Required unless `confirmation_token` is provided. + + promo_code_id : typing.Optional[str] + An active promo code to apply, prefixed `promo_`. It must belong to the account and be valid for the plan. + + return_url : typing.Optional[str] + Where the buyer continues after completing an off-site step. An absolute https URL without credentials, at most 2,048 characters. Ignored unless `confirmation_token` is provided. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CreatePaymentsResponse - A successful response + Payment + payment created from a stored payment method Examples -------- from whop_sdk import Whop - from whop_sdk.payments import ( - CreatePaymentsRequestZero, - CreatePaymentsRequestZeroPlan, - ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.payments.create( - request=CreatePaymentsRequestZero( - company_id="biz_xxxxxxxxxxxxxx", - confirmation_token="confirmation_token", - plan=CreatePaymentsRequestZeroPlan( - currency="usd", - ), - ), + account_id="biz_xxxxxxxxxxxxxx", + plan_id="plan_xxxxxxxxxxxxxx", ) """ - _response = self._raw_client.create(request=request, request_options=request_options) + _response = self._raw_client.create( + account_id=account_id, + plan_id=plan_id, + capture=capture, + confirmation_token=confirmation_token, + email=email, + member_id=member_id, + metadata=metadata, + payment_method_id=payment_method_id, + promo_code_id=promo_code_id, + return_url=return_url, + request_options=request_options, + ) return _response.data - def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> RetrievePaymentsResponse: + def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Payment: """ - Retrieves the details of an existing payment. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Returns one payment. Related records are ids — resolve a plan, membership, member or shipment on its own endpoint, and list this payment's refunds, disputes or Resolution Center cases with `?payment_id=`. Parameters ---------- id : str - The unique identifier of the payment. + The payment to retrieve, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - RetrievePaymentsResponse - A successful response + Payment + payment retrieved Examples -------- from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.payments.retrieve( - id="pay_xxxxxxxxxxxxxx", + id="id", ) """ _response = self._raw_client.retrieve(id, request_options=request_options) @@ -334,7 +305,7 @@ def capture(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -346,69 +317,39 @@ def capture(self, id: str, *, request_options: typing.Optional[RequestOptions] = return _response.data def list_fees( - self, - id: str, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse]: + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ListFeesPaymentsResponse: """ - Returns the list of fees associated with a specific payment, including platform fees and processing fees. - - Required permissions: - - `payment:basic:read` + Returns the fee breakdown of one payment — Whop's fee, processing, affiliate and other lines — each in the currency it was collected in and converted to the payment's settlement currency. The list is complete in one page. Parameters ---------- id : str - The unique identifier of the payment to list fees for. - - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. + The payment whose fees to list, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse] - A successful response + ListFeesPaymentsResponse + fees listed Examples -------- from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) - response = client.payments.list_fees( - id="pay_xxxxxxxxxxxxxx", - first=42, - last=42, + client.payments.list_fees( + id="id", ) - for item in response: - yield item - # alternatively, you can paginate page-by-page - for page in response.iter_pages(): - yield page """ - return self._raw_client.list_fees( - id, after=after, before=before, first=first, last=last, request_options=request_options - ) + _response = self._raw_client.list_fees(id, request_options=request_options) + return _response.data def refund( self, @@ -418,24 +359,12 @@ def refund( request_options: typing.Optional[RequestOptions] = None, ) -> Payment: """ - Issue a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Issues a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. Parameters ---------- id : str - The unique identifier of the payment to refund. + The payment to refund, prefixed `pay_`. partial_amount : typing.Optional[float] The amount to refund. For multi-currency payments, this is in the charge currency (what the buyer paid). For single-currency, this is in the payment currency. If omitted, the full payment amount is refunded. @@ -446,19 +375,19 @@ def refund( Returns ------- Payment - A successful response + payment refunded Examples -------- from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.payments.refund( - id="pay_xxxxxxxxxxxxxx", + id="id", ) """ _response = self._raw_client.refund(id, partial_amount=partial_amount, request_options=request_options) @@ -466,24 +395,12 @@ def refund( def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Payment: """ - Retry a failed or pending payment. This re-attempts the charge using the original payment method and plan details. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Retries a failed or pending payment. This re-attempts the charge using the original payment method and plan details. Parameters ---------- id : str - The unique identifier of the payment to retry. + The payment to retry, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -491,19 +408,19 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N Returns ------- Payment - A successful response + payment retried Examples -------- from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.payments.retry( - id="pay_xxxxxxxxxxxxxx", + id="id", ) """ _response = self._raw_client.retry(id, request_options=request_options) @@ -511,24 +428,12 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Payment: """ - Void a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Voids a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. Parameters ---------- id : str - The unique identifier of the payment to void. + The payment to void, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -536,19 +441,19 @@ def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = No Returns ------- Payment - A successful response + payment voided Examples -------- from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.payments.void( - id="pay_xxxxxxxxxxxxxx", + id="id", ) """ _response = self._raw_client.void(id, request_options=request_options) @@ -581,7 +486,7 @@ def update_return_url( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -619,7 +524,7 @@ def retrieve_status( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -649,143 +554,108 @@ def with_raw_response(self) -> AsyncRawPaymentsClient: async def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - order: typing.Optional[ReceiptV2Order] = None, - product_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - billing_reasons: typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] = None, - currencies: typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - statuses: typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] = None, - substatuses: typing.Optional[ - typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]] - ] = None, - include_free: typing.Optional[bool] = None, + account_id: typing.Optional[str] = None, + status: typing.Optional[ListPaymentsRequestStatus] = None, + billing_reason: typing.Optional[ListPaymentsRequestBillingReason] = None, + currency: typing.Optional[str] = None, + user_id: typing.Optional[str] = None, + query: typing.Optional[str] = None, + member_id: typing.Optional[str] = None, + membership_id: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, + plan_id: typing.Optional[str] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, - updated_before: typing.Optional[dt.datetime] = None, - updated_after: typing.Optional[dt.datetime] = None, - query: typing.Optional[str] = None, - checkout_configuration_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order: typing.Optional[ListPaymentsRequestOrder] = None, + direction: typing.Optional[ListPaymentsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentListItem, ListPaymentsResponse]: + ) -> AsyncPager[Payment, ListPaymentsResponse]: """ - Returns a paginated list of payments for the actor in context, with optional filtering by product, plan, status, billing reason, currency, and creation date. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` + Lists payments, newest first. Without filters this is every payment the caller can read: a company credential's own account, or for a user every account they can read payments for. Filters narrow by account, buyer, product, plan, membership, status, billing reason, currency, and creation window. Filtering by `billing_reason=subscription_cycle` also matches renewals recorded as `subscription_update`. `settlement_time_at` is null on list rows — retrieve the payment for it. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. + account_id : typing.Optional[str] + Only payments charged by this account, prefixed `biz_`. - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. + status : typing.Optional[ListPaymentsRequestStatus] + Only payments in this lifecycle state. - company_id : typing.Optional[str] - The unique identifier of the company to list payments for. + billing_reason : typing.Optional[ListPaymentsRequestBillingReason] + Only payments charged for this reason. - direction : typing.Optional[Direction] + currency : typing.Optional[str] + Only payments presented in this three-letter currency, such as `usd`. - order : typing.Optional[ReceiptV2Order] + user_id : typing.Optional[str] + Only payments made by this buyer, prefixed `user_`. - product_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific product identifiers. - - billing_reasons : typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] - Filter payments by their billing reason. - - currencies : typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] - Filter payments by their currency code. + query : typing.Optional[str] + Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific plan identifiers. + member_id : typing.Optional[str] + Only payments made by this member, prefixed `mber_`. - statuses : typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] - Filter payments by their current status. + membership_id : typing.Optional[str] + Only payments billed under this membership, prefixed `mem_`. - substatuses : typing.Optional[typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]]] - Filter payments by their current substatus for more granular filtering. + product_id : typing.Optional[str] + Only payments for this product, prefixed `prod_`. - include_free : typing.Optional[bool] - Whether to include payments with a zero amount. Defaults to false, so zero-amount payments are omitted unless you set this to true — a company whose sales are all free plans returns an empty list without it. + plan_id : typing.Optional[str] + Only payments priced by this plan, prefixed `plan_`. created_before : typing.Optional[dt.datetime] - Only return payments created before this timestamp. + Only payments created before this ISO 8601 timestamp. created_after : typing.Optional[dt.datetime] - Only return payments created after this timestamp. + Only payments created after this ISO 8601 timestamp. - updated_before : typing.Optional[dt.datetime] - Only return payments last updated before this timestamp. + order : typing.Optional[ListPaymentsRequestOrder] + The field to sort by. - updated_after : typing.Optional[dt.datetime] - Only return payments last updated after this timestamp. + direction : typing.Optional[ListPaymentsRequestDirection] + The sort direction. - query : typing.Optional[str] - Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. + first : typing.Optional[int] + The number of payments to return. - checkout_configuration_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Only return payments from these checkout configurations. + after : typing.Optional[str] + A cursor; returns payments after this position. + + last : typing.Optional[int] + The number of payments to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns payments before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[PaymentListItem, ListPaymentsResponse] - A successful response + AsyncPager[Payment, ListPaymentsResponse] + payments listed Examples -------- import asyncio - import datetime from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) async def main() -> None: - response = await client.payments.list( - first=42, - last=42, - company_id="biz_xxxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - created_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - updated_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - updated_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) + response = await client.payments.list() async for item in response: yield item @@ -797,74 +667,93 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - after=after, - before=before, - first=first, - last=last, - company_id=company_id, - direction=direction, - order=order, - product_ids=product_ids, - billing_reasons=billing_reasons, - currencies=currencies, - plan_ids=plan_ids, - statuses=statuses, - substatuses=substatuses, - include_free=include_free, + account_id=account_id, + status=status, + billing_reason=billing_reason, + currency=currency, + user_id=user_id, + query=query, + member_id=member_id, + membership_id=membership_id, + product_id=product_id, + plan_id=plan_id, created_before=created_before, created_after=created_after, - updated_before=updated_before, - updated_after=updated_after, - query=query, - checkout_configuration_ids=checkout_configuration_ids, + order=order, + direction=direction, + first=first, + after=after, + last=last, + before=before, request_options=request_options, ) async def create( - self, *, request: CreatePaymentsRequest, request_options: typing.Optional[RequestOptions] = None - ) -> CreatePaymentsResponse: + self, + *, + account_id: str, + plan_id: str, + capture: typing.Optional[bool] = OMIT, + confirmation_token: typing.Optional[str] = OMIT, + email: typing.Optional[str] = OMIT, + member_id: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + payment_method_id: typing.Optional[str] = OMIT, + promo_code_id: typing.Optional[str] = OMIT, + return_url: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> Payment: """ - Charge a buyer on-session with a `confirmation_token` for the method they selected, or charge an existing member off-session using a stored payment method. You can provide an existing plan or create one inline. The endpoint returns a payment immediately, but processing continues asynchronously. Use webhooks to learn whether it succeeds or fails, and poll the payment's status endpoint for any step the buyer must complete. - - Required permissions: - - `payment:charge` - - `plan:create` - - `access_pass:create` - - `access_pass:update` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Charges a buyer for a plan. Pass a payment method already on file (`member_id` and `payment_method_id`), or a `confirmation_token` describing a method the buyer just supplied. Collection runs in the background: the response is the payment as created, not its outcome — poll Retrieve status for how far it has got and, for a confirmation-token payment, what the buyer must still do. `plan_id` names the plan to charge for. Parameters ---------- - request : CreatePaymentsRequest + account_id : str + The account to charge for, prefixed `biz_`. + + plan_id : str + The plan to charge for, prefixed `plan_`. It must belong to the account. + + capture : typing.Optional[bool] + Whether to capture a card payment immediately. Defaults to true. Pass false to place an authorization hold that must be captured in full within five days via the capture endpoint. + + confirmation_token : typing.Optional[str] + A confirmation token describing a payment method the buyer just supplied. Provide this instead of `member_id` and `payment_method_id`; the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete — poll the payment's status for what to do next. + + email : typing.Optional[str] + Overrides the buyer email carried on the confirmation token, resolving or creating the user the payment belongs to. Ignored unless `confirmation_token` is provided, and when the token was created by a signed-in buyer. + + member_id : typing.Optional[str] + The member to charge, prefixed `mber_`. Required with `payment_method_id` unless `confirmation_token` is provided. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Custom metadata to attach to the payment. + + payment_method_id : typing.Optional[str] + The stored payment method to charge, prefixed `payt_`. It must belong to the member. Required unless `confirmation_token` is provided. + + promo_code_id : typing.Optional[str] + An active promo code to apply, prefixed `promo_`. It must belong to the account and be valid for the plan. + + return_url : typing.Optional[str] + Where the buyer continues after completing an off-site step. An absolute https URL without credentials, at most 2,048 characters. Ignored unless `confirmation_token` is provided. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CreatePaymentsResponse - A successful response + Payment + payment created from a stored payment method Examples -------- import asyncio from whop_sdk import AsyncWhop - from whop_sdk.payments import ( - CreatePaymentsRequestZero, - CreatePaymentsRequestZeroPlan, - ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -872,51 +761,44 @@ async def create( async def main() -> None: await client.payments.create( - request=CreatePaymentsRequestZero( - company_id="biz_xxxxxxxxxxxxxx", - confirmation_token="confirmation_token", - plan=CreatePaymentsRequestZeroPlan( - currency="usd", - ), - ), + account_id="biz_xxxxxxxxxxxxxx", + plan_id="plan_xxxxxxxxxxxxxx", ) asyncio.run(main()) """ - _response = await self._raw_client.create(request=request, request_options=request_options) + _response = await self._raw_client.create( + account_id=account_id, + plan_id=plan_id, + capture=capture, + confirmation_token=confirmation_token, + email=email, + member_id=member_id, + metadata=metadata, + payment_method_id=payment_method_id, + promo_code_id=promo_code_id, + return_url=return_url, + request_options=request_options, + ) return _response.data - async def retrieve( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> RetrievePaymentsResponse: + async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Payment: """ - Retrieves the details of an existing payment. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Returns one payment. Related records are ids — resolve a plan, membership, member or shipment on its own endpoint, and list this payment's refunds, disputes or Resolution Center cases with `?payment_id=`. Parameters ---------- id : str - The unique identifier of the payment. + The payment to retrieve, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - RetrievePaymentsResponse - A successful response + Payment + payment retrieved Examples -------- @@ -925,7 +807,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -933,7 +815,7 @@ async def retrieve( async def main() -> None: await client.payments.retrieve( - id="pay_xxxxxxxxxxxxxx", + id="id", ) @@ -966,7 +848,7 @@ async def capture(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -984,45 +866,23 @@ async def main() -> None: return _response.data async def list_fees( - self, - id: str, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse]: + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ListFeesPaymentsResponse: """ - Returns the list of fees associated with a specific payment, including platform fees and processing fees. - - Required permissions: - - `payment:basic:read` + Returns the fee breakdown of one payment — Whop's fee, processing, affiliate and other lines — each in the currency it was collected in and converted to the payment's settlement currency. The list is complete in one page. Parameters ---------- id : str - The unique identifier of the payment to list fees for. - - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. + The payment whose fees to list, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse] - A successful response + ListFeesPaymentsResponse + fees listed Examples -------- @@ -1031,31 +891,22 @@ async def list_fees( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) async def main() -> None: - response = await client.payments.list_fees( - id="pay_xxxxxxxxxxxxxx", - first=42, - last=42, + await client.payments.list_fees( + id="id", ) - async for item in response: - yield item - - # alternatively, you can paginate page-by-page - async for page in response.iter_pages(): - yield page asyncio.run(main()) """ - return await self._raw_client.list_fees( - id, after=after, before=before, first=first, last=last, request_options=request_options - ) + _response = await self._raw_client.list_fees(id, request_options=request_options) + return _response.data async def refund( self, @@ -1065,24 +916,12 @@ async def refund( request_options: typing.Optional[RequestOptions] = None, ) -> Payment: """ - Issue a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Issues a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. Parameters ---------- id : str - The unique identifier of the payment to refund. + The payment to refund, prefixed `pay_`. partial_amount : typing.Optional[float] The amount to refund. For multi-currency payments, this is in the charge currency (what the buyer paid). For single-currency, this is in the payment currency. If omitted, the full payment amount is refunded. @@ -1093,7 +932,7 @@ async def refund( Returns ------- Payment - A successful response + payment refunded Examples -------- @@ -1102,7 +941,7 @@ async def refund( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1110,7 +949,7 @@ async def refund( async def main() -> None: await client.payments.refund( - id="pay_xxxxxxxxxxxxxx", + id="id", ) @@ -1121,24 +960,12 @@ async def main() -> None: async def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Payment: """ - Retry a failed or pending payment. This re-attempts the charge using the original payment method and plan details. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Retries a failed or pending payment. This re-attempts the charge using the original payment method and plan details. Parameters ---------- id : str - The unique identifier of the payment to retry. + The payment to retry, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1146,7 +973,7 @@ async def retry(self, id: str, *, request_options: typing.Optional[RequestOption Returns ------- Payment - A successful response + payment retried Examples -------- @@ -1155,7 +982,7 @@ async def retry(self, id: str, *, request_options: typing.Optional[RequestOption from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1163,7 +990,7 @@ async def retry(self, id: str, *, request_options: typing.Optional[RequestOption async def main() -> None: await client.payments.retry( - id="pay_xxxxxxxxxxxxxx", + id="id", ) @@ -1174,24 +1001,12 @@ async def main() -> None: async def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Payment: """ - Void a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Voids a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. Parameters ---------- id : str - The unique identifier of the payment to void. + The payment to void, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1199,7 +1014,7 @@ async def void(self, id: str, *, request_options: typing.Optional[RequestOptions Returns ------- Payment - A successful response + payment voided Examples -------- @@ -1208,7 +1023,7 @@ async def void(self, id: str, *, request_options: typing.Optional[RequestOptions from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1216,7 +1031,7 @@ async def void(self, id: str, *, request_options: typing.Optional[RequestOptions async def main() -> None: await client.payments.void( - id="pay_xxxxxxxxxxxxxx", + id="id", ) @@ -1254,7 +1069,7 @@ async def update_return_url( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1300,7 +1115,7 @@ async def retrieve_status( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payments/raw_client.py b/src/whop_sdk/payments/raw_client.py index 2fb007b8..f247f19d 100644 --- a/src/whop_sdk/payments/raw_client.py +++ b/src/whop_sdk/payments/raw_client.py @@ -13,31 +13,20 @@ from ..core.parse_error import ParsingError from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata from ..errors.bad_request_error import BadRequestError from ..errors.conflict_error import ConflictError from ..errors.forbidden_error import ForbiddenError -from ..errors.internal_server_error import InternalServerError from ..errors.not_found_error import NotFoundError -from ..errors.too_many_requests_error import TooManyRequestsError from ..errors.unauthorized_error import UnauthorizedError -from ..errors.unprocessable_entity_error import UnprocessableEntityError -from ..types.billing_reasons import BillingReasons -from ..types.currencies import Currencies -from ..types.direction import Direction -from ..types.friendly_receipt_status import FriendlyReceiptStatus from ..types.payment import Payment -from ..types.payment_list_item import PaymentListItem from ..types.payment_status import PaymentStatus -from ..types.receipt_status import ReceiptStatus -from ..types.receipt_v2order import ReceiptV2Order from ..types.v1error_response import V1ErrorResponse -from .types.create_payments_request import CreatePaymentsRequest -from .types.create_payments_response import CreatePaymentsResponse from .types.list_fees_payments_response import ListFeesPaymentsResponse -from .types.list_fees_payments_response_data_item import ListFeesPaymentsResponseDataItem +from .types.list_payments_request_billing_reason import ListPaymentsRequestBillingReason +from .types.list_payments_request_direction import ListPaymentsRequestDirection +from .types.list_payments_request_order import ListPaymentsRequestOrder +from .types.list_payments_request_status import ListPaymentsRequestStatus from .types.list_payments_response import ListPaymentsResponse -from .types.retrieve_payments_response import RetrievePaymentsResponse from pydantic import ValidationError # this is used as the default value for optional parameters @@ -51,135 +40,115 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - order: typing.Optional[ReceiptV2Order] = None, - product_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - billing_reasons: typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] = None, - currencies: typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - statuses: typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] = None, - substatuses: typing.Optional[ - typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]] - ] = None, - include_free: typing.Optional[bool] = None, + account_id: typing.Optional[str] = None, + status: typing.Optional[ListPaymentsRequestStatus] = None, + billing_reason: typing.Optional[ListPaymentsRequestBillingReason] = None, + currency: typing.Optional[str] = None, + user_id: typing.Optional[str] = None, + query: typing.Optional[str] = None, + member_id: typing.Optional[str] = None, + membership_id: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, + plan_id: typing.Optional[str] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, - updated_before: typing.Optional[dt.datetime] = None, - updated_after: typing.Optional[dt.datetime] = None, - query: typing.Optional[str] = None, - checkout_configuration_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order: typing.Optional[ListPaymentsRequestOrder] = None, + direction: typing.Optional[ListPaymentsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentListItem, ListPaymentsResponse]: + ) -> SyncPager[Payment, ListPaymentsResponse]: """ - Returns a paginated list of payments for the actor in context, with optional filtering by product, plan, status, billing reason, currency, and creation date. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` + Lists payments, newest first. Without filters this is every payment the caller can read: a company credential's own account, or for a user every account they can read payments for. Filters narrow by account, buyer, product, plan, membership, status, billing reason, currency, and creation window. Filtering by `billing_reason=subscription_cycle` also matches renewals recorded as `subscription_update`. `settlement_time_at` is null on list rows — retrieve the payment for it. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. + account_id : typing.Optional[str] + Only payments charged by this account, prefixed `biz_`. - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - company_id : typing.Optional[str] - The unique identifier of the company to list payments for. - - direction : typing.Optional[Direction] + status : typing.Optional[ListPaymentsRequestStatus] + Only payments in this lifecycle state. - order : typing.Optional[ReceiptV2Order] + billing_reason : typing.Optional[ListPaymentsRequestBillingReason] + Only payments charged for this reason. - product_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific product identifiers. + currency : typing.Optional[str] + Only payments presented in this three-letter currency, such as `usd`. - billing_reasons : typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] - Filter payments by their billing reason. + user_id : typing.Optional[str] + Only payments made by this buyer, prefixed `user_`. - currencies : typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] - Filter payments by their currency code. + query : typing.Optional[str] + Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific plan identifiers. + member_id : typing.Optional[str] + Only payments made by this member, prefixed `mber_`. - statuses : typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] - Filter payments by their current status. + membership_id : typing.Optional[str] + Only payments billed under this membership, prefixed `mem_`. - substatuses : typing.Optional[typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]]] - Filter payments by their current substatus for more granular filtering. + product_id : typing.Optional[str] + Only payments for this product, prefixed `prod_`. - include_free : typing.Optional[bool] - Whether to include payments with a zero amount. Defaults to false, so zero-amount payments are omitted unless you set this to true — a company whose sales are all free plans returns an empty list without it. + plan_id : typing.Optional[str] + Only payments priced by this plan, prefixed `plan_`. created_before : typing.Optional[dt.datetime] - Only return payments created before this timestamp. + Only payments created before this ISO 8601 timestamp. created_after : typing.Optional[dt.datetime] - Only return payments created after this timestamp. + Only payments created after this ISO 8601 timestamp. - updated_before : typing.Optional[dt.datetime] - Only return payments last updated before this timestamp. + order : typing.Optional[ListPaymentsRequestOrder] + The field to sort by. - updated_after : typing.Optional[dt.datetime] - Only return payments last updated after this timestamp. + direction : typing.Optional[ListPaymentsRequestDirection] + The sort direction. - query : typing.Optional[str] - Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. + first : typing.Optional[int] + The number of payments to return. + + after : typing.Optional[str] + A cursor; returns payments after this position. - checkout_configuration_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Only return payments from these checkout configurations. + last : typing.Optional[int] + The number of payments to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns payments before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[PaymentListItem, ListPaymentsResponse] - A successful response + SyncPager[Payment, ListPaymentsResponse] + payments listed """ _response = self._client_wrapper.httpx_client.request( "payments", method="GET", params={ - "after": after, - "before": before, - "first": first, - "last": last, - "company_id": company_id, - "direction": direction, - "order": order, - "product_ids": product_ids, - "billing_reasons": billing_reasons, - "currencies": currencies, - "plan_ids": plan_ids, - "statuses": statuses, - "substatuses": substatuses, - "include_free": include_free, + "account_id": account_id, + "status": status, + "billing_reason": billing_reason, + "currency": currency, + "user_id": user_id, + "query": query, + "member_id": member_id, + "membership_id": membership_id, + "product_id": product_id, + "plan_id": plan_id, "created_before": serialize_datetime(created_before) if created_before is not None else None, "created_after": serialize_datetime(created_after) if created_after is not None else None, - "updated_before": serialize_datetime(updated_before) if updated_before is not None else None, - "updated_after": serialize_datetime(updated_after) if updated_after is not None else None, - "query": query, - "checkout_configuration_ids": checkout_configuration_ids, + "order": order, + "direction": direction, + "first": first, + "after": after, + "last": last, + "before": before, }, request_options=request_options, ) @@ -199,26 +168,24 @@ def list( _parsed_next = _parsed_response.page_info.end_cursor _has_next = _parsed_next is not None and _parsed_next != "" _get_next = lambda: self.list( - after=_parsed_next, - before=before, - first=first, - last=last, - company_id=company_id, - direction=direction, - order=order, - product_ids=product_ids, - billing_reasons=billing_reasons, - currencies=currencies, - plan_ids=plan_ids, - statuses=statuses, - substatuses=substatuses, - include_free=include_free, + account_id=account_id, + status=status, + billing_reason=billing_reason, + currency=currency, + user_id=user_id, + query=query, + member_id=member_id, + membership_id=membership_id, + product_id=product_id, + plan_id=plan_id, created_before=created_before, created_after=created_after, - updated_before=updated_before, - updated_after=updated_after, - query=query, - checkout_configuration_ids=checkout_configuration_ids, + order=order, + direction=direction, + first=first, + after=_parsed_next, + last=last, + before=before, request_options=request_options, ) return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) @@ -244,61 +211,6 @@ def list( ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -309,44 +221,78 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( - self, *, request: CreatePaymentsRequest, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[CreatePaymentsResponse]: + self, + *, + account_id: str, + plan_id: str, + capture: typing.Optional[bool] = OMIT, + confirmation_token: typing.Optional[str] = OMIT, + email: typing.Optional[str] = OMIT, + member_id: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + payment_method_id: typing.Optional[str] = OMIT, + promo_code_id: typing.Optional[str] = OMIT, + return_url: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[Payment]: """ - Charge a buyer on-session with a `confirmation_token` for the method they selected, or charge an existing member off-session using a stored payment method. You can provide an existing plan or create one inline. The endpoint returns a payment immediately, but processing continues asynchronously. Use webhooks to learn whether it succeeds or fails, and poll the payment's status endpoint for any step the buyer must complete. - - Required permissions: - - `payment:charge` - - `plan:create` - - `access_pass:create` - - `access_pass:update` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Charges a buyer for a plan. Pass a payment method already on file (`member_id` and `payment_method_id`), or a `confirmation_token` describing a method the buyer just supplied. Collection runs in the background: the response is the payment as created, not its outcome — poll Retrieve status for how far it has got and, for a confirmation-token payment, what the buyer must still do. `plan_id` names the plan to charge for. Parameters ---------- - request : CreatePaymentsRequest + account_id : str + The account to charge for, prefixed `biz_`. + + plan_id : str + The plan to charge for, prefixed `plan_`. It must belong to the account. + + capture : typing.Optional[bool] + Whether to capture a card payment immediately. Defaults to true. Pass false to place an authorization hold that must be captured in full within five days via the capture endpoint. + + confirmation_token : typing.Optional[str] + A confirmation token describing a payment method the buyer just supplied. Provide this instead of `member_id` and `payment_method_id`; the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete — poll the payment's status for what to do next. + + email : typing.Optional[str] + Overrides the buyer email carried on the confirmation token, resolving or creating the user the payment belongs to. Ignored unless `confirmation_token` is provided, and when the token was created by a signed-in buyer. + + member_id : typing.Optional[str] + The member to charge, prefixed `mber_`. Required with `payment_method_id` unless `confirmation_token` is provided. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Custom metadata to attach to the payment. + + payment_method_id : typing.Optional[str] + The stored payment method to charge, prefixed `payt_`. It must belong to the member. Required unless `confirmation_token` is provided. + + promo_code_id : typing.Optional[str] + An active promo code to apply, prefixed `promo_`. It must belong to the account and be valid for the plan. + + return_url : typing.Optional[str] + Where the buyer continues after completing an off-site step. An absolute https URL without credentials, at most 2,048 characters. Ignored unless `confirmation_token` is provided. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[CreatePaymentsResponse] - A successful response + HttpResponse[Payment] + payment created from a stored payment method """ _response = self._client_wrapper.httpx_client.request( "payments", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=CreatePaymentsRequest, direction="write" - ), + json={ + "account_id": account_id, + "capture": capture, + "confirmation_token": confirmation_token, + "email": email, + "member_id": member_id, + "metadata": metadata, + "payment_method_id": payment_method_id, + "plan_id": plan_id, + "promo_code_id": promo_code_id, + "return_url": return_url, + }, headers={ "content-type": "application/json", }, @@ -356,9 +302,9 @@ def create( try: if 200 <= _response.status_code < 300: _data = typing.cast( - CreatePaymentsResponse, + Payment, parse_obj_as( - type_=CreatePaymentsResponse, # type: ignore + type_=Payment, # type: ignore object_=_response.json(), ), ) @@ -407,35 +353,13 @@ def create( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -449,36 +373,22 @@ def create( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def retrieve( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[RetrievePaymentsResponse]: + def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Payment]: """ - Retrieves the details of an existing payment. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Returns one payment. Related records are ids — resolve a plan, membership, member or shipment on its own endpoint, and list this payment's refunds, disputes or Resolution Center cases with `?payment_id=`. Parameters ---------- id : str - The unique identifier of the payment. + The payment to retrieve, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[RetrievePaymentsResponse] - A successful response + HttpResponse[Payment] + payment retrieved """ _response = self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}", @@ -488,24 +398,13 @@ def retrieve( try: if 200 <= _response.status_code < 300: _data = typing.cast( - RetrievePaymentsResponse, + Payment, parse_obj_as( - type_=RetrievePaymentsResponse, # type: ignore + type_=Payment, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -539,39 +438,6 @@ def retrieve( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -669,92 +535,39 @@ def capture( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def list_fees( - self, - id: str, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse]: + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ListFeesPaymentsResponse]: """ - Returns the list of fees associated with a specific payment, including platform fees and processing fees. - - Required permissions: - - `payment:basic:read` + Returns the fee breakdown of one payment — Whop's fee, processing, affiliate and other lines — each in the currency it was collected in and converted to the payment's settlement currency. The list is complete in one page. Parameters ---------- id : str - The unique identifier of the payment to list fees for. - - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. + The payment whose fees to list, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse] - A successful response + HttpResponse[ListFeesPaymentsResponse] + fees listed """ _response = self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/fees", method="GET", - params={ - "after": after, - "before": before, - "first": first, - "last": last, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( + _data = typing.cast( ListFeesPaymentsResponse, parse_obj_as( type_=ListFeesPaymentsResponse, # type: ignore object_=_response.json(), ), ) - _items = _parsed_response.data - _has_next = False - _get_next = None - if _parsed_response.page_info is not None: - _parsed_next = _parsed_response.page_info.end_cursor - _has_next = _parsed_next is not None and _parsed_next != "" - _get_next = lambda: self.list_fees( - id, - after=_parsed_next, - before=before, - first=first, - last=last, - request_options=request_options, - ) - return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) + return HttpResponse(response=_response, data=_data) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -766,17 +579,6 @@ def list_fees( ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -788,39 +590,6 @@ def list_fees( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -838,24 +607,12 @@ def refund( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[Payment]: """ - Issue a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Issues a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. Parameters ---------- id : str - The unique identifier of the payment to refund. + The payment to refund, prefixed `pay_`. partial_amount : typing.Optional[float] The amount to refund. For multi-currency payments, this is in the charge currency (what the buyer paid). For single-currency, this is in the payment currency. If omitted, the full payment amount is refunded. @@ -866,7 +623,7 @@ def refund( Returns ------- HttpResponse[Payment] - A successful response + payment refunded """ _response = self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/refund", @@ -885,35 +642,13 @@ def refund( _data = typing.cast( Payment, parse_obj_as( - type_=Payment, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), + type_=Payment, # type: ignore + object_=_response.json(), ), ) - if _response.status_code == 403: - raise ForbiddenError( + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( headers=dict(_response.headers), body=typing.cast( typing.Any, @@ -923,8 +658,8 @@ def refund( ), ), ) - if _response.status_code == 404: - raise NotFoundError( + if _response.status_code == 401: + raise UnauthorizedError( headers=dict(_response.headers), body=typing.cast( typing.Any, @@ -934,8 +669,8 @@ def refund( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( + if _response.status_code == 403: + raise ForbiddenError( headers=dict(_response.headers), body=typing.cast( typing.Any, @@ -945,8 +680,8 @@ def refund( ), ), ) - if _response.status_code == 429: - raise TooManyRequestsError( + if _response.status_code == 404: + raise NotFoundError( headers=dict(_response.headers), body=typing.cast( typing.Any, @@ -956,13 +691,13 @@ def refund( ), ), ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -978,24 +713,12 @@ def refund( def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Payment]: """ - Retry a failed or pending payment. This re-attempts the charge using the original payment method and plan details. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Retries a failed or pending payment. This re-attempts the charge using the original payment method and plan details. Parameters ---------- id : str - The unique identifier of the payment to retry. + The payment to retry, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1003,7 +726,7 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N Returns ------- HttpResponse[Payment] - A successful response + payment retried """ _response = self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/retry", @@ -1020,17 +743,6 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N ), ) return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -1042,17 +754,6 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -1064,35 +765,13 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -1108,24 +787,12 @@ def retry(self, id: str, *, request_options: typing.Optional[RequestOptions] = N def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Payment]: """ - Void a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Voids a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. Parameters ---------- id : str - The unique identifier of the payment to void. + The payment to void, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1133,7 +800,7 @@ def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = No Returns ------- HttpResponse[Payment] - A successful response + payment voided """ _response = self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/void", @@ -1150,17 +817,6 @@ def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = No ), ) return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -1172,17 +828,6 @@ def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = No ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -1194,35 +839,13 @@ def void(self, id: str, *, request_options: typing.Optional[RequestOptions] = No ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -1395,135 +1018,115 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - company_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, - order: typing.Optional[ReceiptV2Order] = None, - product_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - billing_reasons: typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] = None, - currencies: typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - statuses: typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] = None, - substatuses: typing.Optional[ - typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]] - ] = None, - include_free: typing.Optional[bool] = None, + account_id: typing.Optional[str] = None, + status: typing.Optional[ListPaymentsRequestStatus] = None, + billing_reason: typing.Optional[ListPaymentsRequestBillingReason] = None, + currency: typing.Optional[str] = None, + user_id: typing.Optional[str] = None, + query: typing.Optional[str] = None, + member_id: typing.Optional[str] = None, + membership_id: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, + plan_id: typing.Optional[str] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, - updated_before: typing.Optional[dt.datetime] = None, - updated_after: typing.Optional[dt.datetime] = None, - query: typing.Optional[str] = None, - checkout_configuration_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order: typing.Optional[ListPaymentsRequestOrder] = None, + direction: typing.Optional[ListPaymentsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentListItem, ListPaymentsResponse]: + ) -> AsyncPager[Payment, ListPaymentsResponse]: """ - Returns a paginated list of payments for the actor in context, with optional filtering by product, plan, status, billing reason, currency, and creation date. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` + Lists payments, newest first. Without filters this is every payment the caller can read: a company credential's own account, or for a user every account they can read payments for. Filters narrow by account, buyer, product, plan, membership, status, billing reason, currency, and creation window. Filtering by `billing_reason=subscription_cycle` also matches renewals recorded as `subscription_update`. `settlement_time_at` is null on list rows — retrieve the payment for it. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. + account_id : typing.Optional[str] + Only payments charged by this account, prefixed `biz_`. - last : typing.Optional[int] - Returns the last _n_ elements from the list. - - company_id : typing.Optional[str] - The unique identifier of the company to list payments for. + status : typing.Optional[ListPaymentsRequestStatus] + Only payments in this lifecycle state. - direction : typing.Optional[Direction] + billing_reason : typing.Optional[ListPaymentsRequestBillingReason] + Only payments charged for this reason. - order : typing.Optional[ReceiptV2Order] + currency : typing.Optional[str] + Only payments presented in this three-letter currency, such as `usd`. - product_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific product identifiers. + user_id : typing.Optional[str] + Only payments made by this buyer, prefixed `user_`. - billing_reasons : typing.Optional[typing.Union[BillingReasons, typing.Sequence[BillingReasons]]] - Filter payments by their billing reason. - - currencies : typing.Optional[typing.Union[Currencies, typing.Sequence[Currencies]]] - Filter payments by their currency code. + query : typing.Optional[str] + Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter payments to only those associated with these specific plan identifiers. + member_id : typing.Optional[str] + Only payments made by this member, prefixed `mber_`. - statuses : typing.Optional[typing.Union[ReceiptStatus, typing.Sequence[ReceiptStatus]]] - Filter payments by their current status. + membership_id : typing.Optional[str] + Only payments billed under this membership, prefixed `mem_`. - substatuses : typing.Optional[typing.Union[FriendlyReceiptStatus, typing.Sequence[FriendlyReceiptStatus]]] - Filter payments by their current substatus for more granular filtering. + product_id : typing.Optional[str] + Only payments for this product, prefixed `prod_`. - include_free : typing.Optional[bool] - Whether to include payments with a zero amount. Defaults to false, so zero-amount payments are omitted unless you set this to true — a company whose sales are all free plans returns an empty list without it. + plan_id : typing.Optional[str] + Only payments priced by this plan, prefixed `plan_`. created_before : typing.Optional[dt.datetime] - Only return payments created before this timestamp. + Only payments created before this ISO 8601 timestamp. created_after : typing.Optional[dt.datetime] - Only return payments created after this timestamp. + Only payments created after this ISO 8601 timestamp. - updated_before : typing.Optional[dt.datetime] - Only return payments last updated before this timestamp. + order : typing.Optional[ListPaymentsRequestOrder] + The field to sort by. - updated_after : typing.Optional[dt.datetime] - Only return payments last updated after this timestamp. + direction : typing.Optional[ListPaymentsRequestDirection] + The sort direction. - query : typing.Optional[str] - Search payments by user ID, membership ID, user email, name, or username. Email filtering requires the member:email:read permission. + first : typing.Optional[int] + The number of payments to return. - checkout_configuration_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Only return payments from these checkout configurations. + after : typing.Optional[str] + A cursor; returns payments after this position. + + last : typing.Optional[int] + The number of payments to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns payments before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[PaymentListItem, ListPaymentsResponse] - A successful response + AsyncPager[Payment, ListPaymentsResponse] + payments listed """ _response = await self._client_wrapper.httpx_client.request( "payments", method="GET", params={ - "after": after, - "before": before, - "first": first, - "last": last, - "company_id": company_id, - "direction": direction, - "order": order, - "product_ids": product_ids, - "billing_reasons": billing_reasons, - "currencies": currencies, - "plan_ids": plan_ids, - "statuses": statuses, - "substatuses": substatuses, - "include_free": include_free, + "account_id": account_id, + "status": status, + "billing_reason": billing_reason, + "currency": currency, + "user_id": user_id, + "query": query, + "member_id": member_id, + "membership_id": membership_id, + "product_id": product_id, + "plan_id": plan_id, "created_before": serialize_datetime(created_before) if created_before is not None else None, "created_after": serialize_datetime(created_after) if created_after is not None else None, - "updated_before": serialize_datetime(updated_before) if updated_before is not None else None, - "updated_after": serialize_datetime(updated_after) if updated_after is not None else None, - "query": query, - "checkout_configuration_ids": checkout_configuration_ids, + "order": order, + "direction": direction, + "first": first, + "after": after, + "last": last, + "before": before, }, request_options=request_options, ) @@ -1545,26 +1148,24 @@ async def list( async def _get_next(): return await self.list( - after=_parsed_next, - before=before, - first=first, - last=last, - company_id=company_id, - direction=direction, - order=order, - product_ids=product_ids, - billing_reasons=billing_reasons, - currencies=currencies, - plan_ids=plan_ids, - statuses=statuses, - substatuses=substatuses, - include_free=include_free, + account_id=account_id, + status=status, + billing_reason=billing_reason, + currency=currency, + user_id=user_id, + query=query, + member_id=member_id, + membership_id=membership_id, + product_id=product_id, + plan_id=plan_id, created_before=created_before, created_after=created_after, - updated_before=updated_before, - updated_after=updated_after, - query=query, - checkout_configuration_ids=checkout_configuration_ids, + order=order, + direction=direction, + first=first, + after=_parsed_next, + last=last, + before=before, request_options=request_options, ) @@ -1591,61 +1192,6 @@ async def _get_next(): ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -1656,44 +1202,78 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( - self, *, request: CreatePaymentsRequest, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[CreatePaymentsResponse]: + self, + *, + account_id: str, + plan_id: str, + capture: typing.Optional[bool] = OMIT, + confirmation_token: typing.Optional[str] = OMIT, + email: typing.Optional[str] = OMIT, + member_id: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + payment_method_id: typing.Optional[str] = OMIT, + promo_code_id: typing.Optional[str] = OMIT, + return_url: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[Payment]: """ - Charge a buyer on-session with a `confirmation_token` for the method they selected, or charge an existing member off-session using a stored payment method. You can provide an existing plan or create one inline. The endpoint returns a payment immediately, but processing continues asynchronously. Use webhooks to learn whether it succeeds or fails, and poll the payment's status endpoint for any step the buyer must complete. - - Required permissions: - - `payment:charge` - - `plan:create` - - `access_pass:create` - - `access_pass:update` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Charges a buyer for a plan. Pass a payment method already on file (`member_id` and `payment_method_id`), or a `confirmation_token` describing a method the buyer just supplied. Collection runs in the background: the response is the payment as created, not its outcome — poll Retrieve status for how far it has got and, for a confirmation-token payment, what the buyer must still do. `plan_id` names the plan to charge for. Parameters ---------- - request : CreatePaymentsRequest + account_id : str + The account to charge for, prefixed `biz_`. + + plan_id : str + The plan to charge for, prefixed `plan_`. It must belong to the account. + + capture : typing.Optional[bool] + Whether to capture a card payment immediately. Defaults to true. Pass false to place an authorization hold that must be captured in full within five days via the capture endpoint. + + confirmation_token : typing.Optional[str] + A confirmation token describing a payment method the buyer just supplied. Provide this instead of `member_id` and `payment_method_id`; the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete — poll the payment's status for what to do next. + + email : typing.Optional[str] + Overrides the buyer email carried on the confirmation token, resolving or creating the user the payment belongs to. Ignored unless `confirmation_token` is provided, and when the token was created by a signed-in buyer. + + member_id : typing.Optional[str] + The member to charge, prefixed `mber_`. Required with `payment_method_id` unless `confirmation_token` is provided. + + metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]] + Custom metadata to attach to the payment. + + payment_method_id : typing.Optional[str] + The stored payment method to charge, prefixed `payt_`. It must belong to the member. Required unless `confirmation_token` is provided. + + promo_code_id : typing.Optional[str] + An active promo code to apply, prefixed `promo_`. It must belong to the account and be valid for the plan. + + return_url : typing.Optional[str] + Where the buyer continues after completing an off-site step. An absolute https URL without credentials, at most 2,048 characters. Ignored unless `confirmation_token` is provided. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[CreatePaymentsResponse] - A successful response + AsyncHttpResponse[Payment] + payment created from a stored payment method """ _response = await self._client_wrapper.httpx_client.request( "payments", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=CreatePaymentsRequest, direction="write" - ), + json={ + "account_id": account_id, + "capture": capture, + "confirmation_token": confirmation_token, + "email": email, + "member_id": member_id, + "metadata": metadata, + "payment_method_id": payment_method_id, + "plan_id": plan_id, + "promo_code_id": promo_code_id, + "return_url": return_url, + }, headers={ "content-type": "application/json", }, @@ -1703,9 +1283,9 @@ async def create( try: if 200 <= _response.status_code < 300: _data = typing.cast( - CreatePaymentsResponse, + Payment, parse_obj_as( - type_=CreatePaymentsResponse, # type: ignore + type_=Payment, # type: ignore object_=_response.json(), ), ) @@ -1754,35 +1334,13 @@ async def create( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -1798,34 +1356,22 @@ async def create( async def retrieve( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[RetrievePaymentsResponse]: + ) -> AsyncHttpResponse[Payment]: """ - Retrieves the details of an existing payment. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Returns one payment. Related records are ids — resolve a plan, membership, member or shipment on its own endpoint, and list this payment's refunds, disputes or Resolution Center cases with `?payment_id=`. Parameters ---------- id : str - The unique identifier of the payment. + The payment to retrieve, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[RetrievePaymentsResponse] - A successful response + AsyncHttpResponse[Payment] + payment retrieved """ _response = await self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}", @@ -1835,24 +1381,13 @@ async def retrieve( try: if 200 <= _response.status_code < 300: _data = typing.cast( - RetrievePaymentsResponse, + Payment, parse_obj_as( - type_=RetrievePaymentsResponse, # type: ignore + type_=Payment, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -1886,39 +1421,6 @@ async def retrieve( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -2016,95 +1518,39 @@ async def capture( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def list_fees( - self, - id: str, - *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse]: + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ListFeesPaymentsResponse]: """ - Returns the list of fees associated with a specific payment, including platform fees and processing fees. - - Required permissions: - - `payment:basic:read` + Returns the fee breakdown of one payment — Whop's fee, processing, affiliate and other lines — each in the currency it was collected in and converted to the payment's settlement currency. The list is complete in one page. Parameters ---------- id : str - The unique identifier of the payment to list fees for. - - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. - - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. - - first : typing.Optional[int] - Returns the first _n_ elements from the list. - - last : typing.Optional[int] - Returns the last _n_ elements from the list. + The payment whose fees to list, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[ListFeesPaymentsResponseDataItem, ListFeesPaymentsResponse] - A successful response + AsyncHttpResponse[ListFeesPaymentsResponse] + fees listed """ _response = await self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/fees", method="GET", - params={ - "after": after, - "before": before, - "first": first, - "last": last, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( + _data = typing.cast( ListFeesPaymentsResponse, parse_obj_as( type_=ListFeesPaymentsResponse, # type: ignore object_=_response.json(), ), ) - _items = _parsed_response.data - _has_next = False - _get_next = None - if _parsed_response.page_info is not None: - _parsed_next = _parsed_response.page_info.end_cursor - _has_next = _parsed_next is not None and _parsed_next != "" - - async def _get_next(): - return await self.list_fees( - id, - after=_parsed_next, - before=before, - first=first, - last=last, - request_options=request_options, - ) - - return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) + return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -2116,17 +1562,6 @@ async def _get_next(): ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -2138,39 +1573,6 @@ async def _get_next(): ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -2188,24 +1590,12 @@ async def refund( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[Payment]: """ - Issue a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Issues a full or partial refund for a payment. The refund is processed through the original payment processor and the membership status is updated accordingly. Parameters ---------- id : str - The unique identifier of the payment to refund. + The payment to refund, prefixed `pay_`. partial_amount : typing.Optional[float] The amount to refund. For multi-currency payments, this is in the charge currency (what the buyer paid). For single-currency, this is in the payment currency. If omitted, the full payment amount is refunded. @@ -2216,7 +1606,7 @@ async def refund( Returns ------- AsyncHttpResponse[Payment] - A successful response + payment refunded """ _response = await self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/refund", @@ -2284,35 +1674,13 @@ async def refund( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -2330,24 +1698,12 @@ async def retry( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Payment]: """ - Retry a failed or pending payment. This re-attempts the charge using the original payment method and plan details. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Retries a failed or pending payment. This re-attempts the charge using the original payment method and plan details. Parameters ---------- id : str - The unique identifier of the payment to retry. + The payment to retry, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2355,7 +1711,7 @@ async def retry( Returns ------- AsyncHttpResponse[Payment] - A successful response + payment retried """ _response = await self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/retry", @@ -2372,17 +1728,6 @@ async def retry( ), ) return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -2394,17 +1739,6 @@ async def retry( ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -2416,35 +1750,13 @@ async def retry( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), @@ -2462,24 +1774,12 @@ async def void( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Payment]: """ - Void a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. - - Required permissions: - - `payment:manage` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` - - `promo_code:basic:read` - - `shipment:basic:read` - - `payment:dispute:read` - - `payment:resolution_center_case:read` + Voids a payment that has not yet been settled. Voiding cancels the payment before it is captured by the payment processor. Parameters ---------- id : str - The unique identifier of the payment to void. + The payment to void, prefixed `pay_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2487,7 +1787,7 @@ async def void( Returns ------- AsyncHttpResponse[Payment] - A successful response + payment voided """ _response = await self._client_wrapper.httpx_client.request( f"payments/{encode_path_param(id)}/void", @@ -2504,17 +1804,6 @@ async def void( ), ) return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -2526,17 +1815,6 @@ async def void( ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -2548,35 +1826,13 @@ async def void( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( + if _response.status_code == 409: + raise ConflictError( headers=dict(_response.headers), body=typing.cast( - typing.Any, + V1ErrorResponse, parse_obj_as( - type_=typing.Any, # type: ignore + type_=V1ErrorResponse, # type: ignore object_=_response.json(), ), ), diff --git a/src/whop_sdk/payments/types/__init__.py b/src/whop_sdk/payments/types/__init__.py index 18a41237..10b4813c 100644 --- a/src/whop_sdk/payments/types/__init__.py +++ b/src/whop_sdk/payments/types/__init__.py @@ -6,19 +6,14 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .create_payments_request import CreatePaymentsRequest - from .create_payments_request_one import CreatePaymentsRequestOne - from .create_payments_request_one_plan import CreatePaymentsRequestOnePlan - from .create_payments_request_one_plan_product import CreatePaymentsRequestOnePlanProduct - from .create_payments_request_three import CreatePaymentsRequestThree - from .create_payments_request_two import CreatePaymentsRequestTwo - from .create_payments_request_zero import CreatePaymentsRequestZero - from .create_payments_request_zero_plan import CreatePaymentsRequestZeroPlan - from .create_payments_request_zero_plan_product import CreatePaymentsRequestZeroPlanProduct - from .create_payments_response import CreatePaymentsResponse from .list_fees_payments_response import ListFeesPaymentsResponse - from .list_fees_payments_response_data_item import ListFeesPaymentsResponseDataItem + from .list_fees_payments_response_page_info import ListFeesPaymentsResponsePageInfo + from .list_payments_request_billing_reason import ListPaymentsRequestBillingReason + from .list_payments_request_direction import ListPaymentsRequestDirection + from .list_payments_request_order import ListPaymentsRequestOrder + from .list_payments_request_status import ListPaymentsRequestStatus from .list_payments_response import ListPaymentsResponse + from .list_payments_response_page_info import ListPaymentsResponsePageInfo from .post_payment_authorized_payload import PostPaymentAuthorizedPayload from .post_payment_authorized_payload_api_version import PostPaymentAuthorizedPayloadApiVersion from .post_payment_authorized_payload_type import PostPaymentAuthorizedPayloadType @@ -37,21 +32,15 @@ from .post_payment_succeeded_payload import PostPaymentSucceededPayload from .post_payment_succeeded_payload_api_version import PostPaymentSucceededPayloadApiVersion from .post_payment_succeeded_payload_type import PostPaymentSucceededPayloadType - from .retrieve_payments_response import RetrievePaymentsResponse _dynamic_imports: typing.Dict[str, str] = { - "CreatePaymentsRequest": ".create_payments_request", - "CreatePaymentsRequestOne": ".create_payments_request_one", - "CreatePaymentsRequestOnePlan": ".create_payments_request_one_plan", - "CreatePaymentsRequestOnePlanProduct": ".create_payments_request_one_plan_product", - "CreatePaymentsRequestThree": ".create_payments_request_three", - "CreatePaymentsRequestTwo": ".create_payments_request_two", - "CreatePaymentsRequestZero": ".create_payments_request_zero", - "CreatePaymentsRequestZeroPlan": ".create_payments_request_zero_plan", - "CreatePaymentsRequestZeroPlanProduct": ".create_payments_request_zero_plan_product", - "CreatePaymentsResponse": ".create_payments_response", "ListFeesPaymentsResponse": ".list_fees_payments_response", - "ListFeesPaymentsResponseDataItem": ".list_fees_payments_response_data_item", + "ListFeesPaymentsResponsePageInfo": ".list_fees_payments_response_page_info", + "ListPaymentsRequestBillingReason": ".list_payments_request_billing_reason", + "ListPaymentsRequestDirection": ".list_payments_request_direction", + "ListPaymentsRequestOrder": ".list_payments_request_order", + "ListPaymentsRequestStatus": ".list_payments_request_status", "ListPaymentsResponse": ".list_payments_response", + "ListPaymentsResponsePageInfo": ".list_payments_response_page_info", "PostPaymentAuthorizedPayload": ".post_payment_authorized_payload", "PostPaymentAuthorizedPayloadApiVersion": ".post_payment_authorized_payload_api_version", "PostPaymentAuthorizedPayloadType": ".post_payment_authorized_payload_type", @@ -70,7 +59,6 @@ "PostPaymentSucceededPayload": ".post_payment_succeeded_payload", "PostPaymentSucceededPayloadApiVersion": ".post_payment_succeeded_payload_api_version", "PostPaymentSucceededPayloadType": ".post_payment_succeeded_payload_type", - "RetrievePaymentsResponse": ".retrieve_payments_response", } @@ -96,19 +84,14 @@ def __dir__(): __all__ = [ - "CreatePaymentsRequest", - "CreatePaymentsRequestOne", - "CreatePaymentsRequestOnePlan", - "CreatePaymentsRequestOnePlanProduct", - "CreatePaymentsRequestThree", - "CreatePaymentsRequestTwo", - "CreatePaymentsRequestZero", - "CreatePaymentsRequestZeroPlan", - "CreatePaymentsRequestZeroPlanProduct", - "CreatePaymentsResponse", "ListFeesPaymentsResponse", - "ListFeesPaymentsResponseDataItem", + "ListFeesPaymentsResponsePageInfo", + "ListPaymentsRequestBillingReason", + "ListPaymentsRequestDirection", + "ListPaymentsRequestOrder", + "ListPaymentsRequestStatus", "ListPaymentsResponse", + "ListPaymentsResponsePageInfo", "PostPaymentAuthorizedPayload", "PostPaymentAuthorizedPayloadApiVersion", "PostPaymentAuthorizedPayloadType", @@ -127,5 +110,4 @@ def __dir__(): "PostPaymentSucceededPayload", "PostPaymentSucceededPayloadApiVersion", "PostPaymentSucceededPayloadType", - "RetrievePaymentsResponse", ] diff --git a/src/whop_sdk/payments/types/create_payments_request.py b/src/whop_sdk/payments/types/create_payments_request.py deleted file mode 100644 index cf518c13..00000000 --- a/src/whop_sdk/payments/types/create_payments_request.py +++ /dev/null @@ -1,12 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .create_payments_request_one import CreatePaymentsRequestOne -from .create_payments_request_three import CreatePaymentsRequestThree -from .create_payments_request_two import CreatePaymentsRequestTwo -from .create_payments_request_zero import CreatePaymentsRequestZero - -CreatePaymentsRequest = typing.Union[ - CreatePaymentsRequestZero, CreatePaymentsRequestOne, CreatePaymentsRequestTwo, CreatePaymentsRequestThree -] diff --git a/src/whop_sdk/payments/types/create_payments_request_one.py b/src/whop_sdk/payments/types/create_payments_request_one.py deleted file mode 100644 index 492ec32d..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_one.py +++ /dev/null @@ -1,67 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .create_payments_request_one_plan import CreatePaymentsRequestOnePlan - - -class CreatePaymentsRequestOne(UniversalBaseModel): - """ - Autogenerated input type of CreatePayment - """ - - capture: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to capture the card payment immediately. Pass false to place an authorization hold that must be captured in full within five days. - """ - - company_id: str = pydantic.Field() - """ - The ID of the company to create the payment for. - """ - - email: typing.Optional[str] = pydantic.Field(default=None) - """ - Overrides the buyer email carried on the confirmation token, resolving or creating the Whop user the payment belongs to. Ignored when the confirmation token was created by a signed-in buyer, and unless confirmation_token is provided. - """ - - member_id: str = pydantic.Field() - """ - The ID of the member to create the payment for. Required unless confirmation_token is provided. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - Custom metadata to attach to the payment. - """ - - payment_method_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the payment method to use for the payment. It must be connected to the Member being charged. Required unless confirmation_token is provided. - """ - - plan: CreatePaymentsRequestOnePlan = pydantic.Field() - """ - Pass this object to create a new plan for this payment - """ - - promo_code_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of an active promo code to apply to this payment. The promo code must belong to the company and be valid for the plan being purchased. The plan must be attached to a product — promo codes are not eligible for one-off purchases. - """ - - return_url: typing.Optional[str] = pydantic.Field(default=None) - """ - Where the buyer continues after completing an off-site step. Must be an absolute https URL without credentials (http is allowed for localhost), at most 2,048 characters. Editable until they return — see the payment's update endpoint. Ignored unless confirmation_token is provided. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_one_plan.py b/src/whop_sdk/payments/types/create_payments_request_one_plan.py deleted file mode 100644 index 0bd04b94..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_one_plan.py +++ /dev/null @@ -1,100 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.currencies import Currencies -from ...types.plan_types import PlanTypes -from ...types.visibility import Visibility -from .create_payments_request_one_plan_product import CreatePaymentsRequestOnePlanProduct - - -class CreatePaymentsRequestOnePlan(UniversalBaseModel): - """ - Pass this object to create a new plan for this payment - """ - - application_fee_amount: typing.Optional[float] = pydantic.Field(default=None) - """ - The application fee amount collected by the platform from this connected account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less than the total payment amount. Only valid for connected accounts with a parent company. - """ - - billing_period: typing.Optional[int] = pydantic.Field(default=None) - """ - The interval in days at which the plan charges (renewal plans). For example, 30 for monthly billing. - """ - - currency: Currencies = pydantic.Field() - """ - The respective currency identifier for the plan. - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - The description of the plan. - """ - - expiration_days: typing.Optional[int] = pydantic.Field(default=None) - """ - The number of days until the membership expires and revokes access (expiration plans). For example, 365 for one year. - """ - - force_create_new_plan: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to force the creation of a new plan even if one with the same attributes already exists. - """ - - initial_price: typing.Optional[float] = pydantic.Field(default=None) - """ - An additional amount charged upon first purchase. Provided as a number in the specified currency. Eg: 10.43 for $10.43 USD. - """ - - internal_notes: typing.Optional[str] = pydantic.Field(default=None) - """ - A personal description or notes section for the business. - """ - - plan_type: typing.Optional[PlanTypes] = pydantic.Field(default=None) - """ - Indicates if the plan is a one time payment or recurring. - """ - - product: typing.Optional[CreatePaymentsRequestOnePlanProduct] = pydantic.Field(default=None) - """ - Pass this object to create a new product for this plan. We will use the product external identifier to find or create an existing product. - """ - - product_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The product the plan is related to. Either this or product is required. - """ - - renewal_price: typing.Optional[float] = pydantic.Field(default=None) - """ - The amount the customer is charged every billing period. Provided as a number in the specified currency. Eg: 10.43 for $10.43 USD. - """ - - title: typing.Optional[str] = pydantic.Field(default=None) - """ - The title of the plan. This will be visible on the product page to customers. - """ - - trial_period_days: typing.Optional[int] = pydantic.Field(default=None) - """ - The number of free trial days added before a renewal plan. - """ - - visibility: typing.Optional[Visibility] = pydantic.Field(default=None) - """ - Shows or hides the plan from public/business view. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_one_plan_product.py b/src/whop_sdk/payments/types/create_payments_request_one_plan_product.py deleted file mode 100644 index 740d0c53..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_one_plan_product.py +++ /dev/null @@ -1,83 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.global_affiliate_statuses import GlobalAffiliateStatuses -from ...types.visibility import Visibility - - -class CreatePaymentsRequestOnePlanProduct(UniversalBaseModel): - """ - Pass this object to create a new product for this plan. We will use the product external identifier to find or create an existing product. - """ - - collect_shipping_address: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether or not to collect shipping information at checkout from the customer. - """ - - custom_statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) - """ - The custom statement descriptor for the product i.e. WHOP*SPORTS, must be between 5 and 22 characters, contain at least one letter, and not contain any of the following characters: <, >, \\, ', " - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - A written description of the product. - """ - - external_identifier: str = pydantic.Field() - """ - A unique ID used to find or create a product. When provided during creation, we will look for an existing product with this external identifier — if found, it will be updated; otherwise, a new product will be created. - """ - - global_affiliate_percentage: typing.Optional[float] = pydantic.Field(default=None) - """ - The percentage of the revenue that goes to the global affiliate program. - """ - - global_affiliate_status: typing.Optional[GlobalAffiliateStatuses] = pydantic.Field(default=None) - """ - The status of the global affiliate program for this product. - """ - - headline: typing.Optional[str] = pydantic.Field(default=None) - """ - The headline of the product. - """ - - product_tax_code_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the product tax code to apply to this product. - """ - - redirect_purchase_url: typing.Optional[str] = pydantic.Field(default=None) - """ - The URL to redirect the customer to after a purchase. - """ - - route: typing.Optional[str] = pydantic.Field(default=None) - """ - The route of the product. - """ - - title: str = pydantic.Field() - """ - The title of the product. - """ - - visibility: typing.Optional[Visibility] = pydantic.Field(default=None) - """ - This product will/will not be displayed publicly - default hidden. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_three.py b/src/whop_sdk/payments/types/create_payments_request_three.py deleted file mode 100644 index 347c6709..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_three.py +++ /dev/null @@ -1,66 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class CreatePaymentsRequestThree(UniversalBaseModel): - """ - Autogenerated input type of CreatePayment - """ - - capture: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to capture the card payment immediately. Pass false to place an authorization hold that must be captured in full within five days. - """ - - company_id: str = pydantic.Field() - """ - The ID of the company to create the payment for. - """ - - email: typing.Optional[str] = pydantic.Field(default=None) - """ - Overrides the buyer email carried on the confirmation token, resolving or creating the Whop user the payment belongs to. Ignored when the confirmation token was created by a signed-in buyer, and unless confirmation_token is provided. - """ - - member_id: str = pydantic.Field() - """ - The ID of the member to create the payment for. Required unless confirmation_token is provided. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - Custom metadata to attach to the payment. - """ - - payment_method_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the payment method to use for the payment. It must be connected to the Member being charged. Required unless confirmation_token is provided. - """ - - plan_id: str = pydantic.Field() - """ - An ID of an existing plan to use for the payment. - """ - - promo_code_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of an active promo code to apply to this payment. The promo code must belong to the company and be valid for the plan being purchased. The plan must be attached to a product — promo codes are not eligible for one-off purchases. - """ - - return_url: typing.Optional[str] = pydantic.Field(default=None) - """ - Where the buyer continues after completing an off-site step. Must be an absolute https URL without credentials (http is allowed for localhost), at most 2,048 characters. Editable until they return — see the payment's update endpoint. Ignored unless confirmation_token is provided. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_two.py b/src/whop_sdk/payments/types/create_payments_request_two.py deleted file mode 100644 index 52a6d2c1..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_two.py +++ /dev/null @@ -1,66 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class CreatePaymentsRequestTwo(UniversalBaseModel): - """ - Autogenerated input type of CreatePayment - """ - - capture: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to capture the card payment immediately. Pass false to place an authorization hold that must be captured in full within five days. - """ - - company_id: str = pydantic.Field() - """ - The ID of the company to create the payment for. - """ - - confirmation_token: str = pydantic.Field() - """ - A confirmation token ID (ctok_) describing a payment method the buyer just supplied. Provide this INSTEAD of member_id and payment_method_id to charge a method that is not yet on file — the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete (3DS, a redirect, linking a bank); poll the payment's status endpoint for what to do next. - """ - - email: typing.Optional[str] = pydantic.Field(default=None) - """ - Overrides the buyer email carried on the confirmation token, resolving or creating the Whop user the payment belongs to. Ignored when the confirmation token was created by a signed-in buyer, and unless confirmation_token is provided. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - Custom metadata to attach to the payment. - """ - - payment_method_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the payment method to use for the payment. It must be connected to the Member being charged. Required unless confirmation_token is provided. - """ - - plan_id: str = pydantic.Field() - """ - An ID of an existing plan to use for the payment. - """ - - promo_code_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of an active promo code to apply to this payment. The promo code must belong to the company and be valid for the plan being purchased. The plan must be attached to a product — promo codes are not eligible for one-off purchases. - """ - - return_url: typing.Optional[str] = pydantic.Field(default=None) - """ - Where the buyer continues after completing an off-site step. Must be an absolute https URL without credentials (http is allowed for localhost), at most 2,048 characters. Editable until they return — see the payment's update endpoint. Ignored unless confirmation_token is provided. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_zero.py b/src/whop_sdk/payments/types/create_payments_request_zero.py deleted file mode 100644 index 1e1757bb..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_zero.py +++ /dev/null @@ -1,67 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .create_payments_request_zero_plan import CreatePaymentsRequestZeroPlan - - -class CreatePaymentsRequestZero(UniversalBaseModel): - """ - Autogenerated input type of CreatePayment - """ - - capture: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to capture the card payment immediately. Pass false to place an authorization hold that must be captured in full within five days. - """ - - company_id: str = pydantic.Field() - """ - The ID of the company to create the payment for. - """ - - confirmation_token: str = pydantic.Field() - """ - A confirmation token ID (ctok_) describing a payment method the buyer just supplied. Provide this INSTEAD of member_id and payment_method_id to charge a method that is not yet on file — the buyer is resolved from the token's billing email, or from `email`. The buyer may still have a step to complete (3DS, a redirect, linking a bank); poll the payment's status endpoint for what to do next. - """ - - email: typing.Optional[str] = pydantic.Field(default=None) - """ - Overrides the buyer email carried on the confirmation token, resolving or creating the Whop user the payment belongs to. Ignored when the confirmation token was created by a signed-in buyer, and unless confirmation_token is provided. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - Custom metadata to attach to the payment. - """ - - payment_method_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the payment method to use for the payment. It must be connected to the Member being charged. Required unless confirmation_token is provided. - """ - - plan: CreatePaymentsRequestZeroPlan = pydantic.Field() - """ - Pass this object to create a new plan for this payment - """ - - promo_code_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of an active promo code to apply to this payment. The promo code must belong to the company and be valid for the plan being purchased. The plan must be attached to a product — promo codes are not eligible for one-off purchases. - """ - - return_url: typing.Optional[str] = pydantic.Field(default=None) - """ - Where the buyer continues after completing an off-site step. Must be an absolute https URL without credentials (http is allowed for localhost), at most 2,048 characters. Editable until they return — see the payment's update endpoint. Ignored unless confirmation_token is provided. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_zero_plan.py b/src/whop_sdk/payments/types/create_payments_request_zero_plan.py deleted file mode 100644 index b654b674..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_zero_plan.py +++ /dev/null @@ -1,100 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.currencies import Currencies -from ...types.plan_types import PlanTypes -from ...types.visibility import Visibility -from .create_payments_request_zero_plan_product import CreatePaymentsRequestZeroPlanProduct - - -class CreatePaymentsRequestZeroPlan(UniversalBaseModel): - """ - Pass this object to create a new plan for this payment - """ - - application_fee_amount: typing.Optional[float] = pydantic.Field(default=None) - """ - The application fee amount collected by the platform from this connected account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less than the total payment amount. Only valid for connected accounts with a parent company. - """ - - billing_period: typing.Optional[int] = pydantic.Field(default=None) - """ - The interval in days at which the plan charges (renewal plans). For example, 30 for monthly billing. - """ - - currency: Currencies = pydantic.Field() - """ - The respective currency identifier for the plan. - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - The description of the plan. - """ - - expiration_days: typing.Optional[int] = pydantic.Field(default=None) - """ - The number of days until the membership expires and revokes access (expiration plans). For example, 365 for one year. - """ - - force_create_new_plan: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether to force the creation of a new plan even if one with the same attributes already exists. - """ - - initial_price: typing.Optional[float] = pydantic.Field(default=None) - """ - An additional amount charged upon first purchase. Provided as a number in the specified currency. Eg: 10.43 for $10.43 USD. - """ - - internal_notes: typing.Optional[str] = pydantic.Field(default=None) - """ - A personal description or notes section for the business. - """ - - plan_type: typing.Optional[PlanTypes] = pydantic.Field(default=None) - """ - Indicates if the plan is a one time payment or recurring. - """ - - product: typing.Optional[CreatePaymentsRequestZeroPlanProduct] = pydantic.Field(default=None) - """ - Pass this object to create a new product for this plan. We will use the product external identifier to find or create an existing product. - """ - - product_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The product the plan is related to. Either this or product is required. - """ - - renewal_price: typing.Optional[float] = pydantic.Field(default=None) - """ - The amount the customer is charged every billing period. Provided as a number in the specified currency. Eg: 10.43 for $10.43 USD. - """ - - title: typing.Optional[str] = pydantic.Field(default=None) - """ - The title of the plan. This will be visible on the product page to customers. - """ - - trial_period_days: typing.Optional[int] = pydantic.Field(default=None) - """ - The number of free trial days added before a renewal plan. - """ - - visibility: typing.Optional[Visibility] = pydantic.Field(default=None) - """ - Shows or hides the plan from public/business view. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_request_zero_plan_product.py b/src/whop_sdk/payments/types/create_payments_request_zero_plan_product.py deleted file mode 100644 index 4adce2a4..00000000 --- a/src/whop_sdk/payments/types/create_payments_request_zero_plan_product.py +++ /dev/null @@ -1,83 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.global_affiliate_statuses import GlobalAffiliateStatuses -from ...types.visibility import Visibility - - -class CreatePaymentsRequestZeroPlanProduct(UniversalBaseModel): - """ - Pass this object to create a new product for this plan. We will use the product external identifier to find or create an existing product. - """ - - collect_shipping_address: typing.Optional[bool] = pydantic.Field(default=None) - """ - Whether or not to collect shipping information at checkout from the customer. - """ - - custom_statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) - """ - The custom statement descriptor for the product i.e. WHOP*SPORTS, must be between 5 and 22 characters, contain at least one letter, and not contain any of the following characters: <, >, \\, ', " - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - A written description of the product. - """ - - external_identifier: str = pydantic.Field() - """ - A unique ID used to find or create a product. When provided during creation, we will look for an existing product with this external identifier — if found, it will be updated; otherwise, a new product will be created. - """ - - global_affiliate_percentage: typing.Optional[float] = pydantic.Field(default=None) - """ - The percentage of the revenue that goes to the global affiliate program. - """ - - global_affiliate_status: typing.Optional[GlobalAffiliateStatuses] = pydantic.Field(default=None) - """ - The status of the global affiliate program for this product. - """ - - headline: typing.Optional[str] = pydantic.Field(default=None) - """ - The headline of the product. - """ - - product_tax_code_id: typing.Optional[str] = pydantic.Field(default=None) - """ - The ID of the product tax code to apply to this product. - """ - - redirect_purchase_url: typing.Optional[str] = pydantic.Field(default=None) - """ - The URL to redirect the customer to after a purchase. - """ - - route: typing.Optional[str] = pydantic.Field(default=None) - """ - The route of the product. - """ - - title: str = pydantic.Field() - """ - The title of the product. - """ - - visibility: typing.Optional[Visibility] = pydantic.Field(default=None) - """ - This product will/will not be displayed publicly - default hidden. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/create_payments_response.py b/src/whop_sdk/payments/types/create_payments_response.py deleted file mode 100644 index 08fd6b59..00000000 --- a/src/whop_sdk/payments/types/create_payments_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...types.payment import Payment - - -class CreatePaymentsResponse(Payment): - client_secret: typing.Optional[str] = pydantic.Field(default=None) - """ - The credential the buyer's surface presents to poll this payment and set its return URL. Returned when a payment created from a confirmation token is created or retrieved by a caller with the payment:charge permission. Null for payments created from a stored payment method or callers without payment:charge. It unlocks this payment and nothing else; treat it like a password for that one attempt. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payments/types/list_fees_payments_response.py b/src/whop_sdk/payments/types/list_fees_payments_response.py index ee8d45d1..2b3af56a 100644 --- a/src/whop_sdk/payments/types/list_fees_payments_response.py +++ b/src/whop_sdk/payments/types/list_fees_payments_response.py @@ -4,24 +4,13 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.page_info import PageInfo -from .list_fees_payments_response_data_item import ListFeesPaymentsResponseDataItem +from ...types.payment_fee import PaymentFee +from .list_fees_payments_response_page_info import ListFeesPaymentsResponsePageInfo class ListFeesPaymentsResponse(UniversalBaseModel): - """ - The connection type for Fee. - """ - - data: typing.List[ListFeesPaymentsResponseDataItem] = pydantic.Field() - """ - A list of nodes. - """ - - page_info: PageInfo = pydantic.Field() - """ - Information to aid in pagination. - """ + data: typing.List[PaymentFee] + page_info: ListFeesPaymentsResponsePageInfo if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/payments/types/list_fees_payments_response_data_item.py b/src/whop_sdk/payments/types/list_fees_payments_response_data_item.py deleted file mode 100644 index c85d799a..00000000 --- a/src/whop_sdk/payments/types/list_fees_payments_response_data_item.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.currencies import Currencies -from ...types.specific_fee_origins import SpecificFeeOrigins - - -class ListFeesPaymentsResponseDataItem(UniversalBaseModel): - """ - Represents a fee related to a payment - """ - - amount: float = pydantic.Field() - """ - The value or amount to display for the fee. - """ - - currency: Currencies = pydantic.Field() - """ - The currency of the fee. - """ - - name: str = pydantic.Field() - """ - The label to display for the fee. - """ - - type: SpecificFeeOrigins = pydantic.Field() - """ - The specific origin of the fee, if applicable. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/companies/types/update_companies_request_social_links_item_image.py b/src/whop_sdk/payments/types/list_fees_payments_response_page_info.py similarity index 68% rename from src/whop_sdk/companies/types/update_companies_request_social_links_item_image.py rename to src/whop_sdk/payments/types/list_fees_payments_response_page_info.py index 2fed8a96..44f911e4 100644 --- a/src/whop_sdk/companies/types/update_companies_request_social_links_item_image.py +++ b/src/whop_sdk/payments/types/list_fees_payments_response_page_info.py @@ -6,15 +6,11 @@ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class UpdateCompaniesRequestSocialLinksItemImage(UniversalBaseModel): - """ - The custom image for the social link - """ - - id: str = pydantic.Field() - """ - The ID of an existing file object. - """ +class ListFeesPaymentsResponsePageInfo(UniversalBaseModel): + end_cursor: typing.Optional[str] = None + has_next_page: bool + has_previous_page: bool + start_cursor: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/payments/types/list_payments_request_billing_reason.py b/src/whop_sdk/payments/types/list_payments_request_billing_reason.py new file mode 100644 index 00000000..e484c116 --- /dev/null +++ b/src/whop_sdk/payments/types/list_payments_request_billing_reason.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListPaymentsRequestBillingReason = typing.Union[ + typing.Literal[ + "subscription_create", "subscription_cycle", "subscription_update", "one_time", "manual", "subscription" + ], + typing.Any, +] diff --git a/src/whop_sdk/payments/types/list_payments_request_direction.py b/src/whop_sdk/payments/types/list_payments_request_direction.py new file mode 100644 index 00000000..2f162be0 --- /dev/null +++ b/src/whop_sdk/payments/types/list_payments_request_direction.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListPaymentsRequestDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] diff --git a/src/whop_sdk/payments/types/list_payments_request_order.py b/src/whop_sdk/payments/types/list_payments_request_order.py new file mode 100644 index 00000000..6a18c8a6 --- /dev/null +++ b/src/whop_sdk/payments/types/list_payments_request_order.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListPaymentsRequestOrder = typing.Union[typing.Literal["created_at", "paid_at"], typing.Any] diff --git a/src/whop_sdk/payments/types/list_payments_request_status.py b/src/whop_sdk/payments/types/list_payments_request_status.py new file mode 100644 index 00000000..3d2f95e0 --- /dev/null +++ b/src/whop_sdk/payments/types/list_payments_request_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListPaymentsRequestStatus = typing.Union[ + typing.Literal["open", "authorized", "paid", "pending", "uncollectible", "unresolved", "void"], typing.Any +] diff --git a/src/whop_sdk/payments/types/list_payments_response.py b/src/whop_sdk/payments/types/list_payments_response.py index 861eb598..ecfbb698 100644 --- a/src/whop_sdk/payments/types/list_payments_response.py +++ b/src/whop_sdk/payments/types/list_payments_response.py @@ -4,24 +4,13 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.page_info import PageInfo -from ...types.payment_list_item import PaymentListItem +from ...types.payment import Payment +from .list_payments_response_page_info import ListPaymentsResponsePageInfo class ListPaymentsResponse(UniversalBaseModel): - """ - The connection type for Receipt. - """ - - data: typing.List[PaymentListItem] = pydantic.Field() - """ - A list of nodes. - """ - - page_info: PageInfo = pydantic.Field() - """ - Information to aid in pagination. - """ + data: typing.List[Payment] + page_info: ListPaymentsResponsePageInfo if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/companies/types/update_companies_request_logo.py b/src/whop_sdk/payments/types/list_payments_response_page_info.py similarity index 67% rename from src/whop_sdk/companies/types/update_companies_request_logo.py rename to src/whop_sdk/payments/types/list_payments_response_page_info.py index bd1f27e2..854c3486 100644 --- a/src/whop_sdk/companies/types/update_companies_request_logo.py +++ b/src/whop_sdk/payments/types/list_payments_response_page_info.py @@ -6,15 +6,11 @@ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class UpdateCompaniesRequestLogo(UniversalBaseModel): - """ - The company's logo image. Accepts PNG, JPEG, or GIF format. - """ - - id: str = pydantic.Field() - """ - The ID of an existing file object. - """ +class ListPaymentsResponsePageInfo(UniversalBaseModel): + end_cursor: typing.Optional[str] = None + has_next_page: bool + has_previous_page: bool + start_cursor: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/payments/types/post_payment_authorized_payload.py b/src/whop_sdk/payments/types/post_payment_authorized_payload.py index 2fb0046e..bcd37506 100644 --- a/src/whop_sdk/payments/types/post_payment_authorized_payload.py +++ b/src/whop_sdk/payments/types/post_payment_authorized_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.payment import Payment +from ...types.payment_legacy import PaymentLegacy from .post_payment_authorized_payload_api_version import PostPaymentAuthorizedPayloadApiVersion from .post_payment_authorized_payload_type import PostPaymentAuthorizedPayloadType @@ -26,7 +26,7 @@ class PostPaymentAuthorizedPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Payment + data: PaymentLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/payments/types/post_payment_canceled_payload.py b/src/whop_sdk/payments/types/post_payment_canceled_payload.py index 6292d14c..522b65f5 100644 --- a/src/whop_sdk/payments/types/post_payment_canceled_payload.py +++ b/src/whop_sdk/payments/types/post_payment_canceled_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.payment import Payment +from ...types.payment_legacy import PaymentLegacy from .post_payment_canceled_payload_api_version import PostPaymentCanceledPayloadApiVersion from .post_payment_canceled_payload_type import PostPaymentCanceledPayloadType @@ -26,7 +26,7 @@ class PostPaymentCanceledPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Payment + data: PaymentLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/payments/types/post_payment_created_payload.py b/src/whop_sdk/payments/types/post_payment_created_payload.py index 5ce2987c..8d3cbdd1 100644 --- a/src/whop_sdk/payments/types/post_payment_created_payload.py +++ b/src/whop_sdk/payments/types/post_payment_created_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.payment import Payment +from ...types.payment_legacy import PaymentLegacy from .post_payment_created_payload_api_version import PostPaymentCreatedPayloadApiVersion from .post_payment_created_payload_type import PostPaymentCreatedPayloadType @@ -26,7 +26,7 @@ class PostPaymentCreatedPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Payment + data: PaymentLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/payments/types/post_payment_failed_payload.py b/src/whop_sdk/payments/types/post_payment_failed_payload.py index ce937aa8..e00aa020 100644 --- a/src/whop_sdk/payments/types/post_payment_failed_payload.py +++ b/src/whop_sdk/payments/types/post_payment_failed_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.payment import Payment +from ...types.payment_legacy import PaymentLegacy from .post_payment_failed_payload_api_version import PostPaymentFailedPayloadApiVersion from .post_payment_failed_payload_type import PostPaymentFailedPayloadType @@ -26,7 +26,7 @@ class PostPaymentFailedPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Payment + data: PaymentLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/payments/types/post_payment_pending_payload.py b/src/whop_sdk/payments/types/post_payment_pending_payload.py index 323f3146..d53b73d6 100644 --- a/src/whop_sdk/payments/types/post_payment_pending_payload.py +++ b/src/whop_sdk/payments/types/post_payment_pending_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.payment import Payment +from ...types.payment_legacy import PaymentLegacy from .post_payment_pending_payload_api_version import PostPaymentPendingPayloadApiVersion from .post_payment_pending_payload_type import PostPaymentPendingPayloadType @@ -26,7 +26,7 @@ class PostPaymentPendingPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Payment + data: PaymentLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/payments/types/post_payment_succeeded_payload.py b/src/whop_sdk/payments/types/post_payment_succeeded_payload.py index b8cd02ca..dc9fe87c 100644 --- a/src/whop_sdk/payments/types/post_payment_succeeded_payload.py +++ b/src/whop_sdk/payments/types/post_payment_succeeded_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.payment import Payment +from ...types.payment_legacy import PaymentLegacy from .post_payment_succeeded_payload_api_version import PostPaymentSucceededPayloadApiVersion from .post_payment_succeeded_payload_type import PostPaymentSucceededPayloadType @@ -26,7 +26,7 @@ class PostPaymentSucceededPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Payment + data: PaymentLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/payments/types/retrieve_payments_response.py b/src/whop_sdk/payments/types/retrieve_payments_response.py deleted file mode 100644 index 031bddf2..00000000 --- a/src/whop_sdk/payments/types/retrieve_payments_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from ...types.payment import Payment - - -class RetrievePaymentsResponse(Payment): - client_secret: typing.Optional[str] = pydantic.Field(default=None) - """ - The credential the buyer's surface presents to poll this payment and set its return URL. Returned when a payment created from a confirmation token is created or retrieved by a caller with the payment:charge permission. Null for payments created from a stored payment method or callers without payment:charge. It unlocks this payment and nothing else; treat it like a password for that one attempt. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/payout_accounts/client.py b/src/whop_sdk/payout_accounts/client.py index 93564ffc..c00a3327 100644 --- a/src/whop_sdk/payout_accounts/client.py +++ b/src/whop_sdk/payout_accounts/client.py @@ -48,7 +48,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -102,7 +102,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payout_methods/client.py b/src/whop_sdk/payout_methods/client.py index 212aef69..0fe73649 100644 --- a/src/whop_sdk/payout_methods/client.py +++ b/src/whop_sdk/payout_methods/client.py @@ -72,7 +72,7 @@ def list_payout_method( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -118,7 +118,7 @@ def retrieve_payout_method( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -193,7 +193,7 @@ async def list_payout_method( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -248,7 +248,7 @@ async def retrieve_payout_method( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payouts/__init__.py b/src/whop_sdk/payouts/__init__.py index ee808e9c..4751b05c 100644 --- a/src/whop_sdk/payouts/__init__.py +++ b/src/whop_sdk/payouts/__init__.py @@ -17,8 +17,7 @@ CancelPayoutsResponseSource, CancelPayoutsResponseSpeed, CancelPayoutsResponseStatus, - CreatePayoutsRequestBody, - CreatePayoutsRequestBodySpeed, + CreatePayoutsRequestSpeed, CreatePayoutsResponse, CreatePayoutsResponseFailure, CreatePayoutsResponseFeePaidBy, @@ -68,6 +67,7 @@ PostPayoutMethodCreatedPayloadDataObject, PostPayoutMethodCreatedPayloadDataQuote, PostPayoutMethodCreatedPayloadDataQuoteInstant, + PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason, PostPayoutMethodCreatedPayloadDataQuoteStandard, PostPayoutMethodCreatedPayloadDataStatus, PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod, @@ -130,6 +130,7 @@ ListMethodsResponseDataItemObject, ListMethodsResponseDataItemQuote, ListMethodsResponseDataItemQuoteInstant, + ListMethodsResponseDataItemQuoteInstantUnavailableReason, ListMethodsResponseDataItemQuoteStandard, ListMethodsResponseDataItemStatus, ListMethodsResponseDataItemSupportedPayoutMethod, @@ -140,6 +141,7 @@ ListMethodsResponseLimitsInstantErrorCode, ListMethodsResponseLimitsObject, ListMethodsResponseLimitsStandard, + ListMethodsResponseLimitsStandardErrorCode, ListMethodsResponsePageInfo, UpdateMethodsResponse, UpdateMethodsResponseBankVerificationState, @@ -179,8 +181,7 @@ "CreateMethodsResponseSupportedPayoutMethod": ".methods", "CreateMethodsResponseSupportedPayoutMethodDeliveryType": ".methods", "CreateMethodsResponseUnavailableReason": ".methods", - "CreatePayoutsRequestBody": ".types", - "CreatePayoutsRequestBodySpeed": ".types", + "CreatePayoutsRequestSpeed": ".types", "CreatePayoutsResponse": ".types", "CreatePayoutsResponseFailure": ".types", "CreatePayoutsResponseFeePaidBy": ".types", @@ -204,6 +205,7 @@ "ListMethodsResponseDataItemObject": ".methods", "ListMethodsResponseDataItemQuote": ".methods", "ListMethodsResponseDataItemQuoteInstant": ".methods", + "ListMethodsResponseDataItemQuoteInstantUnavailableReason": ".methods", "ListMethodsResponseDataItemQuoteStandard": ".methods", "ListMethodsResponseDataItemStatus": ".methods", "ListMethodsResponseDataItemSupportedPayoutMethod": ".methods", @@ -214,6 +216,7 @@ "ListMethodsResponseLimitsInstantErrorCode": ".methods", "ListMethodsResponseLimitsObject": ".methods", "ListMethodsResponseLimitsStandard": ".methods", + "ListMethodsResponseLimitsStandardErrorCode": ".methods", "ListMethodsResponsePageInfo": ".methods", "ListPayoutsRequestSource": ".types", "ListPayoutsRequestStatus": ".types", @@ -261,6 +264,7 @@ "PostPayoutMethodCreatedPayloadDataObject": ".types", "PostPayoutMethodCreatedPayloadDataQuote": ".types", "PostPayoutMethodCreatedPayloadDataQuoteInstant": ".types", + "PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason": ".types", "PostPayoutMethodCreatedPayloadDataQuoteStandard": ".types", "PostPayoutMethodCreatedPayloadDataStatus": ".types", "PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod": ".types", @@ -354,8 +358,7 @@ def __dir__(): "CreateMethodsResponseSupportedPayoutMethod", "CreateMethodsResponseSupportedPayoutMethodDeliveryType", "CreateMethodsResponseUnavailableReason", - "CreatePayoutsRequestBody", - "CreatePayoutsRequestBodySpeed", + "CreatePayoutsRequestSpeed", "CreatePayoutsResponse", "CreatePayoutsResponseFailure", "CreatePayoutsResponseFeePaidBy", @@ -379,6 +382,7 @@ def __dir__(): "ListMethodsResponseDataItemObject", "ListMethodsResponseDataItemQuote", "ListMethodsResponseDataItemQuoteInstant", + "ListMethodsResponseDataItemQuoteInstantUnavailableReason", "ListMethodsResponseDataItemQuoteStandard", "ListMethodsResponseDataItemStatus", "ListMethodsResponseDataItemSupportedPayoutMethod", @@ -389,6 +393,7 @@ def __dir__(): "ListMethodsResponseLimitsInstantErrorCode", "ListMethodsResponseLimitsObject", "ListMethodsResponseLimitsStandard", + "ListMethodsResponseLimitsStandardErrorCode", "ListMethodsResponsePageInfo", "ListPayoutsRequestSource", "ListPayoutsRequestStatus", @@ -436,6 +441,7 @@ def __dir__(): "PostPayoutMethodCreatedPayloadDataObject", "PostPayoutMethodCreatedPayloadDataQuote", "PostPayoutMethodCreatedPayloadDataQuoteInstant", + "PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason", "PostPayoutMethodCreatedPayloadDataQuoteStandard", "PostPayoutMethodCreatedPayloadDataStatus", "PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod", diff --git a/src/whop_sdk/payouts/client.py b/src/whop_sdk/payouts/client.py index 7d7890df..b7158d0b 100644 --- a/src/whop_sdk/payouts/client.py +++ b/src/whop_sdk/payouts/client.py @@ -10,7 +10,7 @@ from ..core.request_options import RequestOptions from .raw_client import AsyncRawPayoutsClient, RawPayoutsClient from .types.cancel_payouts_response import CancelPayoutsResponse -from .types.create_payouts_request_body import CreatePayoutsRequestBody +from .types.create_payouts_request_speed import CreatePayoutsRequestSpeed from .types.create_payouts_response import CreatePayoutsResponse from .types.create_quote_payouts_request_speed import CreateQuotePayoutsRequestSpeed from .types.create_quote_payouts_response import CreateQuotePayoutsResponse @@ -116,7 +116,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -144,14 +144,62 @@ def list( ) def create( - self, *, request: CreatePayoutsRequestBody, request_options: typing.Optional[RequestOptions] = None + self, + *, + amount: float, + payout_method_id: str, + account_id: typing.Optional[str] = OMIT, + acknowledge_bank_warning: typing.Optional[bool] = OMIT, + currency: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, str]] = OMIT, + notes: typing.Optional[str] = OMIT, + platform_covers_fees: typing.Optional[bool] = OMIT, + quote_token: typing.Optional[str] = OMIT, + speed: typing.Optional[CreatePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, + user_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> CreatePayoutsResponse: """ Sends money from an account or user balance to a saved payout method for that owner. Parameters ---------- - request : CreatePayoutsRequestBody + amount : float + The amount to pay out in the specified currency. + + payout_method_id : str + The saved payout method to deliver to (a potk_ identifier). + + account_id : typing.Optional[str] + Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. + + acknowledge_bank_warning : typing.Optional[bool] + Set to `true` to continue when the destination bank could not confirm the payout method account holder's name, or `false` to have the payout refused in that case so the account holder can correct the name or link their bank first. Omitting the field skips the warning gate — a client that cannot show the warning keeps its pre-gate behavior. + + currency : typing.Optional[str] + The currency to pay out. Balances are held per currency and the payout draws only from the balance in this currency, so match the currency the funds arrived in — for example `cad` for an account funded by CAD transfers. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. + + metadata : typing.Optional[typing.Dict[str, str]] + Key-value data to attach to the payout, echoed on every read and in webhook payloads. At most 50 keys, key names up to 40 characters, string values up to 500 characters. Never store secrets or regulated personal data here — webhook bodies are retained for delivery inspection. + + notes : typing.Optional[str] + Free-form notes to attach to the payout, with a maximum of 255 characters. Omit or pass `null` for no notes. + + platform_covers_fees : typing.Optional[bool] + Whether the parent platform covers the payout fee instead of the account being paid out. Omit to use the platform's configured fee coverage policy; pass `false` to opt out of it. `true` is only accepted for accounts that belong to a platform, and requires the platform's policy to cover this payout method's category or a caller authorized to manage the platform's child account fees. + + quote_token : typing.Optional[str] + The server-signed quote_token returned by POST /payouts/quotes. Required when the ledger account's payout_quote_required is true; a payout without it is refused with the invalid_payout_quote error type. When provided, Whop will not commit a provider payout below the destination amount the quote showed. + + speed : typing.Optional[CreatePayoutsRequestSpeed] + How fast the funds should arrive. `instant` is only accepted when the account and payout method are eligible; otherwise the payout is rejected. + + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Without a `quote_token`, omit or pass `null` to use the default descriptor. With a `quote_token`, set this value when creating the quote; the payout request may omit it but cannot add or change it. + + user_id : typing.Optional[str] + User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -166,15 +214,30 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.payouts.create( - request={"key": "value"}, + amount=50.0, + payout_method_id="potk_xxxxxxxxxxxxxx", ) """ - _response = self._raw_client.create(request=request, request_options=request_options) + _response = self._raw_client.create( + amount=amount, + payout_method_id=payout_method_id, + account_id=account_id, + acknowledge_bank_warning=acknowledge_bank_warning, + currency=currency, + metadata=metadata, + notes=notes, + platform_covers_fees=platform_covers_fees, + quote_token=quote_token, + speed=speed, + statement_descriptor=statement_descriptor, + user_id=user_id, + request_options=request_options, + ) return _response.data def create_quote( @@ -186,6 +249,7 @@ def create_quote( currency: typing.Optional[str] = OMIT, platform_covers_fees: typing.Optional[bool] = OMIT, speed: typing.Optional[CreateQuotePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, user_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateQuotePayoutsResponse: @@ -204,7 +268,7 @@ def create_quote( Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. currency : typing.Optional[str] - The balance currency to pay out. + The currency to pay out. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. platform_covers_fees : typing.Optional[bool] Whether the parent platform covers the payout fee instead of the account being paid out. @@ -212,6 +276,9 @@ def create_quote( speed : typing.Optional[CreateQuotePayoutsRequestSpeed] How fast the funds should arrive. + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Omit or pass `null` to use the default descriptor. + user_id : typing.Optional[str] User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. @@ -228,7 +295,7 @@ def create_quote( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -244,6 +311,7 @@ def create_quote( currency=currency, platform_covers_fees=platform_covers_fees, speed=speed, + statement_descriptor=statement_descriptor, user_id=user_id, request_options=request_options, ) @@ -284,7 +352,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -332,7 +400,7 @@ def cancel( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -451,7 +519,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -486,14 +554,62 @@ async def main() -> None: ) async def create( - self, *, request: CreatePayoutsRequestBody, request_options: typing.Optional[RequestOptions] = None + self, + *, + amount: float, + payout_method_id: str, + account_id: typing.Optional[str] = OMIT, + acknowledge_bank_warning: typing.Optional[bool] = OMIT, + currency: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, str]] = OMIT, + notes: typing.Optional[str] = OMIT, + platform_covers_fees: typing.Optional[bool] = OMIT, + quote_token: typing.Optional[str] = OMIT, + speed: typing.Optional[CreatePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, + user_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> CreatePayoutsResponse: """ Sends money from an account or user balance to a saved payout method for that owner. Parameters ---------- - request : CreatePayoutsRequestBody + amount : float + The amount to pay out in the specified currency. + + payout_method_id : str + The saved payout method to deliver to (a potk_ identifier). + + account_id : typing.Optional[str] + Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. + + acknowledge_bank_warning : typing.Optional[bool] + Set to `true` to continue when the destination bank could not confirm the payout method account holder's name, or `false` to have the payout refused in that case so the account holder can correct the name or link their bank first. Omitting the field skips the warning gate — a client that cannot show the warning keeps its pre-gate behavior. + + currency : typing.Optional[str] + The currency to pay out. Balances are held per currency and the payout draws only from the balance in this currency, so match the currency the funds arrived in — for example `cad` for an account funded by CAD transfers. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. + + metadata : typing.Optional[typing.Dict[str, str]] + Key-value data to attach to the payout, echoed on every read and in webhook payloads. At most 50 keys, key names up to 40 characters, string values up to 500 characters. Never store secrets or regulated personal data here — webhook bodies are retained for delivery inspection. + + notes : typing.Optional[str] + Free-form notes to attach to the payout, with a maximum of 255 characters. Omit or pass `null` for no notes. + + platform_covers_fees : typing.Optional[bool] + Whether the parent platform covers the payout fee instead of the account being paid out. Omit to use the platform's configured fee coverage policy; pass `false` to opt out of it. `true` is only accepted for accounts that belong to a platform, and requires the platform's policy to cover this payout method's category or a caller authorized to manage the platform's child account fees. + + quote_token : typing.Optional[str] + The server-signed quote_token returned by POST /payouts/quotes. Required when the ledger account's payout_quote_required is true; a payout without it is refused with the invalid_payout_quote error type. When provided, Whop will not commit a provider payout below the destination amount the quote showed. + + speed : typing.Optional[CreatePayoutsRequestSpeed] + How fast the funds should arrive. `instant` is only accepted when the account and payout method are eligible; otherwise the payout is rejected. + + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Without a `quote_token`, omit or pass `null` to use the default descriptor. With a `quote_token`, set this value when creating the quote; the payout request may omit it but cannot add or change it. + + user_id : typing.Optional[str] + User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -510,7 +626,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -518,13 +634,28 @@ async def create( async def main() -> None: await client.payouts.create( - request={"key": "value"}, + amount=50.0, + payout_method_id="potk_xxxxxxxxxxxxxx", ) asyncio.run(main()) """ - _response = await self._raw_client.create(request=request, request_options=request_options) + _response = await self._raw_client.create( + amount=amount, + payout_method_id=payout_method_id, + account_id=account_id, + acknowledge_bank_warning=acknowledge_bank_warning, + currency=currency, + metadata=metadata, + notes=notes, + platform_covers_fees=platform_covers_fees, + quote_token=quote_token, + speed=speed, + statement_descriptor=statement_descriptor, + user_id=user_id, + request_options=request_options, + ) return _response.data async def create_quote( @@ -536,6 +667,7 @@ async def create_quote( currency: typing.Optional[str] = OMIT, platform_covers_fees: typing.Optional[bool] = OMIT, speed: typing.Optional[CreateQuotePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, user_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateQuotePayoutsResponse: @@ -554,7 +686,7 @@ async def create_quote( Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. currency : typing.Optional[str] - The balance currency to pay out. + The currency to pay out. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. platform_covers_fees : typing.Optional[bool] Whether the parent platform covers the payout fee instead of the account being paid out. @@ -562,6 +694,9 @@ async def create_quote( speed : typing.Optional[CreateQuotePayoutsRequestSpeed] How fast the funds should arrive. + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Omit or pass `null` to use the default descriptor. + user_id : typing.Optional[str] User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. @@ -580,7 +715,7 @@ async def create_quote( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -602,6 +737,7 @@ async def main() -> None: currency=currency, platform_covers_fees=platform_covers_fees, speed=speed, + statement_descriptor=statement_descriptor, user_id=user_id, request_options=request_options, ) @@ -644,7 +780,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -700,7 +836,7 @@ async def cancel( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payouts/methods/__init__.py b/src/whop_sdk/payouts/methods/__init__.py index 0658a03c..2fc48f74 100644 --- a/src/whop_sdk/payouts/methods/__init__.py +++ b/src/whop_sdk/payouts/methods/__init__.py @@ -24,6 +24,7 @@ ListMethodsResponseDataItemObject, ListMethodsResponseDataItemQuote, ListMethodsResponseDataItemQuoteInstant, + ListMethodsResponseDataItemQuoteInstantUnavailableReason, ListMethodsResponseDataItemQuoteStandard, ListMethodsResponseDataItemStatus, ListMethodsResponseDataItemSupportedPayoutMethod, @@ -34,6 +35,7 @@ ListMethodsResponseLimitsInstantErrorCode, ListMethodsResponseLimitsObject, ListMethodsResponseLimitsStandard, + ListMethodsResponseLimitsStandardErrorCode, ListMethodsResponsePageInfo, UpdateMethodsResponse, UpdateMethodsResponseBankVerificationState, @@ -61,6 +63,7 @@ "ListMethodsResponseDataItemObject": ".types", "ListMethodsResponseDataItemQuote": ".types", "ListMethodsResponseDataItemQuoteInstant": ".types", + "ListMethodsResponseDataItemQuoteInstantUnavailableReason": ".types", "ListMethodsResponseDataItemQuoteStandard": ".types", "ListMethodsResponseDataItemStatus": ".types", "ListMethodsResponseDataItemSupportedPayoutMethod": ".types", @@ -71,6 +74,7 @@ "ListMethodsResponseLimitsInstantErrorCode": ".types", "ListMethodsResponseLimitsObject": ".types", "ListMethodsResponseLimitsStandard": ".types", + "ListMethodsResponseLimitsStandardErrorCode": ".types", "ListMethodsResponsePageInfo": ".types", "UpdateMethodsResponse": ".types", "UpdateMethodsResponseBankVerificationState": ".types", @@ -121,6 +125,7 @@ def __dir__(): "ListMethodsResponseDataItemObject", "ListMethodsResponseDataItemQuote", "ListMethodsResponseDataItemQuoteInstant", + "ListMethodsResponseDataItemQuoteInstantUnavailableReason", "ListMethodsResponseDataItemQuoteStandard", "ListMethodsResponseDataItemStatus", "ListMethodsResponseDataItemSupportedPayoutMethod", @@ -131,6 +136,7 @@ def __dir__(): "ListMethodsResponseLimitsInstantErrorCode", "ListMethodsResponseLimitsObject", "ListMethodsResponseLimitsStandard", + "ListMethodsResponseLimitsStandardErrorCode", "ListMethodsResponsePageInfo", "UpdateMethodsResponse", "UpdateMethodsResponseBankVerificationState", diff --git a/src/whop_sdk/payouts/methods/client.py b/src/whop_sdk/payouts/methods/client.py index e7af187e..be6c1fd9 100644 --- a/src/whop_sdk/payouts/methods/client.py +++ b/src/whop_sdk/payouts/methods/client.py @@ -95,7 +95,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -171,7 +171,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -213,7 +213,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -259,7 +259,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -353,7 +353,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -438,7 +438,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -490,7 +490,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -544,7 +544,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payouts/methods/types/__init__.py b/src/whop_sdk/payouts/methods/types/__init__.py index 8241d851..6b16e311 100644 --- a/src/whop_sdk/payouts/methods/types/__init__.py +++ b/src/whop_sdk/payouts/methods/types/__init__.py @@ -27,6 +27,9 @@ from .list_methods_response_data_item_object import ListMethodsResponseDataItemObject from .list_methods_response_data_item_quote import ListMethodsResponseDataItemQuote from .list_methods_response_data_item_quote_instant import ListMethodsResponseDataItemQuoteInstant + from .list_methods_response_data_item_quote_instant_unavailable_reason import ( + ListMethodsResponseDataItemQuoteInstantUnavailableReason, + ) from .list_methods_response_data_item_quote_standard import ListMethodsResponseDataItemQuoteStandard from .list_methods_response_data_item_status import ListMethodsResponseDataItemStatus from .list_methods_response_data_item_supported_payout_method import ( @@ -41,6 +44,7 @@ from .list_methods_response_limits_instant_error_code import ListMethodsResponseLimitsInstantErrorCode from .list_methods_response_limits_object import ListMethodsResponseLimitsObject from .list_methods_response_limits_standard import ListMethodsResponseLimitsStandard + from .list_methods_response_limits_standard_error_code import ListMethodsResponseLimitsStandardErrorCode from .list_methods_response_page_info import ListMethodsResponsePageInfo from .update_methods_response import UpdateMethodsResponse from .update_methods_response_bank_verification_state import UpdateMethodsResponseBankVerificationState @@ -69,6 +73,7 @@ "ListMethodsResponseDataItemObject": ".list_methods_response_data_item_object", "ListMethodsResponseDataItemQuote": ".list_methods_response_data_item_quote", "ListMethodsResponseDataItemQuoteInstant": ".list_methods_response_data_item_quote_instant", + "ListMethodsResponseDataItemQuoteInstantUnavailableReason": ".list_methods_response_data_item_quote_instant_unavailable_reason", "ListMethodsResponseDataItemQuoteStandard": ".list_methods_response_data_item_quote_standard", "ListMethodsResponseDataItemStatus": ".list_methods_response_data_item_status", "ListMethodsResponseDataItemSupportedPayoutMethod": ".list_methods_response_data_item_supported_payout_method", @@ -79,6 +84,7 @@ "ListMethodsResponseLimitsInstantErrorCode": ".list_methods_response_limits_instant_error_code", "ListMethodsResponseLimitsObject": ".list_methods_response_limits_object", "ListMethodsResponseLimitsStandard": ".list_methods_response_limits_standard", + "ListMethodsResponseLimitsStandardErrorCode": ".list_methods_response_limits_standard_error_code", "ListMethodsResponsePageInfo": ".list_methods_response_page_info", "UpdateMethodsResponse": ".update_methods_response", "UpdateMethodsResponseBankVerificationState": ".update_methods_response_bank_verification_state", @@ -129,6 +135,7 @@ def __dir__(): "ListMethodsResponseDataItemObject", "ListMethodsResponseDataItemQuote", "ListMethodsResponseDataItemQuoteInstant", + "ListMethodsResponseDataItemQuoteInstantUnavailableReason", "ListMethodsResponseDataItemQuoteStandard", "ListMethodsResponseDataItemStatus", "ListMethodsResponseDataItemSupportedPayoutMethod", @@ -139,6 +146,7 @@ def __dir__(): "ListMethodsResponseLimitsInstantErrorCode", "ListMethodsResponseLimitsObject", "ListMethodsResponseLimitsStandard", + "ListMethodsResponseLimitsStandardErrorCode", "ListMethodsResponsePageInfo", "UpdateMethodsResponse", "UpdateMethodsResponseBankVerificationState", diff --git a/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote.py b/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote.py index 3a861993..9568d3ab 100644 --- a/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote.py +++ b/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote.py @@ -5,6 +5,9 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .list_methods_response_data_item_quote_instant import ListMethodsResponseDataItemQuoteInstant +from .list_methods_response_data_item_quote_instant_unavailable_reason import ( + ListMethodsResponseDataItemQuoteInstantUnavailableReason, +) from .list_methods_response_data_item_quote_standard import ListMethodsResponseDataItemQuoteStandard @@ -33,6 +36,13 @@ class ListMethodsResponseDataItemQuote(UniversalBaseModel): Instant-delivery estimate. Null if the method does not support instant delivery, instant delivery is unavailable for the account, or the amount does not cover the fee. """ + instant_unavailable_reason: typing.Optional[ListMethodsResponseDataItemQuoteInstantUnavailableReason] = ( + pydantic.Field(default=None) + ) + """ + Why instant delivery is unavailable for this method. `minimum_crypto_sales_not_met` means the account has not reached the total sales required for instant cryptocurrency payouts. `null` when this restriction does not apply. + """ + max_limit: typing.Optional[float] = pydantic.Field(default=None) """ Maximum payout amount for this method, in the payout currency. diff --git a/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote_instant_unavailable_reason.py b/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote_instant_unavailable_reason.py new file mode 100644 index 00000000..18c4dc0e --- /dev/null +++ b/src/whop_sdk/payouts/methods/types/list_methods_response_data_item_quote_instant_unavailable_reason.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListMethodsResponseDataItemQuoteInstantUnavailableReason = typing.Union[ + typing.Literal["minimum_crypto_sales_not_met"], typing.Any +] diff --git a/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard.py b/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard.py index f9a401fd..9259d30d 100644 --- a/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard.py +++ b/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard.py @@ -4,6 +4,7 @@ import pydantic from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .list_methods_response_limits_standard_error_code import ListMethodsResponseLimitsStandardErrorCode class ListMethodsResponseLimitsStandard(UniversalBaseModel): @@ -11,6 +12,16 @@ class ListMethodsResponseLimitsStandard(UniversalBaseModel): Caps for standard-speed payouts, which draw on settled funds only. """ + error_code: typing.Optional[ListMethodsResponseLimitsStandardErrorCode] = pydantic.Field(default=None) + """ + Why a standard payout cannot move funds right now, or null when the cap is above 0. + """ + + error_message: typing.Optional[str] = pydantic.Field(default=None) + """ + Human-readable form of error_code, or null when a standard payout can move funds. + """ + max_amount: float = pydantic.Field() """ The maximum amount a standard payout can move right now, in whole currency units. diff --git a/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard_error_code.py b/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard_error_code.py new file mode 100644 index 00000000..80d9621e --- /dev/null +++ b/src/whop_sdk/payouts/methods/types/list_methods_response_limits_standard_error_code.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListMethodsResponseLimitsStandardErrorCode = typing.Union[ + typing.Literal[ + "account_suspended", + "block_move_money_out_because_clawback", + "supportability_check_payout_status_hold", + "kyc_completed", + "rmi_clear", + "identity_rfi_clear", + "ecommerce_fulfillment_connected", + "block_move_money_out", + "block_move_money_out_set_by_parent", + "card_usage_review_payout_status_hold", + "no_available_balance", + ], + typing.Any, +] diff --git a/src/whop_sdk/payouts/raw_client.py b/src/whop_sdk/payouts/raw_client.py index 7859bc0a..50e30a4b 100644 --- a/src/whop_sdk/payouts/raw_client.py +++ b/src/whop_sdk/payouts/raw_client.py @@ -13,7 +13,6 @@ from ..core.parse_error import ParsingError from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata from ..errors.bad_request_error import BadRequestError from ..errors.conflict_error import ConflictError from ..errors.forbidden_error import ForbiddenError @@ -21,7 +20,7 @@ from ..errors.unauthorized_error import UnauthorizedError from ..types.v1error_response import V1ErrorResponse from .types.cancel_payouts_response import CancelPayoutsResponse -from .types.create_payouts_request_body import CreatePayoutsRequestBody +from .types.create_payouts_request_speed import CreatePayoutsRequestSpeed from .types.create_payouts_response import CreatePayoutsResponse from .types.create_quote_payouts_request_speed import CreateQuotePayoutsRequestSpeed from .types.create_quote_payouts_response import CreateQuotePayoutsResponse @@ -210,14 +209,62 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) def create( - self, *, request: CreatePayoutsRequestBody, request_options: typing.Optional[RequestOptions] = None + self, + *, + amount: float, + payout_method_id: str, + account_id: typing.Optional[str] = OMIT, + acknowledge_bank_warning: typing.Optional[bool] = OMIT, + currency: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, str]] = OMIT, + notes: typing.Optional[str] = OMIT, + platform_covers_fees: typing.Optional[bool] = OMIT, + quote_token: typing.Optional[str] = OMIT, + speed: typing.Optional[CreatePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, + user_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreatePayoutsResponse]: """ Sends money from an account or user balance to a saved payout method for that owner. Parameters ---------- - request : CreatePayoutsRequestBody + amount : float + The amount to pay out in the specified currency. + + payout_method_id : str + The saved payout method to deliver to (a potk_ identifier). + + account_id : typing.Optional[str] + Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. + + acknowledge_bank_warning : typing.Optional[bool] + Set to `true` to continue when the destination bank could not confirm the payout method account holder's name, or `false` to have the payout refused in that case so the account holder can correct the name or link their bank first. Omitting the field skips the warning gate — a client that cannot show the warning keeps its pre-gate behavior. + + currency : typing.Optional[str] + The currency to pay out. Balances are held per currency and the payout draws only from the balance in this currency, so match the currency the funds arrived in — for example `cad` for an account funded by CAD transfers. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. + + metadata : typing.Optional[typing.Dict[str, str]] + Key-value data to attach to the payout, echoed on every read and in webhook payloads. At most 50 keys, key names up to 40 characters, string values up to 500 characters. Never store secrets or regulated personal data here — webhook bodies are retained for delivery inspection. + + notes : typing.Optional[str] + Free-form notes to attach to the payout, with a maximum of 255 characters. Omit or pass `null` for no notes. + + platform_covers_fees : typing.Optional[bool] + Whether the parent platform covers the payout fee instead of the account being paid out. Omit to use the platform's configured fee coverage policy; pass `false` to opt out of it. `true` is only accepted for accounts that belong to a platform, and requires the platform's policy to cover this payout method's category or a caller authorized to manage the platform's child account fees. + + quote_token : typing.Optional[str] + The server-signed quote_token returned by POST /payouts/quotes. Required when the ledger account's payout_quote_required is true; a payout without it is refused with the invalid_payout_quote error type. When provided, Whop will not commit a provider payout below the destination amount the quote showed. + + speed : typing.Optional[CreatePayoutsRequestSpeed] + How fast the funds should arrive. `instant` is only accepted when the account and payout method are eligible; otherwise the payout is rejected. + + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Without a `quote_token`, omit or pass `null` to use the default descriptor. With a `quote_token`, set this value when creating the quote; the payout request may omit it but cannot add or change it. + + user_id : typing.Optional[str] + User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -230,9 +277,23 @@ def create( _response = self._client_wrapper.httpx_client.request( "payouts", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=CreatePayoutsRequestBody, direction="write" - ), + json={ + "account_id": account_id, + "acknowledge_bank_warning": acknowledge_bank_warning, + "amount": amount, + "currency": currency, + "metadata": metadata, + "notes": notes, + "payout_method_id": payout_method_id, + "platform_covers_fees": platform_covers_fees, + "quote_token": quote_token, + "speed": speed, + "statement_descriptor": statement_descriptor, + "user_id": user_id, + }, + headers={ + "content-type": "application/json", + }, request_options=request_options, omit=OMIT, ) @@ -319,6 +380,7 @@ def create_quote( currency: typing.Optional[str] = OMIT, platform_covers_fees: typing.Optional[bool] = OMIT, speed: typing.Optional[CreateQuotePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, user_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateQuotePayoutsResponse]: @@ -337,7 +399,7 @@ def create_quote( Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. currency : typing.Optional[str] - The balance currency to pay out. + The currency to pay out. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. platform_covers_fees : typing.Optional[bool] Whether the parent platform covers the payout fee instead of the account being paid out. @@ -345,6 +407,9 @@ def create_quote( speed : typing.Optional[CreateQuotePayoutsRequestSpeed] How fast the funds should arrive. + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Omit or pass `null` to use the default descriptor. + user_id : typing.Optional[str] User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. @@ -366,6 +431,7 @@ def create_quote( "payout_method_id": payout_method_id, "platform_covers_fees": platform_covers_fees, "speed": speed, + "statement_descriptor": statement_descriptor, "user_id": user_id, }, headers={ @@ -819,14 +885,62 @@ async def _get_next(): raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def create( - self, *, request: CreatePayoutsRequestBody, request_options: typing.Optional[RequestOptions] = None + self, + *, + amount: float, + payout_method_id: str, + account_id: typing.Optional[str] = OMIT, + acknowledge_bank_warning: typing.Optional[bool] = OMIT, + currency: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, str]] = OMIT, + notes: typing.Optional[str] = OMIT, + platform_covers_fees: typing.Optional[bool] = OMIT, + quote_token: typing.Optional[str] = OMIT, + speed: typing.Optional[CreatePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, + user_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreatePayoutsResponse]: """ Sends money from an account or user balance to a saved payout method for that owner. Parameters ---------- - request : CreatePayoutsRequestBody + amount : float + The amount to pay out in the specified currency. + + payout_method_id : str + The saved payout method to deliver to (a potk_ identifier). + + account_id : typing.Optional[str] + Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. + + acknowledge_bank_warning : typing.Optional[bool] + Set to `true` to continue when the destination bank could not confirm the payout method account holder's name, or `false` to have the payout refused in that case so the account holder can correct the name or link their bank first. Omitting the field skips the warning gate — a client that cannot show the warning keeps its pre-gate behavior. + + currency : typing.Optional[str] + The currency to pay out. Balances are held per currency and the payout draws only from the balance in this currency, so match the currency the funds arrived in — for example `cad` for an account funded by CAD transfers. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. + + metadata : typing.Optional[typing.Dict[str, str]] + Key-value data to attach to the payout, echoed on every read and in webhook payloads. At most 50 keys, key names up to 40 characters, string values up to 500 characters. Never store secrets or regulated personal data here — webhook bodies are retained for delivery inspection. + + notes : typing.Optional[str] + Free-form notes to attach to the payout, with a maximum of 255 characters. Omit or pass `null` for no notes. + + platform_covers_fees : typing.Optional[bool] + Whether the parent platform covers the payout fee instead of the account being paid out. Omit to use the platform's configured fee coverage policy; pass `false` to opt out of it. `true` is only accepted for accounts that belong to a platform, and requires the platform's policy to cover this payout method's category or a caller authorized to manage the platform's child account fees. + + quote_token : typing.Optional[str] + The server-signed quote_token returned by POST /payouts/quotes. Required when the ledger account's payout_quote_required is true; a payout without it is refused with the invalid_payout_quote error type. When provided, Whop will not commit a provider payout below the destination amount the quote showed. + + speed : typing.Optional[CreatePayoutsRequestSpeed] + How fast the funds should arrive. `instant` is only accepted when the account and payout method are eligible; otherwise the payout is rejected. + + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Without a `quote_token`, omit or pass `null` to use the default descriptor. With a `quote_token`, set this value when creating the quote; the payout request may omit it but cannot add or change it. + + user_id : typing.Optional[str] + User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -839,9 +953,23 @@ async def create( _response = await self._client_wrapper.httpx_client.request( "payouts", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=CreatePayoutsRequestBody, direction="write" - ), + json={ + "account_id": account_id, + "acknowledge_bank_warning": acknowledge_bank_warning, + "amount": amount, + "currency": currency, + "metadata": metadata, + "notes": notes, + "payout_method_id": payout_method_id, + "platform_covers_fees": platform_covers_fees, + "quote_token": quote_token, + "speed": speed, + "statement_descriptor": statement_descriptor, + "user_id": user_id, + }, + headers={ + "content-type": "application/json", + }, request_options=request_options, omit=OMIT, ) @@ -928,6 +1056,7 @@ async def create_quote( currency: typing.Optional[str] = OMIT, platform_covers_fees: typing.Optional[bool] = OMIT, speed: typing.Optional[CreateQuotePayoutsRequestSpeed] = OMIT, + statement_descriptor: typing.Optional[str] = OMIT, user_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateQuotePayoutsResponse]: @@ -946,7 +1075,7 @@ async def create_quote( Account to pay out from, prefixed `biz_`. Provide exactly one of `account_id` or `user_id`. currency : typing.Optional[str] - The balance currency to pay out. + The currency to pay out. When omitted, uses `usd` if that balance can cover a withdrawal, otherwise the account's only other funded currency. platform_covers_fees : typing.Optional[bool] Whether the parent platform covers the payout fee instead of the account being paid out. @@ -954,6 +1083,9 @@ async def create_quote( speed : typing.Optional[CreateQuotePayoutsRequestSpeed] How fast the funds should arrive. + statement_descriptor : typing.Optional[str] + Text that appears on the recipient's bank statement. Must be 5-22 alphanumeric characters (A-Z, a-z, 0-9). Omit or pass `null` to use the default descriptor. + user_id : typing.Optional[str] User to pay out from, prefixed `user_`. Provide exactly one of `account_id` or `user_id`. @@ -975,6 +1107,7 @@ async def create_quote( "payout_method_id": payout_method_id, "platform_covers_fees": platform_covers_fees, "speed": speed, + "statement_descriptor": statement_descriptor, "user_id": user_id, }, headers={ diff --git a/src/whop_sdk/payouts/supported_methods/client.py b/src/whop_sdk/payouts/supported_methods/client.py index 19e6b641..16b544c6 100644 --- a/src/whop_sdk/payouts/supported_methods/client.py +++ b/src/whop_sdk/payouts/supported_methods/client.py @@ -92,7 +92,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -203,7 +203,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/payouts/types/__init__.py b/src/whop_sdk/payouts/types/__init__.py index 03b37974..2ba51585 100644 --- a/src/whop_sdk/payouts/types/__init__.py +++ b/src/whop_sdk/payouts/types/__init__.py @@ -20,8 +20,7 @@ from .cancel_payouts_response_source import CancelPayoutsResponseSource from .cancel_payouts_response_speed import CancelPayoutsResponseSpeed from .cancel_payouts_response_status import CancelPayoutsResponseStatus - from .create_payouts_request_body import CreatePayoutsRequestBody - from .create_payouts_request_body_speed import CreatePayoutsRequestBodySpeed + from .create_payouts_request_speed import CreatePayoutsRequestSpeed from .create_payouts_response import CreatePayoutsResponse from .create_payouts_response_failure import CreatePayoutsResponseFailure from .create_payouts_response_fee_paid_by import CreatePayoutsResponseFeePaidBy @@ -87,6 +86,9 @@ from .post_payout_method_created_payload_data_object import PostPayoutMethodCreatedPayloadDataObject from .post_payout_method_created_payload_data_quote import PostPayoutMethodCreatedPayloadDataQuote from .post_payout_method_created_payload_data_quote_instant import PostPayoutMethodCreatedPayloadDataQuoteInstant + from .post_payout_method_created_payload_data_quote_instant_unavailable_reason import ( + PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason, + ) from .post_payout_method_created_payload_data_quote_standard import PostPayoutMethodCreatedPayloadDataQuoteStandard from .post_payout_method_created_payload_data_status import PostPayoutMethodCreatedPayloadDataStatus from .post_payout_method_created_payload_data_supported_payout_method import ( @@ -158,8 +160,7 @@ "CancelPayoutsResponseSource": ".cancel_payouts_response_source", "CancelPayoutsResponseSpeed": ".cancel_payouts_response_speed", "CancelPayoutsResponseStatus": ".cancel_payouts_response_status", - "CreatePayoutsRequestBody": ".create_payouts_request_body", - "CreatePayoutsRequestBodySpeed": ".create_payouts_request_body_speed", + "CreatePayoutsRequestSpeed": ".create_payouts_request_speed", "CreatePayoutsResponse": ".create_payouts_response", "CreatePayoutsResponseFailure": ".create_payouts_response_failure", "CreatePayoutsResponseFeePaidBy": ".create_payouts_response_fee_paid_by", @@ -209,6 +210,7 @@ "PostPayoutMethodCreatedPayloadDataObject": ".post_payout_method_created_payload_data_object", "PostPayoutMethodCreatedPayloadDataQuote": ".post_payout_method_created_payload_data_quote", "PostPayoutMethodCreatedPayloadDataQuoteInstant": ".post_payout_method_created_payload_data_quote_instant", + "PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason": ".post_payout_method_created_payload_data_quote_instant_unavailable_reason", "PostPayoutMethodCreatedPayloadDataQuoteStandard": ".post_payout_method_created_payload_data_quote_standard", "PostPayoutMethodCreatedPayloadDataStatus": ".post_payout_method_created_payload_data_status", "PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod": ".post_payout_method_created_payload_data_supported_payout_method", @@ -286,8 +288,7 @@ def __dir__(): "CancelPayoutsResponseSource", "CancelPayoutsResponseSpeed", "CancelPayoutsResponseStatus", - "CreatePayoutsRequestBody", - "CreatePayoutsRequestBodySpeed", + "CreatePayoutsRequestSpeed", "CreatePayoutsResponse", "CreatePayoutsResponseFailure", "CreatePayoutsResponseFeePaidBy", @@ -337,6 +338,7 @@ def __dir__(): "PostPayoutMethodCreatedPayloadDataObject", "PostPayoutMethodCreatedPayloadDataQuote", "PostPayoutMethodCreatedPayloadDataQuoteInstant", + "PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason", "PostPayoutMethodCreatedPayloadDataQuoteStandard", "PostPayoutMethodCreatedPayloadDataStatus", "PostPayoutMethodCreatedPayloadDataSupportedPayoutMethod", diff --git a/src/whop_sdk/payouts/types/cancel_payouts_response.py b/src/whop_sdk/payouts/types/cancel_payouts_response.py index 7b0efb32..9f13ae4d 100644 --- a/src/whop_sdk/payouts/types/cancel_payouts_response.py +++ b/src/whop_sdk/payouts/types/cancel_payouts_response.py @@ -116,6 +116,11 @@ class CancelPayoutsResponse(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: CancelPayoutsResponseStatus = pydantic.Field() """ Current payout status. diff --git a/src/whop_sdk/payouts/types/create_payouts_request_body.py b/src/whop_sdk/payouts/types/create_payouts_request_body.py deleted file mode 100644 index f893a87f..00000000 --- a/src/whop_sdk/payouts/types/create_payouts_request_body.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CreatePayoutsRequestBody = typing.Union[typing.Any] diff --git a/src/whop_sdk/payouts/types/create_payouts_request_body_speed.py b/src/whop_sdk/payouts/types/create_payouts_request_body_speed.py deleted file mode 100644 index fe48fdb9..00000000 --- a/src/whop_sdk/payouts/types/create_payouts_request_body_speed.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CreatePayoutsRequestBodySpeed = typing.Union[typing.Literal["standard", "instant"], typing.Any] diff --git a/src/whop_sdk/payouts/types/create_payouts_request_speed.py b/src/whop_sdk/payouts/types/create_payouts_request_speed.py new file mode 100644 index 00000000..8819486f --- /dev/null +++ b/src/whop_sdk/payouts/types/create_payouts_request_speed.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreatePayoutsRequestSpeed = typing.Union[typing.Literal["standard", "instant"], typing.Any] diff --git a/src/whop_sdk/payouts/types/create_payouts_response.py b/src/whop_sdk/payouts/types/create_payouts_response.py index 08df471c..c3461dbd 100644 --- a/src/whop_sdk/payouts/types/create_payouts_response.py +++ b/src/whop_sdk/payouts/types/create_payouts_response.py @@ -116,6 +116,11 @@ class CreatePayoutsResponse(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: CreatePayoutsResponseStatus = pydantic.Field() """ Current payout status, in the same vocabulary as GET /payouts. diff --git a/src/whop_sdk/payouts/types/list_payouts_response_data_item.py b/src/whop_sdk/payouts/types/list_payouts_response_data_item.py index c3ec807e..4d38a2f3 100644 --- a/src/whop_sdk/payouts/types/list_payouts_response_data_item.py +++ b/src/whop_sdk/payouts/types/list_payouts_response_data_item.py @@ -116,6 +116,11 @@ class ListPayoutsResponseDataItem(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: ListPayoutsResponseDataItemStatus = pydantic.Field() """ Current payout status. diff --git a/src/whop_sdk/payouts/types/post_payout_created_payload_data.py b/src/whop_sdk/payouts/types/post_payout_created_payload_data.py index 2a4e6ae2..a6e013d4 100644 --- a/src/whop_sdk/payouts/types/post_payout_created_payload_data.py +++ b/src/whop_sdk/payouts/types/post_payout_created_payload_data.py @@ -116,6 +116,11 @@ class PostPayoutCreatedPayloadData(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: PostPayoutCreatedPayloadDataStatus = pydantic.Field() """ Current payout status. diff --git a/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote.py b/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote.py index 4d09c964..b2bd2b0c 100644 --- a/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote.py +++ b/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote.py @@ -5,6 +5,9 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .post_payout_method_created_payload_data_quote_instant import PostPayoutMethodCreatedPayloadDataQuoteInstant +from .post_payout_method_created_payload_data_quote_instant_unavailable_reason import ( + PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason, +) from .post_payout_method_created_payload_data_quote_standard import PostPayoutMethodCreatedPayloadDataQuoteStandard @@ -33,6 +36,13 @@ class PostPayoutMethodCreatedPayloadDataQuote(UniversalBaseModel): Instant-delivery estimate. Null if the method does not support instant delivery, instant delivery is unavailable for the account, or the amount does not cover the fee. """ + instant_unavailable_reason: typing.Optional[PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason] = ( + pydantic.Field(default=None) + ) + """ + Why instant delivery is unavailable for this method. `minimum_crypto_sales_not_met` means the account has not reached the total sales required for instant cryptocurrency payouts. `null` when this restriction does not apply. + """ + max_limit: typing.Optional[float] = pydantic.Field(default=None) """ Maximum payout amount for this method, in the payout currency. diff --git a/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote_instant_unavailable_reason.py b/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote_instant_unavailable_reason.py new file mode 100644 index 00000000..c0b48730 --- /dev/null +++ b/src/whop_sdk/payouts/types/post_payout_method_created_payload_data_quote_instant_unavailable_reason.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PostPayoutMethodCreatedPayloadDataQuoteInstantUnavailableReason = typing.Union[ + typing.Literal["minimum_crypto_sales_not_met"], typing.Any +] diff --git a/src/whop_sdk/payouts/types/post_payout_reversed_payload_data.py b/src/whop_sdk/payouts/types/post_payout_reversed_payload_data.py index e7e28fe5..fba4f58a 100644 --- a/src/whop_sdk/payouts/types/post_payout_reversed_payload_data.py +++ b/src/whop_sdk/payouts/types/post_payout_reversed_payload_data.py @@ -116,6 +116,11 @@ class PostPayoutReversedPayloadData(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: PostPayoutReversedPayloadDataStatus = pydantic.Field() """ Current payout status. diff --git a/src/whop_sdk/payouts/types/post_payout_updated_payload_data.py b/src/whop_sdk/payouts/types/post_payout_updated_payload_data.py index 1eaf5749..4117bfc6 100644 --- a/src/whop_sdk/payouts/types/post_payout_updated_payload_data.py +++ b/src/whop_sdk/payouts/types/post_payout_updated_payload_data.py @@ -116,6 +116,11 @@ class PostPayoutUpdatedPayloadData(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: PostPayoutUpdatedPayloadDataStatus = pydantic.Field() """ Current payout status. diff --git a/src/whop_sdk/payouts/types/retrieve_payouts_response.py b/src/whop_sdk/payouts/types/retrieve_payouts_response.py index 6445234a..6cc164c3 100644 --- a/src/whop_sdk/payouts/types/retrieve_payouts_response.py +++ b/src/whop_sdk/payouts/types/retrieve_payouts_response.py @@ -116,6 +116,11 @@ class RetrievePayoutsResponse(UniversalBaseModel): Payout delivery speed. """ + statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Text that appears on the recipient's bank statement, or `null` if no descriptor was set. When set, 5-22 alphanumeric characters (A-Z, a-z, 0-9). + """ + status: RetrievePayoutsResponseStatus = pydantic.Field() """ Current payout status. diff --git a/src/whop_sdk/people/client.py b/src/whop_sdk/people/client.py index 5819cc9e..c19b104e 100644 --- a/src/whop_sdk/people/client.py +++ b/src/whop_sdk/people/client.py @@ -157,7 +157,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -232,7 +232,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -388,7 +388,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -472,7 +472,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/permissions/client.py b/src/whop_sdk/permissions/client.py index 537a947b..dfc32df4 100644 --- a/src/whop_sdk/permissions/client.py +++ b/src/whop_sdk/permissions/client.py @@ -54,7 +54,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -114,7 +114,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/plans/client.py b/src/whop_sdk/plans/client.py index 1a3809bb..12bfedcc 100644 --- a/src/whop_sdk/plans/client.py +++ b/src/whop_sdk/plans/client.py @@ -118,7 +118,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -274,7 +274,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -332,7 +332,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -365,7 +365,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -507,7 +507,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -587,7 +587,7 @@ def calculate_tax( from whop_sdk.plans import CalculateTaxPlansRequestAddress client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -697,7 +697,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -862,7 +862,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -928,7 +928,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -969,7 +969,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1119,7 +1119,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1207,7 +1207,7 @@ async def calculate_tax( from whop_sdk.plans import CalculateTaxPlansRequestAddress client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/products/client.py b/src/whop_sdk/products/client.py index d68b4fb2..06db190c 100644 --- a/src/whop_sdk/products/client.py +++ b/src/whop_sdk/products/client.py @@ -129,7 +129,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -263,7 +263,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -317,7 +317,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -350,7 +350,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -424,7 +424,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -469,7 +469,7 @@ def publish(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -502,7 +502,7 @@ def unpublish(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -624,7 +624,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -767,7 +767,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -829,7 +829,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -872,7 +872,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -954,7 +954,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1007,7 +1007,7 @@ async def publish(self, id: str, *, request_options: typing.Optional[RequestOpti from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1048,7 +1048,7 @@ async def unpublish(self, id: str, *, request_options: typing.Optional[RequestOp from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/promo_codes/client.py b/src/whop_sdk/promo_codes/client.py index cd9d4578..6caf1319 100644 --- a/src/whop_sdk/promo_codes/client.py +++ b/src/whop_sdk/promo_codes/client.py @@ -107,7 +107,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -206,7 +206,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -262,7 +262,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -295,7 +295,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -328,7 +328,7 @@ def activate(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -361,7 +361,7 @@ def deactivate(self, id: str, *, request_options: typing.Optional[RequestOptions from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -461,7 +461,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -569,7 +569,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -633,7 +633,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -676,7 +676,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -717,7 +717,7 @@ async def activate(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -758,7 +758,7 @@ async def deactivate(self, id: str, *, request_options: typing.Optional[RequestO from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/reactions/client.py b/src/whop_sdk/reactions/client.py index 75888f6c..c5953ed2 100644 --- a/src/whop_sdk/reactions/client.py +++ b/src/whop_sdk/reactions/client.py @@ -79,7 +79,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -140,7 +140,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -182,7 +182,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -227,7 +227,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -306,7 +306,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -376,7 +376,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -426,7 +426,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -479,7 +479,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/recommended_actions/client.py b/src/whop_sdk/recommended_actions/client.py index ff1e25a5..724f7ec5 100644 --- a/src/whop_sdk/recommended_actions/client.py +++ b/src/whop_sdk/recommended_actions/client.py @@ -50,7 +50,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -90,7 +90,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -109,7 +109,7 @@ def run( request_options: typing.Optional[RequestOptions] = None, ) -> RunRecommendedActionsResponse: """ - Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event. + Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event and a `redirected` execution per step. Parameters ---------- @@ -132,7 +132,7 @@ def run( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -174,7 +174,7 @@ def list_executions( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -227,7 +227,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -275,7 +275,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -300,7 +300,7 @@ async def run( request_options: typing.Optional[RequestOptions] = None, ) -> RunRecommendedActionsResponse: """ - Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event. + Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event and a `redirected` execution per step. Parameters ---------- @@ -325,7 +325,7 @@ async def run( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -375,7 +375,7 @@ async def list_executions( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/recommended_actions/raw_client.py b/src/whop_sdk/recommended_actions/raw_client.py index 73233da8..0359882f 100644 --- a/src/whop_sdk/recommended_actions/raw_client.py +++ b/src/whop_sdk/recommended_actions/raw_client.py @@ -176,7 +176,7 @@ def run( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[RunRecommendedActionsResponse]: """ - Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event. + Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event and a `redirected` execution per step. Parameters ---------- @@ -485,7 +485,7 @@ async def run( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[RunRecommendedActionsResponse]: """ - Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event. + Records that the caller ran a recommended action chain. Nothing is executed server-side yet — the client follows the chain's step CTAs itself; this writes the `recommended_action_chain.executed` analytics event and a `redirected` execution per step. Parameters ---------- diff --git a/src/whop_sdk/recommended_actions/types/list_recommended_actions_response.py b/src/whop_sdk/recommended_actions/types/list_recommended_actions_response.py index 8c20ec00..6a91673a 100644 --- a/src/whop_sdk/recommended_actions/types/list_recommended_actions_response.py +++ b/src/whop_sdk/recommended_actions/types/list_recommended_actions_response.py @@ -9,6 +9,10 @@ class ListRecommendedActionsResponse(UniversalBaseModel): data: typing.List[AccountRecommendedActionChain] + generation_pending: bool = pydantic.Field() + """ + Whether generation was queued because the account has no available action chains yet. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/refunds/__init__.py b/src/whop_sdk/refunds/__init__.py index 1622712d..fc4ad913 100644 --- a/src/whop_sdk/refunds/__init__.py +++ b/src/whop_sdk/refunds/__init__.py @@ -7,7 +7,10 @@ if typing.TYPE_CHECKING: from .types import ( + ListRefundsRequestDirection, + ListRefundsRequestOrder, ListRefundsResponse, + ListRefundsResponsePageInfo, PostRefundCreatedPayload, PostRefundCreatedPayloadApiVersion, PostRefundCreatedPayloadType, @@ -16,7 +19,10 @@ PostRefundUpdatedPayloadType, ) _dynamic_imports: typing.Dict[str, str] = { + "ListRefundsRequestDirection": ".types", + "ListRefundsRequestOrder": ".types", "ListRefundsResponse": ".types", + "ListRefundsResponsePageInfo": ".types", "PostRefundCreatedPayload": ".types", "PostRefundCreatedPayloadApiVersion": ".types", "PostRefundCreatedPayloadType": ".types", @@ -48,7 +54,10 @@ def __dir__(): __all__ = [ + "ListRefundsRequestDirection", + "ListRefundsRequestOrder", "ListRefundsResponse", + "ListRefundsResponsePageInfo", "PostRefundCreatedPayload", "PostRefundCreatedPayloadApiVersion", "PostRefundCreatedPayloadType", diff --git a/src/whop_sdk/refunds/client.py b/src/whop_sdk/refunds/client.py index 9b33dc96..12526379 100644 --- a/src/whop_sdk/refunds/client.py +++ b/src/whop_sdk/refunds/client.py @@ -6,10 +6,10 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions -from ..types.direction import Direction from ..types.refund import Refund -from ..types.refund_list_item import RefundListItem from .raw_client import AsyncRawRefundsClient, RawRefundsClient +from .types.list_refunds_request_direction import ListRefundsRequestDirection +from .types.list_refunds_request_order import ListRefundsRequestOrder from .types.list_refunds_response import ListRefundsResponse @@ -31,87 +31,75 @@ def with_raw_response(self) -> RawRefundsClient: def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, + account_id: typing.Optional[str] = None, payment_id: typing.Optional[str] = None, - company_id: typing.Optional[str] = None, user_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, + order: typing.Optional[ListRefundsRequestOrder] = None, + direction: typing.Optional[ListRefundsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[RefundListItem, ListRefundsResponse]: + ) -> SyncPager[Refund, ListRefundsResponse]: """ - Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date. - - Required permissions: - - `payment:basic:read` + Lists refunds, newest first. Without filters this is every refund the caller can read; narrow it to one payment with `payment_id`, one account with `account_id`, or one buyer with `user_id`. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. + account_id : typing.Optional[str] + Only refunds issued by this account, prefixed `biz_`. - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. + payment_id : typing.Optional[str] + Only refunds of this payment, prefixed `pay_`. - first : typing.Optional[int] - Returns the first _n_ elements from the list. + user_id : typing.Optional[str] + Only refunds to this buyer, prefixed `user_`. - last : typing.Optional[int] - Returns the last _n_ elements from the list. + created_before : typing.Optional[dt.datetime] + Only refunds requested before this ISO 8601 timestamp. - payment_id : typing.Optional[str] - Filter refunds to those associated with this specific payment. Mutually exclusive with company_id and user_id: provide exactly one. + created_after : typing.Optional[dt.datetime] + Only refunds requested after this ISO 8601 timestamp. - company_id : typing.Optional[str] - Filter refunds to those belonging to this company. Mutually exclusive with payment_id and user_id: provide exactly one. + order : typing.Optional[ListRefundsRequestOrder] + The field to sort by. - user_id : typing.Optional[str] - Filter refunds to those associated with this specific user. Mutually exclusive with payment_id and company_id: provide exactly one. Requires a credential belonging to that user; any other credential receives 'You are not authorized'. + direction : typing.Optional[ListRefundsRequestDirection] + The sort direction. - direction : typing.Optional[Direction] + first : typing.Optional[int] + The number of refunds to return. - created_before : typing.Optional[dt.datetime] - Only return refunds created before this timestamp. + after : typing.Optional[str] + A cursor; returns refunds after this position. - created_after : typing.Optional[dt.datetime] - Only return refunds created after this timestamp. + last : typing.Optional[int] + The number of refunds to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns refunds before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[RefundListItem, ListRefundsResponse] - A successful response + SyncPager[Refund, ListRefundsResponse] + refunds listed Examples -------- - import datetime - from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) - response = client.refunds.list( - first=42, - last=42, - payment_id="pay_xxxxxxxxxxxxxx", - company_id="biz_xxxxxxxxxxxxxx", - user_id="user_xxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - created_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) + response = client.refunds.list() for item in response: yield item # alternatively, you can paginate page-by-page @@ -119,35 +107,28 @@ def list( yield page """ return self._raw_client.list( - after=after, - before=before, - first=first, - last=last, + account_id=account_id, payment_id=payment_id, - company_id=company_id, user_id=user_id, - direction=direction, created_before=created_before, created_after=created_after, + order=order, + direction=direction, + first=first, + after=after, + last=last, + before=before, request_options=request_options, ) def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Refund: """ - Retrieves the details of an existing refund. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` + Returns one refund. Parameters ---------- id : str - The unique identifier of the refund. + The refund to retrieve, prefixed `rf_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -155,19 +136,19 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] Returns ------- Refund - A successful response + refund retrieved Examples -------- from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) client.refunds.retrieve( - id="rf_xxxxxxxxxxxxxxx", + id="id", ) """ _response = self._raw_client.retrieve(id, request_options=request_options) @@ -192,91 +173,80 @@ def with_raw_response(self) -> AsyncRawRefundsClient: async def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, + account_id: typing.Optional[str] = None, payment_id: typing.Optional[str] = None, - company_id: typing.Optional[str] = None, user_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, + order: typing.Optional[ListRefundsRequestOrder] = None, + direction: typing.Optional[ListRefundsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[RefundListItem, ListRefundsResponse]: + ) -> AsyncPager[Refund, ListRefundsResponse]: """ - Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date. - - Required permissions: - - `payment:basic:read` + Lists refunds, newest first. Without filters this is every refund the caller can read; narrow it to one payment with `payment_id`, one account with `account_id`, or one buyer with `user_id`. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. + account_id : typing.Optional[str] + Only refunds issued by this account, prefixed `biz_`. - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. + payment_id : typing.Optional[str] + Only refunds of this payment, prefixed `pay_`. - first : typing.Optional[int] - Returns the first _n_ elements from the list. + user_id : typing.Optional[str] + Only refunds to this buyer, prefixed `user_`. - last : typing.Optional[int] - Returns the last _n_ elements from the list. + created_before : typing.Optional[dt.datetime] + Only refunds requested before this ISO 8601 timestamp. - payment_id : typing.Optional[str] - Filter refunds to those associated with this specific payment. Mutually exclusive with company_id and user_id: provide exactly one. + created_after : typing.Optional[dt.datetime] + Only refunds requested after this ISO 8601 timestamp. - company_id : typing.Optional[str] - Filter refunds to those belonging to this company. Mutually exclusive with payment_id and user_id: provide exactly one. + order : typing.Optional[ListRefundsRequestOrder] + The field to sort by. - user_id : typing.Optional[str] - Filter refunds to those associated with this specific user. Mutually exclusive with payment_id and company_id: provide exactly one. Requires a credential belonging to that user; any other credential receives 'You are not authorized'. + direction : typing.Optional[ListRefundsRequestDirection] + The sort direction. - direction : typing.Optional[Direction] + first : typing.Optional[int] + The number of refunds to return. - created_before : typing.Optional[dt.datetime] - Only return refunds created before this timestamp. + after : typing.Optional[str] + A cursor; returns refunds after this position. - created_after : typing.Optional[dt.datetime] - Only return refunds created after this timestamp. + last : typing.Optional[int] + The number of refunds to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns refunds before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[RefundListItem, ListRefundsResponse] - A successful response + AsyncPager[Refund, ListRefundsResponse] + refunds listed Examples -------- import asyncio - import datetime from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) async def main() -> None: - response = await client.refunds.list( - first=42, - last=42, - payment_id="pay_xxxxxxxxxxxxxx", - company_id="biz_xxxxxxxxxxxxxx", - user_id="user_xxxxxxxxxxxxx", - created_before=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - created_after=datetime.datetime.fromisoformat( - "2023-12-01 05:00:00+00:00", - ), - ) + response = await client.refunds.list() async for item in response: yield item @@ -288,35 +258,28 @@ async def main() -> None: asyncio.run(main()) """ return await self._raw_client.list( - after=after, - before=before, - first=first, - last=last, + account_id=account_id, payment_id=payment_id, - company_id=company_id, user_id=user_id, - direction=direction, created_before=created_before, created_after=created_after, + order=order, + direction=direction, + first=first, + after=after, + last=last, + before=before, request_options=request_options, ) async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Refund: """ - Retrieves the details of an existing refund. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` + Returns one refund. Parameters ---------- id : str - The unique identifier of the refund. + The refund to retrieve, prefixed `rf_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -324,7 +287,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt Returns ------- Refund - A successful response + refund retrieved Examples -------- @@ -333,7 +296,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -341,7 +304,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt async def main() -> None: await client.refunds.retrieve( - id="rf_xxxxxxxxxxxxxxx", + id="id", ) diff --git a/src/whop_sdk/refunds/raw_client.py b/src/whop_sdk/refunds/raw_client.py index 5c65aea3..14b62782 100644 --- a/src/whop_sdk/refunds/raw_client.py +++ b/src/whop_sdk/refunds/raw_client.py @@ -15,14 +15,11 @@ from ..core.request_options import RequestOptions from ..errors.bad_request_error import BadRequestError from ..errors.forbidden_error import ForbiddenError -from ..errors.internal_server_error import InternalServerError from ..errors.not_found_error import NotFoundError -from ..errors.too_many_requests_error import TooManyRequestsError from ..errors.unauthorized_error import UnauthorizedError -from ..errors.unprocessable_entity_error import UnprocessableEntityError -from ..types.direction import Direction from ..types.refund import Refund -from ..types.refund_list_item import RefundListItem +from .types.list_refunds_request_direction import ListRefundsRequestDirection +from .types.list_refunds_request_order import ListRefundsRequestOrder from .types.list_refunds_response import ListRefundsResponse from pydantic import ValidationError @@ -34,77 +31,80 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, + account_id: typing.Optional[str] = None, payment_id: typing.Optional[str] = None, - company_id: typing.Optional[str] = None, user_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, + order: typing.Optional[ListRefundsRequestOrder] = None, + direction: typing.Optional[ListRefundsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[RefundListItem, ListRefundsResponse]: + ) -> SyncPager[Refund, ListRefundsResponse]: """ - Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date. - - Required permissions: - - `payment:basic:read` + Lists refunds, newest first. Without filters this is every refund the caller can read; narrow it to one payment with `payment_id`, one account with `account_id`, or one buyer with `user_id`. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. + account_id : typing.Optional[str] + Only refunds issued by this account, prefixed `biz_`. - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. + payment_id : typing.Optional[str] + Only refunds of this payment, prefixed `pay_`. - first : typing.Optional[int] - Returns the first _n_ elements from the list. + user_id : typing.Optional[str] + Only refunds to this buyer, prefixed `user_`. - last : typing.Optional[int] - Returns the last _n_ elements from the list. + created_before : typing.Optional[dt.datetime] + Only refunds requested before this ISO 8601 timestamp. - payment_id : typing.Optional[str] - Filter refunds to those associated with this specific payment. Mutually exclusive with company_id and user_id: provide exactly one. + created_after : typing.Optional[dt.datetime] + Only refunds requested after this ISO 8601 timestamp. - company_id : typing.Optional[str] - Filter refunds to those belonging to this company. Mutually exclusive with payment_id and user_id: provide exactly one. + order : typing.Optional[ListRefundsRequestOrder] + The field to sort by. - user_id : typing.Optional[str] - Filter refunds to those associated with this specific user. Mutually exclusive with payment_id and company_id: provide exactly one. Requires a credential belonging to that user; any other credential receives 'You are not authorized'. + direction : typing.Optional[ListRefundsRequestDirection] + The sort direction. - direction : typing.Optional[Direction] + first : typing.Optional[int] + The number of refunds to return. - created_before : typing.Optional[dt.datetime] - Only return refunds created before this timestamp. + after : typing.Optional[str] + A cursor; returns refunds after this position. - created_after : typing.Optional[dt.datetime] - Only return refunds created after this timestamp. + last : typing.Optional[int] + The number of refunds to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns refunds before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SyncPager[RefundListItem, ListRefundsResponse] - A successful response + SyncPager[Refund, ListRefundsResponse] + refunds listed """ _response = self._client_wrapper.httpx_client.request( "refunds", method="GET", params={ - "after": after, - "before": before, - "first": first, - "last": last, + "account_id": account_id, "payment_id": payment_id, - "company_id": company_id, "user_id": user_id, - "direction": direction, "created_before": serialize_datetime(created_before) if created_before is not None else None, "created_after": serialize_datetime(created_after) if created_after is not None else None, + "order": order, + "direction": direction, + "first": first, + "after": after, + "last": last, + "before": before, }, request_options=request_options, ) @@ -124,16 +124,17 @@ def list( _parsed_next = _parsed_response.page_info.end_cursor _has_next = _parsed_next is not None and _parsed_next != "" _get_next = lambda: self.list( - after=_parsed_next, - before=before, - first=first, - last=last, + account_id=account_id, payment_id=payment_id, - company_id=company_id, user_id=user_id, - direction=direction, created_before=created_before, created_after=created_after, + order=order, + direction=direction, + first=first, + after=_parsed_next, + last=last, + before=before, request_options=request_options, ) return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response) @@ -159,17 +160,6 @@ def list( ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -181,39 +171,6 @@ def list( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -225,20 +182,12 @@ def list( def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Refund]: """ - Retrieves the details of an existing refund. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` + Returns one refund. Parameters ---------- id : str - The unique identifier of the refund. + The refund to retrieve, prefixed `rf_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -246,7 +195,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] Returns ------- HttpResponse[Refund] - A successful response + refund retrieved """ _response = self._client_wrapper.httpx_client.request( f"refunds/{encode_path_param(id)}", @@ -263,17 +212,6 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] ), ) return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -307,39 +245,6 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -357,77 +262,80 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, - after: typing.Optional[str] = None, - before: typing.Optional[str] = None, - first: typing.Optional[int] = None, - last: typing.Optional[int] = None, + account_id: typing.Optional[str] = None, payment_id: typing.Optional[str] = None, - company_id: typing.Optional[str] = None, user_id: typing.Optional[str] = None, - direction: typing.Optional[Direction] = None, created_before: typing.Optional[dt.datetime] = None, created_after: typing.Optional[dt.datetime] = None, + order: typing.Optional[ListRefundsRequestOrder] = None, + direction: typing.Optional[ListRefundsRequestDirection] = None, + first: typing.Optional[int] = None, + after: typing.Optional[str] = None, + last: typing.Optional[int] = None, + before: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[RefundListItem, ListRefundsResponse]: + ) -> AsyncPager[Refund, ListRefundsResponse]: """ - Returns a paginated list of refunds, with optional filtering by payment, company, user, and creation date. - - Required permissions: - - `payment:basic:read` + Lists refunds, newest first. Without filters this is every refund the caller can read; narrow it to one payment with `payment_id`, one account with `account_id`, or one buyer with `user_id`. Parameters ---------- - after : typing.Optional[str] - Returns the elements in the list that come after the specified cursor. + account_id : typing.Optional[str] + Only refunds issued by this account, prefixed `biz_`. - before : typing.Optional[str] - Returns the elements in the list that come before the specified cursor. + payment_id : typing.Optional[str] + Only refunds of this payment, prefixed `pay_`. - first : typing.Optional[int] - Returns the first _n_ elements from the list. + user_id : typing.Optional[str] + Only refunds to this buyer, prefixed `user_`. - last : typing.Optional[int] - Returns the last _n_ elements from the list. + created_before : typing.Optional[dt.datetime] + Only refunds requested before this ISO 8601 timestamp. - payment_id : typing.Optional[str] - Filter refunds to those associated with this specific payment. Mutually exclusive with company_id and user_id: provide exactly one. + created_after : typing.Optional[dt.datetime] + Only refunds requested after this ISO 8601 timestamp. - company_id : typing.Optional[str] - Filter refunds to those belonging to this company. Mutually exclusive with payment_id and user_id: provide exactly one. + order : typing.Optional[ListRefundsRequestOrder] + The field to sort by. - user_id : typing.Optional[str] - Filter refunds to those associated with this specific user. Mutually exclusive with payment_id and company_id: provide exactly one. Requires a credential belonging to that user; any other credential receives 'You are not authorized'. + direction : typing.Optional[ListRefundsRequestDirection] + The sort direction. - direction : typing.Optional[Direction] + first : typing.Optional[int] + The number of refunds to return. - created_before : typing.Optional[dt.datetime] - Only return refunds created before this timestamp. + after : typing.Optional[str] + A cursor; returns refunds after this position. - created_after : typing.Optional[dt.datetime] - Only return refunds created after this timestamp. + last : typing.Optional[int] + The number of refunds to return from the end of the range. + + before : typing.Optional[str] + A cursor; returns refunds before this position. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncPager[RefundListItem, ListRefundsResponse] - A successful response + AsyncPager[Refund, ListRefundsResponse] + refunds listed """ _response = await self._client_wrapper.httpx_client.request( "refunds", method="GET", params={ - "after": after, - "before": before, - "first": first, - "last": last, + "account_id": account_id, "payment_id": payment_id, - "company_id": company_id, "user_id": user_id, - "direction": direction, "created_before": serialize_datetime(created_before) if created_before is not None else None, "created_after": serialize_datetime(created_after) if created_after is not None else None, + "order": order, + "direction": direction, + "first": first, + "after": after, + "last": last, + "before": before, }, request_options=request_options, ) @@ -449,16 +357,17 @@ async def list( async def _get_next(): return await self.list( - after=_parsed_next, - before=before, - first=first, - last=last, + account_id=account_id, payment_id=payment_id, - company_id=company_id, user_id=user_id, - direction=direction, created_before=created_before, created_after=created_after, + order=order, + direction=direction, + first=first, + after=_parsed_next, + last=last, + before=before, request_options=request_options, ) @@ -485,17 +394,6 @@ async def _get_next(): ), ), ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -507,39 +405,6 @@ async def _get_next(): ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -553,20 +418,12 @@ async def retrieve( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Refund]: """ - Retrieves the details of an existing refund. - - Required permissions: - - `payment:basic:read` - - `plan:basic:read` - - `access_pass:basic:read` - - `member:email:read` - - `member:basic:read` - - `member:phone:read` + Returns one refund. Parameters ---------- id : str - The unique identifier of the refund. + The refund to retrieve, prefixed `rf_`. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -574,7 +431,7 @@ async def retrieve( Returns ------- AsyncHttpResponse[Refund] - A successful response + refund retrieved """ _response = await self._client_wrapper.httpx_client.request( f"refunds/{encode_path_param(id)}", @@ -591,17 +448,6 @@ async def retrieve( ), ) return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), @@ -635,39 +481,6 @@ async def retrieve( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 429: - raise TooManyRequestsError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - typing.Any, - parse_obj_as( - type_=typing.Any, # type: ignore - object_=_response.json(), - ), - ), - ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) diff --git a/src/whop_sdk/refunds/types/__init__.py b/src/whop_sdk/refunds/types/__init__.py index 4b473f08..13563597 100644 --- a/src/whop_sdk/refunds/types/__init__.py +++ b/src/whop_sdk/refunds/types/__init__.py @@ -6,7 +6,10 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .list_refunds_request_direction import ListRefundsRequestDirection + from .list_refunds_request_order import ListRefundsRequestOrder from .list_refunds_response import ListRefundsResponse + from .list_refunds_response_page_info import ListRefundsResponsePageInfo from .post_refund_created_payload import PostRefundCreatedPayload from .post_refund_created_payload_api_version import PostRefundCreatedPayloadApiVersion from .post_refund_created_payload_type import PostRefundCreatedPayloadType @@ -14,7 +17,10 @@ from .post_refund_updated_payload_api_version import PostRefundUpdatedPayloadApiVersion from .post_refund_updated_payload_type import PostRefundUpdatedPayloadType _dynamic_imports: typing.Dict[str, str] = { + "ListRefundsRequestDirection": ".list_refunds_request_direction", + "ListRefundsRequestOrder": ".list_refunds_request_order", "ListRefundsResponse": ".list_refunds_response", + "ListRefundsResponsePageInfo": ".list_refunds_response_page_info", "PostRefundCreatedPayload": ".post_refund_created_payload", "PostRefundCreatedPayloadApiVersion": ".post_refund_created_payload_api_version", "PostRefundCreatedPayloadType": ".post_refund_created_payload_type", @@ -46,7 +52,10 @@ def __dir__(): __all__ = [ + "ListRefundsRequestDirection", + "ListRefundsRequestOrder", "ListRefundsResponse", + "ListRefundsResponsePageInfo", "PostRefundCreatedPayload", "PostRefundCreatedPayloadApiVersion", "PostRefundCreatedPayloadType", diff --git a/src/whop_sdk/refunds/types/list_refunds_request_direction.py b/src/whop_sdk/refunds/types/list_refunds_request_direction.py new file mode 100644 index 00000000..57234c60 --- /dev/null +++ b/src/whop_sdk/refunds/types/list_refunds_request_direction.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListRefundsRequestDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] diff --git a/src/whop_sdk/refunds/types/list_refunds_request_order.py b/src/whop_sdk/refunds/types/list_refunds_request_order.py new file mode 100644 index 00000000..863bfd0b --- /dev/null +++ b/src/whop_sdk/refunds/types/list_refunds_request_order.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ListRefundsRequestOrder = typing.Union[typing.Literal["created_at"], typing.Any] diff --git a/src/whop_sdk/refunds/types/list_refunds_response.py b/src/whop_sdk/refunds/types/list_refunds_response.py index 8fb870fe..b22001ab 100644 --- a/src/whop_sdk/refunds/types/list_refunds_response.py +++ b/src/whop_sdk/refunds/types/list_refunds_response.py @@ -4,24 +4,13 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.page_info import PageInfo -from ...types.refund_list_item import RefundListItem +from ...types.refund import Refund +from .list_refunds_response_page_info import ListRefundsResponsePageInfo class ListRefundsResponse(UniversalBaseModel): - """ - The connection type for Refund. - """ - - data: typing.List[RefundListItem] = pydantic.Field() - """ - A list of nodes. - """ - - page_info: PageInfo = pydantic.Field() - """ - Information to aid in pagination. - """ + data: typing.List[Refund] + page_info: ListRefundsResponsePageInfo if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/companies/types/create_companies_request_logo.py b/src/whop_sdk/refunds/types/list_refunds_response_page_info.py similarity index 67% rename from src/whop_sdk/companies/types/create_companies_request_logo.py rename to src/whop_sdk/refunds/types/list_refunds_response_page_info.py index 9d41da67..b1c6494e 100644 --- a/src/whop_sdk/companies/types/create_companies_request_logo.py +++ b/src/whop_sdk/refunds/types/list_refunds_response_page_info.py @@ -6,15 +6,11 @@ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class CreateCompaniesRequestLogo(UniversalBaseModel): - """ - The company's logo image. Accepts PNG, JPEG, or GIF format. - """ - - id: str = pydantic.Field() - """ - The ID of an existing file object. - """ +class ListRefundsResponsePageInfo(UniversalBaseModel): + end_cursor: typing.Optional[str] = None + has_next_page: bool + has_previous_page: bool + start_cursor: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/whop_sdk/refunds/types/post_refund_created_payload.py b/src/whop_sdk/refunds/types/post_refund_created_payload.py index 070cafcf..43a63524 100644 --- a/src/whop_sdk/refunds/types/post_refund_created_payload.py +++ b/src/whop_sdk/refunds/types/post_refund_created_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.refund import Refund +from ...types.refund_legacy import RefundLegacy from .post_refund_created_payload_api_version import PostRefundCreatedPayloadApiVersion from .post_refund_created_payload_type import PostRefundCreatedPayloadType @@ -26,7 +26,7 @@ class PostRefundCreatedPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Refund + data: RefundLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/refunds/types/post_refund_updated_payload.py b/src/whop_sdk/refunds/types/post_refund_updated_payload.py index 94bd31da..989420a3 100644 --- a/src/whop_sdk/refunds/types/post_refund_updated_payload.py +++ b/src/whop_sdk/refunds/types/post_refund_updated_payload.py @@ -5,7 +5,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.refund import Refund +from ...types.refund_legacy import RefundLegacy from .post_refund_updated_payload_api_version import PostRefundUpdatedPayloadApiVersion from .post_refund_updated_payload_type import PostRefundUpdatedPayloadType @@ -26,7 +26,7 @@ class PostRefundUpdatedPayload(UniversalBaseModel): The dated API version (Api-Version-Date) the payload is serialized to """ - data: Refund + data: RefundLegacy id: str = pydantic.Field() """ A unique ID for every single webhook request diff --git a/src/whop_sdk/resolution_center_cases/client.py b/src/whop_sdk/resolution_center_cases/client.py index 8a5b4b71..095326ff 100644 --- a/src/whop_sdk/resolution_center_cases/client.py +++ b/src/whop_sdk/resolution_center_cases/client.py @@ -145,7 +145,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -211,7 +211,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -305,7 +305,7 @@ def summary( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -346,7 +346,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -396,7 +396,7 @@ def accept( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -448,7 +448,7 @@ def appeal( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -497,7 +497,7 @@ def deny( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -552,7 +552,7 @@ def events( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -604,7 +604,7 @@ def reply( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -653,7 +653,7 @@ def request_info( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -688,7 +688,7 @@ def withdraw(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -805,7 +805,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -880,7 +880,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -982,7 +982,7 @@ async def summary( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1033,7 +1033,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1091,7 +1091,7 @@ async def accept( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1151,7 +1151,7 @@ async def appeal( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1208,7 +1208,7 @@ async def deny( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1273,7 +1273,7 @@ async def events( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1334,7 +1334,7 @@ async def reply( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1391,7 +1391,7 @@ async def request_info( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1436,7 +1436,7 @@ async def withdraw( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/reviews/client.py b/src/whop_sdk/reviews/client.py index 44010c08..c825d0d8 100644 --- a/src/whop_sdk/reviews/client.py +++ b/src/whop_sdk/reviews/client.py @@ -88,7 +88,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -146,7 +146,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -235,7 +235,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -302,7 +302,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/setup_intents/client.py b/src/whop_sdk/setup_intents/client.py index 1391c9f7..df1b759f 100644 --- a/src/whop_sdk/setup_intents/client.py +++ b/src/whop_sdk/setup_intents/client.py @@ -95,7 +95,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -157,7 +157,7 @@ def create( from whop_sdk.setup_intents import CreateSetupIntentsRequestConfirmationToken client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -198,7 +198,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -236,7 +236,7 @@ def update_return_url( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -274,7 +274,7 @@ def retrieve_status( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -363,7 +363,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -434,7 +434,7 @@ async def create( from whop_sdk.setup_intents import CreateSetupIntentsRequestConfirmationToken client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -483,7 +483,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -529,7 +529,7 @@ async def update_return_url( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -575,7 +575,7 @@ async def retrieve_status( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/shipments/client.py b/src/whop_sdk/shipments/client.py index 285ddae3..4a6e4fa8 100644 --- a/src/whop_sdk/shipments/client.py +++ b/src/whop_sdk/shipments/client.py @@ -98,7 +98,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -161,7 +161,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -200,7 +200,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -238,7 +238,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -335,7 +335,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -407,7 +407,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -454,7 +454,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -500,7 +500,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/social_accounts/client.py b/src/whop_sdk/social_accounts/client.py index 238991bf..bb2d0503 100644 --- a/src/whop_sdk/social_accounts/client.py +++ b/src/whop_sdk/social_accounts/client.py @@ -109,7 +109,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -166,7 +166,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -216,7 +216,7 @@ def connect( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -269,7 +269,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -307,7 +307,7 @@ def lead_forms( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -362,7 +362,7 @@ def posts( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -467,7 +467,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -533,7 +533,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -593,7 +593,7 @@ async def connect( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -654,7 +654,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -702,7 +702,7 @@ async def lead_forms( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -765,7 +765,7 @@ async def posts( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/stats/client.py b/src/whop_sdk/stats/client.py index 4044c319..0ccf72c5 100644 --- a/src/whop_sdk/stats/client.py +++ b/src/whop_sdk/stats/client.py @@ -51,7 +51,7 @@ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> Li from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -98,7 +98,7 @@ def describe_stats( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -176,7 +176,7 @@ def metric_stats( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -269,7 +269,7 @@ def raw_stats( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -463,7 +463,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -553,7 +553,7 @@ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -608,7 +608,7 @@ async def describe_stats( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -693,7 +693,7 @@ async def metric_stats( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -793,7 +793,7 @@ async def raw_stats( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -995,7 +995,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/support_channels/client.py b/src/whop_sdk/support_channels/client.py index 01c02f8f..9849de3c 100644 --- a/src/whop_sdk/support_channels/client.py +++ b/src/whop_sdk/support_channels/client.py @@ -91,7 +91,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -161,7 +161,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -204,7 +204,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -292,7 +292,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -371,7 +371,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -422,7 +422,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/swaps/client.py b/src/whop_sdk/swaps/client.py index 49edcca8..ca9e9430 100644 --- a/src/whop_sdk/swaps/client.py +++ b/src/whop_sdk/swaps/client.py @@ -55,7 +55,7 @@ def list(self, *, account_id: str, request_options: typing.Optional[RequestOptio from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -121,7 +121,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -203,7 +203,7 @@ def create_quote( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -249,7 +249,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -302,7 +302,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -376,7 +376,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -466,7 +466,7 @@ async def create_quote( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -522,7 +522,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/team_members/client.py b/src/whop_sdk/team_members/client.py index f98da362..b8dd9141 100644 --- a/src/whop_sdk/team_members/client.py +++ b/src/whop_sdk/team_members/client.py @@ -106,7 +106,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -174,7 +174,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -210,7 +210,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -243,7 +243,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -281,7 +281,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -382,7 +382,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -459,7 +459,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -503,7 +503,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -546,7 +546,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -592,7 +592,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/topups/client.py b/src/whop_sdk/topups/client.py index c93d12c5..85dba5de 100644 --- a/src/whop_sdk/topups/client.py +++ b/src/whop_sdk/topups/client.py @@ -69,7 +69,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -149,7 +149,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/transfers/client.py b/src/whop_sdk/transfers/client.py index bfea2b4f..3ac3b485 100644 --- a/src/whop_sdk/transfers/client.py +++ b/src/whop_sdk/transfers/client.py @@ -99,7 +99,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -187,7 +187,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -250,7 +250,7 @@ def list_recipients( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -291,7 +291,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -383,7 +383,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -480,7 +480,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -551,7 +551,7 @@ async def list_recipients( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -601,7 +601,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/types/__init__.py b/src/whop_sdk/types/__init__.py index 6d1906f7..d8ed08b7 100644 --- a/src/whop_sdk/types/__init__.py +++ b/src/whop_sdk/types/__init__.py @@ -169,16 +169,10 @@ from .ad_lead_form_question import AdLeadFormQuestion from .ad_lead_form_question_option import AdLeadFormQuestionOption from .ad_messaging_config import AdMessagingConfig + from .ad_music import AdMusic from .ad_platform_issue import AdPlatformIssue from .ad_platform_issue_resource_type import AdPlatformIssueResourceType from .ad_post_source import AdPostSource - from .ad_report import AdReport - from .ad_report_breakdown_item import AdReportBreakdownItem - from .ad_report_breakdown_item_granularity_item import AdReportBreakdownItemGranularityItem - from .ad_report_breakdown_item_summary import AdReportBreakdownItemSummary - from .ad_report_breakdown_levels import AdReportBreakdownLevels - from .ad_report_granularity_item import AdReportGranularityItem - from .ad_report_summary import AdReportSummary from .ad_result_event import AdResultEvent from .ad_status import AdStatus from .affiliate import Affiliate @@ -291,6 +285,7 @@ from .card_funding_types import CardFundingTypes from .card_issuing_transaction_status import CardIssuingTransactionStatus from .card_transaction import CardTransaction + from .card_transaction_legacy import CardTransactionLegacy from .card_transaction_list_item import CardTransactionListItem from .card_transaction_status import CardTransactionStatus from .card_transaction_transaction_type import CardTransactionTransactionType @@ -316,14 +311,6 @@ from .checkout_modes import CheckoutModes from .checkout_session_payment_method_configuration import CheckoutSessionPaymentMethodConfiguration from .checkout_shapes import CheckoutShapes - from .company import Company - from .company_featured_affiliate_product import CompanyFeaturedAffiliateProduct - from .company_list_item import CompanyListItem - from .company_list_item_logo import CompanyListItemLogo - from .company_list_item_owner_user import CompanyListItemOwnerUser - from .company_logo import CompanyLogo - from .company_owner_user import CompanyOwnerUser - from .company_social_links_item import CompanySocialLinksItem from .company_token_transaction import CompanyTokenTransaction from .company_token_transaction_company import CompanyTokenTransactionCompany from .company_token_transaction_list_item import CompanyTokenTransactionListItem @@ -337,7 +324,6 @@ from .confirmation_token_status import ConfirmationTokenStatus from .conversion_event import ConversionEvent from .conversion_event_zero import ConversionEventZero - from .countries import Countries from .course import Course from .course_chapter import CourseChapter from .course_chapter_lessons_item import CourseChapterLessonsItem @@ -404,6 +390,12 @@ from .direction import Direction from .dispute import Dispute from .dispute_alert import DisputeAlert + from .dispute_alert_legacy import DisputeAlertLegacy + from .dispute_alert_legacy_dispute import DisputeAlertLegacyDispute + from .dispute_alert_legacy_payment import DisputeAlertLegacyPayment + from .dispute_alert_legacy_payment_member import DisputeAlertLegacyPaymentMember + from .dispute_alert_legacy_payment_membership import DisputeAlertLegacyPaymentMembership + from .dispute_alert_legacy_payment_user import DisputeAlertLegacyPaymentUser from .dispute_alert_list_item import DisputeAlertListItem from .dispute_alert_list_item_dispute import DisputeAlertListItemDispute from .dispute_alert_list_item_payment import DisputeAlertListItemPayment @@ -420,6 +412,27 @@ from .dispute_evidence_document_visibility import DisputeEvidenceDocumentVisibility from .dispute_evidence_locked_reason import DisputeEvidenceLockedReason from .dispute_issuer_comment import DisputeIssuerComment + from .dispute_legacy import DisputeLegacy + from .dispute_legacy_cancellation_policy_attachment import DisputeLegacyCancellationPolicyAttachment + from .dispute_legacy_company import DisputeLegacyCompany + from .dispute_legacy_customer_communication_attachment import DisputeLegacyCustomerCommunicationAttachment + from .dispute_legacy_payment import DisputeLegacyPayment + from .dispute_legacy_payment_member import DisputeLegacyPaymentMember + from .dispute_legacy_payment_membership import DisputeLegacyPaymentMembership + from .dispute_legacy_payment_payment_instrument import DisputeLegacyPaymentPaymentInstrument + from .dispute_legacy_payment_payment_instrument_icons import DisputeLegacyPaymentPaymentInstrumentIcons + from .dispute_legacy_payment_payment_instrument_icons_square import DisputeLegacyPaymentPaymentInstrumentIconsSquare + from .dispute_legacy_payment_payment_instrument_icons_square_dark import ( + DisputeLegacyPaymentPaymentInstrumentIconsSquareDark, + ) + from .dispute_legacy_payment_payment_instrument_icons_square_light import ( + DisputeLegacyPaymentPaymentInstrumentIconsSquareLight, + ) + from .dispute_legacy_payment_user import DisputeLegacyPaymentUser + from .dispute_legacy_plan import DisputeLegacyPlan + from .dispute_legacy_product import DisputeLegacyProduct + from .dispute_legacy_refund_policy_attachment import DisputeLegacyRefundPolicyAttachment + from .dispute_legacy_uncategorized_attachment import DisputeLegacyUncategorizedAttachment from .dispute_list_item import DisputeListItem from .dispute_list_item_company import DisputeListItemCompany from .dispute_list_item_payment import DisputeListItemPayment @@ -504,7 +517,6 @@ from .future_usage_types import FutureUsageTypes from .global_affiliate_statuses import GlobalAffiliateStatuses from .grantable_authorized_user_roles import GrantableAuthorizedUserRoles - from .granularities import Granularities from .identity_profile import IdentityProfile from .identity_profile_business_address import IdentityProfileBusinessAddress from .identity_profile_kinds import IdentityProfileKinds @@ -618,6 +630,9 @@ from .media_asset_status import MediaAssetStatus from .member import Member from .member_access_level import MemberAccessLevel + from .member_legacy import MemberLegacy + from .member_legacy_company import MemberLegacyCompany + from .member_legacy_user import MemberLegacyUser from .member_list_item import MemberListItem from .member_list_item_user import MemberListItemUser from .member_most_recent_actions import MemberMostRecentActions @@ -626,6 +641,14 @@ from .members_sortable_columns import MembersSortableColumns from .membership import Membership from .membership_cancellation_modes import MembershipCancellationModes + from .membership_legacy import MembershipLegacy + from .membership_legacy_company import MembershipLegacyCompany + from .membership_legacy_custom_field_responses_item import MembershipLegacyCustomFieldResponsesItem + from .membership_legacy_member import MembershipLegacyMember + from .membership_legacy_plan import MembershipLegacyPlan + from .membership_legacy_product import MembershipLegacyProduct + from .membership_legacy_promo_code import MembershipLegacyPromoCode + from .membership_legacy_user import MembershipLegacyUser from .membership_list_item import MembershipListItem from .membership_list_item_company import MembershipListItemCompany from .membership_list_item_member import MembershipListItemMember @@ -674,16 +697,14 @@ from .pagination import Pagination from .passkey import Passkey from .payment import Payment - from .payment_application_fee import PaymentApplicationFee + from .payment_address import PaymentAddress from .payment_bank_transfer import PaymentBankTransfer from .payment_bank_transfer_instructions import PaymentBankTransferInstructions - from .payment_billing_address import PaymentBillingAddress from .payment_billing_details_preview import PaymentBillingDetailsPreview - from .payment_company import PaymentCompany from .payment_decline_codes import PaymentDeclineCodes - from .payment_disputes_item import PaymentDisputesItem - from .payment_fees_item import PaymentFeesItem - from .payment_financing_transactions_item import PaymentFinancingTransactionsItem + from .payment_fee import PaymentFee + from .payment_fee_origin import PaymentFeeOrigin + from .payment_fee_type import PaymentFeeType from .payment_instructions import ( PaymentInstructions, PaymentInstructions_BankTransfer, @@ -694,6 +715,35 @@ from .payment_instrument_card import PaymentInstrumentCard from .payment_last_payment_error import PaymentLastPaymentError from .payment_last_payment_error_decline_code import PaymentLastPaymentErrorDeclineCode + from .payment_legacy import PaymentLegacy + from .payment_legacy_application_fee import PaymentLegacyApplicationFee + from .payment_legacy_billing_address import PaymentLegacyBillingAddress + from .payment_legacy_company import PaymentLegacyCompany + from .payment_legacy_disputes_item import PaymentLegacyDisputesItem + from .payment_legacy_fees_item import PaymentLegacyFeesItem + from .payment_legacy_financing_transactions_item import PaymentLegacyFinancingTransactionsItem + from .payment_legacy_member import PaymentLegacyMember + from .payment_legacy_membership import PaymentLegacyMembership + from .payment_legacy_payment_instrument import PaymentLegacyPaymentInstrument + from .payment_legacy_payment_instrument_card import PaymentLegacyPaymentInstrumentCard + from .payment_legacy_payment_instrument_icons import PaymentLegacyPaymentInstrumentIcons + from .payment_legacy_payment_instrument_icons_card import PaymentLegacyPaymentInstrumentIconsCard + from .payment_legacy_payment_instrument_icons_card_dark import PaymentLegacyPaymentInstrumentIconsCardDark + from .payment_legacy_payment_instrument_icons_card_light import PaymentLegacyPaymentInstrumentIconsCardLight + from .payment_legacy_payment_instrument_icons_square import PaymentLegacyPaymentInstrumentIconsSquare + from .payment_legacy_payment_instrument_icons_square_dark import PaymentLegacyPaymentInstrumentIconsSquareDark + from .payment_legacy_payment_instrument_icons_square_light import PaymentLegacyPaymentInstrumentIconsSquareLight + from .payment_legacy_payment_method import PaymentLegacyPaymentMethod + from .payment_legacy_payment_method_card import PaymentLegacyPaymentMethodCard + from .payment_legacy_plan import PaymentLegacyPlan + from .payment_legacy_product import PaymentLegacyProduct + from .payment_legacy_promo_code import PaymentLegacyPromoCode + from .payment_legacy_refunds_item import PaymentLegacyRefundsItem + from .payment_legacy_resolutions_item import PaymentLegacyResolutionsItem + from .payment_legacy_shipment import PaymentLegacyShipment + from .payment_legacy_shipping_address import PaymentLegacyShippingAddress + from .payment_legacy_user import PaymentLegacyUser + from .payment_legacy_verification_checks import PaymentLegacyVerificationChecks from .payment_list_item import PaymentListItem from .payment_list_item_application_fee import PaymentListItemApplicationFee from .payment_list_item_billing_address import PaymentListItemBillingAddress @@ -719,8 +769,6 @@ from .payment_list_item_shipment import PaymentListItemShipment from .payment_list_item_shipping_address import PaymentListItemShippingAddress from .payment_list_item_user import PaymentListItemUser - from .payment_member import PaymentMember - from .payment_membership import PaymentMembership from .payment_method import ( PaymentMethod, PaymentMethod_BasePaymentMethod, @@ -973,36 +1021,17 @@ from .payment_next_action_redirect import PaymentNextActionRedirect from .payment_next_action_redirect_data import PaymentNextActionRedirectData from .payment_next_action_redirect_render_item import PaymentNextActionRedirectRenderItem - from .payment_payment_instrument import PaymentPaymentInstrument - from .payment_payment_instrument_card import PaymentPaymentInstrumentCard - from .payment_payment_instrument_icons import PaymentPaymentInstrumentIcons - from .payment_payment_instrument_icons_card import PaymentPaymentInstrumentIconsCard - from .payment_payment_instrument_icons_card_dark import PaymentPaymentInstrumentIconsCardDark - from .payment_payment_instrument_icons_card_light import PaymentPaymentInstrumentIconsCardLight - from .payment_payment_instrument_icons_square import PaymentPaymentInstrumentIconsSquare - from .payment_payment_instrument_icons_square_dark import PaymentPaymentInstrumentIconsSquareDark - from .payment_payment_instrument_icons_square_light import PaymentPaymentInstrumentIconsSquareLight - from .payment_payment_method import PaymentPaymentMethod - from .payment_payment_method_card import PaymentPaymentMethodCard - from .payment_plan import PaymentPlan from .payment_processing_details import PaymentProcessingDetails - from .payment_product import PaymentProduct - from .payment_promo_code import PaymentPromoCode from .payment_providers import PaymentProviders from .payment_qr import PaymentQr from .payment_qr_instructions import PaymentQrInstructions - from .payment_refunds_item import PaymentRefundsItem from .payment_required_error_body import PaymentRequiredErrorBody from .payment_required_error_body_error import PaymentRequiredErrorBodyError from .payment_required_error_body_error_type import PaymentRequiredErrorBodyErrorType - from .payment_resolutions_item import PaymentResolutionsItem - from .payment_shipment import PaymentShipment - from .payment_shipping_address import PaymentShippingAddress from .payment_status import PaymentStatus from .payment_status_status import PaymentStatusStatus from .payment_transaction_statuses import PaymentTransactionStatuses from .payment_transaction_types import PaymentTransactionTypes - from .payment_user import PaymentUser from .payment_verification_checks import PaymentVerificationChecks from .payment_voucher import PaymentVoucher from .payment_voucher_instructions import PaymentVoucherInstructions @@ -1022,7 +1051,6 @@ from .permission import Permission from .permission_action import PermissionAction from .permission_granted_to_system_roles_item import PermissionGrantedToSystemRolesItem - from .permission_system_roles import PermissionSystemRoles from .pixel_validation import PixelValidation from .plan import Plan from .plan_currency import PlanCurrency @@ -1044,6 +1072,11 @@ from .product_custom_cta import ProductCustomCta from .product_gallery_image import ProductGalleryImage from .product_global_affiliate_status import ProductGlobalAffiliateStatus + from .product_legacy import ProductLegacy + from .product_legacy_company import ProductLegacyCompany + from .product_legacy_gallery_images_item import ProductLegacyGalleryImagesItem + from .product_legacy_owner_user import ProductLegacyOwnerUser + from .product_legacy_product_tax_code import ProductLegacyProductTaxCode from .product_list_item import ProductListItem from .product_marketplace_status import ProductMarketplaceStatus from .product_member_affiliate_status import ProductMemberAffiliateStatus @@ -1078,16 +1111,22 @@ from .recommended_action_execution import RecommendedActionExecution from .recommended_action_execution_status import RecommendedActionExecutionStatus from .refund import Refund + from .refund_failure_reason import RefundFailureReason + from .refund_legacy import RefundLegacy + from .refund_legacy_payment import RefundLegacyPayment + from .refund_legacy_payment_member import RefundLegacyPaymentMember + from .refund_legacy_payment_membership import RefundLegacyPaymentMembership + from .refund_legacy_payment_plan import RefundLegacyPaymentPlan + from .refund_legacy_payment_product import RefundLegacyPaymentProduct + from .refund_legacy_payment_user import RefundLegacyPaymentUser from .refund_list_item import RefundListItem from .refund_list_item_payment import RefundListItemPayment - from .refund_payment import RefundPayment - from .refund_payment_member import RefundPaymentMember - from .refund_payment_membership import RefundPaymentMembership - from .refund_payment_plan import RefundPaymentPlan - from .refund_payment_product import RefundPaymentProduct - from .refund_payment_user import RefundPaymentUser + from .refund_reason import RefundReason + from .refund_reference_status import RefundReferenceStatus from .refund_reference_statuses import RefundReferenceStatuses + from .refund_reference_type import RefundReferenceType from .refund_reference_types import RefundReferenceTypes + from .refund_status import RefundStatus from .refund_statuses import RefundStatuses from .release_method import ReleaseMethod from .resolution_attachment import ResolutionAttachment @@ -1097,6 +1136,12 @@ from .resolution_center_case_available_actions_item import ResolutionCenterCaseAvailableActionsItem from .resolution_center_case_customer_responses import ResolutionCenterCaseCustomerResponses from .resolution_center_case_issue_types import ResolutionCenterCaseIssueTypes + from .resolution_center_case_legacy import ResolutionCenterCaseLegacy + from .resolution_center_case_legacy_company import ResolutionCenterCaseLegacyCompany + from .resolution_center_case_legacy_member import ResolutionCenterCaseLegacyMember + from .resolution_center_case_legacy_payment import ResolutionCenterCaseLegacyPayment + from .resolution_center_case_legacy_resolution_events_item import ResolutionCenterCaseLegacyResolutionEventsItem + from .resolution_center_case_legacy_user import ResolutionCenterCaseLegacyUser from .resolution_center_case_list_item import ResolutionCenterCaseListItem from .resolution_center_case_list_item_company import ResolutionCenterCaseListItemCompany from .resolution_center_case_list_item_payment import ResolutionCenterCaseListItemPayment @@ -1113,7 +1158,6 @@ from .resolution_event_action import ResolutionEventAction from .resolution_event_reporter_type import ResolutionEventReporterType from .resolution_payment import ResolutionPayment - from .result_label_keys import ResultLabelKeys from .review import Review from .review_attachments_item import ReviewAttachmentsItem from .review_company import ReviewCompany @@ -1147,6 +1191,8 @@ from .shipment import Shipment from .shipment_checkpoint import ShipmentCheckpoint from .shipment_checkpoint_status import ShipmentCheckpointStatus + from .shipment_legacy import ShipmentLegacy + from .shipment_legacy_payment import ShipmentLegacyPayment from .shipment_list_item import ShipmentListItem from .shipment_list_item_payment import ShipmentListItemPayment from .shipment_status import ShipmentStatus @@ -1161,7 +1207,6 @@ from .social_account_post import SocialAccountPost from .social_account_post_call_to_action import SocialAccountPostCallToAction from .social_account_post_restrictions_item import SocialAccountPostRestrictionsItem - from .social_link_websites import SocialLinkWebsites from .specific_fee_origins import SpecificFeeOrigins from .status import Status from .statuses import Statuses @@ -1399,16 +1444,10 @@ "AdLeadFormQuestion": ".ad_lead_form_question", "AdLeadFormQuestionOption": ".ad_lead_form_question_option", "AdMessagingConfig": ".ad_messaging_config", + "AdMusic": ".ad_music", "AdPlatformIssue": ".ad_platform_issue", "AdPlatformIssueResourceType": ".ad_platform_issue_resource_type", "AdPostSource": ".ad_post_source", - "AdReport": ".ad_report", - "AdReportBreakdownItem": ".ad_report_breakdown_item", - "AdReportBreakdownItemGranularityItem": ".ad_report_breakdown_item_granularity_item", - "AdReportBreakdownItemSummary": ".ad_report_breakdown_item_summary", - "AdReportBreakdownLevels": ".ad_report_breakdown_levels", - "AdReportGranularityItem": ".ad_report_granularity_item", - "AdReportSummary": ".ad_report_summary", "AdResultEvent": ".ad_result_event", "AdStatus": ".ad_status", "Affiliate": ".affiliate", @@ -1521,6 +1560,7 @@ "CardFundingTypes": ".card_funding_types", "CardIssuingTransactionStatus": ".card_issuing_transaction_status", "CardTransaction": ".card_transaction", + "CardTransactionLegacy": ".card_transaction_legacy", "CardTransactionListItem": ".card_transaction_list_item", "CardTransactionStatus": ".card_transaction_status", "CardTransactionTransactionType": ".card_transaction_transaction_type", @@ -1544,14 +1584,6 @@ "CheckoutModes": ".checkout_modes", "CheckoutSessionPaymentMethodConfiguration": ".checkout_session_payment_method_configuration", "CheckoutShapes": ".checkout_shapes", - "Company": ".company", - "CompanyFeaturedAffiliateProduct": ".company_featured_affiliate_product", - "CompanyListItem": ".company_list_item", - "CompanyListItemLogo": ".company_list_item_logo", - "CompanyListItemOwnerUser": ".company_list_item_owner_user", - "CompanyLogo": ".company_logo", - "CompanyOwnerUser": ".company_owner_user", - "CompanySocialLinksItem": ".company_social_links_item", "CompanyTokenTransaction": ".company_token_transaction", "CompanyTokenTransactionCompany": ".company_token_transaction_company", "CompanyTokenTransactionListItem": ".company_token_transaction_list_item", @@ -1565,7 +1597,6 @@ "ConfirmationTokenStatus": ".confirmation_token_status", "ConversionEvent": ".conversion_event", "ConversionEventZero": ".conversion_event_zero", - "Countries": ".countries", "Course": ".course", "CourseChapter": ".course_chapter", "CourseChapterLessonsItem": ".course_chapter_lessons_item", @@ -1628,6 +1659,12 @@ "Direction": ".direction", "Dispute": ".dispute", "DisputeAlert": ".dispute_alert", + "DisputeAlertLegacy": ".dispute_alert_legacy", + "DisputeAlertLegacyDispute": ".dispute_alert_legacy_dispute", + "DisputeAlertLegacyPayment": ".dispute_alert_legacy_payment", + "DisputeAlertLegacyPaymentMember": ".dispute_alert_legacy_payment_member", + "DisputeAlertLegacyPaymentMembership": ".dispute_alert_legacy_payment_membership", + "DisputeAlertLegacyPaymentUser": ".dispute_alert_legacy_payment_user", "DisputeAlertListItem": ".dispute_alert_list_item", "DisputeAlertListItemDispute": ".dispute_alert_list_item_dispute", "DisputeAlertListItemPayment": ".dispute_alert_list_item_payment", @@ -1644,6 +1681,23 @@ "DisputeEvidenceDocumentVisibility": ".dispute_evidence_document_visibility", "DisputeEvidenceLockedReason": ".dispute_evidence_locked_reason", "DisputeIssuerComment": ".dispute_issuer_comment", + "DisputeLegacy": ".dispute_legacy", + "DisputeLegacyCancellationPolicyAttachment": ".dispute_legacy_cancellation_policy_attachment", + "DisputeLegacyCompany": ".dispute_legacy_company", + "DisputeLegacyCustomerCommunicationAttachment": ".dispute_legacy_customer_communication_attachment", + "DisputeLegacyPayment": ".dispute_legacy_payment", + "DisputeLegacyPaymentMember": ".dispute_legacy_payment_member", + "DisputeLegacyPaymentMembership": ".dispute_legacy_payment_membership", + "DisputeLegacyPaymentPaymentInstrument": ".dispute_legacy_payment_payment_instrument", + "DisputeLegacyPaymentPaymentInstrumentIcons": ".dispute_legacy_payment_payment_instrument_icons", + "DisputeLegacyPaymentPaymentInstrumentIconsSquare": ".dispute_legacy_payment_payment_instrument_icons_square", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareDark": ".dispute_legacy_payment_payment_instrument_icons_square_dark", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareLight": ".dispute_legacy_payment_payment_instrument_icons_square_light", + "DisputeLegacyPaymentUser": ".dispute_legacy_payment_user", + "DisputeLegacyPlan": ".dispute_legacy_plan", + "DisputeLegacyProduct": ".dispute_legacy_product", + "DisputeLegacyRefundPolicyAttachment": ".dispute_legacy_refund_policy_attachment", + "DisputeLegacyUncategorizedAttachment": ".dispute_legacy_uncategorized_attachment", "DisputeListItem": ".dispute_list_item", "DisputeListItemCompany": ".dispute_list_item_company", "DisputeListItemPayment": ".dispute_list_item_payment", @@ -1722,7 +1776,6 @@ "FutureUsageTypes": ".future_usage_types", "GlobalAffiliateStatuses": ".global_affiliate_statuses", "GrantableAuthorizedUserRoles": ".grantable_authorized_user_roles", - "Granularities": ".granularities", "IdentityProfile": ".identity_profile", "IdentityProfileBusinessAddress": ".identity_profile_business_address", "IdentityProfileKinds": ".identity_profile_kinds", @@ -1832,6 +1885,9 @@ "MediaAssetStatus": ".media_asset_status", "Member": ".member", "MemberAccessLevel": ".member_access_level", + "MemberLegacy": ".member_legacy", + "MemberLegacyCompany": ".member_legacy_company", + "MemberLegacyUser": ".member_legacy_user", "MemberListItem": ".member_list_item", "MemberListItemUser": ".member_list_item_user", "MemberMostRecentActions": ".member_most_recent_actions", @@ -1840,6 +1896,14 @@ "MembersSortableColumns": ".members_sortable_columns", "Membership": ".membership", "MembershipCancellationModes": ".membership_cancellation_modes", + "MembershipLegacy": ".membership_legacy", + "MembershipLegacyCompany": ".membership_legacy_company", + "MembershipLegacyCustomFieldResponsesItem": ".membership_legacy_custom_field_responses_item", + "MembershipLegacyMember": ".membership_legacy_member", + "MembershipLegacyPlan": ".membership_legacy_plan", + "MembershipLegacyProduct": ".membership_legacy_product", + "MembershipLegacyPromoCode": ".membership_legacy_promo_code", + "MembershipLegacyUser": ".membership_legacy_user", "MembershipListItem": ".membership_list_item", "MembershipListItemCompany": ".membership_list_item_company", "MembershipListItemMember": ".membership_list_item_member", @@ -1888,16 +1952,14 @@ "Pagination": ".pagination", "Passkey": ".passkey", "Payment": ".payment", - "PaymentApplicationFee": ".payment_application_fee", + "PaymentAddress": ".payment_address", "PaymentBankTransfer": ".payment_bank_transfer", "PaymentBankTransferInstructions": ".payment_bank_transfer_instructions", - "PaymentBillingAddress": ".payment_billing_address", "PaymentBillingDetailsPreview": ".payment_billing_details_preview", - "PaymentCompany": ".payment_company", "PaymentDeclineCodes": ".payment_decline_codes", - "PaymentDisputesItem": ".payment_disputes_item", - "PaymentFeesItem": ".payment_fees_item", - "PaymentFinancingTransactionsItem": ".payment_financing_transactions_item", + "PaymentFee": ".payment_fee", + "PaymentFeeOrigin": ".payment_fee_origin", + "PaymentFeeType": ".payment_fee_type", "PaymentInstructions": ".payment_instructions", "PaymentInstructions_BankTransfer": ".payment_instructions", "PaymentInstructions_Qr": ".payment_instructions", @@ -1906,6 +1968,35 @@ "PaymentInstrumentCard": ".payment_instrument_card", "PaymentLastPaymentError": ".payment_last_payment_error", "PaymentLastPaymentErrorDeclineCode": ".payment_last_payment_error_decline_code", + "PaymentLegacy": ".payment_legacy", + "PaymentLegacyApplicationFee": ".payment_legacy_application_fee", + "PaymentLegacyBillingAddress": ".payment_legacy_billing_address", + "PaymentLegacyCompany": ".payment_legacy_company", + "PaymentLegacyDisputesItem": ".payment_legacy_disputes_item", + "PaymentLegacyFeesItem": ".payment_legacy_fees_item", + "PaymentLegacyFinancingTransactionsItem": ".payment_legacy_financing_transactions_item", + "PaymentLegacyMember": ".payment_legacy_member", + "PaymentLegacyMembership": ".payment_legacy_membership", + "PaymentLegacyPaymentInstrument": ".payment_legacy_payment_instrument", + "PaymentLegacyPaymentInstrumentCard": ".payment_legacy_payment_instrument_card", + "PaymentLegacyPaymentInstrumentIcons": ".payment_legacy_payment_instrument_icons", + "PaymentLegacyPaymentInstrumentIconsCard": ".payment_legacy_payment_instrument_icons_card", + "PaymentLegacyPaymentInstrumentIconsCardDark": ".payment_legacy_payment_instrument_icons_card_dark", + "PaymentLegacyPaymentInstrumentIconsCardLight": ".payment_legacy_payment_instrument_icons_card_light", + "PaymentLegacyPaymentInstrumentIconsSquare": ".payment_legacy_payment_instrument_icons_square", + "PaymentLegacyPaymentInstrumentIconsSquareDark": ".payment_legacy_payment_instrument_icons_square_dark", + "PaymentLegacyPaymentInstrumentIconsSquareLight": ".payment_legacy_payment_instrument_icons_square_light", + "PaymentLegacyPaymentMethod": ".payment_legacy_payment_method", + "PaymentLegacyPaymentMethodCard": ".payment_legacy_payment_method_card", + "PaymentLegacyPlan": ".payment_legacy_plan", + "PaymentLegacyProduct": ".payment_legacy_product", + "PaymentLegacyPromoCode": ".payment_legacy_promo_code", + "PaymentLegacyRefundsItem": ".payment_legacy_refunds_item", + "PaymentLegacyResolutionsItem": ".payment_legacy_resolutions_item", + "PaymentLegacyShipment": ".payment_legacy_shipment", + "PaymentLegacyShippingAddress": ".payment_legacy_shipping_address", + "PaymentLegacyUser": ".payment_legacy_user", + "PaymentLegacyVerificationChecks": ".payment_legacy_verification_checks", "PaymentListItem": ".payment_list_item", "PaymentListItemApplicationFee": ".payment_list_item_application_fee", "PaymentListItemBillingAddress": ".payment_list_item_billing_address", @@ -1929,8 +2020,6 @@ "PaymentListItemShipment": ".payment_list_item_shipment", "PaymentListItemShippingAddress": ".payment_list_item_shipping_address", "PaymentListItemUser": ".payment_list_item_user", - "PaymentMember": ".payment_member", - "PaymentMembership": ".payment_membership", "PaymentMethod": ".payment_method", "PaymentMethodBasePaymentMethod": ".payment_method_base_payment_method", "PaymentMethodBasePaymentMethodIcons": ".payment_method_base_payment_method_icons", @@ -2073,36 +2162,17 @@ "PaymentNextAction_AwaitConfirmation": ".payment_next_action", "PaymentNextAction_DisplayInstructions": ".payment_next_action", "PaymentNextAction_Redirect": ".payment_next_action", - "PaymentPaymentInstrument": ".payment_payment_instrument", - "PaymentPaymentInstrumentCard": ".payment_payment_instrument_card", - "PaymentPaymentInstrumentIcons": ".payment_payment_instrument_icons", - "PaymentPaymentInstrumentIconsCard": ".payment_payment_instrument_icons_card", - "PaymentPaymentInstrumentIconsCardDark": ".payment_payment_instrument_icons_card_dark", - "PaymentPaymentInstrumentIconsCardLight": ".payment_payment_instrument_icons_card_light", - "PaymentPaymentInstrumentIconsSquare": ".payment_payment_instrument_icons_square", - "PaymentPaymentInstrumentIconsSquareDark": ".payment_payment_instrument_icons_square_dark", - "PaymentPaymentInstrumentIconsSquareLight": ".payment_payment_instrument_icons_square_light", - "PaymentPaymentMethod": ".payment_payment_method", - "PaymentPaymentMethodCard": ".payment_payment_method_card", - "PaymentPlan": ".payment_plan", "PaymentProcessingDetails": ".payment_processing_details", - "PaymentProduct": ".payment_product", - "PaymentPromoCode": ".payment_promo_code", "PaymentProviders": ".payment_providers", "PaymentQr": ".payment_qr", "PaymentQrInstructions": ".payment_qr_instructions", - "PaymentRefundsItem": ".payment_refunds_item", "PaymentRequiredErrorBody": ".payment_required_error_body", "PaymentRequiredErrorBodyError": ".payment_required_error_body_error", "PaymentRequiredErrorBodyErrorType": ".payment_required_error_body_error_type", - "PaymentResolutionsItem": ".payment_resolutions_item", - "PaymentShipment": ".payment_shipment", - "PaymentShippingAddress": ".payment_shipping_address", "PaymentStatus": ".payment_status", "PaymentStatusStatus": ".payment_status_status", "PaymentTransactionStatuses": ".payment_transaction_statuses", "PaymentTransactionTypes": ".payment_transaction_types", - "PaymentUser": ".payment_user", "PaymentVerificationChecks": ".payment_verification_checks", "PaymentVoucher": ".payment_voucher", "PaymentVoucherInstructions": ".payment_voucher_instructions", @@ -2122,7 +2192,6 @@ "Permission": ".permission", "PermissionAction": ".permission_action", "PermissionGrantedToSystemRolesItem": ".permission_granted_to_system_roles_item", - "PermissionSystemRoles": ".permission_system_roles", "PixelValidation": ".pixel_validation", "Plan": ".plan", "PlanCurrency": ".plan_currency", @@ -2144,6 +2213,11 @@ "ProductCustomCta": ".product_custom_cta", "ProductGalleryImage": ".product_gallery_image", "ProductGlobalAffiliateStatus": ".product_global_affiliate_status", + "ProductLegacy": ".product_legacy", + "ProductLegacyCompany": ".product_legacy_company", + "ProductLegacyGalleryImagesItem": ".product_legacy_gallery_images_item", + "ProductLegacyOwnerUser": ".product_legacy_owner_user", + "ProductLegacyProductTaxCode": ".product_legacy_product_tax_code", "ProductListItem": ".product_list_item", "ProductMarketplaceStatus": ".product_marketplace_status", "ProductMemberAffiliateStatus": ".product_member_affiliate_status", @@ -2178,16 +2252,22 @@ "RecommendedActionExecution": ".recommended_action_execution", "RecommendedActionExecutionStatus": ".recommended_action_execution_status", "Refund": ".refund", + "RefundFailureReason": ".refund_failure_reason", + "RefundLegacy": ".refund_legacy", + "RefundLegacyPayment": ".refund_legacy_payment", + "RefundLegacyPaymentMember": ".refund_legacy_payment_member", + "RefundLegacyPaymentMembership": ".refund_legacy_payment_membership", + "RefundLegacyPaymentPlan": ".refund_legacy_payment_plan", + "RefundLegacyPaymentProduct": ".refund_legacy_payment_product", + "RefundLegacyPaymentUser": ".refund_legacy_payment_user", "RefundListItem": ".refund_list_item", "RefundListItemPayment": ".refund_list_item_payment", - "RefundPayment": ".refund_payment", - "RefundPaymentMember": ".refund_payment_member", - "RefundPaymentMembership": ".refund_payment_membership", - "RefundPaymentPlan": ".refund_payment_plan", - "RefundPaymentProduct": ".refund_payment_product", - "RefundPaymentUser": ".refund_payment_user", + "RefundReason": ".refund_reason", + "RefundReferenceStatus": ".refund_reference_status", "RefundReferenceStatuses": ".refund_reference_statuses", + "RefundReferenceType": ".refund_reference_type", "RefundReferenceTypes": ".refund_reference_types", + "RefundStatus": ".refund_status", "RefundStatuses": ".refund_statuses", "ReleaseMethod": ".release_method", "ResolutionAttachment": ".resolution_attachment", @@ -2197,6 +2277,12 @@ "ResolutionCenterCaseAvailableActionsItem": ".resolution_center_case_available_actions_item", "ResolutionCenterCaseCustomerResponses": ".resolution_center_case_customer_responses", "ResolutionCenterCaseIssueTypes": ".resolution_center_case_issue_types", + "ResolutionCenterCaseLegacy": ".resolution_center_case_legacy", + "ResolutionCenterCaseLegacyCompany": ".resolution_center_case_legacy_company", + "ResolutionCenterCaseLegacyMember": ".resolution_center_case_legacy_member", + "ResolutionCenterCaseLegacyPayment": ".resolution_center_case_legacy_payment", + "ResolutionCenterCaseLegacyResolutionEventsItem": ".resolution_center_case_legacy_resolution_events_item", + "ResolutionCenterCaseLegacyUser": ".resolution_center_case_legacy_user", "ResolutionCenterCaseListItem": ".resolution_center_case_list_item", "ResolutionCenterCaseListItemCompany": ".resolution_center_case_list_item_company", "ResolutionCenterCaseListItemPayment": ".resolution_center_case_list_item_payment", @@ -2213,7 +2299,6 @@ "ResolutionEventAction": ".resolution_event_action", "ResolutionEventReporterType": ".resolution_event_reporter_type", "ResolutionPayment": ".resolution_payment", - "ResultLabelKeys": ".result_label_keys", "Review": ".review", "ReviewAttachmentsItem": ".review_attachments_item", "ReviewCompany": ".review_company", @@ -2247,6 +2332,8 @@ "Shipment": ".shipment", "ShipmentCheckpoint": ".shipment_checkpoint", "ShipmentCheckpointStatus": ".shipment_checkpoint_status", + "ShipmentLegacy": ".shipment_legacy", + "ShipmentLegacyPayment": ".shipment_legacy_payment", "ShipmentListItem": ".shipment_list_item", "ShipmentListItemPayment": ".shipment_list_item_payment", "ShipmentStatus": ".shipment_status", @@ -2261,7 +2348,6 @@ "SocialAccountPost": ".social_account_post", "SocialAccountPostCallToAction": ".social_account_post_call_to_action", "SocialAccountPostRestrictionsItem": ".social_account_post_restrictions_item", - "SocialLinkWebsites": ".social_link_websites", "SpecificFeeOrigins": ".specific_fee_origins", "Status": ".status", "Statuses": ".statuses", @@ -2521,16 +2607,10 @@ def __dir__(): "AdLeadFormQuestion", "AdLeadFormQuestionOption", "AdMessagingConfig", + "AdMusic", "AdPlatformIssue", "AdPlatformIssueResourceType", "AdPostSource", - "AdReport", - "AdReportBreakdownItem", - "AdReportBreakdownItemGranularityItem", - "AdReportBreakdownItemSummary", - "AdReportBreakdownLevels", - "AdReportGranularityItem", - "AdReportSummary", "AdResultEvent", "AdStatus", "Affiliate", @@ -2643,6 +2723,7 @@ def __dir__(): "CardFundingTypes", "CardIssuingTransactionStatus", "CardTransaction", + "CardTransactionLegacy", "CardTransactionListItem", "CardTransactionStatus", "CardTransactionTransactionType", @@ -2666,14 +2747,6 @@ def __dir__(): "CheckoutModes", "CheckoutSessionPaymentMethodConfiguration", "CheckoutShapes", - "Company", - "CompanyFeaturedAffiliateProduct", - "CompanyListItem", - "CompanyListItemLogo", - "CompanyListItemOwnerUser", - "CompanyLogo", - "CompanyOwnerUser", - "CompanySocialLinksItem", "CompanyTokenTransaction", "CompanyTokenTransactionCompany", "CompanyTokenTransactionListItem", @@ -2687,7 +2760,6 @@ def __dir__(): "ConfirmationTokenStatus", "ConversionEvent", "ConversionEventZero", - "Countries", "Course", "CourseChapter", "CourseChapterLessonsItem", @@ -2750,6 +2822,12 @@ def __dir__(): "Direction", "Dispute", "DisputeAlert", + "DisputeAlertLegacy", + "DisputeAlertLegacyDispute", + "DisputeAlertLegacyPayment", + "DisputeAlertLegacyPaymentMember", + "DisputeAlertLegacyPaymentMembership", + "DisputeAlertLegacyPaymentUser", "DisputeAlertListItem", "DisputeAlertListItemDispute", "DisputeAlertListItemPayment", @@ -2766,6 +2844,23 @@ def __dir__(): "DisputeEvidenceDocumentVisibility", "DisputeEvidenceLockedReason", "DisputeIssuerComment", + "DisputeLegacy", + "DisputeLegacyCancellationPolicyAttachment", + "DisputeLegacyCompany", + "DisputeLegacyCustomerCommunicationAttachment", + "DisputeLegacyPayment", + "DisputeLegacyPaymentMember", + "DisputeLegacyPaymentMembership", + "DisputeLegacyPaymentPaymentInstrument", + "DisputeLegacyPaymentPaymentInstrumentIcons", + "DisputeLegacyPaymentPaymentInstrumentIconsSquare", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareDark", + "DisputeLegacyPaymentPaymentInstrumentIconsSquareLight", + "DisputeLegacyPaymentUser", + "DisputeLegacyPlan", + "DisputeLegacyProduct", + "DisputeLegacyRefundPolicyAttachment", + "DisputeLegacyUncategorizedAttachment", "DisputeListItem", "DisputeListItemCompany", "DisputeListItemPayment", @@ -2844,7 +2939,6 @@ def __dir__(): "FutureUsageTypes", "GlobalAffiliateStatuses", "GrantableAuthorizedUserRoles", - "Granularities", "IdentityProfile", "IdentityProfileBusinessAddress", "IdentityProfileKinds", @@ -2954,6 +3048,9 @@ def __dir__(): "MediaAssetStatus", "Member", "MemberAccessLevel", + "MemberLegacy", + "MemberLegacyCompany", + "MemberLegacyUser", "MemberListItem", "MemberListItemUser", "MemberMostRecentActions", @@ -2962,6 +3059,14 @@ def __dir__(): "MembersSortableColumns", "Membership", "MembershipCancellationModes", + "MembershipLegacy", + "MembershipLegacyCompany", + "MembershipLegacyCustomFieldResponsesItem", + "MembershipLegacyMember", + "MembershipLegacyPlan", + "MembershipLegacyProduct", + "MembershipLegacyPromoCode", + "MembershipLegacyUser", "MembershipListItem", "MembershipListItemCompany", "MembershipListItemMember", @@ -3010,16 +3115,14 @@ def __dir__(): "Pagination", "Passkey", "Payment", - "PaymentApplicationFee", + "PaymentAddress", "PaymentBankTransfer", "PaymentBankTransferInstructions", - "PaymentBillingAddress", "PaymentBillingDetailsPreview", - "PaymentCompany", "PaymentDeclineCodes", - "PaymentDisputesItem", - "PaymentFeesItem", - "PaymentFinancingTransactionsItem", + "PaymentFee", + "PaymentFeeOrigin", + "PaymentFeeType", "PaymentInstructions", "PaymentInstructions_BankTransfer", "PaymentInstructions_Qr", @@ -3028,6 +3131,35 @@ def __dir__(): "PaymentInstrumentCard", "PaymentLastPaymentError", "PaymentLastPaymentErrorDeclineCode", + "PaymentLegacy", + "PaymentLegacyApplicationFee", + "PaymentLegacyBillingAddress", + "PaymentLegacyCompany", + "PaymentLegacyDisputesItem", + "PaymentLegacyFeesItem", + "PaymentLegacyFinancingTransactionsItem", + "PaymentLegacyMember", + "PaymentLegacyMembership", + "PaymentLegacyPaymentInstrument", + "PaymentLegacyPaymentInstrumentCard", + "PaymentLegacyPaymentInstrumentIcons", + "PaymentLegacyPaymentInstrumentIconsCard", + "PaymentLegacyPaymentInstrumentIconsCardDark", + "PaymentLegacyPaymentInstrumentIconsCardLight", + "PaymentLegacyPaymentInstrumentIconsSquare", + "PaymentLegacyPaymentInstrumentIconsSquareDark", + "PaymentLegacyPaymentInstrumentIconsSquareLight", + "PaymentLegacyPaymentMethod", + "PaymentLegacyPaymentMethodCard", + "PaymentLegacyPlan", + "PaymentLegacyProduct", + "PaymentLegacyPromoCode", + "PaymentLegacyRefundsItem", + "PaymentLegacyResolutionsItem", + "PaymentLegacyShipment", + "PaymentLegacyShippingAddress", + "PaymentLegacyUser", + "PaymentLegacyVerificationChecks", "PaymentListItem", "PaymentListItemApplicationFee", "PaymentListItemBillingAddress", @@ -3051,8 +3183,6 @@ def __dir__(): "PaymentListItemShipment", "PaymentListItemShippingAddress", "PaymentListItemUser", - "PaymentMember", - "PaymentMembership", "PaymentMethod", "PaymentMethodBasePaymentMethod", "PaymentMethodBasePaymentMethodIcons", @@ -3195,36 +3325,17 @@ def __dir__(): "PaymentNextAction_AwaitConfirmation", "PaymentNextAction_DisplayInstructions", "PaymentNextAction_Redirect", - "PaymentPaymentInstrument", - "PaymentPaymentInstrumentCard", - "PaymentPaymentInstrumentIcons", - "PaymentPaymentInstrumentIconsCard", - "PaymentPaymentInstrumentIconsCardDark", - "PaymentPaymentInstrumentIconsCardLight", - "PaymentPaymentInstrumentIconsSquare", - "PaymentPaymentInstrumentIconsSquareDark", - "PaymentPaymentInstrumentIconsSquareLight", - "PaymentPaymentMethod", - "PaymentPaymentMethodCard", - "PaymentPlan", "PaymentProcessingDetails", - "PaymentProduct", - "PaymentPromoCode", "PaymentProviders", "PaymentQr", "PaymentQrInstructions", - "PaymentRefundsItem", "PaymentRequiredErrorBody", "PaymentRequiredErrorBodyError", "PaymentRequiredErrorBodyErrorType", - "PaymentResolutionsItem", - "PaymentShipment", - "PaymentShippingAddress", "PaymentStatus", "PaymentStatusStatus", "PaymentTransactionStatuses", "PaymentTransactionTypes", - "PaymentUser", "PaymentVerificationChecks", "PaymentVoucher", "PaymentVoucherInstructions", @@ -3244,7 +3355,6 @@ def __dir__(): "Permission", "PermissionAction", "PermissionGrantedToSystemRolesItem", - "PermissionSystemRoles", "PixelValidation", "Plan", "PlanCurrency", @@ -3266,6 +3376,11 @@ def __dir__(): "ProductCustomCta", "ProductGalleryImage", "ProductGlobalAffiliateStatus", + "ProductLegacy", + "ProductLegacyCompany", + "ProductLegacyGalleryImagesItem", + "ProductLegacyOwnerUser", + "ProductLegacyProductTaxCode", "ProductListItem", "ProductMarketplaceStatus", "ProductMemberAffiliateStatus", @@ -3300,16 +3415,22 @@ def __dir__(): "RecommendedActionExecution", "RecommendedActionExecutionStatus", "Refund", + "RefundFailureReason", + "RefundLegacy", + "RefundLegacyPayment", + "RefundLegacyPaymentMember", + "RefundLegacyPaymentMembership", + "RefundLegacyPaymentPlan", + "RefundLegacyPaymentProduct", + "RefundLegacyPaymentUser", "RefundListItem", "RefundListItemPayment", - "RefundPayment", - "RefundPaymentMember", - "RefundPaymentMembership", - "RefundPaymentPlan", - "RefundPaymentProduct", - "RefundPaymentUser", + "RefundReason", + "RefundReferenceStatus", "RefundReferenceStatuses", + "RefundReferenceType", "RefundReferenceTypes", + "RefundStatus", "RefundStatuses", "ReleaseMethod", "ResolutionAttachment", @@ -3319,6 +3440,12 @@ def __dir__(): "ResolutionCenterCaseAvailableActionsItem", "ResolutionCenterCaseCustomerResponses", "ResolutionCenterCaseIssueTypes", + "ResolutionCenterCaseLegacy", + "ResolutionCenterCaseLegacyCompany", + "ResolutionCenterCaseLegacyMember", + "ResolutionCenterCaseLegacyPayment", + "ResolutionCenterCaseLegacyResolutionEventsItem", + "ResolutionCenterCaseLegacyUser", "ResolutionCenterCaseListItem", "ResolutionCenterCaseListItemCompany", "ResolutionCenterCaseListItemPayment", @@ -3335,7 +3462,6 @@ def __dir__(): "ResolutionEventAction", "ResolutionEventReporterType", "ResolutionPayment", - "ResultLabelKeys", "Review", "ReviewAttachmentsItem", "ReviewCompany", @@ -3369,6 +3495,8 @@ def __dir__(): "Shipment", "ShipmentCheckpoint", "ShipmentCheckpointStatus", + "ShipmentLegacy", + "ShipmentLegacyPayment", "ShipmentListItem", "ShipmentListItemPayment", "ShipmentStatus", @@ -3383,7 +3511,6 @@ def __dir__(): "SocialAccountPost", "SocialAccountPostCallToAction", "SocialAccountPostRestrictionsItem", - "SocialLinkWebsites", "SpecificFeeOrigins", "Status", "Statuses", diff --git a/src/whop_sdk/types/ad.py b/src/whop_sdk/types/ad.py index ff91c5ac..21fbb0f3 100644 --- a/src/whop_sdk/types/ad.py +++ b/src/whop_sdk/types/ad.py @@ -10,6 +10,7 @@ from .ad_entity_reference import AdEntityReference from .ad_lead_form import AdLeadForm from .ad_messaging_config import AdMessagingConfig +from .ad_music import AdMusic from .ad_platform_issue import AdPlatformIssue from .ad_post_source import AdPostSource from .ad_result_event import AdResultEvent @@ -216,6 +217,11 @@ class Ad(UniversalBaseModel): Whether the ad can appear alongside other advertisers' ads in the same unit. Defaults to true. """ + music: typing.Optional[AdMusic] = pydantic.Field(default=None) + """ + The advertiser-uploaded MP3 a TikTok carousel ad plays. TikTok-only; `null` elsewhere and for non-carousel ads. + """ + post_id: typing.Optional[str] = pydantic.Field(default=None) """ The post the ad network serves for this ad, as `pageID_postID` on Meta — the post Meta created for an uploaded creative, or the post being promoted. Use it to open the live post, or to promote the same post from another ad. `null` until the network has created the post. diff --git a/src/whop_sdk/types/company_list_item_logo.py b/src/whop_sdk/types/ad_music.py similarity index 70% rename from src/whop_sdk/types/company_list_item_logo.py rename to src/whop_sdk/types/ad_music.py index e8d1419c..25e4b14a 100644 --- a/src/whop_sdk/types/company_list_item_logo.py +++ b/src/whop_sdk/types/ad_music.py @@ -6,14 +6,20 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class CompanyListItemLogo(UniversalBaseModel): +class AdMusic(UniversalBaseModel): + id: str = pydantic.Field() """ - The company's logo. + The music attachment's file id. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The uploaded file's name. """ url: typing.Optional[str] = pydantic.Field(default=None) """ - A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + CDN url of the MP3. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/ad_report.py b/src/whop_sdk/types/ad_report.py deleted file mode 100644 index fc42def9..00000000 --- a/src/whop_sdk/types/ad_report.py +++ /dev/null @@ -1,39 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .ad_report_breakdown_item import AdReportBreakdownItem -from .ad_report_granularity_item import AdReportGranularityItem -from .ad_report_summary import AdReportSummary - - -class AdReport(UniversalBaseModel): - """ - An ads performance report. Always returns a summary. The `granularity` field contains a per-bucket time series when the `granularity` arg is set; the `breakdown` field contains per-entity rows when the `breakdown` arg is set. - """ - - breakdown: typing.Optional[typing.List[AdReportBreakdownItem]] = pydantic.Field(default=None) - """ - Per-entity rows over the date range. `null` when the `breakdown` arg on `adReport` is omitted; otherwise contains one row per ad campaign, ad group, or ad inside the requested scope at the requested level. - """ - - granularity: typing.Optional[typing.List[AdReportGranularityItem]] = pydantic.Field(default=None) - """ - Per-bucket time series over the date range, ordered ascending by `bucketStart`. `null` when the `granularity` arg on `adReport` is omitted; otherwise contains rows at the requested grain (`daily` or `hourly`). - """ - - summary: AdReportSummary = pydantic.Field() - """ - Aggregate totals and rates over the date range. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/ad_report_breakdown_item.py b/src/whop_sdk/types/ad_report_breakdown_item.py deleted file mode 100644 index a5e1a1b4..00000000 --- a/src/whop_sdk/types/ad_report_breakdown_item.py +++ /dev/null @@ -1,49 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .ad_report_breakdown_item_granularity_item import AdReportBreakdownItemGranularityItem -from .ad_report_breakdown_item_summary import AdReportBreakdownItemSummary -from .ad_report_breakdown_levels import AdReportBreakdownLevels - - -class AdReportBreakdownItem(UniversalBaseModel): - """ - Per-entity ad performance row. Returned when the `breakdown` arg on `adReport` is set. - """ - - granularity: typing.Optional[typing.List[AdReportBreakdownItemGranularityItem]] = pydantic.Field(default=None) - """ - Per-bucket time series for this entity over the date range, ordered ascending by `bucketStart`. `null` when the `granularity` arg on `adReport` is omitted; otherwise contains rows at the requested grain (`daily` or `hourly`). - """ - - id: str = pydantic.Field() - """ - Tag of the entity (ad campaign, ad group, or ad). - """ - - level: AdReportBreakdownLevels = pydantic.Field() - """ - The entity level of this row — matches the `breakdown` arg. - """ - - name: typing.Optional[str] = pydantic.Field(default=None) - """ - Display name of the entity, when available. - """ - - summary: AdReportBreakdownItemSummary = pydantic.Field() - """ - Aggregate totals and rates for this entity over the date range. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/ad_report_breakdown_item_granularity_item.py b/src/whop_sdk/types/ad_report_breakdown_item_granularity_item.py deleted file mode 100644 index 8d567d62..00000000 --- a/src/whop_sdk/types/ad_report_breakdown_item_granularity_item.py +++ /dev/null @@ -1,85 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .currencies import Currencies -from .granularities import Granularities -from .result_label_keys import ResultLabelKeys - - -class AdReportBreakdownItemGranularityItem(UniversalBaseModel): - """ - Per-bucket ad performance for an ad campaign, ad group, or ad. Bucket grain is set by the `ad_report` query's `granularity` argument. - """ - - bucket_start: dt.datetime = pydantic.Field() - """ - The bucket's start time as a real UTC instant. `(statDate, statHour)` resolved in the ad account's reporting timezone — render this in the viewer's local timezone. - """ - - clicks: int = pydantic.Field() - """ - Clicks in this bucket. - """ - - granularity: Granularities = pydantic.Field() - """ - The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). - """ - - impressions: int = pydantic.Field() - """ - Impressions in this bucket. - """ - - reach: int = pydantic.Field() - """ - Unique users reached in this bucket. Always `0` for hourly rows (Meta does not return reach at hourly grain). - """ - - result_count: typing.Optional[int] = pydantic.Field(default=None) - """ - Count of the primary optimization result in this bucket. - """ - - result_label_key: typing.Optional[ResultLabelKeys] = pydantic.Field(default=None) - """ - The type of optimization result represented by `resultCount`. - """ - - result_label_override: typing.Optional[str] = pydantic.Field(default=None) - """ - Advertiser-defined label for the result when `resultLabelKey` is `custom`. - """ - - spend: float = pydantic.Field() - """ - Charged spend in this bucket in the requested reporting currency — the amount billed including platform fees, not the platform-side net spend. - """ - - spend_currency: Currencies = pydantic.Field() - """ - Currency of the `spend` value. - """ - - stat_date: dt.datetime = pydantic.Field() - """ - The date these stats cover (midnight UTC). For hourly rows, see `statHour` and `bucketStart`. - """ - - stat_hour: typing.Optional[int] = pydantic.Field(default=None) - """ - Hour of the day in the ad account's reporting timezone (0-23). `null` for daily rows. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/ad_report_breakdown_item_summary.py b/src/whop_sdk/types/ad_report_breakdown_item_summary.py deleted file mode 100644 index a05e471b..00000000 --- a/src/whop_sdk/types/ad_report_breakdown_item_summary.py +++ /dev/null @@ -1,93 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .currencies import Currencies -from .result_label_keys import ResultLabelKeys - - -class AdReportBreakdownItemSummary(UniversalBaseModel): - """ - Aggregate totals and rates for this entity over the date range. - """ - - click_through_rate: float = pydantic.Field() - """ - Click-through rate (clicks / impressions). - """ - - clicks: int = pydantic.Field() - """ - Total clicks over the date range. - """ - - cost_per_click: float = pydantic.Field() - """ - Cost per click in the requested reporting currency. - """ - - cost_per_mille: typing.Optional[float] = pydantic.Field(default=None) - """ - Cost per thousand impressions in the requested reporting currency. - """ - - cost_per_result: typing.Optional[float] = pydantic.Field(default=None) - """ - Spend divided by `resultCount`. Null when there are no results. - """ - - frequency: typing.Optional[float] = pydantic.Field(default=None) - """ - Average number of times each reached user saw an ad. - """ - - impressions: int = pydantic.Field() - """ - Total impressions over the date range. - """ - - reach: int = pydantic.Field() - """ - Unique users reached, deduplicated by the external ad platform. - """ - - result_count: typing.Optional[int] = pydantic.Field(default=None) - """ - Count of the campaign's primary optimization result (purchases, clicks, etc.) — see `resultLabelKey`. - """ - - result_label_key: typing.Optional[ResultLabelKeys] = pydantic.Field(default=None) - """ - The type of optimization result represented by `resultCount`. - """ - - result_label_override: typing.Optional[str] = pydantic.Field(default=None) - """ - Advertiser-defined label for the result when `resultLabelKey` is `custom`. - """ - - return_on_ad_spend: typing.Optional[float] = pydantic.Field(default=None) - """ - Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as reported by the external ad platform. - """ - - spend: float = pydantic.Field() - """ - Total spend over the date range in the requested reporting currency. - """ - - spend_currency: typing.Optional[Currencies] = pydantic.Field(default=None) - """ - Currency of the `spend` value. Matches the requested `currency` when set. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/ad_report_breakdown_levels.py b/src/whop_sdk/types/ad_report_breakdown_levels.py deleted file mode 100644 index 411aa28f..00000000 --- a/src/whop_sdk/types/ad_report_breakdown_levels.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AdReportBreakdownLevels = typing.Union[typing.Literal["campaign", "ad_group", "ad"], typing.Any] diff --git a/src/whop_sdk/types/ad_report_granularity_item.py b/src/whop_sdk/types/ad_report_granularity_item.py deleted file mode 100644 index f8199f42..00000000 --- a/src/whop_sdk/types/ad_report_granularity_item.py +++ /dev/null @@ -1,85 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .currencies import Currencies -from .granularities import Granularities -from .result_label_keys import ResultLabelKeys - - -class AdReportGranularityItem(UniversalBaseModel): - """ - Per-bucket ad performance for an ad campaign, ad group, or ad. Bucket grain is set by the `ad_report` query's `granularity` argument. - """ - - bucket_start: dt.datetime = pydantic.Field() - """ - The bucket's start time as a real UTC instant. `(statDate, statHour)` resolved in the ad account's reporting timezone — render this in the viewer's local timezone. - """ - - clicks: int = pydantic.Field() - """ - Clicks in this bucket. - """ - - granularity: Granularities = pydantic.Field() - """ - The bucket size of this row (`hourly`, `daily`, `weekly`, or `monthly`). - """ - - impressions: int = pydantic.Field() - """ - Impressions in this bucket. - """ - - reach: int = pydantic.Field() - """ - Unique users reached in this bucket. Always `0` for hourly rows (Meta does not return reach at hourly grain). - """ - - result_count: typing.Optional[int] = pydantic.Field(default=None) - """ - Count of the primary optimization result in this bucket. - """ - - result_label_key: typing.Optional[ResultLabelKeys] = pydantic.Field(default=None) - """ - The type of optimization result represented by `resultCount`. - """ - - result_label_override: typing.Optional[str] = pydantic.Field(default=None) - """ - Advertiser-defined label for the result when `resultLabelKey` is `custom`. - """ - - spend: float = pydantic.Field() - """ - Charged spend in this bucket in the requested reporting currency — the amount billed including platform fees, not the platform-side net spend. - """ - - spend_currency: Currencies = pydantic.Field() - """ - Currency of the `spend` value. - """ - - stat_date: dt.datetime = pydantic.Field() - """ - The date these stats cover (midnight UTC). For hourly rows, see `statHour` and `bucketStart`. - """ - - stat_hour: typing.Optional[int] = pydantic.Field(default=None) - """ - Hour of the day in the ad account's reporting timezone (0-23). `null` for daily rows. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/ad_report_summary.py b/src/whop_sdk/types/ad_report_summary.py deleted file mode 100644 index 32d09251..00000000 --- a/src/whop_sdk/types/ad_report_summary.py +++ /dev/null @@ -1,93 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .currencies import Currencies -from .result_label_keys import ResultLabelKeys - - -class AdReportSummary(UniversalBaseModel): - """ - Aggregate totals and rates over the date range. - """ - - click_through_rate: float = pydantic.Field() - """ - Click-through rate (clicks / impressions). - """ - - clicks: int = pydantic.Field() - """ - Total clicks over the date range. - """ - - cost_per_click: float = pydantic.Field() - """ - Cost per click in the requested reporting currency. - """ - - cost_per_mille: typing.Optional[float] = pydantic.Field(default=None) - """ - Cost per thousand impressions in the requested reporting currency. - """ - - cost_per_result: typing.Optional[float] = pydantic.Field(default=None) - """ - Spend divided by `resultCount`. Null when there are no results. - """ - - frequency: typing.Optional[float] = pydantic.Field(default=None) - """ - Average number of times each reached user saw an ad. - """ - - impressions: int = pydantic.Field() - """ - Total impressions over the date range. - """ - - reach: int = pydantic.Field() - """ - Unique users reached, deduplicated by the external ad platform. - """ - - result_count: typing.Optional[int] = pydantic.Field(default=None) - """ - Count of the campaign's primary optimization result (purchases, clicks, etc.) — see `resultLabelKey`. - """ - - result_label_key: typing.Optional[ResultLabelKeys] = pydantic.Field(default=None) - """ - The type of optimization result represented by `resultCount`. - """ - - result_label_override: typing.Optional[str] = pydantic.Field(default=None) - """ - Advertiser-defined label for the result when `resultLabelKey` is `custom`. - """ - - return_on_ad_spend: typing.Optional[float] = pydantic.Field(default=None) - """ - Alias for `purchaseReturnOnAdSpend` — return on ad spend for purchases, as reported by the external ad platform. - """ - - spend: float = pydantic.Field() - """ - Total spend over the date range in the requested reporting currency. - """ - - spend_currency: typing.Optional[Currencies] = pydantic.Field(default=None) - """ - Currency of the `spend` value. Matches the requested `currency` when set. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/api_key_api_version_date.py b/src/whop_sdk/types/api_key_api_version_date.py index 0d7a8819..f489c990 100644 --- a/src/whop_sdk/types/api_key_api_version_date.py +++ b/src/whop_sdk/types/api_key_api_version_date.py @@ -33,6 +33,9 @@ "2026-08-25", "2026-08-25-1", "2026-08-25-2", + "2026-08-31", + "2026-09-02", + "2026-09-02-1", ], typing.Any, ] diff --git a/src/whop_sdk/types/app.py b/src/whop_sdk/types/app.py index fa69dc5c..840594c3 100644 --- a/src/whop_sdk/types/app.py +++ b/src/whop_sdk/types/app.py @@ -144,6 +144,7 @@ class App(UniversalBaseModel): A short-lived signed pass scoping the caller to this app's gated preview hosts — every build preview and the live dev-server sandbox. Add it to a preview host as the `__whop_preview` query param (or `x-whop-preview-token` header). `null` unless the caller is a team member who can read the app's developer settings. """ + previous_hosted_urls: typing.List[str] product_id: typing.Optional[str] = pydantic.Field(default=None) """ ID of the app's product listing on the Whop app store, or `null` when the app has no associated product. diff --git a/src/whop_sdk/types/app_list_item.py b/src/whop_sdk/types/app_list_item.py index 983f5929..56606cd9 100644 --- a/src/whop_sdk/types/app_list_item.py +++ b/src/whop_sdk/types/app_list_item.py @@ -99,6 +99,7 @@ class AppListItem(UniversalBaseModel): Full origin URL of the app's proxied domain, for example https://ab1c2d3e4f.apps.whop.com. """ + previous_hosted_urls: typing.List[str] route: typing.Optional[str] = pydantic.Field(default=None) """ Claimed subdomain route where hosted web builds are served (`myapp` for myapp.whop.site), or `null` if no route is claimed. diff --git a/src/whop_sdk/types/card_transaction_legacy.py b/src/whop_sdk/types/card_transaction_legacy.py new file mode 100644 index 00000000..625fa99f --- /dev/null +++ b/src/whop_sdk/types/card_transaction_legacy.py @@ -0,0 +1,113 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .card_issuing_transaction_status import CardIssuingTransactionStatus + + +class CardTransactionLegacy(UniversalBaseModel): + """ + A card transaction record. + """ + + authorization_method: typing.Optional[str] = pydantic.Field(default=None) + """ + How the card was presented or authenticated for the purchase. + """ + + card_id: str = pydantic.Field() + """ + Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. + """ + + cashback_usd_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The cashback reward amount earned on this transaction, in USD. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the card transaction was created. + """ + + currency: typing.Optional[str] = pydantic.Field(default=None) + """ + The ISO 4217 currency code for the transaction amount. + """ + + declined_reason: typing.Optional[str] = pydantic.Field(default=None) + """ + The issuer-provided reason the transaction was declined. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the card transaction. + """ + + international: bool = pydantic.Field() + """ + Whether the transaction was made with a merchant outside the card's home country. + """ + + local_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The transaction amount in the merchant's local currency before conversion. + """ + + memo: typing.Optional[str] = pydantic.Field(default=None) + """ + A user-provided note attached to the transaction. + """ + + merchant_category: typing.Optional[str] = pydantic.Field(default=None) + """ + The enriched or raw category label for the merchant. + """ + + merchant_category_code: typing.Optional[str] = pydantic.Field(default=None) + """ + The four-digit ISO 18245 merchant category code (MCC). + """ + + merchant_icon_url: typing.Optional[str] = pydantic.Field(default=None) + """ + A URL to the enriched merchant logo image. + """ + + merchant_name: typing.Optional[str] = pydantic.Field(default=None) + """ + The enriched or raw name of the merchant where the purchase was made. + """ + + posted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the transaction was settled by the card network. + """ + + status: CardIssuingTransactionStatus = pydantic.Field() + """ + The current lifecycle status of the transaction. + """ + + transaction_type: str = pydantic.Field() + """ + The type of transaction. + """ + + usd_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The transaction amount in USD. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company.py b/src/whop_sdk/types/company.py deleted file mode 100644 index 204d39d1..00000000 --- a/src/whop_sdk/types/company.py +++ /dev/null @@ -1,111 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .company_featured_affiliate_product import CompanyFeaturedAffiliateProduct -from .company_logo import CompanyLogo -from .company_owner_user import CompanyOwnerUser -from .company_social_links_item import CompanySocialLinksItem - - -class Company(UniversalBaseModel): - """ - A company is a seller on Whop. Companies own products, manage members, and receive payouts. - """ - - affiliate_instructions: typing.Optional[str] = pydantic.Field(default=None) - """ - Guidelines and instructions provided to affiliates explaining how to promote this company's products. - """ - - created_at: dt.datetime = pydantic.Field() - """ - The datetime the company was created. - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - A promotional pitch written by the company creator, displayed to potential customers on the store page. - """ - - featured_affiliate_product: typing.Optional[CompanyFeaturedAffiliateProduct] = pydantic.Field(default=None) - """ - The product featured for affiliates to promote on this company's affiliate page. Null if none is configured. - """ - - id: str = pydantic.Field() - """ - The unique identifier for the company. - """ - - logo: typing.Optional[CompanyLogo] = pydantic.Field(default=None) - """ - The company's logo. - """ - - member_count: int = pydantic.Field() - """ - The total number of users who currently hold active memberships across all of this company's products. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - A key-value JSON object of custom metadata for this company, managed by the platform that created the account. - """ - - owner_user: CompanyOwnerUser = pydantic.Field() - """ - The user who owns and has full administrative control over this company. - """ - - published_reviews_count: int = pydantic.Field() - """ - The total number of published customer reviews across all products for this company. - """ - - route: str = pydantic.Field() - """ - URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. - """ - - send_customer_emails: bool = pydantic.Field() - """ - Whether Whop sends transactional emails (receipts, updates) to customers on behalf of this company. - """ - - social_links: typing.List[CompanySocialLinksItem] = pydantic.Field() - """ - The list of social media accounts and external links associated with this company. - """ - - target_audience: typing.Optional[str] = pydantic.Field(default=None) - """ - The target audience for the company. Null if not set. - """ - - title: str = pydantic.Field() - """ - The display name of the company shown to customers. - """ - - updated_at: dt.datetime = pydantic.Field() - """ - The datetime the company was last updated. - """ - - verified: bool = pydantic.Field() - """ - Whether this company has been verified by Whop's trust and safety team. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company_list_item.py b/src/whop_sdk/types/company_list_item.py deleted file mode 100644 index 1c4d5d51..00000000 --- a/src/whop_sdk/types/company_list_item.py +++ /dev/null @@ -1,94 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .company_list_item_logo import CompanyListItemLogo -from .company_list_item_owner_user import CompanyListItemOwnerUser - - -class CompanyListItem(UniversalBaseModel): - """ - A company is a seller on Whop. Companies own products, manage members, and receive payouts. - """ - - created_at: dt.datetime = pydantic.Field() - """ - The datetime the company was created. - """ - - description: typing.Optional[str] = pydantic.Field(default=None) - """ - A promotional pitch written by the company creator, displayed to potential customers on the store page. - """ - - id: str = pydantic.Field() - """ - The unique identifier for the company. - """ - - logo: typing.Optional[CompanyListItemLogo] = pydantic.Field(default=None) - """ - The company's logo. - """ - - member_count: int = pydantic.Field() - """ - The total number of users who currently hold active memberships across all of this company's products. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - A key-value JSON object of custom metadata for this company, managed by the platform that created the account. - """ - - owner_user: CompanyListItemOwnerUser = pydantic.Field() - """ - The user who owns and has full administrative control over this company. - """ - - published_reviews_count: int = pydantic.Field() - """ - The total number of published customer reviews across all products for this company. - """ - - route: str = pydantic.Field() - """ - URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. - """ - - send_customer_emails: bool = pydantic.Field() - """ - Whether Whop sends transactional emails (receipts, updates) to customers on behalf of this company. - """ - - target_audience: typing.Optional[str] = pydantic.Field(default=None) - """ - The target audience for the company. Null if not set. - """ - - title: str = pydantic.Field() - """ - The display name of the company shown to customers. - """ - - updated_at: dt.datetime = pydantic.Field() - """ - The datetime the company was last updated. - """ - - verified: bool = pydantic.Field() - """ - Whether this company has been verified by Whop's trust and safety team. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/countries.py b/src/whop_sdk/types/countries.py deleted file mode 100644 index aa64de2c..00000000 --- a/src/whop_sdk/types/countries.py +++ /dev/null @@ -1,251 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -Countries = typing.Union[ - typing.Literal[ - "us", - "ca", - "gb", - "ab", - "af", - "al", - "dz", - "as", - "ad", - "ao", - "ai", - "aq", - "ag", - "ar", - "am", - "aw", - "au", - "at", - "az", - "bs", - "bh", - "bd", - "bb", - "by", - "be", - "bz", - "bj", - "bm", - "bt", - "bo", - "ba", - "bw", - "br", - "io", - "vg", - "bn", - "bg", - "bf", - "bi", - "kh", - "cm", - "cv", - "ky", - "cf", - "td", - "cl", - "cn", - "cx", - "cc", - "co", - "km", - "cg", - "ck", - "cr", - "ci", - "hr", - "cu", - "cw", - "cy", - "cz", - "cd", - "dk", - "dj", - "dm", - "do", - "ec", - "eg", - "sv", - "gq", - "ee", - "et", - "fk", - "fo", - "fj", - "fi", - "fr", - "gf", - "pf", - "ga", - "gm", - "ge", - "de", - "gh", - "gi", - "gr", - "gl", - "gd", - "gp", - "gu", - "gt", - "gg", - "gn", - "gw", - "gy", - "ht", - "hn", - "hk", - "hu", - "is", - "in", - "id", - "iq", - "ie", - "im", - "il", - "it", - "jm", - "sj", - "jp", - "je", - "jo", - "kz", - "ke", - "ki", - "xk", - "kw", - "kg", - "la", - "lv", - "lb", - "ls", - "lr", - "ly", - "li", - "lt", - "lu", - "mo", - "mk", - "mg", - "mw", - "my", - "mv", - "ml", - "mt", - "mh", - "mq", - "mr", - "mu", - "yt", - "mx", - "fm", - "md", - "mc", - "mn", - "me", - "ms", - "ma", - "mz", - "mm", - "na", - "nr", - "np", - "nl", - "an", - "nc", - "nz", - "ni", - "ne", - "ng", - "nu", - "mp", - "no", - "om", - "pk", - "pw", - "ps", - "pa", - "pg", - "py", - "pe", - "ph", - "pn", - "pl", - "pt", - "pr", - "qa", - "re", - "ro", - "ru", - "rw", - "bl", - "sh", - "kn", - "lc", - "mf", - "pm", - "vc", - "ws", - "sm", - "st", - "sa", - "sn", - "rs", - "sc", - "sl", - "sg", - "sx", - "sk", - "si", - "sb", - "so", - "za", - "kr", - "ss", - "es", - "lk", - "sd", - "sr", - "sz", - "se", - "ch", - "tw", - "tj", - "tz", - "th", - "tl", - "tg", - "tk", - "to", - "tt", - "tn", - "tr", - "tm", - "tc", - "tv", - "vi", - "ug", - "ua", - "ae", - "um", - "uy", - "uz", - "vu", - "va", - "ve", - "vn", - "wf", - "eh", - "ye", - "zm", - "zw", - "sy", - ], - typing.Any, -] diff --git a/src/whop_sdk/types/dispute_alert_legacy.py b/src/whop_sdk/types/dispute_alert_legacy.py new file mode 100644 index 00000000..7a6ecff8 --- /dev/null +++ b/src/whop_sdk/types/dispute_alert_legacy.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .currencies import Currencies +from .dispute_alert_legacy_dispute import DisputeAlertLegacyDispute +from .dispute_alert_legacy_payment import DisputeAlertLegacyPayment +from .dispute_alert_types import DisputeAlertTypes + + +class DisputeAlertLegacy(UniversalBaseModel): + """ + A dispute alert represents an early warning notification from a payment processor about a potential dispute or chargeback. + """ + + alert_type: DisputeAlertTypes = pydantic.Field() + """ + The type of the dispute alert. + """ + + amount: float = pydantic.Field() + """ + The alerted amount in the specified currency. + """ + + charge_for_alert: bool = pydantic.Field() + """ + Whether this alert incurs a charge. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The time the dispute alert was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for the alerted amount. + """ + + dispute: typing.Optional[DisputeAlertLegacyDispute] = pydantic.Field(default=None) + """ + The dispute associated with the dispute alert. + """ + + id: str = pydantic.Field() + """ + The unique identifier of the dispute alert. + """ + + payment: typing.Optional[DisputeAlertLegacyPayment] = pydantic.Field(default=None) + """ + The payment associated with the dispute alert. + """ + + transaction_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date of the original transaction. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_alert_legacy_dispute.py b/src/whop_sdk/types/dispute_alert_legacy_dispute.py new file mode 100644 index 00000000..be7e8b7b --- /dev/null +++ b/src/whop_sdk/types/dispute_alert_legacy_dispute.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .currencies import Currencies +from .dispute_statuses import DisputeStatuses + + +class DisputeAlertLegacyDispute(UniversalBaseModel): + """ + The dispute associated with the dispute alert. + """ + + amount: float = pydantic.Field() + """ + The disputed amount in the specified currency, formatted as a decimal. + """ + + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime the dispute was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for the disputed amount. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the dispute. + """ + + reason: typing.Optional[str] = pydantic.Field(default=None) + """ + A human-readable reason for the dispute. + """ + + status: DisputeStatuses = pydantic.Field() + """ + The current status of the dispute lifecycle, such as needs_response, under_review, won, or lost. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_alert_legacy_payment.py b/src/whop_sdk/types/dispute_alert_legacy_payment.py new file mode 100644 index 00000000..b5cbc5ef --- /dev/null +++ b/src/whop_sdk/types/dispute_alert_legacy_payment.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_reasons import BillingReasons +from .card_brands import CardBrands +from .currencies import Currencies +from .dispute_alert_legacy_payment_member import DisputeAlertLegacyPaymentMember +from .dispute_alert_legacy_payment_membership import DisputeAlertLegacyPaymentMembership +from .dispute_alert_legacy_payment_user import DisputeAlertLegacyPaymentUser +from .payment_method_types import PaymentMethodTypes + + +class DisputeAlertLegacyPayment(UniversalBaseModel): + """ + The payment associated with the dispute alert. + """ + + billing_reason: typing.Optional[BillingReasons] = pydantic.Field(default=None) + """ + The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment. + """ + + card_brand: typing.Optional[CardBrands] = pydantic.Field(default=None) + """ + Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'. + """ + + card_last4: typing.Optional[str] = pydantic.Field(default=None) + """ + The last four digits of the card used to make this payment. Null if the payment was not made with a card. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the payment was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). + """ + + dispute_alerted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When an alert came in that this transaction will be disputed + """ + + id: str = pydantic.Field() + """ + The unique identifier for the payment. + """ + + member: typing.Optional[DisputeAlertLegacyPaymentMember] = pydantic.Field(default=None) + """ + The member attached to this payment. + """ + + membership: typing.Optional[DisputeAlertLegacyPaymentMembership] = pydantic.Field(default=None) + """ + The membership attached to this payment. + """ + + paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. + """ + + payment_method_type: typing.Optional[PaymentMethodTypes] = pydantic.Field(default=None) + """ + The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. + """ + + subtotal: typing.Optional[float] = pydantic.Field(default=None) + """ + The subtotal to show to the creator (excluding buyer fees). + """ + + total: typing.Optional[float] = pydantic.Field(default=None) + """ + The total to show to the creator (excluding buyer fees). + """ + + usd_total: typing.Optional[float] = pydantic.Field(default=None) + """ + The total in USD to show to the creator (excluding buyer fees). + """ + + user: typing.Optional[DisputeAlertLegacyPaymentUser] = pydantic.Field(default=None) + """ + The user that made this payment. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_alert_legacy_payment_member.py b/src/whop_sdk/types/dispute_alert_legacy_payment_member.py new file mode 100644 index 00000000..aa90da5b --- /dev/null +++ b/src/whop_sdk/types/dispute_alert_legacy_payment_member.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeAlertLegacyPaymentMember(UniversalBaseModel): + """ + The member attached to this payment. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company member. + """ + + phone: typing.Optional[str] = pydantic.Field(default=None) + """ + The phone number for the member, if available. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_alert_legacy_payment_membership.py b/src/whop_sdk/types/dispute_alert_legacy_payment_membership.py new file mode 100644 index 00000000..1d4cdb65 --- /dev/null +++ b/src/whop_sdk/types/dispute_alert_legacy_payment_membership.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .membership_status import MembershipStatus + + +class DisputeAlertLegacyPaymentMembership(UniversalBaseModel): + """ + The membership attached to this payment. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the membership. + """ + + status: MembershipStatus = pydantic.Field() + """ + The state of the membership. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_alert_legacy_payment_user.py b/src/whop_sdk/types/dispute_alert_legacy_payment_user.py new file mode 100644 index 00000000..a88e926a --- /dev/null +++ b/src/whop_sdk/types/dispute_alert_legacy_payment_user.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeAlertLegacyPaymentUser(UniversalBaseModel): + """ + The user that made this payment. + """ + + email: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's email address. Requires the member:email:read permission to access. Null if not authorized. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the user. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's display name shown on their public profile. + """ + + username: str = pydantic.Field() + """ + The user's unique username shown on their public profile. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy.py b/src/whop_sdk/types/dispute_legacy.py new file mode 100644 index 00000000..03396b8b --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy.py @@ -0,0 +1,176 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .currencies import Currencies +from .dispute_legacy_cancellation_policy_attachment import DisputeLegacyCancellationPolicyAttachment +from .dispute_legacy_company import DisputeLegacyCompany +from .dispute_legacy_customer_communication_attachment import DisputeLegacyCustomerCommunicationAttachment +from .dispute_legacy_payment import DisputeLegacyPayment +from .dispute_legacy_plan import DisputeLegacyPlan +from .dispute_legacy_product import DisputeLegacyProduct +from .dispute_legacy_refund_policy_attachment import DisputeLegacyRefundPolicyAttachment +from .dispute_legacy_uncategorized_attachment import DisputeLegacyUncategorizedAttachment +from .dispute_statuses import DisputeStatuses + + +class DisputeLegacy(UniversalBaseModel): + """ + A dispute is a chargeback or payment challenge filed against a company, including evidence and response status. + """ + + access_activity_log: typing.Optional[str] = pydantic.Field(default=None) + """ + A log of IP-based access activity for the customer on Whop, submitted as evidence in the dispute. + """ + + amount: float = pydantic.Field() + """ + The disputed amount in the specified currency, formatted as a decimal. + """ + + billing_address: typing.Optional[str] = pydantic.Field(default=None) + """ + The customer's billing address from their payment details, submitted as evidence in the dispute. + """ + + cancellation_policy_attachment: typing.Optional[DisputeLegacyCancellationPolicyAttachment] = pydantic.Field( + default=None + ) + """ + The cancellation policy document uploaded as dispute evidence. Null if no cancellation policy has been provided. + """ + + cancellation_policy_disclosure: typing.Optional[str] = pydantic.Field(default=None) + """ + A text disclosure describing the company's cancellation policy, submitted as dispute evidence. + """ + + company: typing.Optional[DisputeLegacyCompany] = pydantic.Field(default=None) + """ + The company that the dispute was filed against. + """ + + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime the dispute was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for the disputed amount. + """ + + customer_communication_attachment: typing.Optional[DisputeLegacyCustomerCommunicationAttachment] = pydantic.Field( + default=None + ) + """ + Evidence of customer communication or product usage, uploaded as a dispute attachment. Null if not provided. + """ + + customer_email_address: typing.Optional[str] = pydantic.Field(default=None) + """ + The customer's email address from their payment details, included in the evidence packet sent to the payment processor. Editable before submission. + """ + + customer_name: typing.Optional[str] = pydantic.Field(default=None) + """ + The customer's full name from their payment details, included in the evidence packet sent to the payment processor. Editable before submission. + """ + + editable: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the dispute evidence can still be edited and submitted. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the dispute. + """ + + needs_response_by: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The deadline by which dispute evidence must be submitted. Null if no response deadline is set. + """ + + notes: typing.Optional[str] = pydantic.Field(default=None) + """ + Additional freeform notes submitted by the company as part of the dispute evidence. + """ + + payment: typing.Optional[DisputeLegacyPayment] = pydantic.Field(default=None) + """ + The original payment that was disputed. + """ + + plan: typing.Optional[DisputeLegacyPlan] = pydantic.Field(default=None) + """ + The plan associated with the disputed payment. Null if the dispute is not linked to a specific plan. + """ + + product: typing.Optional[DisputeLegacyProduct] = pydantic.Field(default=None) + """ + The product associated with the disputed payment. Null if the dispute is not linked to a specific product. + """ + + product_description: typing.Optional[str] = pydantic.Field(default=None) + """ + A description of the product or service provided, submitted as dispute evidence. + """ + + reason: typing.Optional[str] = pydantic.Field(default=None) + """ + A human-readable reason for the dispute. + """ + + reason_code: typing.Optional[str] = pydantic.Field(default=None) + """ + The card network reason code for the dispute. Null when the payment processor did not provide one. + """ + + refund_policy_attachment: typing.Optional[DisputeLegacyRefundPolicyAttachment] = pydantic.Field(default=None) + """ + The refund policy document uploaded as dispute evidence. Null if no refund policy has been provided. + """ + + refund_policy_disclosure: typing.Optional[str] = pydantic.Field(default=None) + """ + A text disclosure describing the company's refund policy, submitted as dispute evidence. + """ + + refund_refusal_explanation: typing.Optional[str] = pydantic.Field(default=None) + """ + An explanation from the company for why a refund was refused, submitted as dispute evidence. + """ + + service_date: typing.Optional[str] = pydantic.Field(default=None) + """ + The date when the product or service was delivered to the customer, submitted as dispute evidence. + """ + + status: DisputeStatuses = pydantic.Field() + """ + The current status of the dispute lifecycle, such as needs_response, under_review, won, or lost. + """ + + uncategorized_attachment: typing.Optional[DisputeLegacyUncategorizedAttachment] = pydantic.Field(default=None) + """ + An additional attachment that does not fit into the standard evidence categories. Null if not provided. + """ + + visa_rdr: bool = pydantic.Field() + """ + Whether the dispute was automatically resolved through Visa Rapid Dispute Resolution (RDR). + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_cancellation_policy_attachment.py b/src/whop_sdk/types/dispute_legacy_cancellation_policy_attachment.py new file mode 100644 index 00000000..a0849fb4 --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_cancellation_policy_attachment.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyCancellationPolicyAttachment(UniversalBaseModel): + """ + The cancellation policy document uploaded as dispute evidence. Null if no cancellation policy has been provided. + """ + + content_type: typing.Optional[str] = pydantic.Field(default=None) + """ + Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + """ + + filename: typing.Optional[str] = pydantic.Field(default=None) + """ + The original filename of the uploaded attachment, including its file extension. + """ + + id: str = pydantic.Field() + """ + Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. + """ + + url: typing.Optional[str] = pydantic.Field(default=None) + """ + A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_company.py b/src/whop_sdk/types/dispute_legacy_company.py new file mode 100644 index 00000000..a3b19f7c --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_company.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyCompany(UniversalBaseModel): + """ + The company that the dispute was filed against. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company. + """ + + title: str = pydantic.Field() + """ + The written name of the company. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_customer_communication_attachment.py b/src/whop_sdk/types/dispute_legacy_customer_communication_attachment.py new file mode 100644 index 00000000..96d7916f --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_customer_communication_attachment.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyCustomerCommunicationAttachment(UniversalBaseModel): + """ + Evidence of customer communication or product usage, uploaded as a dispute attachment. Null if not provided. + """ + + content_type: typing.Optional[str] = pydantic.Field(default=None) + """ + Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + """ + + filename: typing.Optional[str] = pydantic.Field(default=None) + """ + The original filename of the uploaded attachment, including its file extension. + """ + + id: str = pydantic.Field() + """ + Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. + """ + + url: typing.Optional[str] = pydantic.Field(default=None) + """ + A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment.py b/src/whop_sdk/types/dispute_legacy_payment.py new file mode 100644 index 00000000..618b363a --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment.py @@ -0,0 +1,110 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_reasons import BillingReasons +from .card_brands import CardBrands +from .currencies import Currencies +from .dispute_legacy_payment_member import DisputeLegacyPaymentMember +from .dispute_legacy_payment_membership import DisputeLegacyPaymentMembership +from .dispute_legacy_payment_payment_instrument import DisputeLegacyPaymentPaymentInstrument +from .dispute_legacy_payment_user import DisputeLegacyPaymentUser +from .payment_method_types import PaymentMethodTypes + + +class DisputeLegacyPayment(UniversalBaseModel): + """ + The original payment that was disputed. + """ + + billing_reason: typing.Optional[BillingReasons] = pydantic.Field(default=None) + """ + The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment. + """ + + card_brand: typing.Optional[CardBrands] = pydantic.Field(default=None) + """ + Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'. + """ + + card_last4: typing.Optional[str] = pydantic.Field(default=None) + """ + The last four digits of the card used to make this payment. Null if the payment was not made with a card. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the payment was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). + """ + + dispute_alerted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When an alert came in that this transaction will be disputed + """ + + id: str = pydantic.Field() + """ + The unique identifier for the payment. + """ + + member: typing.Optional[DisputeLegacyPaymentMember] = pydantic.Field(default=None) + """ + The member attached to this payment. + """ + + membership: typing.Optional[DisputeLegacyPaymentMembership] = pydantic.Field(default=None) + """ + The membership attached to this payment. + """ + + paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. + """ + + payment_instrument: typing.Optional[DisputeLegacyPaymentPaymentInstrument] = pydantic.Field(default=None) + """ + The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. + """ + + payment_method_type: typing.Optional[PaymentMethodTypes] = pydantic.Field(default=None) + """ + The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. + """ + + subtotal: typing.Optional[float] = pydantic.Field(default=None) + """ + The subtotal to show to the creator (excluding buyer fees). + """ + + total: typing.Optional[float] = pydantic.Field(default=None) + """ + The total to show to the creator (excluding buyer fees). + """ + + usd_total: typing.Optional[float] = pydantic.Field(default=None) + """ + The total in USD to show to the creator (excluding buyer fees). + """ + + user: typing.Optional[DisputeLegacyPaymentUser] = pydantic.Field(default=None) + """ + The user that made this payment. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment_member.py b/src/whop_sdk/types/dispute_legacy_payment_member.py new file mode 100644 index 00000000..e99bcc6f --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_member.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyPaymentMember(UniversalBaseModel): + """ + The member attached to this payment. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company member. + """ + + phone: typing.Optional[str] = pydantic.Field(default=None) + """ + The phone number for the member, if available. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment_membership.py b/src/whop_sdk/types/dispute_legacy_payment_membership.py new file mode 100644 index 00000000..d8be86a3 --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_membership.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .membership_status import MembershipStatus + + +class DisputeLegacyPaymentMembership(UniversalBaseModel): + """ + The membership attached to this payment. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the membership. + """ + + status: MembershipStatus = pydantic.Field() + """ + The state of the membership. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment_payment_instrument.py b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument.py new file mode 100644 index 00000000..38eea524 --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .dispute_legacy_payment_payment_instrument_icons import DisputeLegacyPaymentPaymentInstrumentIcons + + +class DisputeLegacyPaymentPaymentInstrument(UniversalBaseModel): + """ + The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. + """ + + display_name: str = pydantic.Field() + """ + Buyer-facing instrument name — "Visa •••• 4242" when the card surfaced, else the method's own name ("Klarna"). + """ + + icons: DisputeLegacyPaymentPaymentInstrumentIcons = pydantic.Field() + """ + The standard icon set: square and card shapes, each in light and dark colorways. + """ + + installment_count: typing.Optional[int] = pydantic.Field(default=None) + """ + Installment methods only: how many payments the charge splits into. Data, not copy — compose and translate the label client-side. + """ + + payment_method_type: str = pydantic.Field() + """ + The payment method type identifier, e.g. `card`, `klarna`, `apple_pay`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons.py b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons.py new file mode 100644 index 00000000..5b70576b --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .dispute_legacy_payment_payment_instrument_icons_square import DisputeLegacyPaymentPaymentInstrumentIconsSquare + + +class DisputeLegacyPaymentPaymentInstrumentIcons(UniversalBaseModel): + """ + The standard icon set: square and card shapes, each in light and dark colorways. + """ + + square: DisputeLegacyPaymentPaymentInstrumentIconsSquare = pydantic.Field() + """ + The square tile (32x32). + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square.py b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square.py new file mode 100644 index 00000000..bd691f4c --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .dispute_legacy_payment_payment_instrument_icons_square_dark import ( + DisputeLegacyPaymentPaymentInstrumentIconsSquareDark, +) +from .dispute_legacy_payment_payment_instrument_icons_square_light import ( + DisputeLegacyPaymentPaymentInstrumentIconsSquareLight, +) + + +class DisputeLegacyPaymentPaymentInstrumentIconsSquare(UniversalBaseModel): + """ + The square tile (32x32). + """ + + dark: DisputeLegacyPaymentPaymentInstrumentIconsSquareDark = pydantic.Field() + """ + The colorway for dark surfaces. + """ + + light: DisputeLegacyPaymentPaymentInstrumentIconsSquareLight = pydantic.Field() + """ + The colorway for light surfaces. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company_logo.py b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_dark.py similarity index 66% rename from src/whop_sdk/types/company_logo.py rename to src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_dark.py index f13833ef..84b6a290 100644 --- a/src/whop_sdk/types/company_logo.py +++ b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_dark.py @@ -6,14 +6,14 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class CompanyLogo(UniversalBaseModel): +class DisputeLegacyPaymentPaymentInstrumentIconsSquareDark(UniversalBaseModel): """ - The company's logo. + The colorway for dark surfaces. """ - url: typing.Optional[str] = pydantic.Field(default=None) + svg: str = pydantic.Field() """ - A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + The vector file. Prefer this everywhere SVG renders. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_light.py b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_light.py new file mode 100644 index 00000000..4896ed6d --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_payment_instrument_icons_square_light.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyPaymentPaymentInstrumentIconsSquareLight(UniversalBaseModel): + """ + The colorway for light surfaces. + """ + + svg: str = pydantic.Field() + """ + The vector file. Prefer this everywhere SVG renders. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_payment_user.py b/src/whop_sdk/types/dispute_legacy_payment_user.py new file mode 100644 index 00000000..fdff2972 --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_payment_user.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyPaymentUser(UniversalBaseModel): + """ + The user that made this payment. + """ + + email: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's email address. Requires the member:email:read permission to access. Null if not authorized. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the user. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's display name shown on their public profile. + """ + + username: str = pydantic.Field() + """ + The user's unique username shown on their public profile. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_plan.py b/src/whop_sdk/types/dispute_legacy_plan.py new file mode 100644 index 00000000..ff585abd --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_plan.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyPlan(UniversalBaseModel): + """ + The plan associated with the disputed payment. Null if the dispute is not linked to a specific plan. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the plan. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company_featured_affiliate_product.py b/src/whop_sdk/types/dispute_legacy_product.py similarity index 66% rename from src/whop_sdk/types/company_featured_affiliate_product.py rename to src/whop_sdk/types/dispute_legacy_product.py index 5e43f7d5..0300783e 100644 --- a/src/whop_sdk/types/company_featured_affiliate_product.py +++ b/src/whop_sdk/types/dispute_legacy_product.py @@ -6,9 +6,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class CompanyFeaturedAffiliateProduct(UniversalBaseModel): +class DisputeLegacyProduct(UniversalBaseModel): """ - The product featured for affiliates to promote on this company's affiliate page. Null if none is configured. + The product associated with the disputed payment. Null if the dispute is not linked to a specific product. """ id: str = pydantic.Field() @@ -16,9 +16,9 @@ class CompanyFeaturedAffiliateProduct(UniversalBaseModel): The unique identifier for the product. """ - name: str = pydantic.Field() + title: str = pydantic.Field() """ - The display name of the product shown to customers. Maximum 50 characters. + The display name of the product shown to customers on the product page and in search results. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/dispute_legacy_refund_policy_attachment.py b/src/whop_sdk/types/dispute_legacy_refund_policy_attachment.py new file mode 100644 index 00000000..dfb6783c --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_refund_policy_attachment.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyRefundPolicyAttachment(UniversalBaseModel): + """ + The refund policy document uploaded as dispute evidence. Null if no refund policy has been provided. + """ + + content_type: typing.Optional[str] = pydantic.Field(default=None) + """ + Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + """ + + filename: typing.Optional[str] = pydantic.Field(default=None) + """ + The original filename of the uploaded attachment, including its file extension. + """ + + id: str = pydantic.Field() + """ + Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. + """ + + url: typing.Optional[str] = pydantic.Field(default=None) + """ + A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/dispute_legacy_uncategorized_attachment.py b/src/whop_sdk/types/dispute_legacy_uncategorized_attachment.py new file mode 100644 index 00000000..7598798f --- /dev/null +++ b/src/whop_sdk/types/dispute_legacy_uncategorized_attachment.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DisputeLegacyUncategorizedAttachment(UniversalBaseModel): + """ + An additional attachment that does not fit into the standard evidence categories. Null if not provided. + """ + + content_type: typing.Optional[str] = pydantic.Field(default=None) + """ + Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + """ + + filename: typing.Optional[str] = pydantic.Field(default=None) + """ + The original filename of the uploaded attachment, including its file extension. + """ + + id: str = pydantic.Field() + """ + Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. + """ + + url: typing.Optional[str] = pydantic.Field(default=None) + """ + A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/granularities.py b/src/whop_sdk/types/granularities.py deleted file mode 100644 index 78344080..00000000 --- a/src/whop_sdk/types/granularities.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -Granularities = typing.Union[typing.Literal["hourly", "daily", "weekly", "monthly"], typing.Any] diff --git a/src/whop_sdk/types/ledger_account.py b/src/whop_sdk/types/ledger_account.py index fa2f909a..b28ca2b0 100644 --- a/src/whop_sdk/types/ledger_account.py +++ b/src/whop_sdk/types/ledger_account.py @@ -48,6 +48,11 @@ class LedgerAccount(UniversalBaseModel): The payout account associated with the LedgerAccount, if any. """ + payout_quote_required: bool = pydantic.Field() + """ + Whether a payout from this account must be confirmed against a provider-backed quote first. When true, create a quote with POST /payouts/quotes and send its quote_token when creating the payout. + """ + settlement_time_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The settlement batch most recently posted to this account's available balance, at midnight UTC. Every payment settling in that batch carries the same `settlement_time_at`. diff --git a/src/whop_sdk/types/ledger_activity.py b/src/whop_sdk/types/ledger_activity.py index 1a85e598..9f088f54 100644 --- a/src/whop_sdk/types/ledger_activity.py +++ b/src/whop_sdk/types/ledger_activity.py @@ -96,6 +96,11 @@ class LedgerActivity(UniversalBaseModel): Source of this ledger activity. """ + usd_amount: typing.Optional[str] = pydantic.Field(default=None) + """ + Dollar value of this movement as a decimal string, signed like `amount`. Converted from the posted amount at the rate that was live when the line posted — the same pricing the wallet balance chart and the financial reports use — so a crypto row carries its dollar value too. `null` for a currency Whop holds no exchange rate for. + """ + user_email: typing.Optional[str] = pydantic.Field(default=None) """ Email of the customer associated with the payment. Requires member:email:read. diff --git a/src/whop_sdk/types/ledger_activity_line_type.py b/src/whop_sdk/types/ledger_activity_line_type.py index fddc2912..48fb216b 100644 --- a/src/whop_sdk/types/ledger_activity_line_type.py +++ b/src/whop_sdk/types/ledger_activity_line_type.py @@ -66,6 +66,7 @@ "misc_purchase", "misc_refund", "misc_reversal", + "onboarding_reward", "onchain_deposit", "onchain_swap_source", "onchain_swap_target", diff --git a/src/whop_sdk/types/member.py b/src/whop_sdk/types/member.py index 13c52a7e..43ef0394 100644 --- a/src/whop_sdk/types/member.py +++ b/src/whop_sdk/types/member.py @@ -50,6 +50,11 @@ class Member(UniversalBaseModel): `joined` while the member is part of the account, `left` after they leave. """ + token_balance: float = pydantic.Field() + """ + The member's current token balance for this account, computed from token transactions. + """ + user: typing.Optional[UserSummary] = pydantic.Field(default=None) """ The user behind this member. `null` when the buyer is another business rather than a person. diff --git a/src/whop_sdk/types/member_legacy.py b/src/whop_sdk/types/member_legacy.py new file mode 100644 index 00000000..a4784fdd --- /dev/null +++ b/src/whop_sdk/types/member_legacy.py @@ -0,0 +1,92 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .access_level import AccessLevel +from .member_legacy_company import MemberLegacyCompany +from .member_legacy_user import MemberLegacyUser +from .member_most_recent_actions import MemberMostRecentActions +from .member_statuses import MemberStatuses + + +class MemberLegacy(UniversalBaseModel): + """ + A member represents a user's relationship with a company on Whop, including their access level, status, and spending history. + """ + + access_level: AccessLevel = pydantic.Field() + """ + The member's content access level. `admin` means their team role grants administrative content access, `customer` means they hold a valid product membership, and `no_access` means they cannot access company content. + """ + + company: MemberLegacyCompany = pydantic.Field() + """ + The company for the member. + """ + + company_token_balance: float = pydantic.Field() + """ + The member's token balance for this company. Computed live from the ledger, not from a cache. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the company member was created. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company member. + """ + + joined_at: dt.datetime = pydantic.Field() + """ + When the member joined the company + """ + + most_recent_action: typing.Optional[MemberMostRecentActions] = pydantic.Field(default=None) + """ + The most recent action the member has taken. + """ + + most_recent_action_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time for the most recent action, if applicable. + """ + + phone: typing.Optional[str] = pydantic.Field(default=None) + """ + The phone number for the member, if available. + """ + + status: MemberStatuses = pydantic.Field() + """ + The status of the member + """ + + updated_at: dt.datetime = pydantic.Field() + """ + The datetime the company member was last updated. + """ + + usd_total_spent: float = pydantic.Field() + """ + How much money this customer has spent on the company's products and plans + """ + + user: typing.Optional[MemberLegacyUser] = pydantic.Field(default=None) + """ + The user for this member, if any. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/member_legacy_company.py b/src/whop_sdk/types/member_legacy_company.py new file mode 100644 index 00000000..f4ae6958 --- /dev/null +++ b/src/whop_sdk/types/member_legacy_company.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MemberLegacyCompany(UniversalBaseModel): + """ + The company for the member. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company. + """ + + route: str = pydantic.Field() + """ + The slug/route of the company on the Whop site. + """ + + title: str = pydantic.Field() + """ + The written name of the company. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/member_legacy_user.py b/src/whop_sdk/types/member_legacy_user.py new file mode 100644 index 00000000..d81ae897 --- /dev/null +++ b/src/whop_sdk/types/member_legacy_user.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MemberLegacyUser(UniversalBaseModel): + """ + The user for this member, if any. + """ + + email: typing.Optional[str] = pydantic.Field(default=None) + """ + The digital mailing address of the user. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company member user. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's full name. + """ + + username: str = pydantic.Field() + """ + The whop username. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/membership_legacy.py b/src/whop_sdk/types/membership_legacy.py new file mode 100644 index 00000000..b466dabc --- /dev/null +++ b/src/whop_sdk/types/membership_legacy.py @@ -0,0 +1,168 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .cancel_options import CancelOptions +from .cancelation_status import CancelationStatus +from .currencies import Currencies +from .membership_legacy_company import MembershipLegacyCompany +from .membership_legacy_custom_field_responses_item import MembershipLegacyCustomFieldResponsesItem +from .membership_legacy_member import MembershipLegacyMember +from .membership_legacy_plan import MembershipLegacyPlan +from .membership_legacy_product import MembershipLegacyProduct +from .membership_legacy_promo_code import MembershipLegacyPromoCode +from .membership_legacy_user import MembershipLegacyUser +from .membership_status import MembershipStatus + + +class MembershipLegacy(UniversalBaseModel): + """ + A membership represents an active relationship between a user and a product. It tracks the user's access, billing status, and renewal schedule. + """ + + cancel_at_period_end: bool = pydantic.Field() + """ + Whether this membership is set to cancel at the end of the current billing cycle. Only applies to memberships with a recurring plan. + """ + + cancel_option: typing.Optional[CancelOptions] = pydantic.Field(default=None) + """ + The category selected for why the member canceled (e.g. too_expensive, switching, missing_features). + """ + + cancelation_status: typing.Optional[CancelationStatus] = pydantic.Field(default=None) + """ + Whether the customer is canceling, left, or was won back. Null if the membership has no cancellation reason or its cancellation state is indeterminate. + """ + + canceled_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time the customer initiated cancellation of this membership. As a Unix timestamp. Null if the membership has not been canceled. + """ + + cancellation_reason: typing.Optional[str] = pydantic.Field(default=None) + """ + Free-text explanation provided by the customer when canceling. Null if the customer did not provide a reason. + """ + + checkout_configuration_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The ID of the checkout session/configuration that produced this membership, if any. Use this to map memberships back to the checkout configuration that created them. + """ + + company: MembershipLegacyCompany = pydantic.Field() + """ + The company this membership belongs to. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the membership was created. + """ + + currency: typing.Optional[Currencies] = pydantic.Field(default=None) + """ + The three-letter ISO currency code for this membership's billing. Null if the membership is free. + """ + + custom_field_responses: typing.List[MembershipLegacyCustomFieldResponsesItem] = pydantic.Field() + """ + The customer's responses to custom checkout questions configured on the product at the time of purchase. + """ + + formatted_renewal_price: typing.Optional[str] = pydantic.Field(default=None) + """ + The recurring renewal price for this membership, formatted with currency symbol and billing interval. Null if the membership is not recurring. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the membership. + """ + + initial_price_paid: str = pydantic.Field() + """ + The amount the customer paid when first purchasing this membership, formatted with currency symbol. + """ + + joined_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time the user first joined the company associated with this membership. As a Unix timestamp. Null if the member record does not exist. + """ + + license_key: typing.Optional[str] = pydantic.Field(default=None) + """ + The software license key associated with this membership. Only present if the product includes a Whop Software Licensing experience. Null otherwise. + """ + + manage_url: typing.Optional[str] = pydantic.Field(default=None) + """ + The URL where the customer can view and manage this membership, including cancellation and plan changes. Null if no member record exists. + """ + + member: typing.Optional[MembershipLegacyMember] = pydantic.Field(default=None) + """ + The member record linking the user to the company for this membership. Null if the member record has not been created yet. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + Custom key-value pairs for the membership (commonly used for software licensing, e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. + """ + + payment_collection_paused: bool = pydantic.Field() + """ + Whether recurring payment collection for this membership is temporarily paused by the company. + """ + + plan: MembershipLegacyPlan = pydantic.Field() + """ + The plan the customer purchased to create this membership. + """ + + product: MembershipLegacyProduct = pydantic.Field() + """ + The product this membership grants access to. + """ + + promo_code: typing.Optional[MembershipLegacyPromoCode] = pydantic.Field(default=None) + """ + The promotional code currently applied to this membership's billing. Null if no promo code is active. + """ + + renewal_period_end: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The end of the current billing period for this recurring membership. As a Unix timestamp. Null if the membership is not recurring. + """ + + renewal_period_start: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The start of the current billing period for this recurring membership. As a Unix timestamp. Null if the membership is not recurring. + """ + + status: MembershipStatus = pydantic.Field() + """ + The current lifecycle status of the membership (e.g., active, trialing, past_due, canceled, expired, completed). + """ + + updated_at: dt.datetime = pydantic.Field() + """ + The datetime the membership was last updated. + """ + + user: typing.Optional[MembershipLegacyUser] = pydantic.Field(default=None) + """ + The user who owns this membership. Null if the user account has been deleted. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/membership_legacy_company.py b/src/whop_sdk/types/membership_legacy_company.py new file mode 100644 index 00000000..407adf92 --- /dev/null +++ b/src/whop_sdk/types/membership_legacy_company.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MembershipLegacyCompany(UniversalBaseModel): + """ + The company this membership belongs to. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company. + """ + + title: str = pydantic.Field() + """ + The display name of the company shown to customers. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company_social_links_item.py b/src/whop_sdk/types/membership_legacy_custom_field_responses_item.py similarity index 60% rename from src/whop_sdk/types/company_social_links_item.py rename to src/whop_sdk/types/membership_legacy_custom_field_responses_item.py index 3088c143..d4bc1e8a 100644 --- a/src/whop_sdk/types/company_social_links_item.py +++ b/src/whop_sdk/types/membership_legacy_custom_field_responses_item.py @@ -4,27 +4,26 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .social_link_websites import SocialLinkWebsites -class CompanySocialLinksItem(UniversalBaseModel): +class MembershipLegacyCustomFieldResponsesItem(UniversalBaseModel): """ - A social link attached to a resource on the site. + The response from a custom field on checkout """ - id: str = pydantic.Field() + answer: str = pydantic.Field() """ - The unique identifier for the social link. + The response a user gave to the specific question or field. """ - url: str = pydantic.Field() + id: str = pydantic.Field() """ - The URL of the social media profile or external link. + The unique identifier for the custom field response. """ - website: SocialLinkWebsites = pydantic.Field() + question: str = pydantic.Field() """ - The website + The question asked by the custom field """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/membership_legacy_member.py b/src/whop_sdk/types/membership_legacy_member.py new file mode 100644 index 00000000..efee9811 --- /dev/null +++ b/src/whop_sdk/types/membership_legacy_member.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MembershipLegacyMember(UniversalBaseModel): + """ + The member record linking the user to the company for this membership. Null if the member record has not been created yet. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the member. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/membership_legacy_plan.py b/src/whop_sdk/types/membership_legacy_plan.py new file mode 100644 index 00000000..3d55fb8a --- /dev/null +++ b/src/whop_sdk/types/membership_legacy_plan.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MembershipLegacyPlan(UniversalBaseModel): + """ + The plan the customer purchased to create this membership. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the plan. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + Custom key-value pairs stored on the plan. Included in webhook payloads for payment and membership events. Max 50 keys, 100 chars per key, 500 chars per string value. The reserved keys `custom_cta` and `custom_cta_url`, when set, override the product's checkout call to action for this plan. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/membership_legacy_product.py b/src/whop_sdk/types/membership_legacy_product.py new file mode 100644 index 00000000..51eadedb --- /dev/null +++ b/src/whop_sdk/types/membership_legacy_product.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MembershipLegacyProduct(UniversalBaseModel): + """ + The product this membership grants access to. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the product. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + Custom key-value pairs stored on the product and included in payment and membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters per string value. + """ + + title: str = pydantic.Field() + """ + The display name of the product shown to customers on the product page and in search results. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/membership_legacy_promo_code.py b/src/whop_sdk/types/membership_legacy_promo_code.py new file mode 100644 index 00000000..4cc63923 --- /dev/null +++ b/src/whop_sdk/types/membership_legacy_promo_code.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MembershipLegacyPromoCode(UniversalBaseModel): + """ + The promotional code currently applied to this membership's billing. Null if no promo code is active. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the promo code. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/membership_legacy_user.py b/src/whop_sdk/types/membership_legacy_user.py new file mode 100644 index 00000000..21a1fddf --- /dev/null +++ b/src/whop_sdk/types/membership_legacy_user.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MembershipLegacyUser(UniversalBaseModel): + """ + The user who owns this membership. Null if the user account has been deleted. + """ + + email: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's email address. Requires the member:email:read permission to access. Null if not authorized. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the user. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's display name shown on their public profile. + """ + + profile_pic: str = pydantic.Field() + """ + The URL of the user's profile picture. Use profilePicture for the full attachment object. + """ + + username: str = pydantic.Field() + """ + The user's unique username shown on their public profile. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/payment.py b/src/whop_sdk/types/payment.py index 2b2f4978..f83e4356 100644 --- a/src/whop_sdk/types/payment.py +++ b/src/whop_sdk/types/payment.py @@ -1,357 +1,277 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .billing_reasons import BillingReasons -from .card_brands import CardBrands from .currencies import Currencies from .friendly_receipt_status import FriendlyReceiptStatus -from .payment_application_fee import PaymentApplicationFee -from .payment_billing_address import PaymentBillingAddress -from .payment_company import PaymentCompany +from .money import Money +from .payment_address import PaymentAddress from .payment_decline_codes import PaymentDeclineCodes -from .payment_disputes_item import PaymentDisputesItem -from .payment_fees_item import PaymentFeesItem -from .payment_financing_transactions_item import PaymentFinancingTransactionsItem -from .payment_member import PaymentMember -from .payment_membership import PaymentMembership +from .payment_instrument import PaymentInstrument from .payment_method_types import PaymentMethodTypes -from .payment_payment_instrument import PaymentPaymentInstrument -from .payment_payment_method import PaymentPaymentMethod -from .payment_plan import PaymentPlan -from .payment_product import PaymentProduct -from .payment_promo_code import PaymentPromoCode -from .payment_refunds_item import PaymentRefundsItem -from .payment_resolutions_item import PaymentResolutionsItem -from .payment_shipment import PaymentShipment -from .payment_shipping_address import PaymentShippingAddress -from .payment_user import PaymentUser from .payment_verification_checks import PaymentVerificationChecks from .receipt_status import ReceiptStatus from .receipt_tax_behaviors import ReceiptTaxBehaviors +from .user_summary import UserSummary class Payment(UniversalBaseModel): + account_id: typing.Optional[str] = pydantic.Field(default=None) """ - A payment represents a completed or attempted charge. Payments track the amount, status, currency, and payment method used. + The account that received the payment, prefixed `biz_`. """ - amount_after_fees: float = pydantic.Field() + amount_after_fees: Money = pydantic.Field() """ - How much the payment is for after fees - """ - - application_fee: typing.Optional[PaymentApplicationFee] = pydantic.Field(default=None) - """ - The application fee charged on this payment. + What the account keeps: the total less Whop's fees. """ auto_refunded: bool = pydantic.Field() """ - Whether this payment was auto refunded or not + True when Whop refunded the payment automatically, for example on a dispute alert. """ - billing_address: typing.Optional[PaymentBillingAddress] = pydantic.Field(default=None) + billing_address: typing.Optional[PaymentAddress] = pydantic.Field(default=None) """ - The address of the user who made the payment. + The billing address the buyer entered, or null. """ billing_reason: typing.Optional[BillingReasons] = pydantic.Field(default=None) """ - The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment. - """ - - card_brand: typing.Optional[CardBrands] = pydantic.Field(default=None) - """ - Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'. - """ - - card_exp_month: typing.Optional[int] = pydantic.Field(default=None) - """ - The expiration month (1-12) of the card used for this payment. Falls back to the declined card on failed payments with no saved card. Null when the payment was not made with a card or the expiry is unavailable. - """ - - card_exp_year: typing.Optional[int] = pydantic.Field(default=None) - """ - The four-digit expiration year of the card used for this payment. Falls back to the declined card on failed payments with no saved card. Null when the payment was not made with a card or the expiry is unavailable. - """ - - card_last4: typing.Optional[str] = pydantic.Field(default=None) - """ - The last four digits of the card used to make this payment. Null if the payment was not made with a card. + Why the charge was created: a first purchase, a renewal, a one-time payment, or a manual charge. """ checkout_configuration_id: typing.Optional[str] = pydantic.Field(default=None) """ - The ID of the checkout session/configuration that produced this payment, if any. Use this to map payments back to the checkout configuration that created them. + The checkout configuration the buyer paid through, prefixed `ch_`, or null. """ - company: typing.Optional[PaymentCompany] = pydantic.Field(default=None) + client_secret: typing.Optional[str] = pydantic.Field(default=None) """ - The company for the payment. + The credential a buyer's surface presents to poll this payment and set its return URL. Only on payments created from a confirmation token, and always null in list responses — retrieve the payment for it. """ - created_at: dt.datetime = pydantic.Field() + created_at: str = pydantic.Field() """ - The datetime the payment was created. + When the payment was created, as an ISO 8601 timestamp. """ currency: Currencies = pydantic.Field() """ - The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). + The currency the payment settles in, lowercase ISO 4217. Every money field below is stated in it unless it says otherwise. """ customer_phone: typing.Optional[str] = pydantic.Field(default=None) """ - Phone number the customer provided at checkout, or their verified phone number when your checkout requires phone verification. `null` when no phone number was collected. + The phone number the buyer gave at checkout, when one was collected. """ decline_code: typing.Optional[PaymentDeclineCodes] = pydantic.Field(default=None) """ - The reason the payment was declined. Null if the payment did not fail. + The normalized decline reason of the most recent failed attempt, or null. """ - dispute_alerted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + dispute_alerted_at: typing.Optional[str] = pydantic.Field(default=None) """ - When an alert came in that this transaction will be disputed - """ - - disputes: typing.Optional[typing.List[PaymentDisputesItem]] = pydantic.Field(default=None) - """ - The disputes attached to this payment. Null if the actor in context does not have the payment:dispute:read permission. + When an issuer warned that this payment will be disputed, or null. """ failure_message: typing.Optional[str] = pydantic.Field(default=None) """ - If the payment failed, the reason for the failure. + Why the most recent attempt failed, in plain words, or null. """ - fees: typing.List[PaymentFeesItem] = pydantic.Field() + financing_installments_count: typing.Optional[float] = pydantic.Field(default=None) """ - The fees associated with this specific payment. - """ - - financing_installments_count: typing.Optional[int] = pydantic.Field(default=None) - """ - The number of financing installments for the payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.). - """ - - financing_transactions: typing.List[PaymentFinancingTransactionsItem] = pydantic.Field() - """ - The financing transactions attached to this payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.). + For installment methods, how many payments the charge splits into. """ id: str = pydantic.Field() """ - The unique identifier for the payment. + Payment ID, prefixed `pay_`. """ - last_payment_attempt: typing.Optional[dt.datetime] = pydantic.Field(default=None) + last_payment_attempt_at: typing.Optional[str] = pydantic.Field(default=None) """ - The time of the last payment attempt. + When the most recent charge attempt ran, or null. """ - member: typing.Optional[PaymentMember] = pydantic.Field(default=None) + member_id: typing.Optional[str] = pydantic.Field(default=None) """ - The member attached to this payment. + The buyer's member record on the account, prefixed `mber_`. Null without the member:basic:read permission. """ - membership: typing.Optional[PaymentMembership] = pydantic.Field(default=None) + membership_id: typing.Optional[str] = pydantic.Field(default=None) """ - The membership attached to this payment. + The membership this payment is billed against, prefixed `mem_`. Null for one-off purchases or without the member:basic:read permission. """ metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ - The custom metadata stored on this payment. This will be copied over to the checkout configuration for which this payment was made + Your own key-value data attached when the payment was created. """ needs_tracking: typing.Optional[bool] = pydantic.Field(default=None) """ - Whether this payment is holding funds until the order ships and has no tracking number yet. + True when funds are held until the order ships and no tracking number has been added yet. Null without the shipment:basic:read permission. """ - next_payment_attempt: typing.Optional[dt.datetime] = pydantic.Field(default=None) + next_payment_attempt_at: typing.Optional[str] = pydantic.Field(default=None) """ - The time of the next schedule payment retry. + When the next automatic retry is scheduled, or null. """ - paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + paid_at: typing.Optional[str] = pydantic.Field(default=None) """ - The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. + When the money was collected, or null while it has not been. """ - payment_instrument: typing.Optional[PaymentPaymentInstrument] = pydantic.Field(default=None) + payment_instrument: typing.Optional[PaymentInstrument] = pydantic.Field(default=None) """ - The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. + The instrument shaped for display: a buyer-facing name, the standard icon set, and the card's brand and last four when it was a card. """ - payment_method: typing.Optional[PaymentPaymentMethod] = pydantic.Field(default=None) + payment_method_id: typing.Optional[str] = pydantic.Field(default=None) """ - The tokenized payment method reference used for this payment. Null if no token was used. + The stored payment method that was charged, prefixed `payt_`. Null when the method was not saved. """ payment_method_type: typing.Optional[PaymentMethodTypes] = pydantic.Field(default=None) """ - The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. + The kind of instrument used, for example `card`, `apple_pay`, `klarna`, or `us_bank_account`. """ - payments_failed: typing.Optional[int] = pydantic.Field(default=None) + payments_failed: float = pydantic.Field() """ - The number of failed payment attempts for the payment. + How many charge attempts have failed on this payment. """ - plan: typing.Optional[PaymentPlan] = pydantic.Field(default=None) + plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - The plan attached to this payment. + The plan that was charged, prefixed `plan_`. """ - product: typing.Optional[PaymentProduct] = pydantic.Field(default=None) + product_id: typing.Optional[str] = pydantic.Field(default=None) """ - The product this payment was made for + The product the plan belongs to, prefixed `prod_`. Null for a plan with no product. """ - promo_code: typing.Optional[PaymentPromoCode] = pydantic.Field(default=None) + promo_code_id: typing.Optional[str] = pydantic.Field(default=None) """ - The promo code used for this payment. + The promo code applied at checkout, prefixed `promo_`, or null. """ refundable: bool = pydantic.Field() """ - True only for payments that are `paid`, have not been fully refunded, and were processed by a payment processor that allows refunds. - """ - - refunded_amount: typing.Optional[float] = pydantic.Field(default=None) - """ - The payment refund amount(if applicable). - """ - - refunded_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) - """ - When the payment was refunded (if applicable). + True when the payment is `paid`, not yet fully refunded, and its processor supports refunds. """ - refunds: typing.List[PaymentRefundsItem] = pydantic.Field() + refunded_amount: typing.Optional[Money] = pydantic.Field(default=None) """ - The refunds issued against this payment, newest first, including failed and canceled refund attempts. Limited to the 100 most recent. + How much has been refunded so far, as it settled — refunds convert at the rate in force when each one was issued, not the payment's original rate. """ - resolutions: typing.Optional[typing.List[PaymentResolutionsItem]] = pydantic.Field(default=None) + refunded_at: typing.Optional[str] = pydantic.Field(default=None) """ - The resolution center cases opened by the customer on this payment. Null if the actor in context does not have the payment:resolution_center_case:read permission. + When the payment was refunded, or null. """ retryable: bool = pydantic.Field() """ - True when the payment status is `open` and its membership is in one of the retry-eligible states (`active`, `trialing`, `completed`, or `past_due`), or when it is a failed initial billing-engine payment on a `drafted` membership with an unlimited-stock plan; otherwise false. Used to decide if Whop can attempt the charge again. + True when the payment is `open` and Whop can attempt the charge again — see `POST /payments/{id}/retry`. """ - risk_score: typing.Optional[int] = pydantic.Field(default=None) + risk_score: typing.Optional[float] = pydantic.Field(default=None) """ - Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 (highest risk). Null when the payment has not been scored or scoring has not yet completed. + Whop's fraud risk score from 0 (lowest) to 100 (highest), or null when the payment was not scored. """ risk_signals: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ - A curated set of factors behind the risk score, grouped by category (business transaction history, buyer, device). Each entry has a key, human-readable label, category, and value. Null when there is no risk assessment for this payment. - """ - - settlement_amount: float = pydantic.Field() - """ - The total amount charged to the customer for this payment, including taxes and after any discounts. In the currency specified by the currency field. - """ - - settlement_currency: Currencies = pydantic.Field() - """ - The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). - """ - - settlement_exchange_rate: typing.Optional[float] = pydantic.Field(default=None) - """ - Deprecated. Always returns null. + The factors behind `risk_score`, grouped by category, or null. """ - settlement_time_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + settlement_time_at: typing.Optional[str] = pydantic.Field(default=None) """ - When this payment's funds post to the company's available balance, at midnight UTC. Known at payment time and never changes. The `ledger_account.funds_available` webhook carries the same `settlement_time_at` when that batch posts — match them to know these funds are now withdrawable. + When the funds post to the account's available balance, at midnight UTC. The `ledger_account.funds_available` webhook carries the same value. Null until the payment is paid, and always null in list responses — retrieve the payment for it. """ - shipment: typing.Optional[PaymentShipment] = pydantic.Field(default=None) + shipment_id: typing.Optional[str] = pydantic.Field(default=None) """ - The shipment attached to this payment. + The shipment fulfilling this payment, prefixed `ship_`. Null when nothing ships or without the shipment:basic:read permission. """ - shipping_address: typing.Optional[PaymentShippingAddress] = pydantic.Field(default=None) + shipping_address: typing.Optional[PaymentAddress] = pydantic.Field(default=None) """ - The shipping address provided by the customer for physical goods. Null if no shipping address was collected. + The shipping address for physical goods, or null. """ - status: typing.Optional[ReceiptStatus] = pydantic.Field(default=None) + status: ReceiptStatus = pydantic.Field() """ - The current lifecycle state of this payment (e.g., 'draft', 'open', 'paid', 'void'). + The lifecycle state of the charge: `open` while collection is outstanding, `paid` once the money moved, `pending` while a settlement rail clears, `void`/`uncollectible` when it ended without collecting. """ substatus: FriendlyReceiptStatus = pydantic.Field() """ - The friendly status of the payment. + The dashboard's finer-grained reading of the payment, folding in refunds, disputes and Resolution Center cases. """ - subtotal: typing.Optional[float] = pydantic.Field(default=None) + subtotal: typing.Optional[Money] = pydantic.Field(default=None) """ - The subtotal to show to the creator (excluding buyer fees). + The price before discounts, tax and fees. """ - tax_amount: typing.Optional[float] = pydantic.Field(default=None) + tax_amount: typing.Optional[Money] = pydantic.Field(default=None) """ - The calculated amount of the sales/VAT tax (if applicable). + The sales tax or VAT collected. Null when no tax applied. """ tax_behavior: typing.Optional[ReceiptTaxBehaviors] = pydantic.Field(default=None) """ - The type of tax inclusivity applied to the payment, for determining whether the tax is included in the final price, or paid on top. + Whether `tax_amount` was added on top of the price (`exclusive`) or was already inside it (`inclusive`). """ - tax_refunded_amount: typing.Optional[float] = pydantic.Field(default=None) + tax_refunded_amount: Money = pydantic.Field() """ - The amount of tax that has been refunded (if applicable). + How much of the collected tax has been returned to the buyer so far. Zero when the payment carried no tax, or when nothing has been refunded. """ three_ds_verified: bool = pydantic.Field() """ - Whether 3D Secure authentication was completed for this payment. + True when the buyer completed 3D Secure for this payment. """ - total: typing.Optional[float] = pydantic.Field(default=None) + total: typing.Optional[Money] = pydantic.Field(default=None) """ - The total to show to the creator (excluding buyer fees). + The account-facing total: the price after discounts, plus any tax added on top. Excludes buyer fees, which the buyer pays above this amount — so this is not necessarily what the buyer's statement shows. """ - updated_at: dt.datetime = pydantic.Field() + updated_at: str = pydantic.Field() """ - The datetime the payment was last updated. + When the payment last changed, as an ISO 8601 timestamp. """ - usd_total: typing.Optional[float] = pydantic.Field(default=None) + usd_total: typing.Optional[Money] = pydantic.Field(default=None) """ - The total in USD to show to the creator (excluding buyer fees). + The total converted to USD at the time of the charge, for reporting across currencies. Excludes the adaptive pricing FX markup, which the account does not keep. """ - user: typing.Optional[PaymentUser] = pydantic.Field(default=None) + user: typing.Optional[UserSummary] = pydantic.Field(default=None) """ - The user that made this payment. + The buyer. Null when the payment belongs to a company buyer rather than a user. """ verification_checks: typing.Optional[PaymentVerificationChecks] = pydantic.Field(default=None) """ - The issuer's address and card security code check results for this payment. Null when the processor returned none. + The issuer's address and security code check results, or null when the processor returned none. """ voidable: bool = pydantic.Field() """ - True when the payment is tied to a membership in `past_due`, the payment status is `open`, and the processor allows voiding payments; otherwise false. + True when the payment is `open` on a past-due membership and its processor supports voiding — see `POST /payments/{id}/void`. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/payment_address.py b/src/whop_sdk/types/payment_address.py new file mode 100644 index 00000000..eae83ea9 --- /dev/null +++ b/src/whop_sdk/types/payment_address.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class PaymentAddress(UniversalBaseModel): + city: typing.Optional[str] = pydantic.Field(default=None) + """ + The city. + """ + + country: typing.Optional[str] = pydantic.Field(default=None) + """ + The ISO 3166-1 alpha-2 country code. + """ + + line1: typing.Optional[str] = pydantic.Field(default=None) + """ + The first street address line. + """ + + line2: typing.Optional[str] = pydantic.Field(default=None) + """ + The second street address line. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name on the address. + """ + + postal_code: typing.Optional[str] = pydantic.Field(default=None) + """ + The postal or ZIP code. + """ + + state: typing.Optional[str] = pydantic.Field(default=None) + """ + The state, province or region. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/payment_fee.py b/src/whop_sdk/types/payment_fee.py new file mode 100644 index 00000000..b565d607 --- /dev/null +++ b/src/whop_sdk/types/payment_fee.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .money import Money +from .payment_fee_origin import PaymentFeeOrigin +from .payment_fee_type import PaymentFeeType + + +class PaymentFee(UniversalBaseModel): + amount: Money = pydantic.Field() + """ + The fee in the currency it was collected in. + """ + + collected_at: typing.Optional[str] = pydantic.Field(default=None) + """ + When the fee was collected, as an ISO 8601 timestamp, or null when it has not been. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + A longer explanation of the fee, when there is one. + """ + + label: str = pydantic.Field() + """ + The name the dashboard shows for this fee. + """ + + origin: PaymentFeeOrigin = pydantic.Field() + """ + The specific fee this line is, such as `payment_processing_percentage_fee` or `revshare_percentage_fee`. + """ + + settlement_amount: Money = pydantic.Field() + """ + The fee converted to the payment's settlement currency, so lines can be totalled against the payment. + """ + + type: PaymentFeeType = pydantic.Field() + """ + The family the fee belongs to: `whop_fee`, `processing_fee`, `affiliate_program_fee`, or `other_fee`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/payment_fee_origin.py b/src/whop_sdk/types/payment_fee_origin.py new file mode 100644 index 00000000..e90627d2 --- /dev/null +++ b/src/whop_sdk/types/payment_fee_origin.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PaymentFeeOrigin = typing.Union[ + typing.Literal[ + "stripe_domestic_processing_fee", + "stripe_international_processing_fee", + "stripe_fixed_processing_fee", + "stripe_billing_fee", + "stripe_radar_fee", + "sales_tax_remittance", + "sales_tax_remittance_reversal", + "stripe_sales_tax_fee", + "whop_processing_fee", + "marketplace_affiliate_fee", + "affiliate_fee", + "crypto_fee", + "stripe_standard_processing_fee", + "paypal_fee", + "stripe_payout_fee", + "dispute_fee", + "dispute_alert_fee", + "dispute_representment_fee", + "apple_processing_fee", + "buyer_fee", + "sezzle_processing_fee", + "splitit_processing_fee", + "platform_balance_processing_fee", + "payment_processing_percentage_fee", + "payment_processing_fixed_fee", + "cross_border_percentage_fee", + "fx_percentage_fee", + "orchestration_percentage_fee", + "three_ds_fixed_fee", + "billing_percentage_fee", + "revshare_percentage_fee", + "application_fee", + "high_risk_merchant_fee", + ], + typing.Any, +] diff --git a/src/whop_sdk/types/payment_fee_type.py b/src/whop_sdk/types/payment_fee_type.py new file mode 100644 index 00000000..a09cf46a --- /dev/null +++ b/src/whop_sdk/types/payment_fee_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PaymentFeeType = typing.Union[ + typing.Literal["whop_fee", "processing_fee", "affiliate_program_fee", "other_fee"], typing.Any +] diff --git a/src/whop_sdk/types/payment_legacy.py b/src/whop_sdk/types/payment_legacy.py new file mode 100644 index 00000000..68f839c8 --- /dev/null +++ b/src/whop_sdk/types/payment_legacy.py @@ -0,0 +1,364 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_reasons import BillingReasons +from .card_brands import CardBrands +from .currencies import Currencies +from .friendly_receipt_status import FriendlyReceiptStatus +from .payment_decline_codes import PaymentDeclineCodes +from .payment_legacy_application_fee import PaymentLegacyApplicationFee +from .payment_legacy_billing_address import PaymentLegacyBillingAddress +from .payment_legacy_company import PaymentLegacyCompany +from .payment_legacy_disputes_item import PaymentLegacyDisputesItem +from .payment_legacy_fees_item import PaymentLegacyFeesItem +from .payment_legacy_financing_transactions_item import PaymentLegacyFinancingTransactionsItem +from .payment_legacy_member import PaymentLegacyMember +from .payment_legacy_membership import PaymentLegacyMembership +from .payment_legacy_payment_instrument import PaymentLegacyPaymentInstrument +from .payment_legacy_payment_method import PaymentLegacyPaymentMethod +from .payment_legacy_plan import PaymentLegacyPlan +from .payment_legacy_product import PaymentLegacyProduct +from .payment_legacy_promo_code import PaymentLegacyPromoCode +from .payment_legacy_refunds_item import PaymentLegacyRefundsItem +from .payment_legacy_resolutions_item import PaymentLegacyResolutionsItem +from .payment_legacy_shipment import PaymentLegacyShipment +from .payment_legacy_shipping_address import PaymentLegacyShippingAddress +from .payment_legacy_user import PaymentLegacyUser +from .payment_legacy_verification_checks import PaymentLegacyVerificationChecks +from .payment_method_types import PaymentMethodTypes +from .receipt_status import ReceiptStatus +from .receipt_tax_behaviors import ReceiptTaxBehaviors + + +class PaymentLegacy(UniversalBaseModel): + """ + A payment represents a completed or attempted charge. Payments track the amount, status, currency, and payment method used. + """ + + amount_after_fees: float = pydantic.Field() + """ + How much the payment is for after fees + """ + + application_fee: typing.Optional[PaymentLegacyApplicationFee] = pydantic.Field(default=None) + """ + The application fee charged on this payment. + """ + + auto_refunded: bool = pydantic.Field() + """ + Whether this payment was auto refunded or not + """ + + billing_address: typing.Optional[PaymentLegacyBillingAddress] = pydantic.Field(default=None) + """ + The address of the user who made the payment. + """ + + billing_reason: typing.Optional[BillingReasons] = pydantic.Field(default=None) + """ + The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment. + """ + + card_brand: typing.Optional[CardBrands] = pydantic.Field(default=None) + """ + Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'. + """ + + card_exp_month: typing.Optional[int] = pydantic.Field(default=None) + """ + The expiration month (1-12) of the card used for this payment. Falls back to the declined card on failed payments with no saved card. Null when the payment was not made with a card or the expiry is unavailable. + """ + + card_exp_year: typing.Optional[int] = pydantic.Field(default=None) + """ + The four-digit expiration year of the card used for this payment. Falls back to the declined card on failed payments with no saved card. Null when the payment was not made with a card or the expiry is unavailable. + """ + + card_last4: typing.Optional[str] = pydantic.Field(default=None) + """ + The last four digits of the card used to make this payment. Null if the payment was not made with a card. + """ + + checkout_configuration_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The ID of the checkout session/configuration that produced this payment, if any. Use this to map payments back to the checkout configuration that created them. + """ + + company: typing.Optional[PaymentLegacyCompany] = pydantic.Field(default=None) + """ + The company for the payment. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the payment was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). + """ + + customer_phone: typing.Optional[str] = pydantic.Field(default=None) + """ + Phone number the customer provided at checkout, or their verified phone number when your checkout requires phone verification. `null` when no phone number was collected. + """ + + decline_code: typing.Optional[PaymentDeclineCodes] = pydantic.Field(default=None) + """ + The reason the payment was declined. Null if the payment did not fail. + """ + + dispute_alerted_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When an alert came in that this transaction will be disputed + """ + + disputes: typing.Optional[typing.List[PaymentLegacyDisputesItem]] = pydantic.Field(default=None) + """ + The disputes attached to this payment. Null if the actor in context does not have the payment:dispute:read permission. + """ + + failure_message: typing.Optional[str] = pydantic.Field(default=None) + """ + If the payment failed, the reason for the failure. + """ + + fees: typing.List[PaymentLegacyFeesItem] = pydantic.Field() + """ + The fees associated with this specific payment. + """ + + financing_installments_count: typing.Optional[int] = pydantic.Field(default=None) + """ + The number of financing installments for the payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.). + """ + + financing_transactions: typing.List[PaymentLegacyFinancingTransactionsItem] = pydantic.Field() + """ + The financing transactions attached to this payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.). + """ + + id: str = pydantic.Field() + """ + The unique identifier for the payment. + """ + + last_payment_attempt: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time of the last payment attempt. + """ + + member: typing.Optional[PaymentLegacyMember] = pydantic.Field(default=None) + """ + The member attached to this payment. + """ + + membership: typing.Optional[PaymentLegacyMembership] = pydantic.Field(default=None) + """ + The membership attached to this payment. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + The custom metadata stored on this payment. This will be copied over to the checkout configuration for which this payment was made + """ + + needs_tracking: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether this payment is holding funds until the order ships and has no tracking number yet. + """ + + next_payment_attempt: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time of the next schedule payment retry. + """ + + paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. + """ + + payment_instrument: typing.Optional[PaymentLegacyPaymentInstrument] = pydantic.Field(default=None) + """ + The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. + """ + + payment_method: typing.Optional[PaymentLegacyPaymentMethod] = pydantic.Field(default=None) + """ + The tokenized payment method reference used for this payment. Null if no token was used. + """ + + payment_method_type: typing.Optional[PaymentMethodTypes] = pydantic.Field(default=None) + """ + The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. + """ + + payments_failed: typing.Optional[int] = pydantic.Field(default=None) + """ + The number of failed payment attempts for the payment. + """ + + plan: typing.Optional[PaymentLegacyPlan] = pydantic.Field(default=None) + """ + The plan attached to this payment. + """ + + product: typing.Optional[PaymentLegacyProduct] = pydantic.Field(default=None) + """ + The product this payment was made for + """ + + promo_code: typing.Optional[PaymentLegacyPromoCode] = pydantic.Field(default=None) + """ + The promo code used for this payment. + """ + + refundable: bool = pydantic.Field() + """ + True only for payments that are `paid`, have not been fully refunded, and were processed by a payment processor that allows refunds. + """ + + refunded_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The payment refund amount(if applicable). + """ + + refunded_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the payment was refunded (if applicable). + """ + + refunds: typing.List[PaymentLegacyRefundsItem] = pydantic.Field() + """ + The refunds issued against this payment, newest first, including failed and canceled refund attempts. Limited to the 100 most recent. + """ + + resolutions: typing.Optional[typing.List[PaymentLegacyResolutionsItem]] = pydantic.Field(default=None) + """ + The resolution center cases opened by the customer on this payment. Null if the actor in context does not have the payment:resolution_center_case:read permission. + """ + + retryable: bool = pydantic.Field() + """ + True when the payment status is `open` and its membership is in one of the retry-eligible states (`active`, `trialing`, `completed`, or `past_due`), or when it is a failed initial billing-engine payment on a `drafted` membership with an unlimited-stock plan; otherwise false. Used to decide if Whop can attempt the charge again. + """ + + risk_score: typing.Optional[int] = pydantic.Field(default=None) + """ + Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 (highest risk). Null when the payment has not been scored or scoring has not yet completed. + """ + + risk_signals: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + A curated set of factors behind the risk score, grouped by category (business transaction history, buyer, device). Each entry has a key, human-readable label, category, and value. Null when there is no risk assessment for this payment. + """ + + settlement_amount: float = pydantic.Field() + """ + The total amount charged to the customer for this payment, including taxes and after any discounts. In the currency specified by the currency field. + """ + + settlement_currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). + """ + + settlement_exchange_rate: typing.Optional[float] = pydantic.Field(default=None) + """ + Deprecated. Always returns null. + """ + + settlement_time_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When this payment's funds post to the company's available balance, at midnight UTC. Known at payment time and never changes. The `ledger_account.funds_available` webhook carries the same `settlement_time_at` when that batch posts — match them to know these funds are now withdrawable. + """ + + shipment: typing.Optional[PaymentLegacyShipment] = pydantic.Field(default=None) + """ + The shipment attached to this payment. + """ + + shipping_address: typing.Optional[PaymentLegacyShippingAddress] = pydantic.Field(default=None) + """ + The shipping address provided by the customer for physical goods. Null if no shipping address was collected. + """ + + status: typing.Optional[ReceiptStatus] = pydantic.Field(default=None) + """ + The current lifecycle state of this payment (e.g., 'draft', 'open', 'paid', 'void'). + """ + + substatus: FriendlyReceiptStatus = pydantic.Field() + """ + The friendly status of the payment. + """ + + subtotal: typing.Optional[float] = pydantic.Field(default=None) + """ + The subtotal to show to the creator (excluding buyer fees). + """ + + tax_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The calculated amount of the sales/VAT tax (if applicable). + """ + + tax_behavior: typing.Optional[ReceiptTaxBehaviors] = pydantic.Field(default=None) + """ + The type of tax inclusivity applied to the payment, for determining whether the tax is included in the final price, or paid on top. + """ + + tax_refunded_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The amount of tax that has been refunded (if applicable). + """ + + three_ds_verified: bool = pydantic.Field() + """ + Whether 3D Secure authentication was completed for this payment. + """ + + total: typing.Optional[float] = pydantic.Field(default=None) + """ + The total to show to the creator (excluding buyer fees). + """ + + updated_at: dt.datetime = pydantic.Field() + """ + The datetime the payment was last updated. + """ + + usd_total: typing.Optional[float] = pydantic.Field(default=None) + """ + The total in USD to show to the creator (excluding buyer fees). + """ + + user: typing.Optional[PaymentLegacyUser] = pydantic.Field(default=None) + """ + The user that made this payment. + """ + + verification_checks: typing.Optional[PaymentLegacyVerificationChecks] = pydantic.Field(default=None) + """ + The issuer's address and card security code check results for this payment. Null when the processor returned none. + """ + + voidable: bool = pydantic.Field() + """ + True when the payment is tied to a membership in `past_due`, the payment status is `open`, and the processor allows voiding payments; otherwise false. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/payment_application_fee.py b/src/whop_sdk/types/payment_legacy_application_fee.py similarity index 95% rename from src/whop_sdk/types/payment_application_fee.py rename to src/whop_sdk/types/payment_legacy_application_fee.py index 1cd5f021..a4e9407b 100644 --- a/src/whop_sdk/types/payment_application_fee.py +++ b/src/whop_sdk/types/payment_legacy_application_fee.py @@ -8,7 +8,7 @@ from .currencies import Currencies -class PaymentApplicationFee(UniversalBaseModel): +class PaymentLegacyApplicationFee(UniversalBaseModel): """ The application fee charged on this payment. """ diff --git a/src/whop_sdk/types/payment_billing_address.py b/src/whop_sdk/types/payment_legacy_billing_address.py similarity index 95% rename from src/whop_sdk/types/payment_billing_address.py rename to src/whop_sdk/types/payment_legacy_billing_address.py index b2fd7454..b3dfe2b2 100644 --- a/src/whop_sdk/types/payment_billing_address.py +++ b/src/whop_sdk/types/payment_legacy_billing_address.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentBillingAddress(UniversalBaseModel): +class PaymentLegacyBillingAddress(UniversalBaseModel): """ The address of the user who made the payment. """ diff --git a/src/whop_sdk/types/payment_company.py b/src/whop_sdk/types/payment_legacy_company.py similarity index 94% rename from src/whop_sdk/types/payment_company.py rename to src/whop_sdk/types/payment_legacy_company.py index ce34ce18..65e1a86e 100644 --- a/src/whop_sdk/types/payment_company.py +++ b/src/whop_sdk/types/payment_legacy_company.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentCompany(UniversalBaseModel): +class PaymentLegacyCompany(UniversalBaseModel): """ The company for the payment. """ diff --git a/src/whop_sdk/types/payment_disputes_item.py b/src/whop_sdk/types/payment_legacy_disputes_item.py similarity index 97% rename from src/whop_sdk/types/payment_disputes_item.py rename to src/whop_sdk/types/payment_legacy_disputes_item.py index 01d120de..388fd5cc 100644 --- a/src/whop_sdk/types/payment_disputes_item.py +++ b/src/whop_sdk/types/payment_legacy_disputes_item.py @@ -9,7 +9,7 @@ from .dispute_statuses import DisputeStatuses -class PaymentDisputesItem(UniversalBaseModel): +class PaymentLegacyDisputesItem(UniversalBaseModel): """ A dispute is a chargeback or payment challenge filed against a company, including evidence and response status. """ diff --git a/src/whop_sdk/types/payment_fees_item.py b/src/whop_sdk/types/payment_legacy_fees_item.py similarity index 95% rename from src/whop_sdk/types/payment_fees_item.py rename to src/whop_sdk/types/payment_legacy_fees_item.py index becb0a82..c9e0aa32 100644 --- a/src/whop_sdk/types/payment_fees_item.py +++ b/src/whop_sdk/types/payment_legacy_fees_item.py @@ -8,7 +8,7 @@ from .specific_fee_origins import SpecificFeeOrigins -class PaymentFeesItem(UniversalBaseModel): +class PaymentLegacyFeesItem(UniversalBaseModel): """ Represents a fee related to a payment """ diff --git a/src/whop_sdk/types/payment_financing_transactions_item.py b/src/whop_sdk/types/payment_legacy_financing_transactions_item.py similarity index 94% rename from src/whop_sdk/types/payment_financing_transactions_item.py rename to src/whop_sdk/types/payment_legacy_financing_transactions_item.py index a5836875..25cad0ce 100644 --- a/src/whop_sdk/types/payment_financing_transactions_item.py +++ b/src/whop_sdk/types/payment_legacy_financing_transactions_item.py @@ -9,7 +9,7 @@ from .payment_transaction_types import PaymentTransactionTypes -class PaymentFinancingTransactionsItem(UniversalBaseModel): +class PaymentLegacyFinancingTransactionsItem(UniversalBaseModel): """ A payment transaction. """ diff --git a/src/whop_sdk/types/payment_member.py b/src/whop_sdk/types/payment_legacy_member.py similarity index 94% rename from src/whop_sdk/types/payment_member.py rename to src/whop_sdk/types/payment_legacy_member.py index 2ea88ac9..d63a00da 100644 --- a/src/whop_sdk/types/payment_member.py +++ b/src/whop_sdk/types/payment_legacy_member.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentMember(UniversalBaseModel): +class PaymentLegacyMember(UniversalBaseModel): """ The member attached to this payment. """ diff --git a/src/whop_sdk/types/payment_membership.py b/src/whop_sdk/types/payment_legacy_membership.py similarity index 94% rename from src/whop_sdk/types/payment_membership.py rename to src/whop_sdk/types/payment_legacy_membership.py index c556eb87..87821e2c 100644 --- a/src/whop_sdk/types/payment_membership.py +++ b/src/whop_sdk/types/payment_legacy_membership.py @@ -7,7 +7,7 @@ from .membership_status import MembershipStatus -class PaymentMembership(UniversalBaseModel): +class PaymentLegacyMembership(UniversalBaseModel): """ The membership attached to this payment. """ diff --git a/src/whop_sdk/types/payment_payment_instrument.py b/src/whop_sdk/types/payment_legacy_payment_instrument.py similarity index 78% rename from src/whop_sdk/types/payment_payment_instrument.py rename to src/whop_sdk/types/payment_legacy_payment_instrument.py index afe006b6..e5ab8eef 100644 --- a/src/whop_sdk/types/payment_payment_instrument.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument.py @@ -4,16 +4,16 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .payment_payment_instrument_card import PaymentPaymentInstrumentCard -from .payment_payment_instrument_icons import PaymentPaymentInstrumentIcons +from .payment_legacy_payment_instrument_card import PaymentLegacyPaymentInstrumentCard +from .payment_legacy_payment_instrument_icons import PaymentLegacyPaymentInstrumentIcons -class PaymentPaymentInstrument(UniversalBaseModel): +class PaymentLegacyPaymentInstrument(UniversalBaseModel): """ The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. """ - card: typing.Optional[PaymentPaymentInstrumentCard] = pydantic.Field(default=None) + card: typing.Optional[PaymentLegacyPaymentInstrumentCard] = pydantic.Field(default=None) """ Card payments only: the card's network and last four. """ @@ -23,7 +23,7 @@ class PaymentPaymentInstrument(UniversalBaseModel): Buyer-facing instrument name — "Visa •••• 4242" when the card surfaced, else the method's own name ("Klarna"). """ - icons: PaymentPaymentInstrumentIcons = pydantic.Field() + icons: PaymentLegacyPaymentInstrumentIcons = pydantic.Field() """ The standard icon set: square and card shapes, each in light and dark colorways. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_card.py b/src/whop_sdk/types/payment_legacy_payment_instrument_card.py similarity index 93% rename from src/whop_sdk/types/payment_payment_instrument_card.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_card.py index 1c33889b..e8fd7bb9 100644 --- a/src/whop_sdk/types/payment_payment_instrument_card.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_card.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentPaymentInstrumentCard(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentCard(UniversalBaseModel): """ Card payments only: the card's network and last four. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons.py similarity index 62% rename from src/whop_sdk/types/payment_payment_instrument_icons.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons.py index c9679f53..9f5746b4 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons.py @@ -4,21 +4,21 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .payment_payment_instrument_icons_card import PaymentPaymentInstrumentIconsCard -from .payment_payment_instrument_icons_square import PaymentPaymentInstrumentIconsSquare +from .payment_legacy_payment_instrument_icons_card import PaymentLegacyPaymentInstrumentIconsCard +from .payment_legacy_payment_instrument_icons_square import PaymentLegacyPaymentInstrumentIconsSquare -class PaymentPaymentInstrumentIcons(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIcons(UniversalBaseModel): """ The standard icon set: square and card shapes, each in light and dark colorways. """ - card: PaymentPaymentInstrumentIconsCard = pydantic.Field() + card: PaymentLegacyPaymentInstrumentIconsCard = pydantic.Field() """ The credit-card-proportioned tile (48x30). """ - square: PaymentPaymentInstrumentIconsSquare = pydantic.Field() + square: PaymentLegacyPaymentInstrumentIconsSquare = pydantic.Field() """ The square tile (32x32). """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons_card.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_card.py similarity index 59% rename from src/whop_sdk/types/payment_payment_instrument_icons_card.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons_card.py index dea03997..9585a92a 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons_card.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_card.py @@ -4,21 +4,21 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .payment_payment_instrument_icons_card_dark import PaymentPaymentInstrumentIconsCardDark -from .payment_payment_instrument_icons_card_light import PaymentPaymentInstrumentIconsCardLight +from .payment_legacy_payment_instrument_icons_card_dark import PaymentLegacyPaymentInstrumentIconsCardDark +from .payment_legacy_payment_instrument_icons_card_light import PaymentLegacyPaymentInstrumentIconsCardLight -class PaymentPaymentInstrumentIconsCard(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIconsCard(UniversalBaseModel): """ The credit-card-proportioned tile (48x30). """ - dark: PaymentPaymentInstrumentIconsCardDark = pydantic.Field() + dark: PaymentLegacyPaymentInstrumentIconsCardDark = pydantic.Field() """ The colorway for dark surfaces. """ - light: PaymentPaymentInstrumentIconsCardLight = pydantic.Field() + light: PaymentLegacyPaymentInstrumentIconsCardLight = pydantic.Field() """ The colorway for light surfaces. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons_square_dark.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_card_dark.py similarity index 95% rename from src/whop_sdk/types/payment_payment_instrument_icons_square_dark.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons_card_dark.py index 85e8359a..f3692320 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons_square_dark.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_card_dark.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata -class PaymentPaymentInstrumentIconsSquareDark(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIconsCardDark(UniversalBaseModel): """ The colorway for dark surfaces. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons_card_light.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_card_light.py similarity index 95% rename from src/whop_sdk/types/payment_payment_instrument_icons_card_light.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons_card_light.py index 7b35f748..bbad3f26 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons_card_light.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_card_light.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata -class PaymentPaymentInstrumentIconsCardLight(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIconsCardLight(UniversalBaseModel): """ The colorway for light surfaces. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons_square.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_square.py similarity index 58% rename from src/whop_sdk/types/payment_payment_instrument_icons_square.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons_square.py index 95b6a569..8aad5bfe 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons_square.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_square.py @@ -4,21 +4,21 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .payment_payment_instrument_icons_square_dark import PaymentPaymentInstrumentIconsSquareDark -from .payment_payment_instrument_icons_square_light import PaymentPaymentInstrumentIconsSquareLight +from .payment_legacy_payment_instrument_icons_square_dark import PaymentLegacyPaymentInstrumentIconsSquareDark +from .payment_legacy_payment_instrument_icons_square_light import PaymentLegacyPaymentInstrumentIconsSquareLight -class PaymentPaymentInstrumentIconsSquare(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIconsSquare(UniversalBaseModel): """ The square tile (32x32). """ - dark: PaymentPaymentInstrumentIconsSquareDark = pydantic.Field() + dark: PaymentLegacyPaymentInstrumentIconsSquareDark = pydantic.Field() """ The colorway for dark surfaces. """ - light: PaymentPaymentInstrumentIconsSquareLight = pydantic.Field() + light: PaymentLegacyPaymentInstrumentIconsSquareLight = pydantic.Field() """ The colorway for light surfaces. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons_card_dark.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_square_dark.py similarity index 95% rename from src/whop_sdk/types/payment_payment_instrument_icons_card_dark.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons_square_dark.py index 741e166e..dc751630 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons_card_dark.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_square_dark.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata -class PaymentPaymentInstrumentIconsCardDark(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIconsSquareDark(UniversalBaseModel): """ The colorway for dark surfaces. """ diff --git a/src/whop_sdk/types/payment_payment_instrument_icons_square_light.py b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_square_light.py similarity index 95% rename from src/whop_sdk/types/payment_payment_instrument_icons_square_light.py rename to src/whop_sdk/types/payment_legacy_payment_instrument_icons_square_light.py index c2997ee1..9a5468da 100644 --- a/src/whop_sdk/types/payment_payment_instrument_icons_square_light.py +++ b/src/whop_sdk/types/payment_legacy_payment_instrument_icons_square_light.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata -class PaymentPaymentInstrumentIconsSquareLight(UniversalBaseModel): +class PaymentLegacyPaymentInstrumentIconsSquareLight(UniversalBaseModel): """ The colorway for light surfaces. """ diff --git a/src/whop_sdk/types/payment_payment_method.py b/src/whop_sdk/types/payment_legacy_payment_method.py similarity index 83% rename from src/whop_sdk/types/payment_payment_method.py rename to src/whop_sdk/types/payment_legacy_payment_method.py index b519417c..66428e1b 100644 --- a/src/whop_sdk/types/payment_payment_method.py +++ b/src/whop_sdk/types/payment_legacy_payment_method.py @@ -5,16 +5,16 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .payment_legacy_payment_method_card import PaymentLegacyPaymentMethodCard from .payment_method_types import PaymentMethodTypes -from .payment_payment_method_card import PaymentPaymentMethodCard -class PaymentPaymentMethod(UniversalBaseModel): +class PaymentLegacyPaymentMethod(UniversalBaseModel): """ The tokenized payment method reference used for this payment. Null if no token was used. """ - card: typing.Optional[PaymentPaymentMethodCard] = pydantic.Field(default=None) + card: typing.Optional[PaymentLegacyPaymentMethodCard] = pydantic.Field(default=None) """ The card data associated with the payment method, if its a debit or credit card. """ diff --git a/src/whop_sdk/types/payment_payment_method_card.py b/src/whop_sdk/types/payment_legacy_payment_method_card.py similarity index 96% rename from src/whop_sdk/types/payment_payment_method_card.py rename to src/whop_sdk/types/payment_legacy_payment_method_card.py index 436f191f..3c0e906d 100644 --- a/src/whop_sdk/types/payment_payment_method_card.py +++ b/src/whop_sdk/types/payment_legacy_payment_method_card.py @@ -7,7 +7,7 @@ from .card_brands import CardBrands -class PaymentPaymentMethodCard(UniversalBaseModel): +class PaymentLegacyPaymentMethodCard(UniversalBaseModel): """ The card data associated with the payment method, if its a debit or credit card. """ diff --git a/src/whop_sdk/types/payment_plan.py b/src/whop_sdk/types/payment_legacy_plan.py similarity index 96% rename from src/whop_sdk/types/payment_plan.py rename to src/whop_sdk/types/payment_legacy_plan.py index e4e1bb37..65ed9657 100644 --- a/src/whop_sdk/types/payment_plan.py +++ b/src/whop_sdk/types/payment_legacy_plan.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentPlan(UniversalBaseModel): +class PaymentLegacyPlan(UniversalBaseModel): """ The plan attached to this payment. """ diff --git a/src/whop_sdk/types/payment_product.py b/src/whop_sdk/types/payment_legacy_product.py similarity index 96% rename from src/whop_sdk/types/payment_product.py rename to src/whop_sdk/types/payment_legacy_product.py index f2c0630e..133f18cc 100644 --- a/src/whop_sdk/types/payment_product.py +++ b/src/whop_sdk/types/payment_legacy_product.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentProduct(UniversalBaseModel): +class PaymentLegacyProduct(UniversalBaseModel): """ The product this payment was made for """ diff --git a/src/whop_sdk/types/payment_promo_code.py b/src/whop_sdk/types/payment_legacy_promo_code.py similarity index 96% rename from src/whop_sdk/types/payment_promo_code.py rename to src/whop_sdk/types/payment_legacy_promo_code.py index 406f3e68..5ea54959 100644 --- a/src/whop_sdk/types/payment_promo_code.py +++ b/src/whop_sdk/types/payment_legacy_promo_code.py @@ -8,7 +8,7 @@ from .promo_types import PromoTypes -class PaymentPromoCode(UniversalBaseModel): +class PaymentLegacyPromoCode(UniversalBaseModel): """ The promo code used for this payment. """ diff --git a/src/whop_sdk/types/payment_refunds_item.py b/src/whop_sdk/types/payment_legacy_refunds_item.py similarity index 96% rename from src/whop_sdk/types/payment_refunds_item.py rename to src/whop_sdk/types/payment_legacy_refunds_item.py index dfd65e9c..72a8b0e7 100644 --- a/src/whop_sdk/types/payment_refunds_item.py +++ b/src/whop_sdk/types/payment_legacy_refunds_item.py @@ -9,7 +9,7 @@ from .refund_statuses import RefundStatuses -class PaymentRefundsItem(UniversalBaseModel): +class PaymentLegacyRefundsItem(UniversalBaseModel): """ A refund represents a full or partial reversal of a payment, including the amount, status, and payment provider. """ diff --git a/src/whop_sdk/types/payment_resolutions_item.py b/src/whop_sdk/types/payment_legacy_resolutions_item.py similarity index 97% rename from src/whop_sdk/types/payment_resolutions_item.py rename to src/whop_sdk/types/payment_legacy_resolutions_item.py index af7e4395..393559b2 100644 --- a/src/whop_sdk/types/payment_resolutions_item.py +++ b/src/whop_sdk/types/payment_legacy_resolutions_item.py @@ -12,7 +12,7 @@ from .resolution_center_case_statuses import ResolutionCenterCaseStatuses -class PaymentResolutionsItem(UniversalBaseModel): +class PaymentLegacyResolutionsItem(UniversalBaseModel): """ A resolution center case is a dispute or support case between a user and a company, tracking the issue, status, and outcome. """ diff --git a/src/whop_sdk/types/payment_shipment.py b/src/whop_sdk/types/payment_legacy_shipment.py similarity index 96% rename from src/whop_sdk/types/payment_shipment.py rename to src/whop_sdk/types/payment_legacy_shipment.py index 2dcddc5a..6ce3a767 100644 --- a/src/whop_sdk/types/payment_shipment.py +++ b/src/whop_sdk/types/payment_legacy_shipment.py @@ -7,7 +7,7 @@ from .shipment_statuses import ShipmentStatuses -class PaymentShipment(UniversalBaseModel): +class PaymentLegacyShipment(UniversalBaseModel): """ The shipment attached to this payment. """ diff --git a/src/whop_sdk/types/payment_shipping_address.py b/src/whop_sdk/types/payment_legacy_shipping_address.py similarity index 96% rename from src/whop_sdk/types/payment_shipping_address.py rename to src/whop_sdk/types/payment_legacy_shipping_address.py index d1923e02..341f2795 100644 --- a/src/whop_sdk/types/payment_shipping_address.py +++ b/src/whop_sdk/types/payment_legacy_shipping_address.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentShippingAddress(UniversalBaseModel): +class PaymentLegacyShippingAddress(UniversalBaseModel): """ The shipping address provided by the customer for physical goods. Null if no shipping address was collected. """ diff --git a/src/whop_sdk/types/payment_user.py b/src/whop_sdk/types/payment_legacy_user.py similarity index 95% rename from src/whop_sdk/types/payment_user.py rename to src/whop_sdk/types/payment_legacy_user.py index 6da27535..07f278a0 100644 --- a/src/whop_sdk/types/payment_user.py +++ b/src/whop_sdk/types/payment_legacy_user.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class PaymentUser(UniversalBaseModel): +class PaymentLegacyUser(UniversalBaseModel): """ The user that made this payment. """ diff --git a/src/whop_sdk/types/payment_legacy_verification_checks.py b/src/whop_sdk/types/payment_legacy_verification_checks.py new file mode 100644 index 00000000..421e910e --- /dev/null +++ b/src/whop_sdk/types/payment_legacy_verification_checks.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class PaymentLegacyVerificationChecks(UniversalBaseModel): + """ + The issuer's address and card security code check results for this payment. Null when the processor returned none. + """ + + address_line1: typing.Optional[str] = pydantic.Field(default=None) + """ + Whether the billing street address the customer entered matched the address the issuer has on file. + """ + + card_holder_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Whether the cardholder name the customer entered matched the name the issuer has on file. + """ + + card_security_code: typing.Optional[str] = pydantic.Field(default=None) + """ + Whether the CVV / CVC the customer entered matched the card. + """ + + zip_code: typing.Optional[str] = pydantic.Field(default=None) + """ + Whether the billing postal code the customer entered matched the postal code the issuer has on file. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/payment_verification_checks.py b/src/whop_sdk/types/payment_verification_checks.py index 1550323b..fb9bc251 100644 --- a/src/whop_sdk/types/payment_verification_checks.py +++ b/src/whop_sdk/types/payment_verification_checks.py @@ -7,28 +7,24 @@ class PaymentVerificationChecks(UniversalBaseModel): - """ - The issuer's address and card security code check results for this payment. Null when the processor returned none. - """ - address_line1: typing.Optional[str] = pydantic.Field(default=None) """ - Whether the billing street address the customer entered matched the address the issuer has on file. + Whether the billing street address the customer entered matched the issuer's records. """ card_holder_name: typing.Optional[str] = pydantic.Field(default=None) """ - Whether the cardholder name the customer entered matched the name the issuer has on file. + Whether the cardholder name matched the issuer's records. """ card_security_code: typing.Optional[str] = pydantic.Field(default=None) """ - Whether the CVV / CVC the customer entered matched the card. + Whether the CVV / CVC matched the card. """ zip_code: typing.Optional[str] = pydantic.Field(default=None) """ - Whether the billing postal code the customer entered matched the postal code the issuer has on file. + Whether the billing postal code matched the issuer's records. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/permission_system_roles.py b/src/whop_sdk/types/permission_system_roles.py deleted file mode 100644 index e3add52c..00000000 --- a/src/whop_sdk/types/permission_system_roles.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -PermissionSystemRoles = typing.Union[ - typing.Literal["owner", "admin", "moderator", "sales_manager", "advertiser"], typing.Any -] diff --git a/src/whop_sdk/types/product_legacy.py b/src/whop_sdk/types/product_legacy.py new file mode 100644 index 00000000..7f0603c1 --- /dev/null +++ b/src/whop_sdk/types/product_legacy.py @@ -0,0 +1,149 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .custom_ctas import CustomCtas +from .global_affiliate_statuses import GlobalAffiliateStatuses +from .product_legacy_company import ProductLegacyCompany +from .product_legacy_gallery_images_item import ProductLegacyGalleryImagesItem +from .product_legacy_owner_user import ProductLegacyOwnerUser +from .product_legacy_product_tax_code import ProductLegacyProductTaxCode +from .visibility import Visibility + + +class ProductLegacy(UniversalBaseModel): + """ + A product is a digital good or service sold on Whop. Products contain plans for pricing and experiences for content delivery. + """ + + company: ProductLegacyCompany = pydantic.Field() + """ + The company this product belongs to. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the product was created. + """ + + custom_cta: CustomCtas = pydantic.Field() + """ + Call-to-action button label shown on the product purchase page. + """ + + custom_cta_url: typing.Optional[str] = pydantic.Field(default=None) + """ + An optional URL that the call-to-action button links to instead of the default checkout flow. Null if no custom URL is set. + """ + + custom_statement_descriptor: typing.Optional[str] = pydantic.Field(default=None) + """ + Custom bank statement descriptor for product purchases. Maximum 22 characters, including required `WHOP*` prefix. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + A brief summary of what the product offers, displayed on product pages and search results. + """ + + external_identifier: typing.Optional[str] = pydantic.Field(default=None) + """ + External identifier for the product. Providing it on a product creation endpoint updates the existing product with this identifier instead of creating a new one. + """ + + gallery_images: typing.List[ProductLegacyGalleryImagesItem] = pydantic.Field() + """ + The gallery images for this product, ordered by position. + """ + + global_affiliate_percentage: typing.Optional[float] = pydantic.Field(default=None) + """ + Marketplace affiliate commission percentage for this product, or `null` if program is inactive. + """ + + global_affiliate_status: GlobalAffiliateStatuses = pydantic.Field() + """ + The enrollment status of this product in the Whop marketplace global affiliate program. + """ + + headline: typing.Optional[str] = pydantic.Field(default=None) + """ + A short marketing headline displayed prominently on the product's product page. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the product. + """ + + member_affiliate_percentage: typing.Optional[float] = pydantic.Field(default=None) + """ + Member referral commission percentage for this product, or `null` if program is inactive. + """ + + member_affiliate_status: GlobalAffiliateStatuses = pydantic.Field() + """ + The enrollment status of this product in the member affiliate program. + """ + + member_count: int = pydantic.Field() + """ + Active memberships for this product. Returns `0` if the account has disabled public member counts. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + Custom key-value pairs stored on the product and included in payment and membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters per string value. + """ + + owner_user: ProductLegacyOwnerUser = pydantic.Field() + """ + The user who owns the company that sells this product. + """ + + product_tax_code: typing.Optional[ProductLegacyProductTaxCode] = pydantic.Field(default=None) + """ + The tax classification code applied to purchases of this product for sales tax calculation. Null if no tax code is assigned. + """ + + published_reviews_count: int = pydantic.Field() + """ + The total number of published customer reviews for this product's company. + """ + + route: str = pydantic.Field() + """ + URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/company/pickaxe-analytics. + """ + + title: str = pydantic.Field() + """ + The display name of the product shown to customers on the product page and in search results. + """ + + updated_at: dt.datetime = pydantic.Field() + """ + The datetime the product was last updated. + """ + + verified: bool = pydantic.Field() + """ + Whether this company has been verified by Whop's trust and safety team. + """ + + visibility: Visibility = pydantic.Field() + """ + Controls whether the product is visible to customers. When set to 'hidden', the product is only accessible via direct link. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/product_legacy_company.py b/src/whop_sdk/types/product_legacy_company.py new file mode 100644 index 00000000..70742d12 --- /dev/null +++ b/src/whop_sdk/types/product_legacy_company.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ProductLegacyCompany(UniversalBaseModel): + """ + The company this product belongs to. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company. + """ + + route: str = pydantic.Field() + """ + URL slug for the account's store page, e.g. `pickaxe` in whop.com/pickaxe. + """ + + title: str = pydantic.Field() + """ + The display name of the company shown to customers. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/product_legacy_gallery_images_item.py b/src/whop_sdk/types/product_legacy_gallery_images_item.py new file mode 100644 index 00000000..4085edbe --- /dev/null +++ b/src/whop_sdk/types/product_legacy_gallery_images_item.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ProductLegacyGalleryImagesItem(UniversalBaseModel): + """ + Represents an image attachment + """ + + content_type: typing.Optional[str] = pydantic.Field(default=None) + """ + Uploaded file MIME type, such as image/jpeg, video/mp4, or audio/mpeg. + """ + + id: str = pydantic.Field() + """ + Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`) input value will be accepted as an ID. + """ + + url: typing.Optional[str] = pydantic.Field(default=None) + """ + A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company_owner_user.py b/src/whop_sdk/types/product_legacy_owner_user.py similarity index 87% rename from src/whop_sdk/types/company_owner_user.py rename to src/whop_sdk/types/product_legacy_owner_user.py index 71973a0a..78b409c3 100644 --- a/src/whop_sdk/types/company_owner_user.py +++ b/src/whop_sdk/types/product_legacy_owner_user.py @@ -6,9 +6,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class CompanyOwnerUser(UniversalBaseModel): +class ProductLegacyOwnerUser(UniversalBaseModel): """ - The user who owns and has full administrative control over this company. + The user who owns the company that sells this product. """ id: str = pydantic.Field() diff --git a/src/whop_sdk/types/product_legacy_product_tax_code.py b/src/whop_sdk/types/product_legacy_product_tax_code.py new file mode 100644 index 00000000..86bdec7c --- /dev/null +++ b/src/whop_sdk/types/product_legacy_product_tax_code.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .product_tax_code_product_types import ProductTaxCodeProductTypes + + +class ProductLegacyProductTaxCode(UniversalBaseModel): + """ + The tax classification code applied to purchases of this product for sales tax calculation. Null if no tax code is assigned. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the product tax code. + """ + + name: str = pydantic.Field() + """ + Human-readable name of this tax classification, such as 'Digital - SaaS'. + """ + + product_type: ProductTaxCodeProductTypes = pydantic.Field() + """ + Broad product category this tax code covers, such as physical goods or digital services. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/refund.py b/src/whop_sdk/types/refund.py index 487417f5..2045e8f9 100644 --- a/src/whop_sdk/types/refund.py +++ b/src/whop_sdk/types/refund.py @@ -1,76 +1,101 @@ # This file was auto-generated by Fern from our API Definition. -import datetime as dt import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .currencies import Currencies -from .payment_providers import PaymentProviders -from .refund_payment import RefundPayment -from .refund_reference_statuses import RefundReferenceStatuses -from .refund_reference_types import RefundReferenceTypes -from .refund_statuses import RefundStatuses +from .money import Money +from .refund_failure_reason import RefundFailureReason +from .refund_reason import RefundReason +from .refund_reference_status import RefundReferenceStatus +from .refund_reference_type import RefundReferenceType +from .refund_status import RefundStatus class Refund(UniversalBaseModel): + account_id: typing.Optional[str] = pydantic.Field(default=None) """ - A refund represents a full or partial reversal of a payment, including the amount, status, and payment provider. + The account that issued the refund, prefixed `biz_`. """ - amount: float = pydantic.Field() + amount: typing.Optional[Money] = pydantic.Field(default=None) """ - The refunded amount as a decimal in the specified currency, such as 10.43 for $10.43 USD. + The refunded amount as it settled, in the payment's settlement currency, so pages of refunds net against the payment's `refunded_amount`. Converted at the rate in force when the refund was issued, not the payment's original rate. Null only when no exchange rate is recorded for a legacy multi-currency payment. """ - created_at: dt.datetime = pydantic.Field() + created_at: str = pydantic.Field() """ - The datetime the refund was created. + When the refund was requested, as an ISO 8601 timestamp. """ - currency: Currencies = pydantic.Field() + failure_message: typing.Optional[str] = pydantic.Field(default=None) """ - The three-letter ISO currency code for the refunded amount. + The provider's own explanation of the failure, or null. + """ + + failure_reason: typing.Optional[RefundFailureReason] = pydantic.Field(default=None) + """ + Why the refund failed, normalized across providers. Null unless the refund failed or was canceled. """ id: str = pydantic.Field() """ - The unique identifier for the refund. + Refund ID, prefixed `rf_`. + """ + + original_amount: Money = pydantic.Field() + """ + The refunded amount in the currency the processor moved. """ - payment: typing.Optional[RefundPayment] = pydantic.Field(default=None) + payment_id: str = pydantic.Field() """ - The original payment that this refund was issued against. Null if the payment is no longer available. + The payment this refund reverses, prefixed `pay_`. """ - provider: PaymentProviders = pydantic.Field() + provider: str = pydantic.Field() """ - The payment provider that processed the refund. + The payment provider that processed the refund, such as `paypal` or `coinbase`. """ - provider_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + provider_created_at: typing.Optional[str] = pydantic.Field(default=None) """ - The timestamp when the refund was created in the payment provider's system. Null if not available from the provider. + When the provider created the refund, as an ISO 8601 timestamp. """ - reference_status: typing.Optional[RefundReferenceStatuses] = pydantic.Field(default=None) + reason: typing.Optional[RefundReason] = pydantic.Field(default=None) """ - The availability status of the refund tracking reference from the payment processor. Null if no reference was provided. + Why the refund was issued, when recorded. """ - reference_type: typing.Optional[RefundReferenceTypes] = pydantic.Field(default=None) + reference_status: typing.Optional[RefundReferenceStatus] = pydantic.Field(default=None) """ - The type of tracking reference provided by the payment processor, such as an acquirer reference number. Null if no reference was provided. + Whether a banking-network tracking reference is available for this refund. + """ + + reference_type: typing.Optional[RefundReferenceType] = pydantic.Field(default=None) + """ + The kind of tracking reference, such as an acquirer reference number. """ reference_value: typing.Optional[str] = pydantic.Field(default=None) """ - The tracking reference value from the payment processor, used to trace the refund through banking networks. Null if no reference was provided. + The tracking reference the buyer's bank can trace the refund by. + """ + + status: RefundStatus = pydantic.Field() + """ + Where the refund stands with the processor: `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. + """ + + updated_at: str = pydantic.Field() + """ + When the refund last changed, as an ISO 8601 timestamp. """ - status: RefundStatuses = pydantic.Field() + visa_rdr: bool = pydantic.Field() """ - The current processing status of the refund, such as pending, succeeded, or failed. + True when the card network initiated the refund through Rapid Dispute Resolution. """ if IS_PYDANTIC_V2: diff --git a/src/whop_sdk/types/refund_failure_reason.py b/src/whop_sdk/types/refund_failure_reason.py new file mode 100644 index 00000000..aebbd9e4 --- /dev/null +++ b/src/whop_sdk/types/refund_failure_reason.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RefundFailureReason = typing.Union[ + typing.Literal[ + "bank_declined", + "expired_or_canceled_card", + "lost_or_stolen_card", + "insufficient_funds", + "charge_disputed", + "not_refundable", + "merchant_request", + "unknown", + ], + typing.Any, +] diff --git a/src/whop_sdk/types/refund_legacy.py b/src/whop_sdk/types/refund_legacy.py new file mode 100644 index 00000000..f6e50df3 --- /dev/null +++ b/src/whop_sdk/types/refund_legacy.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .currencies import Currencies +from .payment_providers import PaymentProviders +from .refund_legacy_payment import RefundLegacyPayment +from .refund_reference_statuses import RefundReferenceStatuses +from .refund_reference_types import RefundReferenceTypes +from .refund_statuses import RefundStatuses + + +class RefundLegacy(UniversalBaseModel): + """ + A refund represents a full or partial reversal of a payment, including the amount, status, and payment provider. + """ + + amount: float = pydantic.Field() + """ + The refunded amount as a decimal in the specified currency, such as 10.43 for $10.43 USD. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the refund was created. + """ + + currency: Currencies = pydantic.Field() + """ + The three-letter ISO currency code for the refunded amount. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the refund. + """ + + payment: typing.Optional[RefundLegacyPayment] = pydantic.Field(default=None) + """ + The original payment that this refund was issued against. Null if the payment is no longer available. + """ + + provider: PaymentProviders = pydantic.Field() + """ + The payment provider that processed the refund. + """ + + provider_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The timestamp when the refund was created in the payment provider's system. Null if not available from the provider. + """ + + reference_status: typing.Optional[RefundReferenceStatuses] = pydantic.Field(default=None) + """ + The availability status of the refund tracking reference from the payment processor. Null if no reference was provided. + """ + + reference_type: typing.Optional[RefundReferenceTypes] = pydantic.Field(default=None) + """ + The type of tracking reference provided by the payment processor, such as an acquirer reference number. Null if no reference was provided. + """ + + reference_value: typing.Optional[str] = pydantic.Field(default=None) + """ + The tracking reference value from the payment processor, used to trace the refund through banking networks. Null if no reference was provided. + """ + + status: RefundStatuses = pydantic.Field() + """ + The current processing status of the refund, such as pending, succeeded, or failed. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/refund_payment.py b/src/whop_sdk/types/refund_legacy_payment.py similarity index 83% rename from src/whop_sdk/types/refund_payment.py rename to src/whop_sdk/types/refund_legacy_payment.py index 46c852de..cc6e2c35 100644 --- a/src/whop_sdk/types/refund_payment.py +++ b/src/whop_sdk/types/refund_legacy_payment.py @@ -10,14 +10,14 @@ from .currencies import Currencies from .payment_method_types import PaymentMethodTypes from .receipt_tax_behaviors import ReceiptTaxBehaviors -from .refund_payment_member import RefundPaymentMember -from .refund_payment_membership import RefundPaymentMembership -from .refund_payment_plan import RefundPaymentPlan -from .refund_payment_product import RefundPaymentProduct -from .refund_payment_user import RefundPaymentUser +from .refund_legacy_payment_member import RefundLegacyPaymentMember +from .refund_legacy_payment_membership import RefundLegacyPaymentMembership +from .refund_legacy_payment_plan import RefundLegacyPaymentPlan +from .refund_legacy_payment_product import RefundLegacyPaymentProduct +from .refund_legacy_payment_user import RefundLegacyPaymentUser -class RefundPayment(UniversalBaseModel): +class RefundLegacyPayment(UniversalBaseModel): """ The original payment that this refund was issued against. Null if the payment is no longer available. """ @@ -57,12 +57,12 @@ class RefundPayment(UniversalBaseModel): The unique identifier for the payment. """ - member: typing.Optional[RefundPaymentMember] = pydantic.Field(default=None) + member: typing.Optional[RefundLegacyPaymentMember] = pydantic.Field(default=None) """ The member attached to this payment. """ - membership: typing.Optional[RefundPaymentMembership] = pydantic.Field(default=None) + membership: typing.Optional[RefundLegacyPaymentMembership] = pydantic.Field(default=None) """ The membership attached to this payment. """ @@ -82,12 +82,12 @@ class RefundPayment(UniversalBaseModel): The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. """ - plan: typing.Optional[RefundPaymentPlan] = pydantic.Field(default=None) + plan: typing.Optional[RefundLegacyPaymentPlan] = pydantic.Field(default=None) """ The plan attached to this payment. """ - product: typing.Optional[RefundPaymentProduct] = pydantic.Field(default=None) + product: typing.Optional[RefundLegacyPaymentProduct] = pydantic.Field(default=None) """ The product this payment was made for """ @@ -122,7 +122,7 @@ class RefundPayment(UniversalBaseModel): The total in USD to show to the creator (excluding buyer fees). """ - user: typing.Optional[RefundPaymentUser] = pydantic.Field(default=None) + user: typing.Optional[RefundLegacyPaymentUser] = pydantic.Field(default=None) """ The user that made this payment. """ diff --git a/src/whop_sdk/types/refund_payment_member.py b/src/whop_sdk/types/refund_legacy_payment_member.py similarity index 93% rename from src/whop_sdk/types/refund_payment_member.py rename to src/whop_sdk/types/refund_legacy_payment_member.py index a1b06753..f9ae4dee 100644 --- a/src/whop_sdk/types/refund_payment_member.py +++ b/src/whop_sdk/types/refund_legacy_payment_member.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class RefundPaymentMember(UniversalBaseModel): +class RefundLegacyPaymentMember(UniversalBaseModel): """ The member attached to this payment. """ diff --git a/src/whop_sdk/types/refund_payment_membership.py b/src/whop_sdk/types/refund_legacy_payment_membership.py similarity index 93% rename from src/whop_sdk/types/refund_payment_membership.py rename to src/whop_sdk/types/refund_legacy_payment_membership.py index c1eeb091..ffaeeea4 100644 --- a/src/whop_sdk/types/refund_payment_membership.py +++ b/src/whop_sdk/types/refund_legacy_payment_membership.py @@ -7,7 +7,7 @@ from .membership_status import MembershipStatus -class RefundPaymentMembership(UniversalBaseModel): +class RefundLegacyPaymentMembership(UniversalBaseModel): """ The membership attached to this payment. """ diff --git a/src/whop_sdk/types/refund_payment_plan.py b/src/whop_sdk/types/refund_legacy_payment_plan.py similarity index 95% rename from src/whop_sdk/types/refund_payment_plan.py rename to src/whop_sdk/types/refund_legacy_payment_plan.py index c961e60c..ad781225 100644 --- a/src/whop_sdk/types/refund_payment_plan.py +++ b/src/whop_sdk/types/refund_legacy_payment_plan.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class RefundPaymentPlan(UniversalBaseModel): +class RefundLegacyPaymentPlan(UniversalBaseModel): """ The plan attached to this payment. """ diff --git a/src/whop_sdk/types/refund_payment_product.py b/src/whop_sdk/types/refund_legacy_payment_product.py similarity index 94% rename from src/whop_sdk/types/refund_payment_product.py rename to src/whop_sdk/types/refund_legacy_payment_product.py index 2ad4cc7b..ab82b438 100644 --- a/src/whop_sdk/types/refund_payment_product.py +++ b/src/whop_sdk/types/refund_legacy_payment_product.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class RefundPaymentProduct(UniversalBaseModel): +class RefundLegacyPaymentProduct(UniversalBaseModel): """ The product this payment was made for """ diff --git a/src/whop_sdk/types/refund_payment_user.py b/src/whop_sdk/types/refund_legacy_payment_user.py similarity index 95% rename from src/whop_sdk/types/refund_payment_user.py rename to src/whop_sdk/types/refund_legacy_payment_user.py index 52561a46..9e8358b6 100644 --- a/src/whop_sdk/types/refund_payment_user.py +++ b/src/whop_sdk/types/refund_legacy_payment_user.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class RefundPaymentUser(UniversalBaseModel): +class RefundLegacyPaymentUser(UniversalBaseModel): """ The user that made this payment. """ diff --git a/src/whop_sdk/types/refund_reason.py b/src/whop_sdk/types/refund_reason.py new file mode 100644 index 00000000..b83fa8bb --- /dev/null +++ b/src/whop_sdk/types/refund_reason.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RefundReason = typing.Union[ + typing.Literal["duplicate", "fraudulent", "requested_by_customer", "expired_uncaptured_charge"], typing.Any +] diff --git a/src/whop_sdk/types/refund_reference_status.py b/src/whop_sdk/types/refund_reference_status.py new file mode 100644 index 00000000..df3ef723 --- /dev/null +++ b/src/whop_sdk/types/refund_reference_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RefundReferenceStatus = typing.Union[typing.Literal["available", "pending", "unavailable"], typing.Any] diff --git a/src/whop_sdk/types/refund_reference_type.py b/src/whop_sdk/types/refund_reference_type.py new file mode 100644 index 00000000..c850388e --- /dev/null +++ b/src/whop_sdk/types/refund_reference_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RefundReferenceType = typing.Union[ + typing.Literal["acquirer_reference_number", "retrieval_reference_number", "system_trace_audit_number"], typing.Any +] diff --git a/src/whop_sdk/types/refund_status.py b/src/whop_sdk/types/refund_status.py new file mode 100644 index 00000000..06d00b9f --- /dev/null +++ b/src/whop_sdk/types/refund_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RefundStatus = typing.Union[typing.Literal["pending", "requires_action", "succeeded", "failed", "canceled"], typing.Any] diff --git a/src/whop_sdk/types/resolution_center_case_legacy.py b/src/whop_sdk/types/resolution_center_case_legacy.py new file mode 100644 index 00000000..efc950a4 --- /dev/null +++ b/src/whop_sdk/types/resolution_center_case_legacy.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .resolution_center_case_customer_responses import ResolutionCenterCaseCustomerResponses +from .resolution_center_case_issue_types import ResolutionCenterCaseIssueTypes +from .resolution_center_case_legacy_company import ResolutionCenterCaseLegacyCompany +from .resolution_center_case_legacy_member import ResolutionCenterCaseLegacyMember +from .resolution_center_case_legacy_payment import ResolutionCenterCaseLegacyPayment +from .resolution_center_case_legacy_resolution_events_item import ResolutionCenterCaseLegacyResolutionEventsItem +from .resolution_center_case_legacy_user import ResolutionCenterCaseLegacyUser +from .resolution_center_case_merchant_responses import ResolutionCenterCaseMerchantResponses +from .resolution_center_case_platform_responses import ResolutionCenterCasePlatformResponses +from .resolution_center_case_statuses import ResolutionCenterCaseStatuses + + +class ResolutionCenterCaseLegacy(UniversalBaseModel): + """ + A resolution center case is a dispute or support case between a user and a company, tracking the issue, status, and outcome. + """ + + company: typing.Optional[ResolutionCenterCaseLegacyCompany] = pydantic.Field(default=None) + """ + The company involved in this resolution case. Null if the company no longer exists. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the resolution was created. + """ + + customer_appealed: bool = pydantic.Field() + """ + Whether the customer has filed an appeal after the initial resolution decision. + """ + + customer_response_actions: typing.List[ResolutionCenterCaseCustomerResponses] = pydantic.Field() + """ + The list of actions currently available to the customer. + """ + + due_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The deadline by which the next response is required. Null if no deadline is currently active. As a Unix timestamp. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the resolution. + """ + + issue: ResolutionCenterCaseIssueTypes = pydantic.Field() + """ + The category of the dispute. + """ + + member: typing.Optional[ResolutionCenterCaseLegacyMember] = pydantic.Field(default=None) + """ + The membership record associated with the disputed payment. Null if the membership no longer exists. + """ + + merchant_appealed: bool = pydantic.Field() + """ + Whether the merchant has filed an appeal after the initial resolution decision. + """ + + merchant_response_actions: typing.List[ResolutionCenterCaseMerchantResponses] = pydantic.Field() + """ + The list of actions currently available to the merchant. + """ + + payment: ResolutionCenterCaseLegacyPayment = pydantic.Field() + """ + The payment record that is the subject of this resolution case. + """ + + platform_response_actions: typing.List[ResolutionCenterCasePlatformResponses] = pydantic.Field() + """ + The list of actions currently available to the Whop platform for moderating this resolution. + """ + + resolution_events: typing.List[ResolutionCenterCaseLegacyResolutionEventsItem] = pydantic.Field() + """ + The most recent 50 messages, actions, and status changes that have occurred during this resolution case. + """ + + status: ResolutionCenterCaseStatuses = pydantic.Field() + """ + The current status of the resolution case, indicating which party needs to respond or if the case is closed. + """ + + updated_at: dt.datetime = pydantic.Field() + """ + The datetime the resolution was last updated. + """ + + user: ResolutionCenterCaseLegacyUser = pydantic.Field() + """ + The customer (buyer) who filed this resolution case. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/resolution_center_case_legacy_company.py b/src/whop_sdk/types/resolution_center_case_legacy_company.py new file mode 100644 index 00000000..ca8ee963 --- /dev/null +++ b/src/whop_sdk/types/resolution_center_case_legacy_company.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ResolutionCenterCaseLegacyCompany(UniversalBaseModel): + """ + The company involved in this resolution case. Null if the company no longer exists. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the company. + """ + + title: str = pydantic.Field() + """ + The display name of the company shown to customers. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/resolution_center_case_legacy_member.py b/src/whop_sdk/types/resolution_center_case_legacy_member.py new file mode 100644 index 00000000..06d88410 --- /dev/null +++ b/src/whop_sdk/types/resolution_center_case_legacy_member.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ResolutionCenterCaseLegacyMember(UniversalBaseModel): + """ + The membership record associated with the disputed payment. Null if the membership no longer exists. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the extra public member. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/resolution_center_case_legacy_payment.py b/src/whop_sdk/types/resolution_center_case_legacy_payment.py new file mode 100644 index 00000000..fe7d8f10 --- /dev/null +++ b/src/whop_sdk/types/resolution_center_case_legacy_payment.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .currencies import Currencies + + +class ResolutionCenterCaseLegacyPayment(UniversalBaseModel): + """ + The payment record that is the subject of this resolution case. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the payment was created. + """ + + currency: typing.Optional[Currencies] = pydantic.Field(default=None) + """ + The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). + """ + + id: str = pydantic.Field() + """ + The unique identifier for the payment. + """ + + paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. + """ + + subtotal: typing.Optional[float] = pydantic.Field(default=None) + """ + The payment amount before taxes and discounts are applied. In the currency specified by the currency field. + """ + + total: float = pydantic.Field() + """ + The total amount charged to the customer for this payment, including taxes and after any discounts. In the currency specified by the currency field. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/resolution_center_case_legacy_resolution_events_item.py b/src/whop_sdk/types/resolution_center_case_legacy_resolution_events_item.py new file mode 100644 index 00000000..81077f68 --- /dev/null +++ b/src/whop_sdk/types/resolution_center_case_legacy_resolution_events_item.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .resolution_center_case_actions import ResolutionCenterCaseActions +from .resolution_center_case_reporters import ResolutionCenterCaseReporters + + +class ResolutionCenterCaseLegacyResolutionEventsItem(UniversalBaseModel): + """ + A resolution event is a message or action within a resolution case, such as a response, escalation, or status change. + """ + + action: ResolutionCenterCaseActions = pydantic.Field() + """ + The type of action recorded in this event. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the resolution event was created. + """ + + details: typing.Optional[str] = pydantic.Field(default=None) + """ + The message body or additional context provided with this resolution event. Null if no details were included. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the resolution event. + """ + + reporter_type: ResolutionCenterCaseReporters = pydantic.Field() + """ + The party who performed this action. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/company_list_item_owner_user.py b/src/whop_sdk/types/resolution_center_case_legacy_user.py similarity index 86% rename from src/whop_sdk/types/company_list_item_owner_user.py rename to src/whop_sdk/types/resolution_center_case_legacy_user.py index 1f49273b..7dbc6cc0 100644 --- a/src/whop_sdk/types/company_list_item_owner_user.py +++ b/src/whop_sdk/types/resolution_center_case_legacy_user.py @@ -6,9 +6,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class CompanyListItemOwnerUser(UniversalBaseModel): +class ResolutionCenterCaseLegacyUser(UniversalBaseModel): """ - The user who owns and has full administrative control over this company. + The customer (buyer) who filed this resolution case. """ id: str = pydantic.Field() diff --git a/src/whop_sdk/types/result_label_keys.py b/src/whop_sdk/types/result_label_keys.py deleted file mode 100644 index cf24d0b3..00000000 --- a/src/whop_sdk/types/result_label_keys.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ResultLabelKeys = typing.Union[ - typing.Literal[ - "app_installs", - "messaging_conversations_started", - "post_engagement", - "event_responses", - "impressions", - "website_purchases", - "landing_page_views", - "leads", - "link_clicks", - "quality_calls", - "appointments_booked", - "messaging_purchases", - "page_likes", - "instagram_profile_visits", - "reach", - "reminders_set", - "new_subscribers", - "video_views", - "registrations", - "content_views", - "searches", - "adds_to_cart", - "adds_to_wishlist", - "adds_of_payment_info", - "checkouts_initiated", - "website_schedules", - "website_submit_applications", - "website_trials_started", - "website_subscriptions", - "website_contacts", - "website_donations", - "website_find_locations", - "website_product_customizations", - "custom", - ], - typing.Any, -] diff --git a/src/whop_sdk/types/shipment_legacy.py b/src/whop_sdk/types/shipment_legacy.py new file mode 100644 index 00000000..a49efbc5 --- /dev/null +++ b/src/whop_sdk/types/shipment_legacy.py @@ -0,0 +1,70 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .shipment_legacy_payment import ShipmentLegacyPayment +from .shipment_statuses import ShipmentStatuses +from .shipment_substatuses import ShipmentSubstatuses + + +class ShipmentLegacy(UniversalBaseModel): + """ + A physical shipment associated with a payment, including carrier details and tracking information. + """ + + created_at: dt.datetime = pydantic.Field() + """ + The datetime the shipment was created. + """ + + delivery_estimate: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The estimated delivery date for this shipment. Null if the carrier has not provided an estimate. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the shipment. + """ + + payment: typing.Optional[ShipmentLegacyPayment] = pydantic.Field(default=None) + """ + The payment associated with this shipment. Null if the payment has been deleted or is inaccessible. + """ + + service: typing.Optional[str] = pydantic.Field(default=None) + """ + The shipping service level used for this shipment. Null if the carrier does not specify a service tier. + """ + + status: ShipmentStatuses = pydantic.Field() + """ + The current delivery status of this shipment. + """ + + substatus: typing.Optional[ShipmentSubstatuses] = pydantic.Field(default=None) + """ + A more granular status providing additional detail about the shipment's current state. Null if no substatus applies. + """ + + tracking_code: str = pydantic.Field() + """ + The carrier-assigned tracking number used to look up shipment progress. + """ + + updated_at: dt.datetime = pydantic.Field() + """ + The datetime the shipment was last updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/shipment_legacy_payment.py b/src/whop_sdk/types/shipment_legacy_payment.py new file mode 100644 index 00000000..ae8c761f --- /dev/null +++ b/src/whop_sdk/types/shipment_legacy_payment.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ShipmentLegacyPayment(UniversalBaseModel): + """ + The payment associated with this shipment. Null if the payment has been deleted or is inaccessible. + """ + + id: str = pydantic.Field() + """ + The unique identifier for the payment. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/whop_sdk/types/social_link_websites.py b/src/whop_sdk/types/social_link_websites.py deleted file mode 100644 index f740bebc..00000000 --- a/src/whop_sdk/types/social_link_websites.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -SocialLinkWebsites = typing.Union[ - typing.Literal["x", "instagram", "facebook", "tiktok", "youtube", "linkedin", "twitch", "website", "custom"], - typing.Any, -] diff --git a/src/whop_sdk/types/user.py b/src/whop_sdk/types/user.py index 1b0a6a8b..f77701c8 100644 --- a/src/whop_sdk/types/user.py +++ b/src/whop_sdk/types/user.py @@ -41,7 +41,7 @@ class User(UniversalBaseModel): earnings_usd: typing.Optional[UserEarnings] = pydantic.Field(default=None) """ - The user's gross USD income over time. Populated only on single-user self reads for callers with balance-read scope; `null` otherwise. + The user's gross USD income over time, including a Partner commission breakdown. Populated only on single-user self reads for callers with balance-read scope; `null` otherwise. """ email: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/whop_sdk/types/user_earnings.py b/src/whop_sdk/types/user_earnings.py index b63daa79..00b5fbcb 100644 --- a/src/whop_sdk/types/user_earnings.py +++ b/src/whop_sdk/types/user_earnings.py @@ -18,6 +18,11 @@ class UserEarnings(UniversalBaseModel): Gross income from accounts the user owns or is owner-authorized on. """ + partners: UserEarningsAmount = pydantic.Field() + """ + Partner commissions posted to the user's wallet. Pending Partner payouts are excluded until they post; later reversals do not reduce gross income. + """ + personal: UserEarningsAmount = pydantic.Field() """ Gross income from the user's personal wallet. diff --git a/src/whop_sdk/users/client.py b/src/whop_sdk/users/client.py index 72e5b64f..085e53ae 100644 --- a/src/whop_sdk/users/client.py +++ b/src/whop_sdk/users/client.py @@ -89,7 +89,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -151,7 +151,7 @@ def me( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -210,7 +210,7 @@ def update_me( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -278,7 +278,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -344,7 +344,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -391,7 +391,7 @@ def check_access( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -427,7 +427,7 @@ def recommend_actions( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -527,7 +527,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -598,7 +598,7 @@ async def me( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -665,7 +665,7 @@ async def update_me( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -741,7 +741,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -815,7 +815,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -870,7 +870,7 @@ async def check_access( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -914,7 +914,7 @@ async def recommend_actions( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/users/oauth_grants/client.py b/src/whop_sdk/users/oauth_grants/client.py index 23face76..505be7c9 100644 --- a/src/whop_sdk/users/oauth_grants/client.py +++ b/src/whop_sdk/users/oauth_grants/client.py @@ -83,7 +83,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -168,7 +168,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -264,7 +264,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -358,7 +358,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/users/passkeys/client.py b/src/whop_sdk/users/passkeys/client.py index 37e36d8e..6a8aa823 100644 --- a/src/whop_sdk/users/passkeys/client.py +++ b/src/whop_sdk/users/passkeys/client.py @@ -80,7 +80,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -140,7 +140,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -191,7 +191,7 @@ def challenge( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -243,7 +243,7 @@ def delete( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -328,7 +328,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -397,7 +397,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -456,7 +456,7 @@ async def challenge( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -516,7 +516,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/users/preferences/client.py b/src/whop_sdk/users/preferences/client.py index e748f72b..c0ef1863 100644 --- a/src/whop_sdk/users/preferences/client.py +++ b/src/whop_sdk/users/preferences/client.py @@ -51,7 +51,7 @@ def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) - from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -95,7 +95,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -156,7 +156,7 @@ async def retrieve(self, *, request_options: typing.Optional[RequestOptions] = N from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -208,7 +208,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/users/preferences/notifications/client.py b/src/whop_sdk/users/preferences/notifications/client.py index f6a6373a..5580509e 100644 --- a/src/whop_sdk/users/preferences/notifications/client.py +++ b/src/whop_sdk/users/preferences/notifications/client.py @@ -72,7 +72,7 @@ def set( ) client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -161,7 +161,7 @@ async def set( ) client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/users/preferences/notifications/experiences/client.py b/src/whop_sdk/users/preferences/notifications/experiences/client.py index 393d40fb..252836bd 100644 --- a/src/whop_sdk/users/preferences/notifications/experiences/client.py +++ b/src/whop_sdk/users/preferences/notifications/experiences/client.py @@ -56,7 +56,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -118,7 +118,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/users/preferences/notifications/topics/client.py b/src/whop_sdk/users/preferences/notifications/topics/client.py index fc1a0652..2bbf9db2 100644 --- a/src/whop_sdk/users/preferences/notifications/topics/client.py +++ b/src/whop_sdk/users/preferences/notifications/topics/client.py @@ -77,7 +77,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -168,7 +168,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/verifications/client.py b/src/whop_sdk/verifications/client.py index ffb0a5ec..3477a3ff 100644 --- a/src/whop_sdk/verifications/client.py +++ b/src/whop_sdk/verifications/client.py @@ -68,7 +68,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -112,7 +112,7 @@ def create( from whop_sdk.verifications import CreateVerificationsRequestBody_Individual client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -148,7 +148,7 @@ def retrieve( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -190,7 +190,7 @@ def update( from whop_sdk.verifications import UpdateVerificationsRequestBodyPersonalAddress client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -255,7 +255,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -307,7 +307,7 @@ async def create( from whop_sdk.verifications import CreateVerificationsRequestBody_Individual client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -353,7 +353,7 @@ async def retrieve( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -403,7 +403,7 @@ async def update( from whop_sdk.verifications import UpdateVerificationsRequestBodyPersonalAddress client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) diff --git a/src/whop_sdk/webhooks/client.py b/src/whop_sdk/webhooks/client.py index 00065206..cacf7856 100644 --- a/src/whop_sdk/webhooks/client.py +++ b/src/whop_sdk/webhooks/client.py @@ -94,7 +94,7 @@ def list( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -166,7 +166,7 @@ def create( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -207,7 +207,7 @@ def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -240,7 +240,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -298,7 +298,7 @@ def update( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -352,7 +352,7 @@ def list_deliveries( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -402,7 +402,7 @@ def replay_delivery( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -463,7 +463,7 @@ def replay( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -510,7 +510,7 @@ def test( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -568,7 +568,7 @@ def deliveries_webhook( from whop_sdk import Whop client = Whop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -660,7 +660,7 @@ async def list( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -741,7 +741,7 @@ async def create( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -790,7 +790,7 @@ async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOpt from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -833,7 +833,7 @@ async def delete( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -899,7 +899,7 @@ async def update( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -961,7 +961,7 @@ async def list_deliveries( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1020,7 +1020,7 @@ async def replay_delivery( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1089,7 +1089,7 @@ async def replay( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1144,7 +1144,7 @@ async def test( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) @@ -1210,7 +1210,7 @@ async def deliveries_webhook( from whop_sdk import AsyncWhop client = AsyncWhop( - "2026-08-25-2", + "2026-09-02-1", idempotency_key="YOUR_IDEMPOTENCY_KEY", token="YOUR_TOKEN", ) From a1fb3e5f3dc83fe4c078cf33d3f893c8a4094786 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 00:23:18 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index b6f137b7..fe3e6f79 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -60,5 +60,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-python-sdk: 5.28.0 -current_generation: 7455c12e8e11b1d9a1ff89ba52cb2015c637979e + - commit_sha: d0edcccb41f48a2e2bf656e8d40e1eef9390b3c0 + tree_hash: 8bff75531af1857116d14d74d1c0045a64793cbe + timestamp: 2026-09-03T00:23:13.024Z + cli_version: unknown + generator_versions: + fernapi/fern-python-sdk: 5.28.0 +current_generation: d0edcccb41f48a2e2bf656e8d40e1eef9390b3c0 patches: []