diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f86881eb..7a9f1353 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: e7042734-e669-4c36-85da-bbb4a7500ac8 management: - docChecksum: f9f2707053257f5298131d6530946e63 + docChecksum: 7602d2b4f9cae7111e7fe191e5292e9b docVersion: 0.1.0 speakeasyVersion: 1.648.0 generationVersion: 2.737.0 - releaseVersion: 0.31.5 - configChecksum: 0822c8291f14ca7037c4188b08d3ff60 + releaseVersion: 0.31.6 + configChecksum: db8e3767495ca8eda5b66e3c2ce586a5 repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -900,18 +900,24 @@ generatedFiles: - docs/models/oauth2clientsoauth2updateclientrequest.md - docs/models/oauth2requesttokenrequestbody.md - docs/models/oauth2userinforesponseoauth2userinfo.md + - docs/models/offsessionchargesnotenabled.md - docs/models/onetimeproducts.md - docs/models/onetimeproductsnetrevenue.md - docs/models/onetimeproductsrevenue.md - docs/models/order.md - docs/models/orderbillingreason.md + - docs/models/ordercreate.md + - docs/models/ordercreatecustomfielddata.md + - docs/models/ordercreatemetadata.md - docs/models/ordercustomer.md - docs/models/ordercustomertaxid.md - docs/models/ordercustomfielddata.md - docs/models/orderdiscount.md + - docs/models/orderfinalize.md - docs/models/orderidfilter.md - docs/models/orderinvoice.md - docs/models/orderitemschema.md + - docs/models/ordernotdraft.md - docs/models/ordernoteligibleforretry.md - docs/models/orderpaidevent.md - docs/models/orderpaidmetadata.md @@ -923,6 +929,9 @@ generatedFiles: - docs/models/ordersexportqueryparamproductidfilter.md - docs/models/ordersexportrequest.md - docs/models/ordersexportresponse.md + - docs/models/ordersfinalizerequest.md + - docs/models/ordersfinalizeresponse402ordersfinalize.md + - docs/models/ordersfinalizeresponse403ordersfinalize.md - docs/models/ordersgenerateinvoicerequest.md - docs/models/ordersgenerateinvoiceresponse422ordersgenerateinvoice.md - docs/models/ordersgetrequest.md @@ -966,6 +975,7 @@ generatedFiles: - docs/models/organizationidfilter.md - docs/models/organizationindividuallegalentityschema.md - docs/models/organizationnotificationsettings.md + - docs/models/organizationnotreadyforpayments.md - docs/models/organizationsgetrequest.md - docs/models/organizationslistrequest.md - docs/models/organizationslistresponse.md @@ -978,6 +988,7 @@ generatedFiles: - docs/models/organizationupdate.md - docs/models/pagination.md - docs/models/payment.md + - docs/models/paymentactionrequired.md - docs/models/paymentalreadyinprogress.md - docs/models/paymenterror.md - docs/models/paymentfailed.md @@ -985,10 +996,12 @@ generatedFiles: - docs/models/paymentmethodcardmetadata.md - docs/models/paymentmethodgeneric.md - docs/models/paymentmethodinusebyactivesubscription.md + - docs/models/paymentmethodsetupfailed.md - docs/models/paymentnotready.md - docs/models/paymentprocessor.md - docs/models/paymentsgetrequest.md - docs/models/paymentslistqueryparamcheckoutidfilter.md + - docs/models/paymentslistqueryparamcustomeridfilter.md - docs/models/paymentslistqueryparamorderidfilter.md - docs/models/paymentslistqueryparamorganizationidfilter.md - docs/models/paymentslistqueryparamstatusfilter.md @@ -1848,11 +1861,15 @@ generatedFiles: - src/polar_sdk/models/oauth2clientconfiguration.py - src/polar_sdk/models/oauth2clientconfigurationupdate.py - src/polar_sdk/models/oauth2clientpublic.py + - src/polar_sdk/models/offsessionchargesnotenabled.py - src/polar_sdk/models/order.py - src/polar_sdk/models/orderbillingreason.py + - src/polar_sdk/models/ordercreate.py - src/polar_sdk/models/ordercustomer.py + - src/polar_sdk/models/orderfinalize.py - src/polar_sdk/models/orderinvoice.py - src/polar_sdk/models/orderitemschema.py + - src/polar_sdk/models/ordernotdraft.py - src/polar_sdk/models/ordernoteligibleforretry.py - src/polar_sdk/models/orderpaidevent.py - src/polar_sdk/models/orderpaidmetadata.py @@ -1861,6 +1878,7 @@ generatedFiles: - src/polar_sdk/models/orderrefundedevent.py - src/polar_sdk/models/orderrefundedmetadata.py - src/polar_sdk/models/orders_exportop.py + - src/polar_sdk/models/orders_finalizeop.py - src/polar_sdk/models/orders_generate_invoiceop.py - src/polar_sdk/models/orders_getop.py - src/polar_sdk/models/orders_invoiceop.py @@ -1892,6 +1910,7 @@ generatedFiles: - src/polar_sdk/models/organizationfeaturesettings.py - src/polar_sdk/models/organizationindividuallegalentityschema.py - src/polar_sdk/models/organizationnotificationsettings.py + - src/polar_sdk/models/organizationnotreadyforpayments.py - src/polar_sdk/models/organizations_getop.py - src/polar_sdk/models/organizations_listop.py - src/polar_sdk/models/organizations_updateop.py @@ -1903,6 +1922,7 @@ generatedFiles: - src/polar_sdk/models/organizationupdate.py - src/polar_sdk/models/pagination.py - src/polar_sdk/models/payment.py + - src/polar_sdk/models/paymentactionrequired.py - src/polar_sdk/models/paymentalreadyinprogress.py - src/polar_sdk/models/paymenterror.py - src/polar_sdk/models/paymentfailed.py @@ -1910,6 +1930,7 @@ generatedFiles: - src/polar_sdk/models/paymentmethodcardmetadata.py - src/polar_sdk/models/paymentmethodgeneric.py - src/polar_sdk/models/paymentmethodinusebyactivesubscription.py + - src/polar_sdk/models/paymentmethodsetupfailed.py - src/polar_sdk/models/paymentnotready.py - src/polar_sdk/models/paymentprocessor.py - src/polar_sdk/models/payments_getop.py @@ -2323,7 +2344,7 @@ examples: _endpointorganization_updated_post: speakeasy-default-endpointorganization-updated-post: requestBody: - application/json: {"type": "organization.updated", "timestamp": "2025-08-19T15:02:44.139Z", "data": {"created_at": "2025-08-19T15:02:44.139Z", "modified_at": "2025-08-23T00:45:50.780Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": null, "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Lemuel44@gmail.com", "website": "", "socials": [{"platform": "tiktok", "url": "https://grizzled-patroller.info/"}, {"platform": "tiktok", "url": "https://grizzled-patroller.info/"}], "status": "active", "details_submitted_at": null, "default_presentment_currency": "", "default_tax_behavior": "exclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "invoice", "benefit_revocation_grace_period": 877397, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": true, "subscription_cycled_after_trial": false, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": true}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}}} + application/json: {"type": "organization.updated", "timestamp": "2025-08-19T15:02:44.139Z", "data": {"created_at": "2025-08-19T15:02:44.139Z", "modified_at": "2025-08-23T00:45:50.780Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": null, "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Lemuel44@gmail.com", "website": "", "socials": [{"platform": "tiktok", "url": "https://grizzled-patroller.info/"}, {"platform": "tiktok", "url": "https://grizzled-patroller.info/"}], "status": "active", "details_submitted_at": null, "default_presentment_currency": "", "default_tax_behavior": "exclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "off_session_charges_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "invoice", "benefit_revocation_grace_period": 877397, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": true, "subscription_cycled_after_trial": false, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": true}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}}} responses: "200": application/json: "" @@ -2400,7 +2421,7 @@ examples: application/json: {"name": "", "slug": ""} responses: "201": - application/json: {"created_at": "2024-12-19T02:20:41.368Z", "modified_at": "2024-07-08T16:38:56.712Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://menacing-draft.net", "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Ursula99@yahoo.com", "website": "", "socials": [{"platform": "facebook", "url": "https://likable-commodity.biz/"}], "status": "denied", "details_submitted_at": "2024-04-04T18:10:47.254Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "prorate", "benefit_revocation_grace_period": 655199, "prevent_trial_abuse": false, "allow_customer_updates": true}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": false, "subscription_past_due": false, "subscription_renewal_reminder": false, "subscription_revoked": false, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": false, "api_access": false, "dashboard_access": false}} + application/json: {"created_at": "2024-12-19T02:20:41.368Z", "modified_at": "2024-07-08T16:38:56.712Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://menacing-draft.net", "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Ursula99@yahoo.com", "website": "", "socials": [{"platform": "facebook", "url": "https://likable-commodity.biz/"}], "status": "denied", "details_submitted_at": "2024-04-04T18:10:47.254Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "off_session_charges_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "prorate", "benefit_revocation_grace_period": 655199, "prevent_trial_abuse": false, "allow_customer_updates": true}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": false, "subscription_past_due": false, "subscription_renewal_reminder": false, "subscription_revoked": false, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": false, "api_access": false, "dashboard_access": false}} "422": application/json: {} organizations:get: @@ -2410,7 +2431,7 @@ examples: id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737" responses: "200": - application/json: {"created_at": "2024-06-18T23:12:24.609Z", "modified_at": "2023-11-22T07:49:02.109Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://far-off-resource.com", "proration_behavior": "invoice", "allow_customer_updates": true, "email": "Dejon.Jakubowski-Bashirian6@gmail.com", "website": null, "socials": [{"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}], "status": "denied", "details_submitted_at": "2023-07-16T01:59:28.607Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "prorate", "benefit_revocation_grace_period": 488109, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": true}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": true, "subscription_confirmation": true, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": false, "subscription_renewal_reminder": true, "subscription_revoked": true, "subscription_trial_conversion_reminder": true, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": true, "subscription_renewals": true, "payouts": false, "refunds": false, "api_access": true, "dashboard_access": false}} + application/json: {"created_at": "2024-06-18T23:12:24.609Z", "modified_at": "2023-11-22T07:49:02.109Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://far-off-resource.com", "proration_behavior": "invoice", "allow_customer_updates": true, "email": "Dejon.Jakubowski-Bashirian6@gmail.com", "website": null, "socials": [{"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}], "status": "denied", "details_submitted_at": "2023-07-16T01:59:28.607Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "off_session_charges_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "prorate", "benefit_revocation_grace_period": 488109, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": true}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": true, "subscription_confirmation": true, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": false, "subscription_renewal_reminder": true, "subscription_revoked": true, "subscription_trial_conversion_reminder": true, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": true, "subscription_renewals": true, "payouts": false, "refunds": false, "api_access": true, "dashboard_access": false}} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -2424,7 +2445,7 @@ examples: application/json: {} responses: "200": - application/json: {"created_at": "2024-01-10T12:09:47.665Z", "modified_at": "2025-07-12T14:18:16.022Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://juvenile-deed.name/", "proration_behavior": "invoice", "allow_customer_updates": false, "email": "Stanford.Streich62@gmail.com", "website": "", "socials": [{"platform": "github", "url": "https://violent-ownership.org/"}], "status": "snoozed", "details_submitted_at": "2024-05-08T13:53:13.516Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "invoice", "benefit_revocation_grace_period": 341703, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": false}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}} + application/json: {"created_at": "2024-01-10T12:09:47.665Z", "modified_at": "2025-07-12T14:18:16.022Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://juvenile-deed.name/", "proration_behavior": "invoice", "allow_customer_updates": false, "email": "Stanford.Streich62@gmail.com", "website": "", "socials": [{"platform": "github", "url": "https://violent-ownership.org/"}], "status": "snoozed", "details_submitted_at": "2024-05-08T13:53:13.516Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "account_review_v2_enabled": false, "reset_proration_behavior_enabled": false, "off_session_charges_enabled": false, "billing_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "invoice", "benefit_revocation_grace_period": 341703, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": false}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}} "403": application/json: {"error": "NotPermitted", "detail": ""} "404": @@ -3411,6 +3432,8 @@ examples: application/json: {"status": "succeeded", "payment_method": {"id": "", "created_at": "2025-12-23T00:32:19.874Z", "modified_at": "2025-02-22T23:44:51.542Z", "processor": "stripe", "customer_id": "", "type": "card", "method_metadata": {"brand": "", "last4": "", "exp_month": 510329, "exp_year": 902331}}} "422": application/json: {} + "400": + application/json: {"error": "PaymentMethodSetupFailed", "detail": ""} customer_portal:customers:delete_payment_method: speakeasy-default-customer-portal:customers:delete-payment-method: parameters: @@ -4694,9 +4717,38 @@ examples: application/json: {"error": "ResourceNotFound", "detail": ""} "422": application/json: {} + orders:create: + speakeasy-default-orders:create: + requestBody: + application/json: {"organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "customer_id": "", "product_id": ""} + responses: + "201": + application/json: {"id": "", "created_at": "2026-07-18T17:44:54.628Z", "modified_at": null, "status": "void", "paid": true, "subtotal_amount": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "purchase", "billing_name": null, "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": null, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-11-29T03:34:26.239Z", "modified_at": "2024-07-12T06:58:01.957Z", "metadata": {"key": 3792.25}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "type": "individual", "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": null, "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "product": {"metadata": {"key": ""}, "id": "", "created_at": "2026-01-15T20:09:02.162Z", "modified_at": "2024-08-30T12:54:42.214Z", "trial_interval": "year", "trial_interval_count": 699089, "name": "", "description": "resolve pish aha catch", "visibility": "private", "recurring_interval": "year", "recurring_interval_count": null, "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 656996, "type": "percentage", "amount": 1000, "currency": "usd", "amounts": {"eur": 900, "usd": 1000}, "created_at": "2025-04-17T06:39:47.276Z", "modified_at": "2025-11-02T14:27:57.549Z", "id": "", "metadata": {"key": false}, "name": "", "code": "", "starts_at": "2026-03-17T06:05:44.637Z", "ends_at": null, "max_redemptions": 414158, "redemptions_count": 749098, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2026-04-25T21:43:56.917Z", "modified_at": "2026-06-17T03:54:09.889Z", "id": "", "amount": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 403525, "status": "unpaid", "current_period_start": "2024-03-21T21:52:16.023Z", "current_period_end": "2026-09-21T14:02:23.888Z", "trial_start": "2025-08-11T16:40:47.152Z", "trial_end": "2025-01-06T10:28:40.440Z", "cancel_at_period_end": true, "canceled_at": "2026-12-27T03:53:58.178Z", "started_at": "2024-07-03T14:46:34.620Z", "ends_at": null, "ended_at": "2024-10-29T12:03:40.812Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}, "items": [], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720} + "422": + application/json: {} + orders:finalize: + speakeasy-default-orders:finalize: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "created_at": "2025-05-24T20:30:52.486Z", "modified_at": "2026-03-14T23:42:09.699Z", "status": "refunded", "paid": true, "subtotal_amount": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-25T22:40:42.220Z", "modified_at": "2024-03-29T16:00:03.359Z", "metadata": {}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "type": "individual", "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2024-12-31T05:13:06.739Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "product": {"metadata": {"key": 62319}, "id": "", "created_at": "2025-03-11T02:25:51.106Z", "modified_at": "2026-08-31T21:34:30.185Z", "trial_interval": null, "trial_interval_count": 996232, "name": "", "description": "outfox pish as triumphantly what supposing hence frightfully", "visibility": "public", "recurring_interval": "day", "recurring_interval_count": 783393, "is_recurring": false, "is_archived": false, "organization_id": ""}, "discount": {"duration": "forever", "type": "fixed", "basis_points": 1000, "created_at": "2024-01-23T22:12:50.534Z", "modified_at": null, "id": "", "metadata": {"key": true}, "name": "", "code": "", "starts_at": "2025-10-27T16:08:34.656Z", "ends_at": "2024-07-04T05:28:05.146Z", "max_redemptions": null, "redemptions_count": 848910, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": [], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720} + "402": + application/json: {"error": "PaymentFailed", "detail": ""} + "403": + application/json: {"error": "OffSessionChargesNotEnabled", "detail": ""} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "412": + application/json: {"error": "OrderNotDraft", "detail": ""} + "422": + application/json: {} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Python SDK Changes Detected:\n* `polar.customer_portal.seats.assign_seat()`: \n * `request.checkout_client_secret` **Removed** **Breaking** :warning:\n* `polar.events.list()`: `response.[list_resource_event_].items.[].[system_event]` **Changed** **Breaking** :warning:\n* `polar._endpointorder_created_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_paid_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_refunded_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorganization_updated_post()`: \n * `request.data.feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.list()`: `response.items.[].feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.create()`: \n * `request.feature_settings` **Changed** **Breaking** :warning:\n * `response.feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.get()`: `response.feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.update()`: \n * `request.organization_update.feature_settings` **Changed** **Breaking** :warning:\n * `response.feature_settings` **Changed** **Breaking** :warning:\n* `polar.event-types.list()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.events.get()`: `response.[system_event]` **Changed** **Breaking** :warning:\n* `polar.customer-seats.assign_seat()`: `request` **Changed** **Breaking** :warning:\n* `polar.discounts.create()`: `request` **Changed** **Breaking** :warning:\n* `polar.subscriptions.update()`: \n * `request.subscription_update.[subscription_update_clear]` **Added**\n* `polar.members.create_member()`: \n * `request.role` **Changed**\n* `polar.customer_portal.customers.update()`: \n * `request.default_payment_method_id` **Added**\n* `polar.orders.receipt()`: **Added**\n* `polar.customer_portal.orders.list()`: `response.items.[]` **Changed**\n* `polar.customer_portal.orders.get()`: `response` **Changed**\n* `polar.customer_portal.orders.update()`: `response` **Changed**\n* `polar.customer_portal.subscriptions.update()`: \n * `request.customer_subscription_update.[customer_subscription_update_clear]` **Added**\n* `polar.orders.list()`: `response.items.[]` **Changed**\n* `polar.orders.get()`: `response` **Changed**\n* `polar.customer_portal.orders.receipt()`: **Added**\n* `polar.orders.update()`: `response` **Changed**\n" +releaseNotes: "## Python SDK Changes Detected:\n* `polar.orders.list()`: `response.items.[].invoice_number` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.update()`: `response.invoice_number` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.get()`: `response.invoice_number` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.list()`: `response.items.[].invoice_number` **Changed** **Breaking** :warning:\n* `polar.orders.update()`: `response.invoice_number` **Changed** **Breaking** :warning:\n* `polar.orders.get()`: `response.invoice_number` **Changed** **Breaking** :warning:\n* `polar.organizations.get()`: `response.feature_settings.off_session_charges_enabled` **Added**\n* `polar._endpointorder_updated_post()`: \n * `request.data.invoice_number` **Changed**\n* `polar._endpointorganization_updated_post()`: \n * `request.data.feature_settings.off_session_charges_enabled` **Added**\n* `polar.organizations.create()`: \n * `request.feature_settings.off_session_charges_enabled` **Added**\n * `response.feature_settings.off_session_charges_enabled` **Added**\n* `polar.organizations.list_organizations()`: **Added**\n* `polar.organizations.update()`: \n * `request.organization_update.feature_settings.off_session_charges_enabled` **Added**\n * `response.feature_settings.off_session_charges_enabled` **Added**\n* `polar._endpointorder_paid_post()`: \n * `request.data.invoice_number` **Changed**\n* `polar._endpointorder_refunded_post()`: \n * `request.data.invoice_number` **Changed**\n* `polar._endpointorder_created_post()`: \n * `request.data.invoice_number` **Changed**\n* `polar.customers.list()`: `request.active` **Added**\n* `polar.customer_portal.customers.add_payment_method()`: `error.status[400]` **Added**\n* `polar.organizations.list()`: **Deleted** **Breaking** :warning:\n* `polar.orders.finalize()`: **Added**\n* `polar.orders.create()`: **Added**\n* `polar.payments.list()`: `request.customer_id` **Added**\n" trackedFiles: .devcontainer/README.md: last_write_checksum: sha1:e2a191a1fa8ceb27387eb32eabf36f7ad16a532c @@ -4709,7 +4761,7 @@ trackedFiles: .vscode/settings.json: last_write_checksum: sha1:f84632c81029fcdda8c3b0c768d02b836fc80526 USAGE.md: - last_write_checksum: sha1:f0b26c208168f2dff9aa26cdbaf5c1a3a8fbff98 + last_write_checksum: sha1:100ad323976442d76b2055854c14371dbb36e2d5 docs/models/activesubscriptions.md: last_write_checksum: sha1:b3eaf87dcdf62890d684cfc6ec8ddb2f574475c9 docs/models/activeuserbyevent.md: @@ -5319,7 +5371,7 @@ trackedFiles: docs/models/customernotready.md: last_write_checksum: sha1:2faa3980f943abc75095106230343a3e8b67e67a docs/models/customerorder.md: - last_write_checksum: sha1:4650924bfe3aa470634b7cb4ecde3c3b314e8958 + last_write_checksum: sha1:a5649ac4b004556de0f03305e3a6aea83b0864a9 docs/models/customerorderconfirmpayment.md: last_write_checksum: sha1:d1082e2ca6e98078093253308617e3f1e9039acc docs/models/customerorderinvoice.md: @@ -5601,7 +5653,7 @@ trackedFiles: docs/models/customerslistqueryparamorganizationidfilter.md: last_write_checksum: sha1:943b8d02cc1e5ae96b73fc1cdb8f7987e2689603 docs/models/customerslistrequest.md: - last_write_checksum: sha1:170c64fefb80210d20d0baf03184294288f7113e + last_write_checksum: sha1:d7dc8cfaf7d9331d144ec8f05caad05f934336b7 docs/models/customerslistresponse.md: last_write_checksum: sha1:90281a239335ca50f1e83bd1fa015a9659fec192 docs/models/customersortproperty.md: @@ -6414,6 +6466,8 @@ trackedFiles: last_write_checksum: sha1:8fd2b3a37fccafd17bb20225f16a2b9925786987 docs/models/oauth2userinforesponseoauth2userinfo.md: last_write_checksum: sha1:a1d5a8429b64c2d212282767a80301e8f8628d77 + docs/models/offsessionchargesnotenabled.md: + last_write_checksum: sha1:237bcaf76ebbfac1b023443ee018383944612ed7 docs/models/onetimeproducts.md: last_write_checksum: sha1:c9a9888a9ea33c52463aba7ab6368ac1e307add2 docs/models/onetimeproductsnetrevenue.md: @@ -6421,9 +6475,15 @@ trackedFiles: docs/models/onetimeproductsrevenue.md: last_write_checksum: sha1:8e7c90912be37abe552adac8531990fe41efb803 docs/models/order.md: - last_write_checksum: sha1:c97dbd8c24dfe435118458b07db40128c6b1cd6c + last_write_checksum: sha1:e3a67db7fd287ce28d4ad583103971b2df0911bf docs/models/orderbillingreason.md: last_write_checksum: sha1:fdbf3af4604ebfc3f7d5cf2b5bed2528ab3d7cab + docs/models/ordercreate.md: + last_write_checksum: sha1:f11ff64248e256dfd6b78d9720f7d95d95d6ace3 + docs/models/ordercreatecustomfielddata.md: + last_write_checksum: sha1:2af083c91fb1eb518eeeb54ac3b1aab40198301d + docs/models/ordercreatemetadata.md: + last_write_checksum: sha1:91f7d995ed96b594b0ec042db2438c51b58adc4f docs/models/ordercustomer.md: last_write_checksum: sha1:006de59831c12de08c6d430d6ccdb5b5ae5be70c docs/models/ordercustomertaxid.md: @@ -6432,12 +6492,16 @@ trackedFiles: last_write_checksum: sha1:9b93074a6835a90acd2f999a7ffdf48759b823ae docs/models/orderdiscount.md: last_write_checksum: sha1:7e135509a9fa50b5713202345da3b00a6344d614 + docs/models/orderfinalize.md: + last_write_checksum: sha1:88c4b89f476c5a34fc23b7b739d33815130964c3 docs/models/orderidfilter.md: last_write_checksum: sha1:80cb3d23aae3aea9a3f03abe3d491a7ffbc6a5f8 docs/models/orderinvoice.md: last_write_checksum: sha1:9d4c485faebb8415766ba66cdc3f26432899ac8b docs/models/orderitemschema.md: last_write_checksum: sha1:bbdfd2b9367625374157de0b54fad32724b16a1f + docs/models/ordernotdraft.md: + last_write_checksum: sha1:ecd74711946aec52d49c4e977b3ff899c07b584f docs/models/ordernoteligibleforretry.md: last_write_checksum: sha1:e2ce6d678b0b5c60623b3b0278d868965a96a9fd docs/models/orderpaidevent.md: @@ -6460,6 +6524,12 @@ trackedFiles: last_write_checksum: sha1:eccdd1e558f250211cde2d8844ba288820548558 docs/models/ordersexportresponse.md: last_write_checksum: sha1:ffc26b1180e3b5967e7a5b33b494167fe1a53cae + docs/models/ordersfinalizerequest.md: + last_write_checksum: sha1:df5d43bc75cf6068f1fb566f61c4ed1074da43af + docs/models/ordersfinalizeresponse402ordersfinalize.md: + last_write_checksum: sha1:9374d3eebeb9ae80b8616a1e0935f9b1cb8d0c7e + docs/models/ordersfinalizeresponse403ordersfinalize.md: + last_write_checksum: sha1:46b4ad14bdafb453ed7d1ae5265856aa5ef0b39d docs/models/ordersgenerateinvoicerequest.md: last_write_checksum: sha1:e1bd44ba32fdca15b5526ac870ed157b7e5ff7b1 docs/models/ordersgenerateinvoiceresponse422ordersgenerateinvoice.md: @@ -6487,7 +6557,7 @@ trackedFiles: docs/models/ordersreceiptrequest.md: last_write_checksum: sha1:8d8ac3562231bdcd2874873096895bdd09924a9a docs/models/orderstatus.md: - last_write_checksum: sha1:ab6604b2d86046ffea690671545d5e80dd5cef2b + last_write_checksum: sha1:fc12a2988f8de5657634a8f68ec8b8a6c64de664 docs/models/ordersubscription.md: last_write_checksum: sha1:400c3a0718f96c2038b98f62334c9d08bd4357eb docs/models/ordersupdaterequest.md: @@ -6537,7 +6607,7 @@ trackedFiles: docs/models/organizationdetails.md: last_write_checksum: sha1:59784eef0c4fcb65f8c7006ffd0c3df8a7cfba0b docs/models/organizationfeaturesettings.md: - last_write_checksum: sha1:f7fcd59cee6d15252437cc0bcc2c73ebafb47f5e + last_write_checksum: sha1:45447412c9e2ea2f7ff5439d8ea6975492483012 docs/models/organizationid.md: last_write_checksum: sha1:5adf4fb1a723f361ac66da12542fedbe34fd9e5d docs/models/organizationidfilter.md: @@ -6546,6 +6616,8 @@ trackedFiles: last_write_checksum: sha1:2ea97cdbe83c90aed9605835a6bc942ee2a67596 docs/models/organizationnotificationsettings.md: last_write_checksum: sha1:9dfa31a45e5c019bee16f7633b023be3524d8f42 + docs/models/organizationnotreadyforpayments.md: + last_write_checksum: sha1:02f405d8a3a23fe497d285b25a14032b346e83c4 docs/models/organizationsgetrequest.md: last_write_checksum: sha1:ef9861c86cd9be7f5cc85495e19e574da41c24d5 docs/models/organizationslistrequest.md: @@ -6570,6 +6642,8 @@ trackedFiles: last_write_checksum: sha1:1aedcef9b4f0bc5ab25ef1e9542e22d82088682a docs/models/payment.md: last_write_checksum: sha1:be4a62b4543395995c4bd76dfca288bc95b8b0b6 + docs/models/paymentactionrequired.md: + last_write_checksum: sha1:7ed936621233b5254cc63fb193ae1a67ce539bd0 docs/models/paymentalreadyinprogress.md: last_write_checksum: sha1:7a77e5b6ecbe00b15806f0b1c60f0a59b84ac7d2 docs/models/paymenterror.md: @@ -6584,6 +6658,8 @@ trackedFiles: last_write_checksum: sha1:88efec40525c06ec229d0416d7f3b94692208d0f docs/models/paymentmethodinusebyactivesubscription.md: last_write_checksum: sha1:40d4ab667210c5d634601aa941be855d539b2160 + docs/models/paymentmethodsetupfailed.md: + last_write_checksum: sha1:f5a98f6db8c9f98ea5d5bbbdb72eac4d44af46b3 docs/models/paymentnotready.md: last_write_checksum: sha1:432398707451baaf2d86099de54b03ee760df963 docs/models/paymentprocessor.md: @@ -6592,6 +6668,8 @@ trackedFiles: last_write_checksum: sha1:877dd09682a4bf6eae15f2a5753b1ffe7eaedb73 docs/models/paymentslistqueryparamcheckoutidfilter.md: last_write_checksum: sha1:5df7333528b3d442344366dff4c919ab05ce3daa + docs/models/paymentslistqueryparamcustomeridfilter.md: + last_write_checksum: sha1:c449209d60b1ddd2427a4dbb2a7d869e500b9271 docs/models/paymentslistqueryparamorderidfilter.md: last_write_checksum: sha1:07a7b964210406c8aa44e28e8b5dcbd6078d1d31 docs/models/paymentslistqueryparamorganizationidfilter.md: @@ -6599,7 +6677,7 @@ trackedFiles: docs/models/paymentslistqueryparamstatusfilter.md: last_write_checksum: sha1:adc2b23a6e930d45f04da1c0fcc55f6302ec7fb4 docs/models/paymentslistrequest.md: - last_write_checksum: sha1:5e6bcda9dd6e6a7097047d1661efd5b7aaa29bfd + last_write_checksum: sha1:e7d463e22a64da00d0f82413328f34240906d8c0 docs/models/paymentslistresponse.md: last_write_checksum: sha1:f6336f1f7dccbc0b5bd8381e3b0a558b7e7ac706 docs/models/paymentsortproperty.md: @@ -6649,11 +6727,11 @@ trackedFiles: docs/models/productpricecustom.md: last_write_checksum: sha1:4f1e0f5d1209426a562d94a9eb8c70ec99e16312 docs/models/productpricecustomcreate.md: - last_write_checksum: sha1:f278577a21a2b88c42f15b8dfa1c4421a460cdd6 + last_write_checksum: sha1:3a06a5c6b110c0bbeae446890dc3fb2664374c61 docs/models/productpricefixed.md: last_write_checksum: sha1:0456129d409689286ceea9254e1f45498566e4da docs/models/productpricefixedcreate.md: - last_write_checksum: sha1:d5db4e1e023741733aeaa9d0bda78ced09c5ad08 + last_write_checksum: sha1:148662b9dc9c7015a9e99f536edd1800ec6f4c1b docs/models/productpricefree.md: last_write_checksum: sha1:5877a4eecbae4dc7951c1733461c1dab37fef3bb docs/models/productpricefreecreate.md: @@ -6797,7 +6875,7 @@ trackedFiles: docs/models/s3fileuploadpart.md: last_write_checksum: sha1:59c41738e82863712fb78083d1650dc76f060d33 docs/models/scope.md: - last_write_checksum: sha1:004ffe9fb1fcbdfff5053bf9b77f34340e892db2 + last_write_checksum: sha1:362e208ec433a16d20b544d5d3e4b462e6c5c3dc docs/models/seatassign.md: last_write_checksum: sha1:64fc1b70a5ea6e0a12c70b10a21b6687e66781cb docs/models/seatclaim.md: @@ -7125,7 +7203,7 @@ trackedFiles: docs/sdks/customermeters/README.md: last_write_checksum: sha1:b90c86939a9133539681534059241026b501c783 docs/sdks/customers/README.md: - last_write_checksum: sha1:fb75054ed57677f444b4c3e61e7d9694d4fa6175 + last_write_checksum: sha1:272637510c479eec187db685be0a864d9d9f3d4a docs/sdks/customerseats/README.md: last_write_checksum: sha1:7f63eb8dd09fcc98ffb4dc15cb4c9241bab5ae7d docs/sdks/customersessions/README.md: @@ -7157,19 +7235,19 @@ trackedFiles: docs/sdks/oauth2/README.md: last_write_checksum: sha1:41ab71747a1ea845eb6e342b3a827d347b0209d9 docs/sdks/orders/README.md: - last_write_checksum: sha1:87ae9bc5bc858611760888dabfe63f6a44f43a63 + last_write_checksum: sha1:6a7c8ea380f4e60ccea093fb43779f92d1af6067 docs/sdks/organizationaccesstokens/README.md: last_write_checksum: sha1:05bb349d7b4ac8d0feda927af81a9a71de2e4684 docs/sdks/organizations/README.md: - last_write_checksum: sha1:539a9bb438f60e85284e0630399d566cdb139b2c + last_write_checksum: sha1:3fdbe442ff036467bbe8bfcd5befafc7d04c9d40 docs/sdks/payments/README.md: - last_write_checksum: sha1:c0c2c61bef213dfafcb00274baddd1c43ba3e602 + last_write_checksum: sha1:55ac9bba178fa51cc9d81e8b31660e1b6cef56b1 docs/sdks/polarbenefitgrants/README.md: last_write_checksum: sha1:3250975e14ed5f0eee012ac31d644de61fc8946e docs/sdks/polarcustomermeters/README.md: last_write_checksum: sha1:3afd1422131745f9eeaf55cb8a28e386d3684d83 docs/sdks/polarcustomers/README.md: - last_write_checksum: sha1:beef732c191b592284cf3511a7b31e05ac6f08a8 + last_write_checksum: sha1:37ee8734ef1d43389ea8c19278f21c54c8cd673f docs/sdks/polarlicensekeys/README.md: last_write_checksum: sha1:01f6ad4f58453a9ef561beee742f8aebf20f42d8 docs/sdks/polarmembers/README.md: @@ -7213,7 +7291,7 @@ trackedFiles: src/polar_sdk/_hooks/types.py: last_write_checksum: sha1:a218c66f3e2d1f1b9af54f270472b970b0cc1913 src/polar_sdk/_version.py: - last_write_checksum: sha1:d9ff953d823bfd0059ba15ec4ddc7d34b0cdd5a9 + last_write_checksum: sha1:e927ba455352bf0952a242f1f46f4fe41677bff6 src/polar_sdk/basesdk.py: last_write_checksum: sha1:4523ea81f1381f171fe2d4e60f85b82203208d02 src/polar_sdk/benefit_grants.py: @@ -7239,7 +7317,7 @@ trackedFiles: src/polar_sdk/customer_sessions.py: last_write_checksum: sha1:25f6cc89c87320a87e76bb4c2548989a145c1303 src/polar_sdk/customers.py: - last_write_checksum: sha1:0c7db239381376f161f322b1903df33a6db17cfa + last_write_checksum: sha1:ba012388989e030ec0689672dacd8d9c40f32d52 src/polar_sdk/discounts.py: last_write_checksum: sha1:624026ce7ab6578e5207d7cb7decd3d35e0895a5 src/polar_sdk/disputes.py: @@ -7261,9 +7339,9 @@ trackedFiles: src/polar_sdk/meters.py: last_write_checksum: sha1:b34c6c20fa382d46845215528e2975173984a004 src/polar_sdk/metrics_sdk.py: - last_write_checksum: sha1:c30599374f77c15def258831ff82e18b21155976 + last_write_checksum: sha1:d77ec52b4757fb51de8e4a1c173032136908af9e src/polar_sdk/models/__init__.py: - last_write_checksum: sha1:3eaefb9aeeaff31cb27ff3605b83384986504227 + last_write_checksum: sha1:3f567d7f5275d090aae29985042df3b363b54141 src/polar_sdk/models/address.py: last_write_checksum: sha1:083edb7f045174ac1aea30545e9981c33f07d57d src/polar_sdk/models/addressdict.py: @@ -7753,7 +7831,7 @@ trackedFiles: src/polar_sdk/models/customernotready.py: last_write_checksum: sha1:bfcfe22b088cbbf10854f6e6bb9f22c046362d28 src/polar_sdk/models/customerorder.py: - last_write_checksum: sha1:910f8ec56288b9bc18523f741d3201b6b4bd395f + last_write_checksum: sha1:1b833b6ac2a1ffdb925ab8403d790801b05ad4af src/polar_sdk/models/customerorderconfirmpayment.py: last_write_checksum: sha1:1a363d74823980436253fc208c5ad3a508e5f97f src/polar_sdk/models/customerorderinvoice.py: @@ -8310,16 +8388,24 @@ trackedFiles: last_write_checksum: sha1:9275201aa87fcca19337f596ebfff7735cc5c9b3 src/polar_sdk/models/oauth2_userinfoop.py: last_write_checksum: sha1:b6b3f96a4dbd2ffe9216d781a6dd997eef4496b8 + src/polar_sdk/models/offsessionchargesnotenabled.py: + last_write_checksum: sha1:425ffa5dc180558667b7012c33c11825594de78d src/polar_sdk/models/order.py: - last_write_checksum: sha1:d75b8f4968b9032376bb6cae348e7b7137c8641b + last_write_checksum: sha1:1a8a7007718a3b433ffae64b6e2bee5b9526e0b9 src/polar_sdk/models/orderbillingreason.py: last_write_checksum: sha1:3b294070e89e6d9f91bdd42c34207bc44769b5b1 + src/polar_sdk/models/ordercreate.py: + last_write_checksum: sha1:4e9b03a06b586d1d90af52088867f9ebc17c6331 src/polar_sdk/models/ordercustomer.py: last_write_checksum: sha1:6568290f7335f21ca1e84a6ec2676ab31dba7346 + src/polar_sdk/models/orderfinalize.py: + last_write_checksum: sha1:af747340ca25c4cb133681da07d058680aae25f1 src/polar_sdk/models/orderinvoice.py: last_write_checksum: sha1:21020a291e1d6153cf8efa40bdff3f50f7def599 src/polar_sdk/models/orderitemschema.py: last_write_checksum: sha1:14067a77d3a47c0985ff26a7b6674f0b5a574341 + src/polar_sdk/models/ordernotdraft.py: + last_write_checksum: sha1:f388d8c8b5adb3d145ac760c596ca59574baebd0 src/polar_sdk/models/ordernoteligibleforretry.py: last_write_checksum: sha1:cd1ab440c9b5bd1d8b438beeb66118e4d053c242 src/polar_sdk/models/orderpaidevent.py: @@ -8336,6 +8422,8 @@ trackedFiles: last_write_checksum: sha1:3ce8e61cc2ef8c8368ee802783a7783e2c4b9660 src/polar_sdk/models/orders_exportop.py: last_write_checksum: sha1:c8f2b41b7aef39762404a08bf44984e7627e38d8 + src/polar_sdk/models/orders_finalizeop.py: + last_write_checksum: sha1:5c81fcc1895c982c33bcc4bb7fcf7dc59e1b7ae7 src/polar_sdk/models/orders_generate_invoiceop.py: last_write_checksum: sha1:f08138259c636da7da4048963a03f8ddf3e4038a src/polar_sdk/models/orders_getop.py: @@ -8349,7 +8437,7 @@ trackedFiles: src/polar_sdk/models/ordersortproperty.py: last_write_checksum: sha1:6e6f93d4431b2d28b672669a649cae54786b8f6c src/polar_sdk/models/orderstatus.py: - last_write_checksum: sha1:89d37b6b4115ba5940f4e1559095be2b7256509d + last_write_checksum: sha1:d22b6b744e74c156612aa03b907c16e362de836e src/polar_sdk/models/ordersubscription.py: last_write_checksum: sha1:2c562ae7ec8743fd25c0808d968da454be0abada src/polar_sdk/models/orderupdate.py: @@ -8393,11 +8481,13 @@ trackedFiles: src/polar_sdk/models/organizationdetails.py: last_write_checksum: sha1:74233062d4ab6a42a6799705ac3cfd820ba3244c src/polar_sdk/models/organizationfeaturesettings.py: - last_write_checksum: sha1:43d0b09f41afdb90673b164edacded53fcb4ce22 + last_write_checksum: sha1:3947f7dd76b5250a52f4158aaff764d144147667 src/polar_sdk/models/organizationindividuallegalentityschema.py: last_write_checksum: sha1:33b021299f8a9ef86b315e3030acf6e34ccedeb4 src/polar_sdk/models/organizationnotificationsettings.py: last_write_checksum: sha1:d56d2a800ac2800e155ca918ff4e6765797ee3ed + src/polar_sdk/models/organizationnotreadyforpayments.py: + last_write_checksum: sha1:759a373d584d830a2fde026d9692726c5b83dcec src/polar_sdk/models/organizations_getop.py: last_write_checksum: sha1:022214ce77271823d20259056dcd5b7c735784b3 src/polar_sdk/models/organizations_listop.py: @@ -8420,6 +8510,8 @@ trackedFiles: last_write_checksum: sha1:88b8cafcf8bbbb722ffc53957982fecae18d95bf src/polar_sdk/models/payment.py: last_write_checksum: sha1:95ba3eb59845c7d7f9a805c08f11775c2598e0bd + src/polar_sdk/models/paymentactionrequired.py: + last_write_checksum: sha1:dcfbbc6c332a2ea5cbbd0069148ebd81bf876a75 src/polar_sdk/models/paymentalreadyinprogress.py: last_write_checksum: sha1:fa33f08bd9d50268ed3a87e38589f625a4910e44 src/polar_sdk/models/paymenterror.py: @@ -8434,6 +8526,8 @@ trackedFiles: last_write_checksum: sha1:479565160d08c6c40db2040dc9fc85ff91c1ef23 src/polar_sdk/models/paymentmethodinusebyactivesubscription.py: last_write_checksum: sha1:4c48e18c0fd51dbe2e4da0388f22904a96fdf192 + src/polar_sdk/models/paymentmethodsetupfailed.py: + last_write_checksum: sha1:49a24da7ab74cfe9800505934249743adf44717a src/polar_sdk/models/paymentnotready.py: last_write_checksum: sha1:984ca3217bddf6b7dff363723bbec523a8b3f836 src/polar_sdk/models/paymentprocessor.py: @@ -8441,7 +8535,7 @@ trackedFiles: src/polar_sdk/models/payments_getop.py: last_write_checksum: sha1:8fe3be2c7cef991aa96ffe23a6c21a6baf18c1dc src/polar_sdk/models/payments_listop.py: - last_write_checksum: sha1:323e8950aaed26e9f16d2d93622fb00da1ba546f + last_write_checksum: sha1:4c3795de9f69aa9b5a46fdc18f2be6c71059227d src/polar_sdk/models/paymentsortproperty.py: last_write_checksum: sha1:2803a0c85f1046a5e19a3f7f136d789e5b0ca439 src/polar_sdk/models/paymentstatus.py: @@ -8475,11 +8569,11 @@ trackedFiles: src/polar_sdk/models/productpricecustom.py: last_write_checksum: sha1:60c580ba1d7e5755b2e273a5141319d20eadc166 src/polar_sdk/models/productpricecustomcreate.py: - last_write_checksum: sha1:98710526a0b503c6727a07112a495a0845d2e62a + last_write_checksum: sha1:edd96818ab0248d09355c8a093f988f0ff67ac04 src/polar_sdk/models/productpricefixed.py: last_write_checksum: sha1:9b5e42ece47c918221067ce8ea86005edf364c93 src/polar_sdk/models/productpricefixedcreate.py: - last_write_checksum: sha1:f0fe11e72034784886e4e9fe20205d817d9042c1 + last_write_checksum: sha1:21e4d55605bd6e81fafd84dd9b654b269b1d9ceb src/polar_sdk/models/productpricefree.py: last_write_checksum: sha1:bfacb3a8115f8a96ed2adc4c4e6660abf99632fe src/polar_sdk/models/productpricefreecreate.py: @@ -8555,7 +8649,7 @@ trackedFiles: src/polar_sdk/models/s3fileuploadpart.py: last_write_checksum: sha1:b0e5a41676f97c5df49525997913dc94bcaf7b6e src/polar_sdk/models/scope.py: - last_write_checksum: sha1:8ae0f41ff51f9f7c7f0ba0698fd4a710c7fad359 + last_write_checksum: sha1:497cf57767780009130d9f479e2ba49bacc66247 src/polar_sdk/models/sdkerror.py: last_write_checksum: sha1:409dc5170c233e828971025155f631c8e49dcf70 src/polar_sdk/models/seatassign.py: @@ -8631,7 +8725,7 @@ trackedFiles: src/polar_sdk/models/subscriptions_getop.py: last_write_checksum: sha1:74872cc7de547940f4189bbabea5d8d4803837e1 src/polar_sdk/models/subscriptions_listop.py: - last_write_checksum: sha1:24b8dbf3d9e8a94bffa772ed5329e0dbf004917e + last_write_checksum: sha1:781924f5c3d82d82afd175fa61c50589f990235a src/polar_sdk/models/subscriptions_revokeop.py: last_write_checksum: sha1:e1ca41a0bf57c37d748d641ca62cea7b71509537 src/polar_sdk/models/subscriptions_updateop.py: @@ -8813,19 +8907,19 @@ trackedFiles: src/polar_sdk/oauth2.py: last_write_checksum: sha1:4d04c5a98c3a4b5219d1ff484e7e1c8295b01f47 src/polar_sdk/orders.py: - last_write_checksum: sha1:54324f8787d3e8b07925d79ea3eec3ef4b59b52d + last_write_checksum: sha1:c35c53d44e20ec8d47d9510a078e0e8dc6cb8f89 src/polar_sdk/organization_access_tokens.py: last_write_checksum: sha1:fc169e6debb5c6918755d3c3ce2dfdda2fad8ce0 src/polar_sdk/organizations.py: - last_write_checksum: sha1:3c21a0fcba6f317fa1ba9a6b7fcc3ca4f8d1e35a + last_write_checksum: sha1:7bbeff0d7a492c946b6eafc1ed411c5d63ecad00 src/polar_sdk/payments.py: - last_write_checksum: sha1:a5dded8ecdfef5faf4ce25fedaeed39c10adb881 + last_write_checksum: sha1:880ac7db391c26415a194c28e104cf8127959108 src/polar_sdk/polar_benefit_grants.py: last_write_checksum: sha1:0f8f499e162deaa8e1a570afc9327be5f24cda38 src/polar_sdk/polar_customer_meters.py: last_write_checksum: sha1:b2831a77fd6408b00f32ff405a6815865673d569 src/polar_sdk/polar_customers.py: - last_write_checksum: sha1:2e9118e4bea24cfcd8ff21571c1f55826c816fae + last_write_checksum: sha1:7f5ae5234e5bb95f63c945eed6dd3d942176ddf3 src/polar_sdk/polar_license_keys.py: last_write_checksum: sha1:21662dddfbe9a0df7f9e4d2992bb493d6fc60f4b src/polar_sdk/polar_members.py: @@ -8843,15 +8937,17 @@ trackedFiles: src/polar_sdk/refunds.py: last_write_checksum: sha1:3a40acdfa627d784ed220738c094536dbcd1a60f src/polar_sdk/sdk.py: - last_write_checksum: sha1:8546539ea54f6b9708eff5e463e91e3059f27273 + last_write_checksum: sha1:7a44c48c491ac2c41d1b0d049bacfd04fbcfcc00 src/polar_sdk/sdkconfiguration.py: last_write_checksum: sha1:b9b14902f71407dd21a4b209f2e342c54a0a86a7 src/polar_sdk/seats.py: last_write_checksum: sha1:157c57cd5aceea3ed4d99e7a78803123d1125de8 src/polar_sdk/subscriptions.py: - last_write_checksum: sha1:f0b56069383999baf694f765fbb009907a36b921 + last_write_checksum: sha1:ffeb5e545c9ae8a3e60eabbcb484bfa85a6d085c src/polar_sdk/types/__init__.py: - last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed + last_write_checksum: sha1:f9ad14217f832e74f594285960125add50324be9 + src/polar_sdk/types/base64fileinput.py: + last_write_checksum: sha1:4780e893d3853b5a6e28d9a6ca3ee102ce0f502d src/polar_sdk/types/basemodel.py: last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 src/polar_sdk/utils/__init__.py: @@ -8877,7 +8973,7 @@ trackedFiles: src/polar_sdk/utils/queryparams.py: last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 src/polar_sdk/utils/requestbodies.py: - last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 + last_write_checksum: sha1:e1fef575283b7fe7fe2ad392dbbb3fb105309124 src/polar_sdk/utils/retries.py: last_write_checksum: sha1:471372f5c5d1dd5583239c9cf3c75f1b636e5d87 src/polar_sdk/utils/security.py: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 3e91ebe3..a7559425 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: persistentEdits: {} versioningStrategy: automatic python: - version: 0.31.5 + version: 0.31.6 additionalDependencies: dev: pydantic-ai-slim: ^0.1.0 @@ -47,6 +47,7 @@ python: authors: - Polar baseErrorName: PolarError + bodyVariantOverloads: false clientServerStatusCodesAsErrors: true constFieldCasing: upper defaultErrorName: SDKError @@ -74,14 +75,18 @@ python: license: "" maxMethodParams: 100 methodArguments: infer-optional-args + methodTimeoutArgument: timeout-ms + methodTimeoutUnits: milliseconds moduleName: "" multipartArrayFormat: legacy + optionalDependencies: {} outputModelSuffix: output packageManager: poetry packageName: polar-sdk preApplyUnionDiscriminators: false pytestFilterWarnings: [] pytestTimeout: 0 + rawResponseHelpers: false responseFormat: flat sseFlatResponse: false templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1c937807..d15faf76 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.648.0 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:71002fcc451a5c21286dce02a4500670f3d77017019bf7fd20a4fd669d20c34c - sourceBlobDigest: sha256:0effc8c2537f9cb96cc364f1b6d6e0eb3997dab0bf4b6803d46cca8099f4aa11 + sourceRevisionDigest: sha256:9bf82638b4a1bd46168b32d7c28fa6c95142e1a428dae3caa932f388ec799630 + sourceBlobDigest: sha256:d8e44a9267b3bb3f7f7dcc18374219d9b3775f836c290f0081beb1deddc5965e tags: - latest - - speakeasy-sdk-regen-1779064662 + - speakeasy-sdk-regen-1779324054 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:71002fcc451a5c21286dce02a4500670f3d77017019bf7fd20a4fd669d20c34c - sourceBlobDigest: sha256:0effc8c2537f9cb96cc364f1b6d6e0eb3997dab0bf4b6803d46cca8099f4aa11 + sourceRevisionDigest: sha256:9bf82638b4a1bd46168b32d7c28fa6c95142e1a428dae3caa932f388ec799630 + sourceBlobDigest: sha256:d8e44a9267b3bb3f7f7dcc18374219d9b3775f836c290f0081beb1deddc5965e codeSamplesNamespace: polar-oas-py-code-samples - codeSamplesRevisionDigest: sha256:32cd60a9a754af414d62c8516a90943306093cf779f184d73635f472848df454 + codeSamplesRevisionDigest: sha256:9d8a6f7c0114b24b4558d3fc1b5e7a432ce24ec9c318a0d7f9856445a44d5592 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 17c76c25..1cc4b192 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -143,7 +143,7 @@ async def main(): access_token="", ) as polar: - res = await polar.organizations.list_async(page=1, limit=10) + res = await polar.organizations.list_organizations_async(page=1, limit=10) while res is not None: # Handle items @@ -444,9 +444,11 @@ of crashing on a `pydantic.ValidationError`. ### [orders](docs/sdks/orders/README.md) * [list](docs/sdks/orders/README.md#list) - List Orders +* [create](docs/sdks/orders/README.md#create) - Create Order * [export](docs/sdks/orders/README.md#export) - Export Orders * [get](docs/sdks/orders/README.md#get) - Get Order * [update](docs/sdks/orders/README.md#update) - Update Order +* [finalize](docs/sdks/orders/README.md#finalize) - Finalize Order * [generate_invoice](docs/sdks/orders/README.md#generate_invoice) - Generate Order Invoice * [invoice](docs/sdks/orders/README.md#invoice) - Get Order Invoice * [receipt](docs/sdks/orders/README.md#receipt) - Get Order Receipt @@ -460,7 +462,7 @@ of crashing on a `pydantic.ValidationError`. ### [organizations](docs/sdks/organizations/README.md) -* [list](docs/sdks/organizations/README.md#list) - List Organizations +* [list_organizations](docs/sdks/organizations/README.md#list_organizations) - List Organizations * [create](docs/sdks/organizations/README.md#create) - Create Organization * [get](docs/sdks/organizations/README.md#get) - Get Organization * [update](docs/sdks/organizations/README.md#update) - Update Organization @@ -521,7 +523,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10, + res = polar.organizations.list_organizations(page=1, limit=10, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) while res is not None: @@ -542,7 +544,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -578,7 +580,7 @@ with Polar( res = None try: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -604,7 +606,7 @@ with Polar( * [`PolarError`](./src/polar_sdk/models/polarerror.py): The base class for HTTP error responses. * [`HTTPValidationError`](./src/polar_sdk/models/httpvalidationerror.py): Validation Error. Status code `422`. * -
Less common errors (25) +
Less common errors (30)
@@ -615,26 +617,31 @@ with Polar( **Inherit from [`PolarError`](./src/polar_sdk/models/polarerror.py)**: -* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 87 of 183 methods.* -* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 183 methods.* -* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 183 methods.* -* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 183 methods.* -* [`AlreadyActiveSubscriptionError`](./src/polar_sdk/models/alreadyactivesubscriptionerror.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* -* [`NotOpenCheckout`](./src/polar_sdk/models/notopencheckout.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* -* [`PaymentNotReady`](./src/polar_sdk/models/paymentnotready.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* -* [`TrialAlreadyRedeemed`](./src/polar_sdk/models/trialalreadyredeemed.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* -* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 183 methods.* -* [`PaymentFailed`](./src/polar_sdk/models/paymentfailed.py): Payment required to apply the subscription update. Status code `402`. Applicable to 2 of 183 methods.* -* [`SubscriptionLocked`](./src/polar_sdk/models/subscriptionlocked.py): Subscription is pending an update. Status code `409`. Applicable to 2 of 183 methods.* -* [`MissingInvoiceBillingDetails`](./src/polar_sdk/models/missinginvoicebillingdetails.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 183 methods.* -* [`NotPaidOrder`](./src/polar_sdk/models/notpaidorder.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 183 methods.* -* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 183 methods.* -* [`CustomerNotReady`](./src/polar_sdk/models/customernotready.py): Customer is not ready to confirm a payment method. Status code `400`. Applicable to 1 of 183 methods.* -* [`PaymentMethodInUseByActiveSubscription`](./src/polar_sdk/models/paymentmethodinusebyactivesubscription.py): Payment method is used by active subscription(s). Status code `400`. Applicable to 1 of 183 methods.* -* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 183 methods.* -* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 183 methods.* -* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 183 methods.* -* [`ManualRetryLimitExceeded`](./src/polar_sdk/models/manualretrylimitexceeded.py): Manual retry limit exceeded. Status code `429`. Applicable to 1 of 183 methods.* +* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 88 of 185 methods.* +* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 185 methods.* +* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 185 methods.* +* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 185 methods.* +* [`PaymentFailed`](./src/polar_sdk/models/paymentfailed.py): Status code `402`. Applicable to 3 of 185 methods.* +* [`AlreadyActiveSubscriptionError`](./src/polar_sdk/models/alreadyactivesubscriptionerror.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 185 methods.* +* [`NotOpenCheckout`](./src/polar_sdk/models/notopencheckout.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 185 methods.* +* [`PaymentNotReady`](./src/polar_sdk/models/paymentnotready.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 185 methods.* +* [`TrialAlreadyRedeemed`](./src/polar_sdk/models/trialalreadyredeemed.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 185 methods.* +* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 185 methods.* +* [`SubscriptionLocked`](./src/polar_sdk/models/subscriptionlocked.py): Subscription is pending an update. Status code `409`. Applicable to 2 of 185 methods.* +* [`MissingInvoiceBillingDetails`](./src/polar_sdk/models/missinginvoicebillingdetails.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 185 methods.* +* [`NotPaidOrder`](./src/polar_sdk/models/notpaidorder.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 185 methods.* +* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 185 methods.* +* [`PaymentMethodSetupFailed`](./src/polar_sdk/models/paymentmethodsetupfailed.py): The card was declined while setting up the payment method. Status code `400`. Applicable to 1 of 185 methods.* +* [`CustomerNotReady`](./src/polar_sdk/models/customernotready.py): Customer is not ready to confirm a payment method. Status code `400`. Applicable to 1 of 185 methods.* +* [`PaymentMethodInUseByActiveSubscription`](./src/polar_sdk/models/paymentmethodinusebyactivesubscription.py): Payment method is used by active subscription(s). Status code `400`. Applicable to 1 of 185 methods.* +* [`PaymentActionRequired`](./src/polar_sdk/models/paymentactionrequired.py): The charge failed, or requires customer authentication (e.g. a 3DS challenge) that can't be completed off-session. Status code `402`. Applicable to 1 of 185 methods.* +* [`OffSessionChargesNotEnabled`](./src/polar_sdk/models/offsessionchargesnotenabled.py): Off-session charges are not enabled for this organization, or its account can't currently accept payments. Status code `403`. Applicable to 1 of 185 methods.* +* [`OrganizationNotReadyForPayments`](./src/polar_sdk/models/organizationnotreadyforpayments.py): Off-session charges are not enabled for this organization, or its account can't currently accept payments. Status code `403`. Applicable to 1 of 185 methods.* +* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 185 methods.* +* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 185 methods.* +* [`OrderNotDraft`](./src/polar_sdk/models/ordernotdraft.py): The order is not in `draft` status. Status code `412`. Applicable to 1 of 185 methods.* +* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 185 methods.* +* [`ManualRetryLimitExceeded`](./src/polar_sdk/models/manualretrylimitexceeded.py): Manual retry limit exceeded. Status code `429`. Applicable to 1 of 185 methods.* * [`ResponseValidationError`](./src/polar_sdk/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
@@ -665,7 +672,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -686,7 +693,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -797,7 +804,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -886,7 +893,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items diff --git a/RELEASES.md b/RELEASES.md index 26d97c62..9e2d0952 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1123,4 +1123,14 @@ Based on: ### Generated - [python v0.31.5] . ### Releases -- [PyPI v0.31.5] https://pypi.org/project/polar-sdk/0.31.5 - . \ No newline at end of file +- [PyPI v0.31.5] https://pypi.org/project/polar-sdk/0.31.5 - . + +## 2026-06-03 00:50:10 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.648.0 (2.737.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.31.6] . +### Releases +- [PyPI v0.31.6] https://pypi.org/project/polar-sdk/0.31.6 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index edd08b93..0824f2c4 100644 --- a/USAGE.md +++ b/USAGE.md @@ -8,7 +8,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items @@ -31,7 +31,7 @@ async def main(): access_token="", ) as polar: - res = await polar.organizations.list_async(page=1, limit=10) + res = await polar.organizations.list_organizations_async(page=1, limit=10) while res is not None: # Handle items diff --git a/codeSamples.yaml b/codeSamples.yaml index 569318ce..e06a9870 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -879,6 +879,12 @@ actions: - "lang": "python" "label": "Python (SDK)" "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.list(organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\", page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + - target: $["paths"]["/v1/orders/"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.create(request={\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"customer_id\": \"\",\n \"product_id\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/orders/export"]["get"] update: "x-codeSamples": @@ -897,6 +903,12 @@ actions: - "lang": "python" "label": "Python (SDK)" "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.update(id=\"\", order_update={\n \"billing_address\": {\n \"country\": polar_sdk.AddressInputCountryAlpha2Input.US,\n },\n })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/orders/{id}/finalize"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.finalize(id=\"\", order_finalize={})\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/orders/{id}/invoice"]["get"] update: "x-codeSamples": @@ -944,7 +956,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.organizations.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.organizations.list_organizations(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/organizations/"]["post"] update: "x-codeSamples": @@ -1220,25 +1232,25 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n timestamp=parse_datetime(\"2025-08-21T06:55:49.348Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-01-02T23:31:01.991Z\"),\n modified_at=parse_datetime(\"2026-11-09T23:45:36.352Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.PURCHASE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-08-09T17:02:40.706Z\"),\n modified_at=parse_datetime(\"2026-10-06T19:34:47.732Z\"),\n metadata={\n \"key\": 701529,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=None,\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-30T16:49:49.935Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2024-10-20T21:28:56.316Z\"),\n modified_at=parse_datetime(\"2025-06-10T22:36:12.736Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=703327,\n name=\"\",\n description=\"accidentally omelet statement\",\n visibility=polar_sdk.ProductVisibility.DRAFT,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=525458,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-03-11T18:30:15.526Z\"),\n modified_at=parse_datetime(\"2024-01-30T13:01:14.788Z\"),\n id=\"\",\n metadata={\n \"key\": True,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-01-18T04:35:27.509Z\"),\n ends_at=parse_datetime(\"2025-10-09T00:43:35.864Z\"),\n max_redemptions=623984,\n redemptions_count=564618,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n timestamp=parse_datetime(\"2025-08-21T06:55:49.348Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-01-02T23:31:01.991Z\"),\n modified_at=parse_datetime(\"2026-11-09T23:45:36.352Z\"),\n status=polar_sdk.OrderStatus.DRAFT,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.PURCHASE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 9213.65,\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-07-26T23:28:05.716Z\"),\n modified_at=parse_datetime(\"2026-02-07T21:01:19.424Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2026-06-03T19:46:15.179Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2025-07-30T20:36:36.637Z\"),\n modified_at=parse_datetime(\"2024-10-17T19:16:06.791Z\"),\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=213971,\n name=\"\",\n description=None,\n visibility=polar_sdk.ProductVisibility.PUBLIC,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=673056,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.FIXED,\n amount=1000,\n currency=\"usd\",\n amounts={\n \"eur\": 900,\n \"usd\": 1000,\n },\n created_at=parse_datetime(\"2026-10-18T21:36:17.336Z\"),\n modified_at=parse_datetime(\"2025-11-12T14:01:42.212Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-08-11T07:51:56.436Z\"),\n ends_at=parse_datetime(\"2024-05-05T17:33:16.103Z\"),\n max_redemptions=254706,\n redemptions_count=852483,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 5558.24,\n },\n created_at=parse_datetime(\"2025-05-10T05:33:12.990Z\"),\n modified_at=parse_datetime(\"2025-10-27T02:55:38.822Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=415154,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2026-03-16T08:37:15.714Z\"),\n current_period_end=parse_datetime(\"2024-01-30T13:01:14.788Z\"),\n trial_start=parse_datetime(\"2026-12-27T11:04:16.188Z\"),\n trial_end=parse_datetime(\"2024-06-30T09:05:58.012Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2026-03-18T15:38:59.923Z\"),\n started_at=parse_datetime(\"2025-11-16T22:02:37.250Z\"),\n ends_at=parse_datetime(\"2025-09-10T19:42:40.294Z\"),\n ended_at=None,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=None,\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.paid"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_paid_post(request=polar_sdk.WebhookOrderPaidPayload(\n timestamp=parse_datetime(\"2026-12-05T07:44:21.172Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-07-27T09:45:49.517Z\"),\n modified_at=parse_datetime(\"2025-12-13T20:55:19.644Z\"),\n status=polar_sdk.OrderStatus.VOID,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_UPDATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": \"\",\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-07-24T12:09:26.716Z\"),\n modified_at=parse_datetime(\"2024-04-03T05:45:29.640Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-20T08:16:19.561Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": False,\n },\n id=\"\",\n created_at=parse_datetime(\"2024-12-19T02:23:05.399Z\"),\n modified_at=parse_datetime(\"2024-05-17T09:50:39.456Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=928538,\n name=\"\",\n description=\"peony um portray since frank rudely mask\",\n visibility=polar_sdk.ProductVisibility.PUBLIC,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=None,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-01-18T14:11:17.140Z\"),\n modified_at=parse_datetime(\"2025-01-31T23:45:02.476Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2026-12-02T15:10:04.656Z\"),\n ends_at=parse_datetime(\"2025-10-30T18:07:50.242Z\"),\n max_redemptions=568756,\n redemptions_count=465215,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2024-11-23T17:59:56.836Z\"),\n modified_at=parse_datetime(\"2026-08-12T18:11:29.547Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=727805,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2025-09-10T07:58:34.888Z\"),\n current_period_end=parse_datetime(\"2024-09-10T23:54:04.035Z\"),\n trial_start=parse_datetime(\"2024-09-15T09:43:57.152Z\"),\n trial_end=parse_datetime(\"2025-08-15T07:25:23.875Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2026-06-10T20:57:22.896Z\"),\n started_at=None,\n ends_at=parse_datetime(\"2024-12-06T15:09:08.144Z\"),\n ended_at=parse_datetime(\"2024-11-19T10:20:23.628Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=None,\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-12-01T06:46:04.196Z\"),\n modified_at=parse_datetime(\"2025-06-19T05:54:14.128Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_paid_post(request=polar_sdk.WebhookOrderPaidPayload(\n timestamp=parse_datetime(\"2026-12-05T07:44:21.172Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-07-27T09:45:49.517Z\"),\n modified_at=parse_datetime(\"2025-12-13T20:55:19.644Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_UPDATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-07-24T12:09:26.716Z\"),\n modified_at=parse_datetime(\"2024-04-03T05:45:29.640Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-20T08:16:19.561Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": False,\n },\n id=\"\",\n created_at=parse_datetime(\"2024-12-19T02:23:05.399Z\"),\n modified_at=parse_datetime(\"2024-05-17T09:50:39.456Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=928538,\n name=\"\",\n description=\"peony um portray since frank rudely mask\",\n visibility=polar_sdk.ProductVisibility.PUBLIC,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=None,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-01-18T14:11:17.140Z\"),\n modified_at=parse_datetime(\"2025-01-31T23:45:02.476Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2026-12-02T15:10:04.656Z\"),\n ends_at=parse_datetime(\"2025-10-30T18:07:50.242Z\"),\n max_redemptions=568756,\n redemptions_count=465215,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2024-11-23T17:59:56.836Z\"),\n modified_at=parse_datetime(\"2026-08-12T18:11:29.547Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=727805,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2025-09-10T07:58:34.888Z\"),\n current_period_end=parse_datetime(\"2024-09-10T23:54:04.035Z\"),\n trial_start=parse_datetime(\"2024-09-15T09:43:57.152Z\"),\n trial_end=parse_datetime(\"2025-08-15T07:25:23.875Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2026-06-10T20:57:22.896Z\"),\n started_at=None,\n ends_at=parse_datetime(\"2024-12-06T15:09:08.144Z\"),\n ended_at=parse_datetime(\"2024-11-19T10:20:23.628Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=None,\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-12-01T06:46:04.196Z\"),\n modified_at=parse_datetime(\"2025-06-19T05:54:14.128Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.refunded"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_refunded_post(request=polar_sdk.WebhookOrderRefundedPayload(\n timestamp=parse_datetime(\"2025-07-23T18:00:11.615Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-03-19T11:53:59.744Z\"),\n modified_at=parse_datetime(\"2025-12-01T04:03:14.906Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-03-10T03:56:20.855Z\"),\n modified_at=parse_datetime(\"2026-04-02T07:55:28.069Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-08-19T02:54:30.835Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=None,\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=310259,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n amounts={\n \"eur\": 900,\n \"usd\": 1000,\n },\n created_at=parse_datetime(\"2024-01-26T21:26:48.872Z\"),\n modified_at=parse_datetime(\"2024-01-16T07:26:04.196Z\"),\n id=\"\",\n metadata={\n \"key\": 4016.73,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2026-09-14T03:05:33.012Z\"),\n ends_at=None,\n max_redemptions=211875,\n redemptions_count=188354,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2025-12-08T10:40:25.472Z\"),\n modified_at=parse_datetime(\"2024-12-19T17:19:16.701Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_refunded_post(request=polar_sdk.WebhookOrderRefundedPayload(\n timestamp=parse_datetime(\"2025-07-23T18:00:11.615Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-03-19T11:53:59.744Z\"),\n modified_at=parse_datetime(\"2025-12-01T04:03:14.906Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 7503.02,\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-02-02T04:00:16.399Z\"),\n modified_at=parse_datetime(\"2025-05-12T21:39:32.718Z\"),\n metadata={\n \"key\": 494.76,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=None,\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": \"\",\n },\n id=\"\",\n created_at=parse_datetime(\"2024-11-14T20:33:24.727Z\"),\n modified_at=None,\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=718503,\n name=\"\",\n description=\"that sensitize helpfully usher barring frequent kowtow sock boohoo so\",\n visibility=polar_sdk.ProductVisibility.PRIVATE,\n recurring_interval=None,\n recurring_interval_count=477690,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=329481,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-05-28T09:04:03.584Z\"),\n modified_at=None,\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-12T23:30:42.892Z\"),\n ends_at=parse_datetime(\"2026-01-12T08:55:29.027Z\"),\n max_redemptions=287547,\n redemptions_count=818398,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 348392,\n },\n created_at=parse_datetime(\"2025-11-02T04:41:56.340Z\"),\n modified_at=parse_datetime(\"2024-07-14T14:19:42.078Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=366035,\n status=polar_sdk.SubscriptionStatus.UNPAID,\n current_period_start=parse_datetime(\"2025-10-07T20:29:14.854Z\"),\n current_period_end=parse_datetime(\"2025-06-01T22:10:54.514Z\"),\n trial_start=None,\n trial_end=parse_datetime(\"2025-06-25T04:37:29.420Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2026-06-19T17:25:09.928Z\"),\n started_at=parse_datetime(\"2025-12-22T05:39:47.270Z\"),\n ends_at=parse_datetime(\"2024-11-09T02:18:02.434Z\"),\n ended_at=parse_datetime(\"2025-03-09T07:27:38.032Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=None,\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2026-06-15T09:12:55.866Z\"),\n modified_at=parse_datetime(\"2024-03-17T21:35:07.139Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.updated"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_updated_post(request=polar_sdk.WebhookOrderUpdatedPayload(\n timestamp=parse_datetime(\"2024-10-24T00:08:50.290Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-04-30T23:35:35.375Z\"),\n modified_at=parse_datetime(\"2026-06-01T02:02:46.580Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-12-03T13:57:13.515Z\"),\n modified_at=parse_datetime(\"2025-03-08T23:35:59.086Z\"),\n metadata={\n \"key\": False,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-10-27T19:38:51.490Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=None,\n discount=None,\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-06-25T15:51:37.068Z\"),\n modified_at=parse_datetime(\"2025-07-10T12:45:44.731Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_updated_post(request=polar_sdk.WebhookOrderUpdatedPayload(\n timestamp=parse_datetime(\"2024-10-24T00:08:50.290Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-04-30T23:35:35.375Z\"),\n modified_at=parse_datetime(\"2026-06-01T02:02:46.580Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 395058,\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-02-15T17:44:03.209Z\"),\n modified_at=parse_datetime(\"2025-10-23T02:39:12.424Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-03-10T05:58:05.184Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=None,\n discount=None,\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2024-09-08T23:29:46.282Z\"),\n modified_at=parse_datetime(\"2024-12-06T14:52:42.853Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=887482,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2026-06-11T19:05:49.465Z\"),\n current_period_end=parse_datetime(\"2026-09-25T12:24:57.702Z\"),\n trial_start=parse_datetime(\"2025-10-18T03:50:03.596Z\"),\n trial_end=parse_datetime(\"2026-09-02T02:15:18.698Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-05-01T21:40:14.334Z\"),\n started_at=parse_datetime(\"2026-06-21T08:18:53.167Z\"),\n ends_at=parse_datetime(\"2026-12-02T23:08:13.339Z\"),\n ended_at=parse_datetime(\"2024-03-30T21:02:29.805Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.UNUSED,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2025-02-19T16:08:02.133Z\"),\n modified_at=parse_datetime(\"2025-08-24T19:13:05.462Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=None,\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["organization.updated"]["post"] update: "x-codeSamples": diff --git a/docs/models/customerorder.md b/docs/models/customerorder.md index 5762a262..c496cb1b 100644 --- a/docs/models/customerorder.md +++ b/docs/models/customerorder.md @@ -23,7 +23,7 @@ | `billing_reason` | [models.OrderBillingReason](../models/orderbillingreason.md) | :heavy_check_mark: | N/A | | | `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. | | | `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | -| `invoice_number` | *str* | :heavy_check_mark: | The invoice number associated with this order. | | +| `invoice_number` | *Nullable[str]* | :heavy_check_mark: | The invoice number associated with this order. `null` while the order is in `draft` status; assigned at finalize. | | | `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | | `receipt_number` | *Nullable[str]* | :heavy_check_mark: | The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint. | | | `seats` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of seats purchased (for seat-based one-time orders). | | diff --git a/docs/models/customerslistrequest.md b/docs/models/customerslistrequest.md index 56d986a7..127b3873 100644 --- a/docs/models/customerslistrequest.md +++ b/docs/models/customerslistrequest.md @@ -8,6 +8,7 @@ | `organization_id` | [OptionalNullable[models.CustomersListQueryParamOrganizationIDFilter]](../models/customerslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by exact email. | | `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name, email, or external ID. | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by active customers, i.e. customers with at least one trialing, active or past_due subscription. | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | | `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | | `sorting` | List[[models.CustomerSortProperty](../models/customersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | diff --git a/docs/models/offsessionchargesnotenabled.md b/docs/models/offsessionchargesnotenabled.md new file mode 100644 index 00000000..7de230dd --- /dev/null +++ b/docs/models/offsessionchargesnotenabled.md @@ -0,0 +1,9 @@ +# OffSessionChargesNotEnabled + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `error` | *Literal["OffSessionChargesNotEnabled"]* | :heavy_check_mark: | N/A | OffSessionChargesNotEnabled | +| `detail` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/order.md b/docs/models/order.md index 4b031823..277fe888 100644 --- a/docs/models/order.md +++ b/docs/models/order.md @@ -23,7 +23,7 @@ | `billing_reason` | [models.OrderBillingReason](../models/orderbillingreason.md) | :heavy_check_mark: | N/A | | | `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. | | | `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | -| `invoice_number` | *str* | :heavy_check_mark: | The invoice number associated with this order. | | +| `invoice_number` | *Nullable[str]* | :heavy_check_mark: | The invoice number associated with this order. `null` while the order is in `draft` status; assigned at finalize. | | | `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | | `receipt_number` | *Nullable[str]* | :heavy_check_mark: | The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint. | | | `seats` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of seats purchased (for seat-based one-time orders). | | diff --git a/docs/models/ordercreate.md b/docs/models/ordercreate.md new file mode 100644 index 00000000..06292900 --- /dev/null +++ b/docs/models/ordercreate.md @@ -0,0 +1,15 @@ +# OrderCreate + +Schema to create a draft order for an off-session charge. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `custom_field_data` | Dict[str, [Nullable[models.OrderCreateCustomFieldData]](../models/ordercreatecustomfielddata.md)] | :heavy_minus_sign: | Key-value object storing custom field values. | | +| `metadata` | Dict[str, [models.OrderCreateMetadata](../models/ordercreatemetadata.md)] | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A floating-point number
* A boolean

You can store up to **50 key-value pairs**. | | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization the order belongs to. **Required unless you use an organization token.** The customer and product must belong to this organization. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `customer_id` | *str* | :heavy_check_mark: | The ID of the customer the order is for. Must belong to the order's organization. | | +| `product_id` | *str* | :heavy_check_mark: | The ID of the one-time, fixed-price product to charge for. Must belong to the order's organization. Subscription, seat-based, and pay-what-you-want products are not supported. | | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | The currency to charge in (ISO 4217, lowercase, e.g. `usd`). Defaults to the organization's default currency; specify it to force a different one, or when the product isn't priced in the organization's default currency. | | \ No newline at end of file diff --git a/docs/models/ordercreatecustomfielddata.md b/docs/models/ordercreatecustomfielddata.md new file mode 100644 index 00000000..525a312d --- /dev/null +++ b/docs/models/ordercreatecustomfielddata.md @@ -0,0 +1,29 @@ +# OrderCreateCustomFieldData + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + +### `datetime` + +```python +value: datetime = /* values here */ +``` + diff --git a/docs/models/ordercreatemetadata.md b/docs/models/ordercreatemetadata.md new file mode 100644 index 00000000..f4bd0a9d --- /dev/null +++ b/docs/models/ordercreatemetadata.md @@ -0,0 +1,29 @@ +# OrderCreateMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/orderfinalize.md b/docs/models/orderfinalize.md new file mode 100644 index 00000000..c9cf1107 --- /dev/null +++ b/docs/models/orderfinalize.md @@ -0,0 +1,10 @@ +# OrderFinalize + +Schema to finalize a draft order and trigger an off-session charge. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `payment_method_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the payment method to charge. Must belong to the order's customer. Falls back to the customer's default payment method when unset. | \ No newline at end of file diff --git a/docs/models/ordernotdraft.md b/docs/models/ordernotdraft.md new file mode 100644 index 00000000..1a8a2523 --- /dev/null +++ b/docs/models/ordernotdraft.md @@ -0,0 +1,9 @@ +# OrderNotDraft + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `error` | *Literal["OrderNotDraft"]* | :heavy_check_mark: | N/A | OrderNotDraft | +| `detail` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/ordersfinalizerequest.md b/docs/models/ordersfinalizerequest.md new file mode 100644 index 00000000..92772f42 --- /dev/null +++ b/docs/models/ordersfinalizerequest.md @@ -0,0 +1,9 @@ +# OrdersFinalizeRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `order_finalize` | [models.OrderFinalize](../models/orderfinalize.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ordersfinalizeresponse402ordersfinalize.md b/docs/models/ordersfinalizeresponse402ordersfinalize.md new file mode 100644 index 00000000..44068c30 --- /dev/null +++ b/docs/models/ordersfinalizeresponse402ordersfinalize.md @@ -0,0 +1,19 @@ +# OrdersFinalizeResponse402OrdersFinalize + +The charge failed, or requires customer authentication (e.g. a 3DS challenge) that can't be completed off-session. + + +## Supported Types + +### `models.PaymentFailed` + +```python +value: models.PaymentFailed = /* values here */ +``` + +### `models.PaymentActionRequired` + +```python +value: models.PaymentActionRequired = /* values here */ +``` + diff --git a/docs/models/ordersfinalizeresponse403ordersfinalize.md b/docs/models/ordersfinalizeresponse403ordersfinalize.md new file mode 100644 index 00000000..fb95f5f1 --- /dev/null +++ b/docs/models/ordersfinalizeresponse403ordersfinalize.md @@ -0,0 +1,19 @@ +# OrdersFinalizeResponse403OrdersFinalize + +Off-session charges are not enabled for this organization, or its account can't currently accept payments. + + +## Supported Types + +### `models.OffSessionChargesNotEnabled` + +```python +value: models.OffSessionChargesNotEnabled = /* values here */ +``` + +### `models.OrganizationNotReadyForPayments` + +```python +value: models.OrganizationNotReadyForPayments = /* values here */ +``` + diff --git a/docs/models/orderstatus.md b/docs/models/orderstatus.md index c726f9d4..058ae349 100644 --- a/docs/models/orderstatus.md +++ b/docs/models/orderstatus.md @@ -5,6 +5,7 @@ | Name | Value | | -------------------- | -------------------- | +| `DRAFT` | draft | | `PENDING` | pending | | `PAID` | paid | | `REFUNDED` | refunded | diff --git a/docs/models/organizationfeaturesettings.md b/docs/models/organizationfeaturesettings.md index 84033308..124ffa4c 100644 --- a/docs/models/organizationfeaturesettings.md +++ b/docs/models/organizationfeaturesettings.md @@ -3,14 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `issue_funding_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has issue funding enabled | -| `seat_based_pricing_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has seat-based pricing enabled | -| `wallets_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has Wallets enabled | -| `member_model_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has the Member model enabled | -| `checkout_localization_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has checkout localization enabled | -| `account_review_v2_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization sees the new account review checklist UI. | -| `overview_metrics` | List[*str*] | :heavy_minus_sign: | Ordered list of metric slugs shown on the dashboard overview. | -| `reset_proration_behavior_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has access to reset proration behavior. | -| `billing_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has billing enabled | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `issue_funding_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has issue funding enabled | +| `seat_based_pricing_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has seat-based pricing enabled | +| `wallets_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has Wallets enabled | +| `member_model_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has the Member model enabled | +| `checkout_localization_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has checkout localization enabled | +| `account_review_v2_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization sees the new account review checklist UI. | +| `overview_metrics` | List[*str*] | :heavy_minus_sign: | Ordered list of metric slugs shown on the dashboard overview. | +| `reset_proration_behavior_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has access to reset proration behavior. | +| `off_session_charges_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization can create and finalize draft orders via the API (off-session charges against a saved payment method). | +| `billing_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has billing enabled | \ No newline at end of file diff --git a/docs/models/organizationnotreadyforpayments.md b/docs/models/organizationnotreadyforpayments.md new file mode 100644 index 00000000..64c45061 --- /dev/null +++ b/docs/models/organizationnotreadyforpayments.md @@ -0,0 +1,9 @@ +# OrganizationNotReadyForPayments + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `error` | *Literal["OrganizationNotReadyForPayments"]* | :heavy_check_mark: | N/A | OrganizationNotReadyForPayments | +| `detail` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/paymentactionrequired.md b/docs/models/paymentactionrequired.md new file mode 100644 index 00000000..16fc9a05 --- /dev/null +++ b/docs/models/paymentactionrequired.md @@ -0,0 +1,9 @@ +# PaymentActionRequired + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `error` | *Literal["PaymentActionRequired"]* | :heavy_check_mark: | N/A | PaymentActionRequired | +| `detail` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/paymentmethodsetupfailed.md b/docs/models/paymentmethodsetupfailed.md new file mode 100644 index 00000000..365eaa0d --- /dev/null +++ b/docs/models/paymentmethodsetupfailed.md @@ -0,0 +1,9 @@ +# PaymentMethodSetupFailed + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `error` | *Literal["PaymentMethodSetupFailed"]* | :heavy_check_mark: | N/A | PaymentMethodSetupFailed | +| `detail` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/paymentslistqueryparamcustomeridfilter.md b/docs/models/paymentslistqueryparamcustomeridfilter.md new file mode 100644 index 00000000..c71baed6 --- /dev/null +++ b/docs/models/paymentslistqueryparamcustomeridfilter.md @@ -0,0 +1,19 @@ +# PaymentsListQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/paymentslistrequest.md b/docs/models/paymentslistrequest.md index c67b0186..e6371f59 100644 --- a/docs/models/paymentslistrequest.md +++ b/docs/models/paymentslistrequest.md @@ -8,6 +8,7 @@ | `organization_id` | [OptionalNullable[models.PaymentsListQueryParamOrganizationIDFilter]](../models/paymentslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `checkout_id` | [OptionalNullable[models.PaymentsListQueryParamCheckoutIDFilter]](../models/paymentslistqueryparamcheckoutidfilter.md) | :heavy_minus_sign: | Filter by checkout ID. | | `order_id` | [OptionalNullable[models.PaymentsListQueryParamOrderIDFilter]](../models/paymentslistqueryparamorderidfilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `customer_id` | [OptionalNullable[models.PaymentsListQueryParamCustomerIDFilter]](../models/paymentslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | | `status` | [OptionalNullable[models.PaymentsListQueryParamStatusFilter]](../models/paymentslistqueryparamstatusfilter.md) | :heavy_minus_sign: | Filter by payment status. | | `method` | [OptionalNullable[models.MethodFilter]](../models/methodfilter.md) | :heavy_minus_sign: | Filter by payment method. | | `customer_email` | [OptionalNullable[models.CustomerEmailFilter]](../models/customeremailfilter.md) | :heavy_minus_sign: | Filter by customer email. | diff --git a/docs/models/productpricecustomcreate.md b/docs/models/productpricecustomcreate.md index 4f989daa..43624827 100644 --- a/docs/models/productpricecustomcreate.md +++ b/docs/models/productpricecustomcreate.md @@ -5,11 +5,11 @@ Schema to create a pay-what-you-want price. ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount_type` | *Literal["custom"]* | :heavy_check_mark: | N/A | -| `price_currency` | [Optional[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | N/A | -| `tax_behavior` | [OptionalNullable[models.TaxBehaviorOption]](../models/taxbehavioroption.md) | :heavy_minus_sign: | The tax behavior of the price. If not set, it will default to the organization's default tax behavior. | -| `minimum_amount` | *Optional[int]* | :heavy_minus_sign: | The minimum amount the customer can pay. If set to 0, the price is 'free or pay what you want' and $0 is accepted. If set to a value below the minimum price amount for the currency, it will be rejected. Defaults to the minimum price amount for the currency. Minimum per currency:
- USD: 0.5
- AED: 2
- ALL: 50
- AMD: 200
- AOA: 500
- ARS: 750
- AUD: 0.7
- AWG: 1
- AZN: 1
- BAM: 1
- BBD: 2
- BDT: 70
- BIF: 2,000
- BMD: 1
- BND: 1
- BOB: 5
- BRL: 2.5
- BSD: 1
- BWP: 10
- BZD: 2
- CAD: 0.7
- CDF: 2,000
- CHF: 0.5
- CLP: 500
- CNY: 5
- COP: 2,000
- CRC: 300
- CVE: 50
- CZK: 15
- DJF: 100
- DKK: 3.2
- DOP: 40
- DZD: 70
- EGP: 30
- ETB: 80
- EUR: 0.5
- FJD: 2
- FKP: 1
- GBP: 0.4
- GEL: 2
- GNF: 5,000
- GIP: 1
- GMD: 40
- GTQ: 5
- GYD: 200
- HKD: 4
- HNL: 20
- HTG: 70
- HUF: 175
- IDR: 9,000
- ILS: 1.5
- INR: 60
- ISK: 70
- JMD: 80
- JPY: 80
- KES: 70
- KGS: 50
- KHR: 3,000
- KMF: 500
- KRW: 800
- KYD: 1
- KZT: 300
- LAK: 20,000
- LKR: 200
- LRD: 100
- LSL: 10
- MAD: 5
- MDL: 10
- MGA: 3,000
- MKD: 50
- MNT: 2,000
- MOP: 5
- MUR: 50
- MVR: 8
- MXN: 9
- MWK: 1,000
- MYR: 2
- MZN: 50
- NAD: 10
- NGN: 700
- NIO: 20
- NOK: 5
- NPR: 80
- NZD: 0.9
- PAB: 1
- PEN: 2
- PGK: 3
- PHP: 35
- PKR: 200
- PLN: 2
- PYG: 4,000
- QAR: 2
- RON: 2.5
- RSD: 60
- RWF: 1,000
- SAR: 2
- SBD: 4
- SCR: 8
- SEK: 5
- SGD: 0.7
- SHP: 1
- SOS: 500
- SRD: 20
- SZL: 10
- THB: 20
- TJS: 5
- TOP: 2
- TRY: 30
- TTD: 4
- TWD: 20
- TZS: 2,000
- UAH: 30
- UGX: 2,000
- UYU: 20
- UZS: 7,000
- VND: 20,000
- VUV: 100
- WST: 2
- XAF: 500
- XCD: 2
- XCG: 1
- XOF: 500
- XPF: 100
- YER: 200
- ZAR: 9
- ZMW: 10 | -| `maximum_amount` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum amount the customer can pay. | -| `preset_amount` | *OptionalNullable[int]* | :heavy_minus_sign: | The initial amount shown to the customer. If 0, the customer will see $0 as the default. If set to a value below the minimum price amount for the currency, it will be rejected.Minimum per currency:
- USD: 0.5
- AED: 2
- ALL: 50
- AMD: 200
- AOA: 500
- ARS: 750
- AUD: 0.7
- AWG: 1
- AZN: 1
- BAM: 1
- BBD: 2
- BDT: 70
- BIF: 2,000
- BMD: 1
- BND: 1
- BOB: 5
- BRL: 2.5
- BSD: 1
- BWP: 10
- BZD: 2
- CAD: 0.7
- CDF: 2,000
- CHF: 0.5
- CLP: 500
- CNY: 5
- COP: 2,000
- CRC: 300
- CVE: 50
- CZK: 15
- DJF: 100
- DKK: 3.2
- DOP: 40
- DZD: 70
- EGP: 30
- ETB: 80
- EUR: 0.5
- FJD: 2
- FKP: 1
- GBP: 0.4
- GEL: 2
- GNF: 5,000
- GIP: 1
- GMD: 40
- GTQ: 5
- GYD: 200
- HKD: 4
- HNL: 20
- HTG: 70
- HUF: 175
- IDR: 9,000
- ILS: 1.5
- INR: 60
- ISK: 70
- JMD: 80
- JPY: 80
- KES: 70
- KGS: 50
- KHR: 3,000
- KMF: 500
- KRW: 800
- KYD: 1
- KZT: 300
- LAK: 20,000
- LKR: 200
- LRD: 100
- LSL: 10
- MAD: 5
- MDL: 10
- MGA: 3,000
- MKD: 50
- MNT: 2,000
- MOP: 5
- MUR: 50
- MVR: 8
- MXN: 9
- MWK: 1,000
- MYR: 2
- MZN: 50
- NAD: 10
- NGN: 700
- NIO: 20
- NOK: 5
- NPR: 80
- NZD: 0.9
- PAB: 1
- PEN: 2
- PGK: 3
- PHP: 35
- PKR: 200
- PLN: 2
- PYG: 4,000
- QAR: 2
- RON: 2.5
- RSD: 60
- RWF: 1,000
- SAR: 2
- SBD: 4
- SCR: 8
- SEK: 5
- SGD: 0.7
- SHP: 1
- SOS: 500
- SRD: 20
- SZL: 10
- THB: 20
- TJS: 5
- TOP: 2
- TRY: 30
- TTD: 4
- TWD: 20
- TZS: 2,000
- UAH: 30
- UGX: 2,000
- UYU: 20
- UZS: 7,000
- VND: 20,000
- VUV: 100
- WST: 2
- XAF: 500
- XCD: 2
- XCG: 1
- XOF: 500
- XPF: 100
- YER: 200
- ZAR: 9
- ZMW: 10 | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount_type` | *Literal["custom"]* | :heavy_check_mark: | N/A | +| `price_currency` | [Optional[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | N/A | +| `tax_behavior` | [OptionalNullable[models.TaxBehaviorOption]](../models/taxbehavioroption.md) | :heavy_minus_sign: | The tax behavior of the price. If not set, it will default to the organization's default tax behavior. | +| `minimum_amount` | *Optional[int]* | :heavy_minus_sign: | The minimum amount the customer can pay. If set to 0, the price is 'free or pay what you want' and $0 is accepted. If set to a value below the minimum price amount for the currency, it will be rejected. Defaults to the minimum price amount for the currency. Minimum per currency:
- USD: 0.5
- AED: 2
- ALL: 50
- AMD: 200
- AOA: 500
- ARS: 750
- AUD: 0.7
- AWG: 1
- AZN: 1
- BAM: 1
- BBD: 2
- BDT: 70
- BIF: 2,000
- BMD: 1
- BND: 1
- BOB: 5
- BRL: 2.5
- BSD: 1
- BWP: 10
- BZD: 2
- CAD: 0.7
- CDF: 2,000
- CHF: 0.5
- CLP: 500
- CNY: 5
- COP: 2,000
- CRC: 300
- CVE: 50
- CZK: 15
- DJF: 100
- DKK: 3.2
- DOP: 40
- DZD: 70
- EGP: 30
- ETB: 80
- EUR: 0.5
- FJD: 2
- FKP: 1
- GBP: 0.4
- GEL: 2
- GNF: 5,000
- GIP: 1
- GMD: 40
- GTQ: 5
- GYD: 200
- HKD: 4
- HNL: 20
- HTG: 70
- HUF: 175
- IDR: 9,000
- ILS: 1.5
- INR: 60
- ISK: 70
- JMD: 80
- JPY: 80
- KES: 70
- KGS: 50
- KHR: 3,000
- KMF: 500
- KRW: 800
- KYD: 1
- KZT: 300
- LAK: 20,000
- LKR: 200
- LRD: 100
- LSL: 10
- MAD: 5
- MDL: 10
- MGA: 3,000
- MKD: 50
- MNT: 2,000
- MOP: 5
- MUR: 50
- MVR: 8
- MXN: 9
- MWK: 1,000
- MYR: 2
- MZN: 50
- NAD: 10
- NGN: 700
- NIO: 20
- NOK: 5
- NPR: 80
- NZD: 0.9
- PAB: 1
- PEN: 2
- PGK: 3
- PHP: 35
- PKR: 200
- PLN: 2
- PYG: 4,000
- QAR: 2
- RON: 2.5
- RSD: 60
- RWF: 1,000
- SAR: 2
- SBD: 4
- SCR: 8
- SEK: 5
- SGD: 0.7
- SHP: 1
- SOS: 500
- SRD: 20
- SZL: 10
- THB: 20
- TJS: 5
- TOP: 2
- TRY: 30
- TTD: 4
- TWD: 20
- TZS: 2,000
- UAH: 30
- UGX: 2,000
- UYU: 20
- UZS: 7,000
- VND: 20,000
- VUV: 100
- WST: 2
- XAF: 500
- XCD: 2
- XCG: 1
- XOF: 500
- XPF: 100
- YER: 200
- ZAR: 9
- ZMW: 10
- Other currencies: 50 minor units | +| `maximum_amount` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum amount the customer can pay. Maximum per currency:
- USD: 999,999.99
- EUR: 999,999.99
- GBP: 999,999.99
- ARS: 1,400,000
- CDF: 2,800,000
- COP: 4,000,000
- IDR: 16,000,000
- KHR: 4,000,000
- LAK: 21,000,000
- MNT: 3,500,000
- MWK: 1,750,000
- NGN: 1,550,000
- TZS: 2,500,000
- UGX: 3,700,000
- UZS: 12,500,000
- Other currencies: 99,999,999 minor units | +| `preset_amount` | *OptionalNullable[int]* | :heavy_minus_sign: | The initial amount shown to the customer. If 0, the customer will see $0 as the default. If set to a value below the minimum price amount for the currency, it will be rejected.Minimum per currency:
- USD: 0.5
- AED: 2
- ALL: 50
- AMD: 200
- AOA: 500
- ARS: 750
- AUD: 0.7
- AWG: 1
- AZN: 1
- BAM: 1
- BBD: 2
- BDT: 70
- BIF: 2,000
- BMD: 1
- BND: 1
- BOB: 5
- BRL: 2.5
- BSD: 1
- BWP: 10
- BZD: 2
- CAD: 0.7
- CDF: 2,000
- CHF: 0.5
- CLP: 500
- CNY: 5
- COP: 2,000
- CRC: 300
- CVE: 50
- CZK: 15
- DJF: 100
- DKK: 3.2
- DOP: 40
- DZD: 70
- EGP: 30
- ETB: 80
- EUR: 0.5
- FJD: 2
- FKP: 1
- GBP: 0.4
- GEL: 2
- GNF: 5,000
- GIP: 1
- GMD: 40
- GTQ: 5
- GYD: 200
- HKD: 4
- HNL: 20
- HTG: 70
- HUF: 175
- IDR: 9,000
- ILS: 1.5
- INR: 60
- ISK: 70
- JMD: 80
- JPY: 80
- KES: 70
- KGS: 50
- KHR: 3,000
- KMF: 500
- KRW: 800
- KYD: 1
- KZT: 300
- LAK: 20,000
- LKR: 200
- LRD: 100
- LSL: 10
- MAD: 5
- MDL: 10
- MGA: 3,000
- MKD: 50
- MNT: 2,000
- MOP: 5
- MUR: 50
- MVR: 8
- MXN: 9
- MWK: 1,000
- MYR: 2
- MZN: 50
- NAD: 10
- NGN: 700
- NIO: 20
- NOK: 5
- NPR: 80
- NZD: 0.9
- PAB: 1
- PEN: 2
- PGK: 3
- PHP: 35
- PKR: 200
- PLN: 2
- PYG: 4,000
- QAR: 2
- RON: 2.5
- RSD: 60
- RWF: 1,000
- SAR: 2
- SBD: 4
- SCR: 8
- SEK: 5
- SGD: 0.7
- SHP: 1
- SOS: 500
- SRD: 20
- SZL: 10
- THB: 20
- TJS: 5
- TOP: 2
- TRY: 30
- TTD: 4
- TWD: 20
- TZS: 2,000
- UAH: 30
- UGX: 2,000
- UYU: 20
- UZS: 7,000
- VND: 20,000
- VUV: 100
- WST: 2
- XAF: 500
- XCD: 2
- XCG: 1
- XOF: 500
- XPF: 100
- YER: 200
- ZAR: 9
- ZMW: 10
- Other currencies: 50 minor units | \ No newline at end of file diff --git a/docs/models/productpricefixedcreate.md b/docs/models/productpricefixedcreate.md index c5e44e3f..30b1cf92 100644 --- a/docs/models/productpricefixedcreate.md +++ b/docs/models/productpricefixedcreate.md @@ -5,9 +5,9 @@ Schema to create a fixed price. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount_type` | *Literal["fixed"]* | :heavy_check_mark: | N/A | -| `price_currency` | [Optional[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | N/A | -| `tax_behavior` | [OptionalNullable[models.TaxBehaviorOption]](../models/taxbehavioroption.md) | :heavy_minus_sign: | The tax behavior of the price. If not set, it will default to the organization's default tax behavior. | -| `price_amount` | *int* | :heavy_check_mark: | The price in cents.
Minimum amounts per currency:
- USD: 0.5
- AED: 2
- ALL: 50
- AMD: 200
- AOA: 500
- ARS: 750
- AUD: 0.7
- AWG: 1
- AZN: 1
- BAM: 1
- BBD: 2
- BDT: 70
- BIF: 2,000
- BMD: 1
- BND: 1
- BOB: 5
- BRL: 2.5
- BSD: 1
- BWP: 10
- BZD: 2
- CAD: 0.7
- CDF: 2,000
- CHF: 0.5
- CLP: 500
- CNY: 5
- COP: 2,000
- CRC: 300
- CVE: 50
- CZK: 15
- DJF: 100
- DKK: 3.2
- DOP: 40
- DZD: 70
- EGP: 30
- ETB: 80
- EUR: 0.5
- FJD: 2
- FKP: 1
- GBP: 0.4
- GEL: 2
- GNF: 5,000
- GIP: 1
- GMD: 40
- GTQ: 5
- GYD: 200
- HKD: 4
- HNL: 20
- HTG: 70
- HUF: 175
- IDR: 9,000
- ILS: 1.5
- INR: 60
- ISK: 70
- JMD: 80
- JPY: 80
- KES: 70
- KGS: 50
- KHR: 3,000
- KMF: 500
- KRW: 800
- KYD: 1
- KZT: 300
- LAK: 20,000
- LKR: 200
- LRD: 100
- LSL: 10
- MAD: 5
- MDL: 10
- MGA: 3,000
- MKD: 50
- MNT: 2,000
- MOP: 5
- MUR: 50
- MVR: 8
- MXN: 9
- MWK: 1,000
- MYR: 2
- MZN: 50
- NAD: 10
- NGN: 700
- NIO: 20
- NOK: 5
- NPR: 80
- NZD: 0.9
- PAB: 1
- PEN: 2
- PGK: 3
- PHP: 35
- PKR: 200
- PLN: 2
- PYG: 4,000
- QAR: 2
- RON: 2.5
- RSD: 60
- RWF: 1,000
- SAR: 2
- SBD: 4
- SCR: 8
- SEK: 5
- SGD: 0.7
- SHP: 1
- SOS: 500
- SRD: 20
- SZL: 10
- THB: 20
- TJS: 5
- TOP: 2
- TRY: 30
- TTD: 4
- TWD: 20
- TZS: 2,000
- UAH: 30
- UGX: 2,000
- UYU: 20
- UZS: 7,000
- VND: 20,000
- VUV: 100
- WST: 2
- XAF: 500
- XCD: 2
- XCG: 1
- XOF: 500
- XPF: 100
- YER: 200
- ZAR: 9
- ZMW: 10 | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `amount_type` | *Literal["fixed"]* | :heavy_check_mark: | N/A | +| `price_currency` | [Optional[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | N/A | +| `tax_behavior` | [OptionalNullable[models.TaxBehaviorOption]](../models/taxbehavioroption.md) | :heavy_minus_sign: | The tax behavior of the price. If not set, it will default to the organization's default tax behavior. | +| `price_amount` | *int* | :heavy_check_mark: | The price in cents.
Minimum amounts per currency:
- USD: 0.5
- AED: 2
- ALL: 50
- AMD: 200
- AOA: 500
- ARS: 750
- AUD: 0.7
- AWG: 1
- AZN: 1
- BAM: 1
- BBD: 2
- BDT: 70
- BIF: 2,000
- BMD: 1
- BND: 1
- BOB: 5
- BRL: 2.5
- BSD: 1
- BWP: 10
- BZD: 2
- CAD: 0.7
- CDF: 2,000
- CHF: 0.5
- CLP: 500
- CNY: 5
- COP: 2,000
- CRC: 300
- CVE: 50
- CZK: 15
- DJF: 100
- DKK: 3.2
- DOP: 40
- DZD: 70
- EGP: 30
- ETB: 80
- EUR: 0.5
- FJD: 2
- FKP: 1
- GBP: 0.4
- GEL: 2
- GNF: 5,000
- GIP: 1
- GMD: 40
- GTQ: 5
- GYD: 200
- HKD: 4
- HNL: 20
- HTG: 70
- HUF: 175
- IDR: 9,000
- ILS: 1.5
- INR: 60
- ISK: 70
- JMD: 80
- JPY: 80
- KES: 70
- KGS: 50
- KHR: 3,000
- KMF: 500
- KRW: 800
- KYD: 1
- KZT: 300
- LAK: 20,000
- LKR: 200
- LRD: 100
- LSL: 10
- MAD: 5
- MDL: 10
- MGA: 3,000
- MKD: 50
- MNT: 2,000
- MOP: 5
- MUR: 50
- MVR: 8
- MXN: 9
- MWK: 1,000
- MYR: 2
- MZN: 50
- NAD: 10
- NGN: 700
- NIO: 20
- NOK: 5
- NPR: 80
- NZD: 0.9
- PAB: 1
- PEN: 2
- PGK: 3
- PHP: 35
- PKR: 200
- PLN: 2
- PYG: 4,000
- QAR: 2
- RON: 2.5
- RSD: 60
- RWF: 1,000
- SAR: 2
- SBD: 4
- SCR: 8
- SEK: 5
- SGD: 0.7
- SHP: 1
- SOS: 500
- SRD: 20
- SZL: 10
- THB: 20
- TJS: 5
- TOP: 2
- TRY: 30
- TTD: 4
- TWD: 20
- TZS: 2,000
- UAH: 30
- UGX: 2,000
- UYU: 20
- UZS: 7,000
- VND: 20,000
- VUV: 100
- WST: 2
- XAF: 500
- XCD: 2
- XCG: 1
- XOF: 500
- XPF: 100
- YER: 200
- ZAR: 9
- ZMW: 10
- Other currencies: 50 minor units | \ No newline at end of file diff --git a/docs/models/scope.md b/docs/models/scope.md index 59f311bc..98e86af4 100644 --- a/docs/models/scope.md +++ b/docs/models/scope.md @@ -10,8 +10,6 @@ | `EMAIL` | email | | `USER_READ` | user:read | | `USER_WRITE` | user:write | -| `WEB_READ` | web:read | -| `WEB_WRITE` | web:write | | `ORGANIZATIONS_READ` | organizations:read | | `ORGANIZATIONS_WRITE` | organizations:write | | `CUSTOM_FIELDS_READ` | custom_fields:read | diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index eda33c1e..38b17291 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -50,6 +50,7 @@ with Polar( | `organization_id` | [OptionalNullable[models.CustomersListQueryParamOrganizationIDFilter]](../../models/customerslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by exact email. | | `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name, email, or external ID. | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by active customers, i.e. customers with at least one trialing, active or past_due subscription. | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | | `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | | `sorting` | List[[models.CustomerSortProperty](../../models/customersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index 2058dcfd..5dffef24 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -6,9 +6,11 @@ ### Available Operations * [list](#list) - List Orders +* [create](#create) - Create Order * [export](#export) - Export Orders * [get](#get) - Get Order * [update](#update) - Update Order +* [finalize](#finalize) - Finalize Order * [generate_invoice](#generate_invoice) - Generate Order Invoice * [invoice](#invoice) - Get Order Invoice * [receipt](#receipt) - Get Order Receipt @@ -68,6 +70,56 @@ with Polar( | models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | +## create + +Create a draft order for an off-session charge against a saved payment +method. The order is created with `status=draft` and no invoice number; +call `POST /v1/orders/{id}/finalize` to attempt the charge. + +The organization must have the `off_session_charges_enabled` feature flag. + +**Scopes**: `orders:write` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.orders.create(request={ + "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "customer_id": "", + "product_id": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.OrderCreate](../../models/ordercreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Order](../../models/order.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## export Export orders as a CSV file. @@ -203,6 +255,61 @@ with Polar( | models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | +## finalize + +Finalize a draft order and synchronously attempt an off-session charge. + +On success, the order transitions to `paid` and benefit grants fire +before the response returns. On failure (decline, missing payment method, +SCA challenge), the order stays in `draft` and a 4xx error is returned. + +The request fails with 412 if the order is not in `draft` status. + +**Scopes**: `orders:write` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.orders.finalize(id="", order_finalize={}) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `order_finalize` | [models.OrderFinalize](../../models/orderfinalize.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Order](../../models/order.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models.PaymentFailed | 402 | application/json | +| models.PaymentActionRequired | 402 | application/json | +| models.OffSessionChargesNotEnabled | 403 | application/json | +| models.OrganizationNotReadyForPayments | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.OrderNotDraft | 412 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## generate_invoice Trigger generation of an order's invoice. diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index 97f9d9ae..400cc18f 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -5,12 +5,12 @@ ### Available Operations -* [list](#list) - List Organizations +* [list_organizations](#list_organizations) - List Organizations * [create](#create) - Create Organization * [get](#get) - Get Organization * [update](#update) - Update Organization -## list +## list_organizations List organizations. @@ -27,7 +27,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list_organizations(page=1, limit=10) while res is not None: # Handle items diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md index 8f067b78..f82f4f9b 100644 --- a/docs/sdks/payments/README.md +++ b/docs/sdks/payments/README.md @@ -41,6 +41,7 @@ with Polar( | `organization_id` | [OptionalNullable[models.PaymentsListQueryParamOrganizationIDFilter]](../../models/paymentslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `checkout_id` | [OptionalNullable[models.PaymentsListQueryParamCheckoutIDFilter]](../../models/paymentslistqueryparamcheckoutidfilter.md) | :heavy_minus_sign: | Filter by checkout ID. | | `order_id` | [OptionalNullable[models.PaymentsListQueryParamOrderIDFilter]](../../models/paymentslistqueryparamorderidfilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `customer_id` | [OptionalNullable[models.PaymentsListQueryParamCustomerIDFilter]](../../models/paymentslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | | `status` | [OptionalNullable[models.PaymentsListQueryParamStatusFilter]](../../models/paymentslistqueryparamstatusfilter.md) | :heavy_minus_sign: | Filter by payment status. | | `method` | [OptionalNullable[models.MethodFilter]](../../models/methodfilter.md) | :heavy_minus_sign: | Filter by payment method. | | `customer_email` | [OptionalNullable[models.CustomerEmailFilter]](../../models/customeremailfilter.md) | :heavy_minus_sign: | Filter by customer email. | diff --git a/docs/sdks/polarcustomers/README.md b/docs/sdks/polarcustomers/README.md index e5ac8c59..734c2f3d 100644 --- a/docs/sdks/polarcustomers/README.md +++ b/docs/sdks/polarcustomers/README.md @@ -189,10 +189,11 @@ with Polar() as polar: ### Errors -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| models.PaymentMethodSetupFailed | 400 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | ## confirm_payment_method diff --git a/pyproject.toml b/pyproject.toml index 932e468f..82b4812a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "polar-sdk" -version = "0.31.5" +version = "0.31.6" description = "Polar SDK for Python" authors = [{ name = "Polar" },] readme = "README-PYPI.md" diff --git a/src/polar_sdk/_version.py b/src/polar_sdk/_version.py index 9b9b869f..a43c9548 100644 --- a/src/polar_sdk/_version.py +++ b/src/polar_sdk/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "polar-sdk" -__version__: str = "0.31.5" +__version__: str = "0.31.6" __openapi_doc_version__: str = "0.1.0" __gen_version__: str = "2.737.0" -__user_agent__: str = "speakeasy-sdk/python 0.31.5 2.737.0 0.1.0 polar-sdk" +__user_agent__: str = "speakeasy-sdk/python 0.31.6 2.737.0 0.1.0 polar-sdk" try: if __package__ is not None: diff --git a/src/polar_sdk/customers.py b/src/polar_sdk/customers.py index 71fc9a9f..e576ce5b 100644 --- a/src/polar_sdk/customers.py +++ b/src/polar_sdk/customers.py @@ -27,6 +27,7 @@ def list( ] = UNSET, email: OptionalNullable[str] = UNSET, query: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, page: Optional[int] = 1, limit: Optional[int] = 10, sorting: OptionalNullable[List[models.CustomerSortProperty]] = UNSET, @@ -50,6 +51,7 @@ def list( :param organization_id: Filter by organization ID. :param email: Filter by exact email. :param query: Filter by name, email, or external ID. + :param active: Filter by active customers, i.e. customers with at least one trialing, active or past_due subscription. :param page: Page number, defaults to 1. :param limit: Size of a page, defaults to 10. Maximum is 100. :param sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. @@ -73,6 +75,7 @@ def list( organization_id=organization_id, email=email, query=query, + active=active, page=page, limit=limit, sorting=sorting, @@ -138,6 +141,7 @@ def next_func() -> Optional[models.CustomersListResponse]: organization_id=organization_id, email=email, query=query, + active=active, page=next_page, limit=limit, sorting=sorting, @@ -176,6 +180,7 @@ async def list_async( ] = UNSET, email: OptionalNullable[str] = UNSET, query: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, page: Optional[int] = 1, limit: Optional[int] = 10, sorting: OptionalNullable[List[models.CustomerSortProperty]] = UNSET, @@ -199,6 +204,7 @@ async def list_async( :param organization_id: Filter by organization ID. :param email: Filter by exact email. :param query: Filter by name, email, or external ID. + :param active: Filter by active customers, i.e. customers with at least one trialing, active or past_due subscription. :param page: Page number, defaults to 1. :param limit: Size of a page, defaults to 10. Maximum is 100. :param sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. @@ -222,6 +228,7 @@ async def list_async( organization_id=organization_id, email=email, query=query, + active=active, page=page, limit=limit, sorting=sorting, @@ -287,6 +294,7 @@ def next_func() -> Optional[models.CustomersListResponse]: organization_id=organization_id, email=email, query=query, + active=active, page=next_page, limit=limit, sorting=sorting, diff --git a/src/polar_sdk/models/__init__.py b/src/polar_sdk/models/__init__.py index fa633782..2d117674 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -2284,6 +2284,10 @@ OAuth2ClientConfigurationUpdateTypedDict, ) from .oauth2clientpublic import OAuth2ClientPublic, OAuth2ClientPublicTypedDict + from .offsessionchargesnotenabled import ( + OffSessionChargesNotEnabled, + OffSessionChargesNotEnabledData, + ) from .order import ( Order, OrderCustomFieldData, @@ -2293,14 +2297,24 @@ OrderTypedDict, ) from .orderbillingreason import OrderBillingReason + from .ordercreate import ( + OrderCreate, + OrderCreateCustomFieldData, + OrderCreateCustomFieldDataTypedDict, + OrderCreateMetadata, + OrderCreateMetadataTypedDict, + OrderCreateTypedDict, + ) from .ordercustomer import ( OrderCustomer, OrderCustomerTaxID, OrderCustomerTaxIDTypedDict, OrderCustomerTypedDict, ) + from .orderfinalize import OrderFinalize, OrderFinalizeTypedDict from .orderinvoice import OrderInvoice, OrderInvoiceTypedDict from .orderitemschema import OrderItemSchema, OrderItemSchemaTypedDict + from .ordernotdraft import OrderNotDraft, OrderNotDraftData from .ordernoteligibleforretry import ( OrderNotEligibleForRetry, OrderNotEligibleForRetryData, @@ -2324,6 +2338,14 @@ OrdersExportResponse, OrdersExportResponseTypedDict, ) + from .orders_finalizeop import ( + OrdersFinalizeRequest, + OrdersFinalizeRequestTypedDict, + OrdersFinalizeResponse402OrdersFinalize, + OrdersFinalizeResponse402OrdersFinalizeUnion, + OrdersFinalizeResponse403OrdersFinalize, + OrdersFinalizeResponse403OrdersFinalizeUnion, + ) from .orders_generate_invoiceop import ( OrdersGenerateInvoiceRequest, OrdersGenerateInvoiceRequestTypedDict, @@ -2422,6 +2444,10 @@ OrganizationNotificationSettings, OrganizationNotificationSettingsTypedDict, ) + from .organizationnotreadyforpayments import ( + OrganizationNotReadyForPayments, + OrganizationNotReadyForPaymentsData, + ) from .organizations_getop import ( OrganizationsGetRequest, OrganizationsGetRequestTypedDict, @@ -2455,6 +2481,7 @@ ) from .pagination import Pagination, PaginationTypedDict from .payment import Payment, PaymentTypedDict + from .paymentactionrequired import PaymentActionRequired, PaymentActionRequiredData from .paymentalreadyinprogress import ( PaymentAlreadyInProgress, PaymentAlreadyInProgressData, @@ -2474,6 +2501,10 @@ PaymentMethodInUseByActiveSubscription, PaymentMethodInUseByActiveSubscriptionData, ) + from .paymentmethodsetupfailed import ( + PaymentMethodSetupFailed, + PaymentMethodSetupFailedData, + ) from .paymentnotready import PaymentNotReady, PaymentNotReadyData from .paymentprocessor import PaymentProcessor from .payments_getop import PaymentsGetRequest, PaymentsGetRequestTypedDict @@ -2484,6 +2515,8 @@ MethodFilterTypedDict, PaymentsListQueryParamCheckoutIDFilter, PaymentsListQueryParamCheckoutIDFilterTypedDict, + PaymentsListQueryParamCustomerIDFilter, + PaymentsListQueryParamCustomerIDFilterTypedDict, PaymentsListQueryParamOrderIDFilter, PaymentsListQueryParamOrderIDFilterTypedDict, PaymentsListQueryParamOrganizationIDFilter, @@ -4845,6 +4878,8 @@ "Oauth2RequestTokenRequestBodyTypedDict", "Oauth2UserinfoResponseOauth2Userinfo", "Oauth2UserinfoResponseOauth2UserinfoTypedDict", + "OffSessionChargesNotEnabled", + "OffSessionChargesNotEnabledData", "OneTimeProducts", "OneTimeProductsNetRevenue", "OneTimeProductsNetRevenueTypedDict", @@ -4853,6 +4888,12 @@ "OneTimeProductsTypedDict", "Order", "OrderBillingReason", + "OrderCreate", + "OrderCreateCustomFieldData", + "OrderCreateCustomFieldDataTypedDict", + "OrderCreateMetadata", + "OrderCreateMetadataTypedDict", + "OrderCreateTypedDict", "OrderCustomFieldData", "OrderCustomFieldDataTypedDict", "OrderCustomer", @@ -4861,12 +4902,16 @@ "OrderCustomerTypedDict", "OrderDiscount", "OrderDiscountTypedDict", + "OrderFinalize", + "OrderFinalizeTypedDict", "OrderIDFilter", "OrderIDFilterTypedDict", "OrderInvoice", "OrderInvoiceTypedDict", "OrderItemSchema", "OrderItemSchemaTypedDict", + "OrderNotDraft", + "OrderNotDraftData", "OrderNotEligibleForRetry", "OrderNotEligibleForRetryData", "OrderPaidEvent", @@ -4900,6 +4945,12 @@ "OrdersExportRequestTypedDict", "OrdersExportResponse", "OrdersExportResponseTypedDict", + "OrdersFinalizeRequest", + "OrdersFinalizeRequestTypedDict", + "OrdersFinalizeResponse402OrdersFinalize", + "OrdersFinalizeResponse402OrdersFinalizeUnion", + "OrdersFinalizeResponse403OrdersFinalize", + "OrdersFinalizeResponse403OrdersFinalizeUnion", "OrdersGenerateInvoiceRequest", "OrdersGenerateInvoiceRequestTypedDict", "OrdersGenerateInvoiceResponse422OrdersGenerateInvoice", @@ -4970,6 +5021,8 @@ "OrganizationIDTypedDict", "OrganizationIndividualLegalEntitySchema", "OrganizationIndividualLegalEntitySchemaTypedDict", + "OrganizationNotReadyForPayments", + "OrganizationNotReadyForPaymentsData", "OrganizationNotificationSettings", "OrganizationNotificationSettingsTypedDict", "OrganizationSocialLink", @@ -4993,6 +5046,8 @@ "Pagination", "PaginationTypedDict", "Payment", + "PaymentActionRequired", + "PaymentActionRequiredData", "PaymentAlreadyInProgress", "PaymentAlreadyInProgressData", "PaymentError", @@ -5007,6 +5062,8 @@ "PaymentMethodGenericTypedDict", "PaymentMethodInUseByActiveSubscription", "PaymentMethodInUseByActiveSubscriptionData", + "PaymentMethodSetupFailed", + "PaymentMethodSetupFailedData", "PaymentNotReady", "PaymentNotReadyData", "PaymentProcessor", @@ -5017,6 +5074,8 @@ "PaymentsGetRequestTypedDict", "PaymentsListQueryParamCheckoutIDFilter", "PaymentsListQueryParamCheckoutIDFilterTypedDict", + "PaymentsListQueryParamCustomerIDFilter", + "PaymentsListQueryParamCustomerIDFilterTypedDict", "PaymentsListQueryParamOrderIDFilter", "PaymentsListQueryParamOrderIDFilterTypedDict", "PaymentsListQueryParamOrganizationIDFilter", @@ -7145,6 +7204,8 @@ "OAuth2ClientConfigurationUpdateTypedDict": ".oauth2clientconfigurationupdate", "OAuth2ClientPublic": ".oauth2clientpublic", "OAuth2ClientPublicTypedDict": ".oauth2clientpublic", + "OffSessionChargesNotEnabled": ".offsessionchargesnotenabled", + "OffSessionChargesNotEnabledData": ".offsessionchargesnotenabled", "Order": ".order", "OrderCustomFieldData": ".order", "OrderCustomFieldDataTypedDict": ".order", @@ -7152,14 +7213,24 @@ "OrderDiscountTypedDict": ".order", "OrderTypedDict": ".order", "OrderBillingReason": ".orderbillingreason", + "OrderCreate": ".ordercreate", + "OrderCreateCustomFieldData": ".ordercreate", + "OrderCreateCustomFieldDataTypedDict": ".ordercreate", + "OrderCreateMetadata": ".ordercreate", + "OrderCreateMetadataTypedDict": ".ordercreate", + "OrderCreateTypedDict": ".ordercreate", "OrderCustomer": ".ordercustomer", "OrderCustomerTaxID": ".ordercustomer", "OrderCustomerTaxIDTypedDict": ".ordercustomer", "OrderCustomerTypedDict": ".ordercustomer", + "OrderFinalize": ".orderfinalize", + "OrderFinalizeTypedDict": ".orderfinalize", "OrderInvoice": ".orderinvoice", "OrderInvoiceTypedDict": ".orderinvoice", "OrderItemSchema": ".orderitemschema", "OrderItemSchemaTypedDict": ".orderitemschema", + "OrderNotDraft": ".ordernotdraft", + "OrderNotDraftData": ".ordernotdraft", "OrderNotEligibleForRetry": ".ordernoteligibleforretry", "OrderNotEligibleForRetryData": ".ordernoteligibleforretry", "OrderPaidEvent": ".orderpaidevent", @@ -7182,6 +7253,12 @@ "OrdersExportRequestTypedDict": ".orders_exportop", "OrdersExportResponse": ".orders_exportop", "OrdersExportResponseTypedDict": ".orders_exportop", + "OrdersFinalizeRequest": ".orders_finalizeop", + "OrdersFinalizeRequestTypedDict": ".orders_finalizeop", + "OrdersFinalizeResponse402OrdersFinalize": ".orders_finalizeop", + "OrdersFinalizeResponse402OrdersFinalizeUnion": ".orders_finalizeop", + "OrdersFinalizeResponse403OrdersFinalize": ".orders_finalizeop", + "OrdersFinalizeResponse403OrdersFinalizeUnion": ".orders_finalizeop", "OrdersGenerateInvoiceRequest": ".orders_generate_invoiceop", "OrdersGenerateInvoiceRequestTypedDict": ".orders_generate_invoiceop", "OrdersGenerateInvoiceResponse422OrdersGenerateInvoice": ".orders_generate_invoiceop", @@ -7252,6 +7329,8 @@ "OrganizationIndividualLegalEntitySchemaTypedDict": ".organizationindividuallegalentityschema", "OrganizationNotificationSettings": ".organizationnotificationsettings", "OrganizationNotificationSettingsTypedDict": ".organizationnotificationsettings", + "OrganizationNotReadyForPayments": ".organizationnotreadyforpayments", + "OrganizationNotReadyForPaymentsData": ".organizationnotreadyforpayments", "OrganizationsGetRequest": ".organizations_getop", "OrganizationsGetRequestTypedDict": ".organizations_getop", "OrganizationsListRequest": ".organizations_listop", @@ -7275,6 +7354,8 @@ "PaginationTypedDict": ".pagination", "Payment": ".payment", "PaymentTypedDict": ".payment", + "PaymentActionRequired": ".paymentactionrequired", + "PaymentActionRequiredData": ".paymentactionrequired", "PaymentAlreadyInProgress": ".paymentalreadyinprogress", "PaymentAlreadyInProgressData": ".paymentalreadyinprogress", "PaymentError": ".paymenterror", @@ -7289,6 +7370,8 @@ "PaymentMethodGenericTypedDict": ".paymentmethodgeneric", "PaymentMethodInUseByActiveSubscription": ".paymentmethodinusebyactivesubscription", "PaymentMethodInUseByActiveSubscriptionData": ".paymentmethodinusebyactivesubscription", + "PaymentMethodSetupFailed": ".paymentmethodsetupfailed", + "PaymentMethodSetupFailedData": ".paymentmethodsetupfailed", "PaymentNotReady": ".paymentnotready", "PaymentNotReadyData": ".paymentnotready", "PaymentProcessor": ".paymentprocessor", @@ -7300,6 +7383,8 @@ "MethodFilterTypedDict": ".payments_listop", "PaymentsListQueryParamCheckoutIDFilter": ".payments_listop", "PaymentsListQueryParamCheckoutIDFilterTypedDict": ".payments_listop", + "PaymentsListQueryParamCustomerIDFilter": ".payments_listop", + "PaymentsListQueryParamCustomerIDFilterTypedDict": ".payments_listop", "PaymentsListQueryParamOrderIDFilter": ".payments_listop", "PaymentsListQueryParamOrderIDFilterTypedDict": ".payments_listop", "PaymentsListQueryParamOrganizationIDFilter": ".payments_listop", diff --git a/src/polar_sdk/models/customerorder.py b/src/polar_sdk/models/customerorder.py index e0879a66..c695a4ad 100644 --- a/src/polar_sdk/models/customerorder.py +++ b/src/polar_sdk/models/customerorder.py @@ -50,8 +50,8 @@ class CustomerOrderTypedDict(TypedDict): billing_name: Nullable[str] r"""The name of the customer that should appear on the invoice.""" billing_address: Nullable[AddressTypedDict] - invoice_number: str - r"""The invoice number associated with this order.""" + invoice_number: Nullable[str] + r"""The invoice number associated with this order. `null` while the order is in `draft` status; assigned at finalize.""" is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" receipt_number: Nullable[str] @@ -128,8 +128,8 @@ class CustomerOrder(BaseModel): billing_address: Nullable[Address] - invoice_number: str - r"""The invoice number associated with this order.""" + invoice_number: Nullable[str] + r"""The invoice number associated with this order. `null` while the order is in `draft` status; assigned at finalize.""" is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" @@ -176,6 +176,7 @@ def serialize_model(self, handler): "modified_at", "billing_name", "billing_address", + "invoice_number", "receipt_number", "seats", "product_id", diff --git a/src/polar_sdk/models/offsessionchargesnotenabled.py b/src/polar_sdk/models/offsessionchargesnotenabled.py new file mode 100644 index 00000000..7b6542f7 --- /dev/null +++ b/src/polar_sdk/models/offsessionchargesnotenabled.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from polar_sdk.models import PolarError +from polar_sdk.types import BaseModel +from polar_sdk.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated + + +class OffSessionChargesNotEnabledData(BaseModel): + detail: str + + ERROR: Annotated[ + Annotated[ + Literal["OffSessionChargesNotEnabled"], + AfterValidator(validate_const("OffSessionChargesNotEnabled")), + ], + pydantic.Field(alias="error"), + ] = "OffSessionChargesNotEnabled" + + +@dataclass(unsafe_hash=True) +class OffSessionChargesNotEnabled(PolarError): + data: OffSessionChargesNotEnabledData = field(hash=False) + + def __init__( + self, + data: OffSessionChargesNotEnabledData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/polar_sdk/models/order.py b/src/polar_sdk/models/order.py index d343db95..97caad69 100644 --- a/src/polar_sdk/models/order.py +++ b/src/polar_sdk/models/order.py @@ -97,8 +97,8 @@ class OrderTypedDict(TypedDict): billing_name: Nullable[str] r"""The name of the customer that should appear on the invoice.""" billing_address: Nullable[AddressTypedDict] - invoice_number: str - r"""The invoice number associated with this order.""" + invoice_number: Nullable[str] + r"""The invoice number associated with this order. `null` while the order is in `draft` status; assigned at finalize.""" is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" receipt_number: Nullable[str] @@ -182,8 +182,8 @@ class Order(BaseModel): billing_address: Nullable[Address] - invoice_number: str - r"""The invoice number associated with this order.""" + invoice_number: Nullable[str] + r"""The invoice number associated with this order. `null` while the order is in `draft` status; assigned at finalize.""" is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" @@ -242,6 +242,7 @@ def serialize_model(self, handler): "modified_at", "billing_name", "billing_address", + "invoice_number", "receipt_number", "seats", "product_id", diff --git a/src/polar_sdk/models/ordercreate.py b/src/polar_sdk/models/ordercreate.py new file mode 100644 index 00000000..7aeecba7 --- /dev/null +++ b/src/polar_sdk/models/ordercreate.py @@ -0,0 +1,124 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +OrderCreateCustomFieldDataTypedDict = TypeAliasType( + "OrderCreateCustomFieldDataTypedDict", Union[str, int, bool, datetime] +) + + +OrderCreateCustomFieldData = TypeAliasType( + "OrderCreateCustomFieldData", Union[str, int, bool, datetime] +) + + +OrderCreateMetadataTypedDict = TypeAliasType( + "OrderCreateMetadataTypedDict", Union[str, int, float, bool] +) + + +OrderCreateMetadata = TypeAliasType("OrderCreateMetadata", Union[str, int, float, bool]) + + +class OrderCreateTypedDict(TypedDict): + r"""Schema to create a draft order for an off-session charge.""" + + customer_id: str + r"""The ID of the customer the order is for. Must belong to the order's organization.""" + product_id: str + r"""The ID of the one-time, fixed-price product to charge for. Must belong to the order's organization. Subscription, seat-based, and pay-what-you-want products are not supported.""" + custom_field_data: NotRequired[ + Dict[str, Nullable[OrderCreateCustomFieldDataTypedDict]] + ] + r"""Key-value object storing custom field values.""" + metadata: NotRequired[Dict[str, OrderCreateMetadataTypedDict]] + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A floating-point number + * A boolean + + You can store up to **50 key-value pairs**. + """ + organization_id: NotRequired[Nullable[str]] + r"""The ID of the organization the order belongs to. **Required unless you use an organization token.** The customer and product must belong to this organization.""" + currency: NotRequired[Nullable[str]] + r"""The currency to charge in (ISO 4217, lowercase, e.g. `usd`). Defaults to the organization's default currency; specify it to force a different one, or when the product isn't priced in the organization's default currency.""" + + +class OrderCreate(BaseModel): + r"""Schema to create a draft order for an off-session charge.""" + + customer_id: str + r"""The ID of the customer the order is for. Must belong to the order's organization.""" + + product_id: str + r"""The ID of the one-time, fixed-price product to charge for. Must belong to the order's organization. Subscription, seat-based, and pay-what-you-want products are not supported.""" + + custom_field_data: Optional[Dict[str, Nullable[OrderCreateCustomFieldData]]] = None + r"""Key-value object storing custom field values.""" + + metadata: Optional[Dict[str, OrderCreateMetadata]] = None + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A floating-point number + * A boolean + + You can store up to **50 key-value pairs**. + """ + + organization_id: OptionalNullable[str] = UNSET + r"""The ID of the organization the order belongs to. **Required unless you use an organization token.** The customer and product must belong to this organization.""" + + currency: OptionalNullable[str] = UNSET + r"""The currency to charge in (ISO 4217, lowercase, e.g. `usd`). Defaults to the organization's default currency; specify it to force a different one, or when the product isn't priced in the organization's default currency.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "custom_field_data", + "metadata", + "organization_id", + "currency", + ] + nullable_fields = ["organization_id", "currency"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/orderfinalize.py b/src/polar_sdk/models/orderfinalize.py new file mode 100644 index 00000000..23038167 --- /dev/null +++ b/src/polar_sdk/models/orderfinalize.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class OrderFinalizeTypedDict(TypedDict): + r"""Schema to finalize a draft order and trigger an off-session charge.""" + + payment_method_id: NotRequired[Nullable[str]] + r"""ID of the payment method to charge. Must belong to the order's customer. Falls back to the customer's default payment method when unset.""" + + +class OrderFinalize(BaseModel): + r"""Schema to finalize a draft order and trigger an off-session charge.""" + + payment_method_id: OptionalNullable[str] = UNSET + r"""ID of the payment method to charge. Must belong to the order's customer. Falls back to the customer's default payment method when unset.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["payment_method_id"] + nullable_fields = ["payment_method_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/ordernotdraft.py b/src/polar_sdk/models/ordernotdraft.py new file mode 100644 index 00000000..fb841d0b --- /dev/null +++ b/src/polar_sdk/models/ordernotdraft.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from polar_sdk.models import PolarError +from polar_sdk.types import BaseModel +from polar_sdk.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated + + +class OrderNotDraftData(BaseModel): + detail: str + + ERROR: Annotated[ + Annotated[ + Literal["OrderNotDraft"], AfterValidator(validate_const("OrderNotDraft")) + ], + pydantic.Field(alias="error"), + ] = "OrderNotDraft" + + +@dataclass(unsafe_hash=True) +class OrderNotDraft(PolarError): + data: OrderNotDraftData = field(hash=False) + + def __init__( + self, + data: OrderNotDraftData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/polar_sdk/models/orders_finalizeop.py b/src/polar_sdk/models/orders_finalizeop.py new file mode 100644 index 00000000..fd42a922 --- /dev/null +++ b/src/polar_sdk/models/orders_finalizeop.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .offsessionchargesnotenabled import OffSessionChargesNotEnabledData +from .orderfinalize import OrderFinalize, OrderFinalizeTypedDict +from .organizationnotreadyforpayments import OrganizationNotReadyForPaymentsData +from .paymentactionrequired import PaymentActionRequiredData +from .paymentfailed import PaymentFailedData +from dataclasses import dataclass, field +import httpx +from polar_sdk.models import PolarError +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import Optional, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class OrdersFinalizeRequestTypedDict(TypedDict): + id: str + r"""The order ID.""" + order_finalize: OrderFinalizeTypedDict + + +class OrdersFinalizeRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The order ID.""" + + order_finalize: Annotated[ + OrderFinalize, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +OrdersFinalizeResponse403OrdersFinalizeUnion = TypeAliasType( + "OrdersFinalizeResponse403OrdersFinalizeUnion", + Union[OffSessionChargesNotEnabledData, OrganizationNotReadyForPaymentsData], +) +r"""Off-session charges are not enabled for this organization, or its account can't currently accept payments.""" + + +@dataclass(unsafe_hash=True) +class OrdersFinalizeResponse403OrdersFinalize(PolarError): + r"""Off-session charges are not enabled for this organization, or its account can't currently accept payments.""" + + data: OrdersFinalizeResponse403OrdersFinalizeUnion = field(hash=False) + + def __init__( + self, + data: OrdersFinalizeResponse403OrdersFinalizeUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) + + +OrdersFinalizeResponse402OrdersFinalizeUnion = TypeAliasType( + "OrdersFinalizeResponse402OrdersFinalizeUnion", + Union[PaymentFailedData, PaymentActionRequiredData], +) +r"""The charge failed, or requires customer authentication (e.g. a 3DS challenge) that can't be completed off-session.""" + + +@dataclass(unsafe_hash=True) +class OrdersFinalizeResponse402OrdersFinalize(PolarError): + r"""The charge failed, or requires customer authentication (e.g. a 3DS challenge) that can't be completed off-session.""" + + data: OrdersFinalizeResponse402OrdersFinalizeUnion = field(hash=False) + + def __init__( + self, + data: OrdersFinalizeResponse402OrdersFinalizeUnion, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/polar_sdk/models/orderstatus.py b/src/polar_sdk/models/orderstatus.py index eeb50996..cfef72f0 100644 --- a/src/polar_sdk/models/orderstatus.py +++ b/src/polar_sdk/models/orderstatus.py @@ -5,6 +5,7 @@ class OrderStatus(str, Enum): + DRAFT = "draft" PENDING = "pending" PAID = "paid" REFUNDED = "refunded" diff --git a/src/polar_sdk/models/organizationfeaturesettings.py b/src/polar_sdk/models/organizationfeaturesettings.py index 14f6753c..844d585a 100644 --- a/src/polar_sdk/models/organizationfeaturesettings.py +++ b/src/polar_sdk/models/organizationfeaturesettings.py @@ -24,6 +24,8 @@ class OrganizationFeatureSettingsTypedDict(TypedDict): r"""Ordered list of metric slugs shown on the dashboard overview.""" reset_proration_behavior_enabled: NotRequired[bool] r"""If this organization has access to reset proration behavior.""" + off_session_charges_enabled: NotRequired[bool] + r"""If this organization can create and finalize draft orders via the API (off-session charges against a saved payment method).""" billing_enabled: NotRequired[bool] r"""If this organization has billing enabled""" @@ -53,6 +55,9 @@ class OrganizationFeatureSettings(BaseModel): reset_proration_behavior_enabled: Optional[bool] = False r"""If this organization has access to reset proration behavior.""" + off_session_charges_enabled: Optional[bool] = False + r"""If this organization can create and finalize draft orders via the API (off-session charges against a saved payment method).""" + billing_enabled: Optional[bool] = False r"""If this organization has billing enabled""" @@ -67,6 +72,7 @@ def serialize_model(self, handler): "account_review_v2_enabled", "overview_metrics", "reset_proration_behavior_enabled", + "off_session_charges_enabled", "billing_enabled", ] nullable_fields = ["overview_metrics"] diff --git a/src/polar_sdk/models/organizationnotreadyforpayments.py b/src/polar_sdk/models/organizationnotreadyforpayments.py new file mode 100644 index 00000000..71f2f0ad --- /dev/null +++ b/src/polar_sdk/models/organizationnotreadyforpayments.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from polar_sdk.models import PolarError +from polar_sdk.types import BaseModel +from polar_sdk.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated + + +class OrganizationNotReadyForPaymentsData(BaseModel): + detail: str + + ERROR: Annotated[ + Annotated[ + Literal["OrganizationNotReadyForPayments"], + AfterValidator(validate_const("OrganizationNotReadyForPayments")), + ], + pydantic.Field(alias="error"), + ] = "OrganizationNotReadyForPayments" + + +@dataclass(unsafe_hash=True) +class OrganizationNotReadyForPayments(PolarError): + data: OrganizationNotReadyForPaymentsData = field(hash=False) + + def __init__( + self, + data: OrganizationNotReadyForPaymentsData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/polar_sdk/models/paymentactionrequired.py b/src/polar_sdk/models/paymentactionrequired.py new file mode 100644 index 00000000..b4fce29b --- /dev/null +++ b/src/polar_sdk/models/paymentactionrequired.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from polar_sdk.models import PolarError +from polar_sdk.types import BaseModel +from polar_sdk.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated + + +class PaymentActionRequiredData(BaseModel): + detail: str + + ERROR: Annotated[ + Annotated[ + Literal["PaymentActionRequired"], + AfterValidator(validate_const("PaymentActionRequired")), + ], + pydantic.Field(alias="error"), + ] = "PaymentActionRequired" + + +@dataclass(unsafe_hash=True) +class PaymentActionRequired(PolarError): + data: PaymentActionRequiredData = field(hash=False) + + def __init__( + self, + data: PaymentActionRequiredData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/polar_sdk/models/paymentmethodsetupfailed.py b/src/polar_sdk/models/paymentmethodsetupfailed.py new file mode 100644 index 00000000..6ea5a247 --- /dev/null +++ b/src/polar_sdk/models/paymentmethodsetupfailed.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from polar_sdk.models import PolarError +from polar_sdk.types import BaseModel +from polar_sdk.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated + + +class PaymentMethodSetupFailedData(BaseModel): + detail: str + + ERROR: Annotated[ + Annotated[ + Literal["PaymentMethodSetupFailed"], + AfterValidator(validate_const("PaymentMethodSetupFailed")), + ], + pydantic.Field(alias="error"), + ] = "PaymentMethodSetupFailed" + + +@dataclass(unsafe_hash=True) +class PaymentMethodSetupFailed(PolarError): + data: PaymentMethodSetupFailedData = field(hash=False) + + def __init__( + self, + data: PaymentMethodSetupFailedData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/polar_sdk/models/payments_listop.py b/src/polar_sdk/models/payments_listop.py index 854c460f..b7e149c2 100644 --- a/src/polar_sdk/models/payments_listop.py +++ b/src/polar_sdk/models/payments_listop.py @@ -47,6 +47,18 @@ r"""Filter by order ID.""" +PaymentsListQueryParamCustomerIDFilterTypedDict = TypeAliasType( + "PaymentsListQueryParamCustomerIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +PaymentsListQueryParamCustomerIDFilter = TypeAliasType( + "PaymentsListQueryParamCustomerIDFilter", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + PaymentsListQueryParamStatusFilterTypedDict = TypeAliasType( "PaymentsListQueryParamStatusFilterTypedDict", Union[PaymentStatus, List[PaymentStatus]], @@ -87,6 +99,8 @@ class PaymentsListRequestTypedDict(TypedDict): r"""Filter by checkout ID.""" order_id: NotRequired[Nullable[PaymentsListQueryParamOrderIDFilterTypedDict]] r"""Filter by order ID.""" + customer_id: NotRequired[Nullable[PaymentsListQueryParamCustomerIDFilterTypedDict]] + r"""Filter by customer ID.""" status: NotRequired[Nullable[PaymentsListQueryParamStatusFilterTypedDict]] r"""Filter by payment status.""" method: NotRequired[Nullable[MethodFilterTypedDict]] @@ -120,6 +134,12 @@ class PaymentsListRequest(BaseModel): ] = UNSET r"""Filter by order ID.""" + customer_id: Annotated[ + OptionalNullable[PaymentsListQueryParamCustomerIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by customer ID.""" + status: Annotated[ OptionalNullable[PaymentsListQueryParamStatusFilter], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -162,6 +182,7 @@ def serialize_model(self, handler): "organization_id", "checkout_id", "order_id", + "customer_id", "status", "method", "customer_email", @@ -173,6 +194,7 @@ def serialize_model(self, handler): "organization_id", "checkout_id", "order_id", + "customer_id", "status", "method", "customer_email", diff --git a/src/polar_sdk/models/productpricecustomcreate.py b/src/polar_sdk/models/productpricecustomcreate.py index 8b97eaa3..5efb6b6d 100644 --- a/src/polar_sdk/models/productpricecustomcreate.py +++ b/src/polar_sdk/models/productpricecustomcreate.py @@ -147,9 +147,27 @@ class ProductPriceCustomCreateTypedDict(TypedDict): - YER: 200 - ZAR: 9 - ZMW: 10 + - Other currencies: 50 minor units """ maximum_amount: NotRequired[Nullable[int]] - r"""The maximum amount the customer can pay.""" + r"""The maximum amount the customer can pay. Maximum per currency: + - USD: 999,999.99 + - EUR: 999,999.99 + - GBP: 999,999.99 + - ARS: 1,400,000 + - CDF: 2,800,000 + - COP: 4,000,000 + - IDR: 16,000,000 + - KHR: 4,000,000 + - LAK: 21,000,000 + - MNT: 3,500,000 + - MWK: 1,750,000 + - NGN: 1,550,000 + - TZS: 2,500,000 + - UGX: 3,700,000 + - UZS: 12,500,000 + - Other currencies: 99,999,999 minor units + """ preset_amount: NotRequired[Nullable[int]] r"""The initial amount shown to the customer. If 0, the customer will see $0 as the default. If set to a value below the minimum price amount for the currency, it will be rejected.Minimum per currency: - USD: 0.5 @@ -278,6 +296,7 @@ class ProductPriceCustomCreateTypedDict(TypedDict): - YER: 200 - ZAR: 9 - ZMW: 10 + - Other currencies: 50 minor units """ @@ -422,10 +441,28 @@ class ProductPriceCustomCreate(BaseModel): - YER: 200 - ZAR: 9 - ZMW: 10 + - Other currencies: 50 minor units """ maximum_amount: OptionalNullable[int] = UNSET - r"""The maximum amount the customer can pay.""" + r"""The maximum amount the customer can pay. Maximum per currency: + - USD: 999,999.99 + - EUR: 999,999.99 + - GBP: 999,999.99 + - ARS: 1,400,000 + - CDF: 2,800,000 + - COP: 4,000,000 + - IDR: 16,000,000 + - KHR: 4,000,000 + - LAK: 21,000,000 + - MNT: 3,500,000 + - MWK: 1,750,000 + - NGN: 1,550,000 + - TZS: 2,500,000 + - UGX: 3,700,000 + - UZS: 12,500,000 + - Other currencies: 99,999,999 minor units + """ preset_amount: OptionalNullable[int] = UNSET r"""The initial amount shown to the customer. If 0, the customer will see $0 as the default. If set to a value below the minimum price amount for the currency, it will be rejected.Minimum per currency: @@ -555,6 +592,7 @@ class ProductPriceCustomCreate(BaseModel): - YER: 200 - ZAR: 9 - ZMW: 10 + - Other currencies: 50 minor units """ @model_serializer(mode="wrap") diff --git a/src/polar_sdk/models/productpricefixedcreate.py b/src/polar_sdk/models/productpricefixedcreate.py index 784174cd..9afc1d5b 100644 --- a/src/polar_sdk/models/productpricefixedcreate.py +++ b/src/polar_sdk/models/productpricefixedcreate.py @@ -144,6 +144,7 @@ class ProductPriceFixedCreateTypedDict(TypedDict): - YER: 200 - ZAR: 9 - ZMW: 10 + - Other currencies: 50 minor units """ amount_type: Literal["fixed"] price_currency: NotRequired[PresentmentCurrency] @@ -283,6 +284,7 @@ class ProductPriceFixedCreate(BaseModel): - YER: 200 - ZAR: 9 - ZMW: 10 + - Other currencies: 50 minor units """ AMOUNT_TYPE: Annotated[ diff --git a/src/polar_sdk/models/scope.py b/src/polar_sdk/models/scope.py index c98645b3..cb28cecc 100644 --- a/src/polar_sdk/models/scope.py +++ b/src/polar_sdk/models/scope.py @@ -10,8 +10,6 @@ class Scope(str, Enum): EMAIL = "email" USER_READ = "user:read" USER_WRITE = "user:write" - WEB_READ = "web:read" - WEB_WRITE = "web:write" ORGANIZATIONS_READ = "organizations:read" ORGANIZATIONS_WRITE = "organizations:write" CUSTOM_FIELDS_READ = "custom_fields:read" diff --git a/src/polar_sdk/models/subscriptions_listop.py b/src/polar_sdk/models/subscriptions_listop.py index 9bbc6a8e..0fef537e 100644 --- a/src/polar_sdk/models/subscriptions_listop.py +++ b/src/polar_sdk/models/subscriptions_listop.py @@ -951,6 +951,8 @@ class CustomersListRequestTypedDict(TypedDict): r"""Filter by exact email.""" query: NotRequired[Nullable[str]] r"""Filter by name, email, or external ID.""" + active: NotRequired[Nullable[bool]] + r"""Filter by active customers, i.e. customers with at least one trialing, active or past_due subscription.""" page: NotRequired[int] r"""Page number, defaults to 1.""" limit: NotRequired[int] @@ -980,6 +982,12 @@ class CustomersListRequest(BaseModel): ] = UNSET r"""Filter by name, email, or external ID.""" + active: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by active customers, i.e. customers with at least one trialing, active or past_due subscription.""" + page: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -1010,12 +1018,20 @@ def serialize_model(self, handler): "organization_id", "email", "query", + "active", "page", "limit", "sorting", "metadata", ] - nullable_fields = ["organization_id", "email", "query", "sorting", "metadata"] + nullable_fields = [ + "organization_id", + "email", + "query", + "active", + "sorting", + "metadata", + ] null_default_fields = [] serialized = handler(self) diff --git a/src/polar_sdk/orders.py b/src/polar_sdk/orders.py index eef1d3e0..85466acc 100644 --- a/src/polar_sdk/orders.py +++ b/src/polar_sdk/orders.py @@ -5,9 +5,9 @@ from jsonpath import JSONPath from polar_sdk import models, utils from polar_sdk._hooks import HookContext -from polar_sdk.types import OptionalNullable, UNSET +from polar_sdk.types import BaseModel, OptionalNullable, UNSET from polar_sdk.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Dict, List, Mapping, Optional, Union +from typing import Any, Dict, List, Mapping, Optional, Union, cast class ExportAcceptEnum(str, Enum): @@ -412,6 +412,198 @@ def next_func() -> Optional[models.OrdersListResponse]: raise models.SDKError("Unexpected response received", http_res) + def create( + self, + *, + request: Union[models.OrderCreate, models.OrderCreateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Order: + r"""Create Order + + Create a draft order for an off-session charge against a saved payment + method. The order is created with `status=draft` and no invoice number; + call `POST /v1/orders/{id}/finalize` to attempt the charge. + + The organization must have the `off_session_charges_enabled` feature flag. + + **Scopes**: `orders:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.OrderCreate) + request = cast(models.OrderCreate, request) + + req = self._build_request( + method="POST", + path="/v1/orders/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.OrderCreate + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="orders:create", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Order, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + request: Union[models.OrderCreate, models.OrderCreateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Order: + r"""Create Order + + Create a draft order for an off-session charge against a saved payment + method. The order is created with `status=draft` and no invoice number; + call `POST /v1/orders/{id}/finalize` to attempt the charge. + + The organization must have the `off_session_charges_enabled` feature flag. + + **Scopes**: `orders:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.OrderCreate) + request = cast(models.OrderCreate, request) + + req = self._build_request_async( + method="POST", + path="/v1/orders/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.OrderCreate + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="orders:create", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Order, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + def export( self, *, @@ -1016,6 +1208,256 @@ async def update_async( raise models.SDKError("Unexpected response received", http_res) + def finalize( + self, + *, + id: str, + order_finalize: Union[models.OrderFinalize, models.OrderFinalizeTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Order: + r"""Finalize Order + + Finalize a draft order and synchronously attempt an off-session charge. + + On success, the order transitions to `paid` and benefit grants fire + before the response returns. On failure (decline, missing payment method, + SCA challenge), the order stays in `draft` and a 4xx error is returned. + + The request fails with 412 if the order is not in `draft` status. + + **Scopes**: `orders:write` + + :param id: The order ID. + :param order_finalize: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.OrdersFinalizeRequest( + id=id, + order_finalize=utils.get_pydantic_model( + order_finalize, models.OrderFinalize + ), + ) + + req = self._build_request( + method="POST", + path="/v1/orders/{id}/finalize", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.order_finalize, False, False, "json", models.OrderFinalize + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="orders:finalize", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["402", "403", "404", "412", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Order, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.OrdersFinalizeResponse402OrdersFinalizeUnion, http_res + ) + raise models.OrdersFinalizeResponse402OrdersFinalize( + response_data, http_res + ) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + models.OrdersFinalizeResponse403OrdersFinalizeUnion, http_res + ) + raise models.OrdersFinalizeResponse403OrdersFinalize( + response_data, http_res + ) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "412", "application/json"): + response_data = unmarshal_json_response(models.OrderNotDraftData, http_res) + raise models.OrderNotDraft(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def finalize_async( + self, + *, + id: str, + order_finalize: Union[models.OrderFinalize, models.OrderFinalizeTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Order: + r"""Finalize Order + + Finalize a draft order and synchronously attempt an off-session charge. + + On success, the order transitions to `paid` and benefit grants fire + before the response returns. On failure (decline, missing payment method, + SCA challenge), the order stays in `draft` and a 4xx error is returned. + + The request fails with 412 if the order is not in `draft` status. + + **Scopes**: `orders:write` + + :param id: The order ID. + :param order_finalize: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.OrdersFinalizeRequest( + id=id, + order_finalize=utils.get_pydantic_model( + order_finalize, models.OrderFinalize + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/orders/{id}/finalize", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.order_finalize, False, False, "json", models.OrderFinalize + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="orders:finalize", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["402", "403", "404", "412", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Order, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.OrdersFinalizeResponse402OrdersFinalizeUnion, http_res + ) + raise models.OrdersFinalizeResponse402OrdersFinalize( + response_data, http_res + ) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response( + models.OrdersFinalizeResponse403OrdersFinalizeUnion, http_res + ) + raise models.OrdersFinalizeResponse403OrdersFinalize( + response_data, http_res + ) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "412", "application/json"): + response_data = unmarshal_json_response(models.OrderNotDraftData, http_res) + raise models.OrderNotDraft(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + def generate_invoice( self, *, diff --git a/src/polar_sdk/organizations.py b/src/polar_sdk/organizations.py index 4769452e..7def0719 100644 --- a/src/polar_sdk/organizations.py +++ b/src/polar_sdk/organizations.py @@ -10,7 +10,7 @@ class Organizations(BaseSDK): - def list( + def list_organizations( self, *, slug: OptionalNullable[str] = UNSET, @@ -109,7 +109,7 @@ def next_func() -> Optional[models.OrganizationsListResponse]: if len(results[0]) < limit: return None - return self.list( + return self.list_organizations( slug=slug, page=next_page, limit=limit, @@ -139,7 +139,7 @@ def next_func() -> Optional[models.OrganizationsListResponse]: raise models.SDKError("Unexpected response received", http_res) - async def list_async( + async def list_organizations_async( self, *, slug: OptionalNullable[str] = UNSET, @@ -238,7 +238,7 @@ def next_func() -> Optional[models.OrganizationsListResponse]: if len(results[0]) < limit: return None - return self.list( + return self.list_organizations( slug=slug, page=next_page, limit=limit, diff --git a/src/polar_sdk/payments.py b/src/polar_sdk/payments.py index 6b8b8b14..791192cf 100644 --- a/src/polar_sdk/payments.py +++ b/src/polar_sdk/payments.py @@ -31,6 +31,12 @@ def list( models.PaymentsListQueryParamOrderIDFilterTypedDict, ] ] = UNSET, + customer_id: OptionalNullable[ + Union[ + models.PaymentsListQueryParamCustomerIDFilter, + models.PaymentsListQueryParamCustomerIDFilterTypedDict, + ] + ] = UNSET, status: OptionalNullable[ Union[ models.PaymentsListQueryParamStatusFilter, @@ -60,6 +66,7 @@ def list( :param organization_id: Filter by organization ID. :param checkout_id: Filter by checkout ID. :param order_id: Filter by order ID. + :param customer_id: Filter by customer ID. :param status: Filter by payment status. :param method: Filter by payment method. :param customer_email: Filter by customer email. @@ -85,6 +92,7 @@ def list( organization_id=organization_id, checkout_id=checkout_id, order_id=order_id, + customer_id=customer_id, status=status, method=method, customer_email=customer_email, @@ -152,6 +160,7 @@ def next_func() -> Optional[models.PaymentsListResponse]: organization_id=organization_id, checkout_id=checkout_id, order_id=order_id, + customer_id=customer_id, status=status, method=method, customer_email=customer_email, @@ -202,6 +211,12 @@ async def list_async( models.PaymentsListQueryParamOrderIDFilterTypedDict, ] ] = UNSET, + customer_id: OptionalNullable[ + Union[ + models.PaymentsListQueryParamCustomerIDFilter, + models.PaymentsListQueryParamCustomerIDFilterTypedDict, + ] + ] = UNSET, status: OptionalNullable[ Union[ models.PaymentsListQueryParamStatusFilter, @@ -231,6 +246,7 @@ async def list_async( :param organization_id: Filter by organization ID. :param checkout_id: Filter by checkout ID. :param order_id: Filter by order ID. + :param customer_id: Filter by customer ID. :param status: Filter by payment status. :param method: Filter by payment method. :param customer_email: Filter by customer email. @@ -256,6 +272,7 @@ async def list_async( organization_id=organization_id, checkout_id=checkout_id, order_id=order_id, + customer_id=customer_id, status=status, method=method, customer_email=customer_email, @@ -323,6 +340,7 @@ def next_func() -> Optional[models.PaymentsListResponse]: organization_id=organization_id, checkout_id=checkout_id, order_id=order_id, + customer_id=customer_id, status=status, method=method, customer_email=customer_email, diff --git a/src/polar_sdk/polar_customers.py b/src/polar_sdk/polar_customers.py index 56f9b360..5d632b44 100644 --- a/src/polar_sdk/polar_customers.py +++ b/src/polar_sdk/polar_customers.py @@ -713,7 +713,7 @@ def add_payment_method( security_source=security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + error_status_codes=["400", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -722,6 +722,11 @@ def add_payment_method( return unmarshal_json_response( models.CustomerPaymentMethodCreateResponse, http_res ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.PaymentMethodSetupFailedData, http_res + ) + raise models.PaymentMethodSetupFailed(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( models.HTTPValidationErrorData, http_res @@ -815,7 +820,7 @@ async def add_payment_method_async( security_source=security, ), request=req, - error_status_codes=["422", "4XX", "5XX"], + error_status_codes=["400", "422", "4XX", "5XX"], retry_config=retry_config, ) @@ -824,6 +829,11 @@ async def add_payment_method_async( return unmarshal_json_response( models.CustomerPaymentMethodCreateResponse, http_res ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.PaymentMethodSetupFailedData, http_res + ) + raise models.PaymentMethodSetupFailed(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( models.HTTPValidationErrorData, http_res