From ce2d340572bee7a4f6d7895ad4aa6aa79465fae2 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 13 Jan 2026 00:17:34 +0000 Subject: [PATCH 1/2] ## Python SDK Changes Detected: * `polar._endpointcheckout_created_post()`: * `request.data.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointcheckout_updated_post()`: * `request.data.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_created_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_updated_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_active_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_canceled_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_uncanceled_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_revoked_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointsubscription_past_due_post()`: * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointproduct_created_post()`: * `request.data.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar._endpointproduct_updated_post()`: * `request.data.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning: * `polar.customers.list()`: `request.include_members` **Removed** **Breaking** :warning: * `polar.customers.create()`: `request` **Changed** **Breaking** :warning: * `polar.events.get()`: `response.[system_event]` **Changed** **Breaking** :warning: * `polar.events.list()`: `response.[list_resource_event_].items.[].[system_event]` **Changed** **Breaking** :warning: * `polar.customers.update_external()`: `request.include_members` **Removed** **Breaking** :warning: * `polar.customers.get_external()`: `request.include_members` **Removed** **Breaking** :warning: * `polar.customers.update()`: `request.include_members` **Removed** **Breaking** :warning: * `polar.customers.get()`: `request.include_members` **Removed** **Breaking** :warning: * `polar.checkouts.update()`: * `request.checkout_update.currency` **Added** * `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkout-links.get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.oauth2.authorize()`: `response` **Changed** * `polar.products.list()`: `response.items.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.products.create()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.products.get()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.products.update()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.products.update_benefits()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkouts.list()`: `response.items.[].products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkouts.create()`: * `request.currency` **Added** * `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkouts.get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.subscriptions.revoke()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkouts.client_get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkouts.client_update()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkouts.client_confirm()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkout-links.list()`: `response.items.[].products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkout-links.create()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.subscriptions.get()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.subscriptions.create()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.subscriptions.list()`: `response.items.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar._endpointcustomer_seat_revoked_post()`: * `request.data` **Changed** * `polar.subscriptions.update()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.checkout-links.update()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.seats.list_seats()`: `response.seats.[]` **Changed** * `polar.customer_portal.seats.assign_seat()`: `response` **Changed** * `polar.customer_portal.seats.revoke_seat()`: `response` **Changed** * `polar.customer_portal.seats.resend_invitation()`: `response` **Changed** * `polar.customer_portal.seats.list_claimed_subscriptions()`: `response.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.orders.list()`: `response.items.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.orders.get()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.orders.update()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.organizations.get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.subscriptions.list()`: `response.items.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.subscriptions.get()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.subscriptions.cancel()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer_portal.subscriptions.update()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** * `polar.customer-seats.list_seats()`: `response.seats.[]` **Changed** * `polar.customer-seats.assign_seat()`: `response` **Changed** * `polar.customer-seats.revoke_seat()`: `response` **Changed** * `polar.customer-seats.resend_invitation()`: `response` **Changed** * `polar.customer-seats.claim_seat()`: `response.seat` **Changed** * `polar._endpointcustomer_seat_claimed_post()`: * `request.data` **Changed** * `polar._endpointcustomer_seat_assigned_post()`: * `request.data` **Changed** --- .speakeasy/gen.lock | 162 ++++++++++++------ .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 12 +- RELEASES.md | 12 +- codeSamples.yaml | 80 ++++----- docs/models/authorizeresponseorganization.md | 1 + docs/models/authorizeresponseuser.md | 3 +- docs/models/balancedisputeevent.md | 21 +++ docs/models/balancedisputemetadata.md | 20 +++ docs/models/balancedisputereversalevent.md | 21 +++ docs/models/balanceorderevent.md | 21 +++ docs/models/balanceordermetadata.md | 19 ++ docs/models/balancerefundevent.md | 21 +++ docs/models/balancerefundmetadata.md | 21 +++ docs/models/balancerefundreversalevent.md | 21 +++ docs/models/checkoutcreate.md | 1 + docs/models/checkoutupdate.md | 1 + docs/models/customerscreaterequest.md | 9 - docs/models/customerseat.md | 30 ++-- docs/models/customersgetexternalrequest.md | 7 +- docs/models/customersgetrequest.md | 7 +- docs/models/customerslistrequest.md | 1 - docs/models/customersupdateexternalrequest.md | 1 - docs/models/customersupdaterequest.md | 9 +- docs/models/presentmentcurrency.md | 15 ++ docs/models/productpriceseatbased.md | 26 +-- docs/models/productpriceseatbasedcreate.md | 10 +- ...tiers.md => productpriceseattiersinput.md} | 6 +- docs/models/productpriceseattiersoutput.md | 16 ++ docs/models/systemevent.md | 30 ++++ .../webhooksubscriptionuncanceledpayload.md | 6 +- docs/sdks/customers/README.md | 22 +-- pyproject.toml | 2 +- src/polar_sdk/_version.py | 4 +- src/polar_sdk/customers.py | 70 ++------ src/polar_sdk/models/__init__.py | 88 ++++++++-- .../models/authorizeresponseorganization.py | 9 +- src/polar_sdk/models/authorizeresponseuser.py | 9 +- src/polar_sdk/models/balancedisputeevent.py | 127 ++++++++++++++ .../models/balancedisputemetadata.py | 87 ++++++++++ .../models/balancedisputereversalevent.py | 127 ++++++++++++++ src/polar_sdk/models/balanceorderevent.py | 123 +++++++++++++ src/polar_sdk/models/balanceordermetadata.py | 78 +++++++++ src/polar_sdk/models/balancerefundevent.py | 123 +++++++++++++ src/polar_sdk/models/balancerefundmetadata.py | 91 ++++++++++ .../models/balancerefundreversalevent.py | 124 ++++++++++++++ src/polar_sdk/models/checkoutcreate.py | 6 + src/polar_sdk/models/checkoutupdate.py | 6 + src/polar_sdk/models/customers_createop.py | 27 --- .../models/customers_get_externalop.py | 13 +- src/polar_sdk/models/customers_getop.py | 13 +- .../models/customers_update_externalop.py | 18 +- src/polar_sdk/models/customers_updateop.py | 18 +- src/polar_sdk/models/customerseat.py | 18 +- src/polar_sdk/models/presentmentcurrency.py | 15 ++ src/polar_sdk/models/productpriceseatbased.py | 23 ++- .../models/productpriceseatbasedcreate.py | 23 ++- src/polar_sdk/models/productpriceseattiers.py | 21 --- .../models/productpriceseattiers_input.py | 31 ++++ .../models/productpriceseattiers_output.py | 72 ++++++++ src/polar_sdk/models/subscriptions_listop.py | 9 - src/polar_sdk/models/systemevent.py | 21 +++ .../webhooksubscriptionuncanceledpayload.py | 12 +- 63 files changed, 1662 insertions(+), 380 deletions(-) create mode 100644 docs/models/balancedisputeevent.md create mode 100644 docs/models/balancedisputemetadata.md create mode 100644 docs/models/balancedisputereversalevent.md create mode 100644 docs/models/balanceorderevent.md create mode 100644 docs/models/balanceordermetadata.md create mode 100644 docs/models/balancerefundevent.md create mode 100644 docs/models/balancerefundmetadata.md create mode 100644 docs/models/balancerefundreversalevent.md delete mode 100644 docs/models/customerscreaterequest.md create mode 100644 docs/models/presentmentcurrency.md rename docs/models/{productpriceseattiers.md => productpriceseattiersinput.md} (82%) create mode 100644 docs/models/productpriceseattiersoutput.md create mode 100644 src/polar_sdk/models/balancedisputeevent.py create mode 100644 src/polar_sdk/models/balancedisputemetadata.py create mode 100644 src/polar_sdk/models/balancedisputereversalevent.py create mode 100644 src/polar_sdk/models/balanceorderevent.py create mode 100644 src/polar_sdk/models/balanceordermetadata.py create mode 100644 src/polar_sdk/models/balancerefundevent.py create mode 100644 src/polar_sdk/models/balancerefundmetadata.py create mode 100644 src/polar_sdk/models/balancerefundreversalevent.py delete mode 100644 src/polar_sdk/models/customers_createop.py create mode 100644 src/polar_sdk/models/presentmentcurrency.py delete mode 100644 src/polar_sdk/models/productpriceseattiers.py create mode 100644 src/polar_sdk/models/productpriceseattiers_input.py create mode 100644 src/polar_sdk/models/productpriceseattiers_output.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b1a252d1..b7beea36 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: 9dd1216e61c45d7d3fbc2c6f1acc192b + docChecksum: cb1de50c062b6f3f7c1365801f68a43b docVersion: 0.1.0 speakeasyVersion: 1.648.0 generationVersion: 2.737.0 - releaseVersion: 0.28.1 - configChecksum: 7f8a12c411ad0ef3683cd2f932236539 + releaseVersion: 0.28.2 + configChecksum: adb2c7c8b1b113a8ca5cf628fa8e7007 repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -66,6 +66,14 @@ generatedFiles: - docs/models/authorizeuser.md - docs/models/averageordervalue.md - docs/models/averagerevenueperuser.md + - docs/models/balancedisputeevent.md + - docs/models/balancedisputemetadata.md + - docs/models/balancedisputereversalevent.md + - docs/models/balanceorderevent.md + - docs/models/balanceordermetadata.md + - docs/models/balancerefundevent.md + - docs/models/balancerefundmetadata.md + - docs/models/balancerefundreversalevent.md - docs/models/benefit.md - docs/models/benefitcreate.md - docs/models/benefitcustom.md @@ -414,7 +422,6 @@ generatedFiles: - docs/models/customerportalwalletslistsecurity.md - docs/models/customerproduct.md - docs/models/customerproductprices.md - - docs/models/customerscreaterequest.md - docs/models/customersdeleteexternalrequest.md - docs/models/customersdeleterequest.md - docs/models/customerseat.md @@ -877,6 +884,7 @@ generatedFiles: - docs/models/paymentsortproperty.md - docs/models/paymentstatus.md - docs/models/permission.md + - docs/models/presentmentcurrency.md - docs/models/prices.md - docs/models/product.md - docs/models/productbenefitsupdate.md @@ -905,7 +913,8 @@ generatedFiles: - docs/models/productpriceseatbased.md - docs/models/productpriceseatbasedcreate.md - docs/models/productpriceseattier.md - - docs/models/productpriceseattiers.md + - docs/models/productpriceseattiersinput.md + - docs/models/productpriceseattiersoutput.md - docs/models/productpricesource.md - docs/models/productpricetype.md - docs/models/productsgetrequest.md @@ -1179,6 +1188,14 @@ generatedFiles: - src/polar_sdk/models/authorizeresponseorganization.py - src/polar_sdk/models/authorizeresponseuser.py - src/polar_sdk/models/authorizeuser.py + - src/polar_sdk/models/balancedisputeevent.py + - src/polar_sdk/models/balancedisputemetadata.py + - src/polar_sdk/models/balancedisputereversalevent.py + - src/polar_sdk/models/balanceorderevent.py + - src/polar_sdk/models/balanceordermetadata.py + - src/polar_sdk/models/balancerefundevent.py + - src/polar_sdk/models/balancerefundmetadata.py + - src/polar_sdk/models/balancerefundreversalevent.py - src/polar_sdk/models/benefit.py - src/polar_sdk/models/benefit_grants_listop.py - src/polar_sdk/models/benefitcreate.py @@ -1399,7 +1416,6 @@ generatedFiles: - src/polar_sdk/models/customerportalsubscriptionsettings.py - src/polar_sdk/models/customerportalusagesettings.py - src/polar_sdk/models/customerproduct.py - - src/polar_sdk/models/customers_createop.py - src/polar_sdk/models/customers_delete_externalop.py - src/polar_sdk/models/customers_deleteop.py - src/polar_sdk/models/customers_exportop.py @@ -1681,6 +1697,7 @@ generatedFiles: - src/polar_sdk/models/paymentsortproperty.py - src/polar_sdk/models/paymentstatus.py - src/polar_sdk/models/polarerror.py + - src/polar_sdk/models/presentmentcurrency.py - src/polar_sdk/models/product.py - src/polar_sdk/models/productbenefitsupdate.py - src/polar_sdk/models/productbillingtype.py @@ -1702,7 +1719,8 @@ generatedFiles: - src/polar_sdk/models/productpriceseatbased.py - src/polar_sdk/models/productpriceseatbasedcreate.py - src/polar_sdk/models/productpriceseattier.py - - src/polar_sdk/models/productpriceseattiers.py + - src/polar_sdk/models/productpriceseattiers_input.py + - src/polar_sdk/models/productpriceseattiers_output.py - src/polar_sdk/models/productpricesource.py - src/polar_sdk/models/productpricetype.py - src/polar_sdk/models/products_getop.py @@ -3843,7 +3861,7 @@ examples: speakeasy-default-customer-portal:seats:list-claimed-subscriptions: responses: "200": - application/json: [{"created_at": "2023-07-05T03:11:10.458Z", "modified_at": null, "id": "", "amount": 188802, "currency": "East Caribbean Dollar", "recurring_interval": "month", "recurring_interval_count": 168916, "status": "trialing", "current_period_start": "2025-09-23T18:01:38.664Z", "current_period_end": null, "trial_start": "2024-11-15T19:25:07.298Z", "trial_end": "2024-11-21T16:14:26.632Z", "cancel_at_period_end": true, "canceled_at": "2025-09-04T07:50:50.427Z", "started_at": "2025-04-06T15:41:59.631Z", "ends_at": "2024-01-11T20:31:07.862Z", "ended_at": "2025-07-13T17:45:41.928Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": "", "product": {"id": "", "created_at": "2025-07-01T03:12:52.869Z", "modified_at": null, "trial_interval": "year", "trial_interval_count": 622272, "name": "", "description": "airbus irritably loudly jive drain deployment happily badly oh", "recurring_interval": "month", "recurring_interval_count": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-02-04T14:35:33.491Z", "modified_at": "2024-07-09T12:47:49.884Z", "id": "", "source": "catalog", "amount_type": "seat_based", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "year", "price_currency": "", "seat_tiers": {"tiers": []}}], "benefits": [{"id": "", "created_at": "2024-01-28T05:47:37.378Z", "modified_at": "2024-03-11T13:18:09.440Z", "type": "discord", "description": "worth circular however congregate", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/spool", "mime_type": "", "size": 652913, "storage_version": null, "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": null, "last_modified_at": "2025-01-29T20:54:15.453Z", "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2024-11-20T13:19:02.015Z", "size_readable": "", "public_url": "https://trusty-ceramics.info/"}], "organization": {"created_at": "2024-11-01T13:25:57.001Z", "modified_at": "2024-08-12T19:24:27.962Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://frightened-designation.name/", "proration_behavior": "invoice", "allow_customer_updates": true, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": true}}}}, "prices": [], "meters": []}] + application/json: [{"created_at": "2023-07-05T03:11:10.458Z", "modified_at": null, "id": "", "amount": 188802, "currency": "East Caribbean Dollar", "recurring_interval": "month", "recurring_interval_count": 168916, "status": "trialing", "current_period_start": "2025-09-23T18:01:38.664Z", "current_period_end": null, "trial_start": "2024-11-15T19:25:07.298Z", "trial_end": "2024-11-21T16:14:26.632Z", "cancel_at_period_end": true, "canceled_at": "2025-09-04T07:50:50.427Z", "started_at": "2025-04-06T15:41:59.631Z", "ends_at": "2024-01-11T20:31:07.862Z", "ended_at": "2025-07-13T17:45:41.928Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": "", "product": {"id": "", "created_at": "2025-07-01T03:12:52.869Z", "modified_at": null, "trial_interval": "year", "trial_interval_count": 622272, "name": "", "description": "airbus irritably loudly jive drain deployment happily badly oh", "recurring_interval": "month", "recurring_interval_count": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-02-04T14:35:33.491Z", "modified_at": "2024-07-09T12:47:49.884Z", "id": "", "source": "catalog", "amount_type": "seat_based", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "year", "price_currency": "", "seat_tiers": {"tiers": [], "minimum_seats": 168916, "maximum_seats": null}}], "benefits": [{"id": "", "created_at": "2024-01-28T05:47:37.378Z", "modified_at": "2024-03-11T13:18:09.440Z", "type": "discord", "description": "worth circular however congregate", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/spool", "mime_type": "", "size": 652913, "storage_version": null, "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": null, "last_modified_at": "2025-01-29T20:54:15.453Z", "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2024-11-20T13:19:02.015Z", "size_readable": "", "public_url": "https://trusty-ceramics.info/"}], "organization": {"created_at": "2024-11-01T13:25:57.001Z", "modified_at": "2024-08-12T19:24:27.962Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://frightened-designation.name/", "proration_behavior": "invoice", "allow_customer_updates": true, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": true}}}}, "prices": [], "meters": []}] customer_portal:customer-session:introspect: speakeasy-default-customer-portal:customer-session:introspect: responses: @@ -4107,7 +4125,7 @@ examples: application/json: {} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Python SDK Changes Detected:\n* `polar._endpointcheckout_created_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointcheckout_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_created_post()`: \n * `request.data.platform_fee_currency` **Added** **Breaking** :warning:\n* `polar._endpointorder_updated_post()`: \n * `request.data.platform_fee_currency` **Added** **Breaking** :warning:\n* `polar._endpointorder_paid_post()`: \n * `request.data.platform_fee_currency` **Added** **Breaking** :warning:\n* `polar.events.get()`: `response` **Changed** **Breaking** :warning:\n* `polar.events.list()`: \n * `request.depth` **Added**\n * `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.subscriptions.update()`: `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.subscriptions.cancel()`: `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.subscriptions.get()`: `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.subscriptions.list()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.customer_portal.organizations.get()`: `response` **Changed** **Breaking** :warning:\n* `polar._endpointorder_refunded_post()`: \n * `request.data.platform_fee_currency` **Added** **Breaking** :warning:\n* `polar._endpointsubscription_created_post()`: \n * `request.data.product.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_updated_post()`: \n * `request.data.product.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_active_post()`: \n * `request.data.product.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_canceled_post()`: \n * `request.data.product.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_uncanceled_post()`: \n * `request.data.product.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_revoked_post()`: \n * `request.data.product.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointrefund_created_post()`: \n * `request.data.dispute` **Added** **Breaking** :warning:\n* `polar._endpointrefund_updated_post()`: \n * `request.data.dispute` **Added** **Breaking** :warning:\n* `polar._endpointproduct_created_post()`: \n * `request.data.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointproduct_updated_post()`: \n * `request.data.prices.[]` **Changed** **Breaking** :warning:\n* `polar._endpointorganization_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.update()`: `response.product` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.get()`: `response.product` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.list()`: `response.items.[].product` **Changed** **Breaking** :warning:\n* `polar.customer_portal.seats.list_claimed_subscriptions()`: `response.[]` **Changed** **Breaking** :warning:\n* `polar.customer_portal.benefit-grants.update()`: `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.benefit-grants.get()`: `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.benefit-grants.list()`: \n * `request` **Changed**\n * `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.customers.create()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.members` **Added**\n* `polar.metrics.get()`: \n * `request.metrics` **Added**\n * `response` **Changed** **Breaking** :warning:\n* `polar.checkouts.client_confirm()`: \n * `request.checkout_confirm_stripe.allow_trial` **Added**\n * `response` **Changed** **Breaking** :warning:\n * `error.[trial_already_redeemed]` **Added**\n* `polar.organizations.create()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed**\n* `polar.checkouts.client_update()`: \n * `request.checkout_update_public.allow_trial` **Added**\n * `response` **Changed** **Breaking** :warning:\n * `error.[trial_already_redeemed]` **Added**\n* `polar.organizations.update()`: \n * `request.organization_update` **Changed** **Breaking** :warning:\n * `response` **Changed**\n* `polar.checkouts.client_get()`: `response` **Changed** **Breaking** :warning:\n* `polar.refunds.create()`: \n * `response.dispute` **Added**\n * `error.status[400]` **Removed** **Breaking** :warning:\n* `polar.benefit-grants.list()`: `response.items.[].member_id` **Added**\n* `polar.metrics.limits()`: `response.intervals.hour.min_days` **Added**\n* `polar.subscriptions.update()`: \n * `request.subscription_update.[subscription_update_billing_period]` **Added**\n * `response.product.prices.[]` **Changed**\n* `polar.benefits.list()`: `request` **Changed**\n* `polar.benefits.grants()`: \n * `request.member_id` **Added**\n * `response.items.[].member_id` **Added**\n* `polar.subscriptions.get()`: `response.product.prices.[]` **Changed**\n* `polar.webhooks.list_webhook_deliveries()`: `response.items.[].webhook_event.skipped` **Added**\n* `polar.products.list()`: `response.items.[].prices.[]` **Changed**\n* `polar.products.create()`: `response.prices.[]` **Changed**\n* `polar.products.get()`: `response.prices.[]` **Changed**\n* `polar.products.update()`: `response.prices.[]` **Changed**\n* `polar.products.update_benefits()`: `response.prices.[]` **Changed**\n* `polar.orders.list()`: `response.items.[].platform_fee_currency` **Added**\n* `polar.orders.get()`: `response.platform_fee_currency` **Added**\n* `polar.orders.update()`: `response.platform_fee_currency` **Added**\n* `polar.refunds.list()`: `response.items.[].dispute` **Added**\n* `polar.subscriptions.create()`: `response.product.prices.[]` **Changed**\n* `polar.checkouts.list()`: `response.items.[]` **Changed**\n* `polar.checkouts.create()`: \n * `request` **Changed**\n * `response` **Changed**\n* `polar.checkouts.get()`: `response` **Changed**\n* `polar.checkouts.update()`: \n * `request.checkout_update.allow_trial` **Added**\n * `response` **Changed**\n * `error.[trial_already_redeemed]` **Added**\n* `polar.subscriptions.list()`: \n * `request` **Changed**\n * `response.items.[].product.prices.[]` **Changed**\n* `polar.organizations.get()`: `response` **Changed**\n* `polar.organizations.list()`: `response.items.[]` **Changed**\n* `polar._endpointbenefit_grant_revoked_post()`: \n * `request.data` **Changed**\n* `polar.subscriptions.revoke()`: `response.product.prices.[]` **Changed**\n* `polar.checkout-links.list()`: `response.items.[].products.[].prices.[]` **Changed**\n* `polar.checkout-links.create()`: `response.products.[].prices.[]` **Changed**\n* `polar.checkout-links.get()`: `response.products.[].prices.[]` **Changed**\n* `polar.checkout-links.update()`: `response.products.[].prices.[]` **Changed**\n* `polar.customers.list()`: \n * `request.include_members` **Added**\n * `response.items.[].members` **Added**\n* `polar._endpointbenefit_grant_cycled_post()`: \n * `request.data` **Changed**\n* `polar.customers.get()`: \n * `request.include_members` **Added**\n * `response.members` **Added**\n* `polar.customers.update()`: \n * `request.include_members` **Added**\n * `response.members` **Added**\n* `polar.customers.get_external()`: \n * `request.include_members` **Added**\n * `response.members` **Added**\n* `polar.customers.update_external()`: \n * `request.include_members` **Added**\n * `response.members` **Added**\n* `polar._endpointbenefit_grant_updated_post()`: \n * `request.data` **Changed**\n* `polar._endpointbenefit_grant_created_post()`: \n * `request.data` **Changed**\n* `polar.wallets.top_up()`: **Deleted** **Breaking** :warning:\n* `polar.wallets.get()`: **Deleted** **Breaking** :warning:\n* `polar.wallets.list()`: **Deleted** **Breaking** :warning:\n* `polar.customers.get_balance()`: **Deleted** **Breaking** :warning:\n* `polar.event-types.update()`: **Added**\n* `polar.event-types.list()`: **Added**\n* `polar.members.delete_member()`: **Added**\n* `polar.members.create_member()`: **Added**\n* `polar.members.list_members()`: **Added**\n* `polar.disputes.get()`: **Added**\n* `polar.disputes.list()`: **Added**\n* `polar._endpointsubscription_past_due_post()`: **Added**\n" +releaseNotes: "## Python SDK Changes Detected:\n* `polar._endpointcheckout_created_post()`: \n * `request.data.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointcheckout_updated_post()`: \n * `request.data.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_created_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_updated_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_active_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_canceled_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_uncanceled_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_revoked_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_past_due_post()`: \n * `request.data.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointproduct_created_post()`: \n * `request.data.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar._endpointproduct_updated_post()`: \n * `request.data.prices.[].[product_price].[metered_unit].seat_tiers` **Changed** **Breaking** :warning:\n* `polar.customers.list()`: `request.include_members` **Removed** **Breaking** :warning:\n* `polar.customers.create()`: `request` **Changed** **Breaking** :warning:\n* `polar.events.get()`: `response.[system_event]` **Changed** **Breaking** :warning:\n* `polar.events.list()`: `response.[list_resource_event_].items.[].[system_event]` **Changed** **Breaking** :warning:\n* `polar.customers.update_external()`: `request.include_members` **Removed** **Breaking** :warning:\n* `polar.customers.get_external()`: `request.include_members` **Removed** **Breaking** :warning:\n* `polar.customers.update()`: `request.include_members` **Removed** **Breaking** :warning:\n* `polar.customers.get()`: `request.include_members` **Removed** **Breaking** :warning:\n* `polar.checkouts.update()`: \n * `request.checkout_update.currency` **Added**\n * `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkout-links.get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.oauth2.authorize()`: `response` **Changed**\n* `polar.products.list()`: `response.items.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.products.create()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.products.get()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.products.update()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.products.update_benefits()`: `response.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkouts.list()`: `response.items.[].products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkouts.create()`: \n * `request.currency` **Added**\n * `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkouts.get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.subscriptions.revoke()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkouts.client_get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkouts.client_update()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkouts.client_confirm()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkout-links.list()`: `response.items.[].products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkout-links.create()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.subscriptions.get()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.subscriptions.create()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.subscriptions.list()`: `response.items.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar._endpointcustomer_seat_revoked_post()`: \n * `request.data` **Changed**\n* `polar.subscriptions.update()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.checkout-links.update()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.seats.list_seats()`: `response.seats.[]` **Changed**\n* `polar.customer_portal.seats.assign_seat()`: `response` **Changed**\n* `polar.customer_portal.seats.revoke_seat()`: `response` **Changed**\n* `polar.customer_portal.seats.resend_invitation()`: `response` **Changed**\n* `polar.customer_portal.seats.list_claimed_subscriptions()`: `response.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.orders.list()`: `response.items.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.orders.get()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.orders.update()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.organizations.get()`: `response.products.[].prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.subscriptions.list()`: `response.items.[].product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.subscriptions.get()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.subscriptions.cancel()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer_portal.subscriptions.update()`: `response.product.prices.[].[product_price].[metered_unit].seat_tiers` **Changed**\n* `polar.customer-seats.list_seats()`: `response.seats.[]` **Changed**\n* `polar.customer-seats.assign_seat()`: `response` **Changed**\n* `polar.customer-seats.revoke_seat()`: `response` **Changed**\n* `polar.customer-seats.resend_invitation()`: `response` **Changed**\n* `polar.customer-seats.claim_seat()`: `response.seat` **Changed**\n* `polar._endpointcustomer_seat_claimed_post()`: \n * `request.data` **Changed**\n* `polar._endpointcustomer_seat_assigned_post()`: \n * `request.data` **Changed**\n" trackedFiles: .devcontainer/README.md: last_write_checksum: sha1:e2a191a1fa8ceb27387eb32eabf36f7ad16a532c @@ -4150,15 +4168,31 @@ trackedFiles: docs/models/authorizeorganization.md: last_write_checksum: sha1:79e37d6875e1cb3410dcb28f9d673ef34a6a51f4 docs/models/authorizeresponseorganization.md: - last_write_checksum: sha1:376aa016c0465e46beb06473065ed630574e2497 + last_write_checksum: sha1:49669170aae64b219d80c43764bf73d86788f943 docs/models/authorizeresponseuser.md: - last_write_checksum: sha1:f9d5a07316b91e90ac6c8377da6b1d179ed0a7cf + last_write_checksum: sha1:3040ef7dc61e1e2c63b97e72ad84f80e5d773204 docs/models/authorizeuser.md: last_write_checksum: sha1:e44eafd43e6b2f3c07aca75b5643f609f822bedf docs/models/averageordervalue.md: last_write_checksum: sha1:cdb0b5525cc2a84fa569f0f1fe9fcfae7fde7fae docs/models/averagerevenueperuser.md: last_write_checksum: sha1:830ef8e35339f3a98d6f506e4636b6d99ffff821 + docs/models/balancedisputeevent.md: + last_write_checksum: sha1:0aea3bf6c97869ce4b7db656346ea414d2932886 + docs/models/balancedisputemetadata.md: + last_write_checksum: sha1:7c6d270dddbbd44cbbaf0bb836d8bf6fa7b2e1ab + docs/models/balancedisputereversalevent.md: + last_write_checksum: sha1:023d08b42d907ce023ef110dae903c99d2ebce4d + docs/models/balanceorderevent.md: + last_write_checksum: sha1:d3eee83862affe0c277962badc9ee8d379f6ad16 + docs/models/balanceordermetadata.md: + last_write_checksum: sha1:6c1dddb28e05dca101868f36d383dc62be2a1a29 + docs/models/balancerefundevent.md: + last_write_checksum: sha1:f206a1ce6a834560fc76a1b9ab9eee54e5ff482e + docs/models/balancerefundmetadata.md: + last_write_checksum: sha1:97145bb9dfe414e0eb1aafbddb650bc964540aa6 + docs/models/balancerefundreversalevent.md: + last_write_checksum: sha1:8d5dc8da15e12df826beb9745a02dbae5b60d581 docs/models/benefit.md: last_write_checksum: sha1:238607ced01aeb17fe69b91f04ee98cf32eac883 docs/models/benefitcreate.md: @@ -4394,7 +4428,7 @@ trackedFiles: docs/models/checkoutconfirmstripecustomfielddata.md: last_write_checksum: sha1:8e5feb192029fd53eabd49eab94326d92b5b03f0 docs/models/checkoutcreate.md: - last_write_checksum: sha1:3b5a1359a4b04825c1035d71b0bbe224e806670f + last_write_checksum: sha1:092c6a165644aba13ac8737138396c9b5484e830 docs/models/checkoutcreatecustomermetadata.md: last_write_checksum: sha1:39510973eb3370dcf053e8f4b3e75d880ce8dd7e docs/models/checkoutcreatecustomfielddata.md: @@ -4524,7 +4558,7 @@ trackedFiles: docs/models/checkoutsupdaterequest.md: last_write_checksum: sha1:c52939bc917e5d1a7982f0aba0ea530f5442db72 docs/models/checkoutupdate.md: - last_write_checksum: sha1:a35029074c6790c597636eef8387c60505215192 + last_write_checksum: sha1:c2e56a1db03b66c95d0e6ed3c68fe8cd2d8dee01 docs/models/checkoutupdatecustomermetadata.md: last_write_checksum: sha1:f58bf24188339194c01f670f440fcbbf1ee2bcfa docs/models/checkoutupdatecustomfielddata.md: @@ -4855,14 +4889,12 @@ trackedFiles: last_write_checksum: sha1:df0fc2783f26719d0a9aaac552f546c2ddecc9a2 docs/models/customerproductprices.md: last_write_checksum: sha1:a6c8e9f2e2cad0d954e92f791d67bf0722e811c9 - docs/models/customerscreaterequest.md: - last_write_checksum: sha1:33dd07f824f4d99f283db86e95a01294f615fe60 docs/models/customersdeleteexternalrequest.md: last_write_checksum: sha1:2adbb835e220bd7363a847a45c8e20dbd2192163 docs/models/customersdeleterequest.md: last_write_checksum: sha1:b76538c9790c78f39561de1ec4d9121f9071bc24 docs/models/customerseat.md: - last_write_checksum: sha1:0ebf2d07cfe5fbb4c9bd6a1b464646a60b10f22a + last_write_checksum: sha1:f1bb1e3f67134f955e8e91db87044ebef3285a2e docs/models/customerseatclaimresponse.md: last_write_checksum: sha1:85cf8364a1c80f980d3211f4201a0a5669623e1a docs/models/customerseatsgetclaiminforequest.md: @@ -4886,9 +4918,9 @@ trackedFiles: docs/models/customersexportrequest.md: last_write_checksum: sha1:90162c8bb41cad7f971cf918e9ac44b93bfa39a0 docs/models/customersgetexternalrequest.md: - last_write_checksum: sha1:1649c705a96922aee3ce971986ddcd8a2657169d + last_write_checksum: sha1:ee037f03acf251243bb2e5e6b5a2ce11499ebc14 docs/models/customersgetrequest.md: - last_write_checksum: sha1:9b07763f3ca58aa29432078fdf421410855b4185 + last_write_checksum: sha1:584d2e70d07439124a9cad503422b6b85209362c docs/models/customersgetstateexternalrequest.md: last_write_checksum: sha1:e46765ae6b6140cf2b14195a334dcc6c03aada4e docs/models/customersgetstaterequest.md: @@ -4896,7 +4928,7 @@ trackedFiles: docs/models/customerslistqueryparamorganizationidfilter.md: last_write_checksum: sha1:943b8d02cc1e5ae96b73fc1cdb8f7987e2689603 docs/models/customerslistrequest.md: - last_write_checksum: sha1:d0d6973dcf09952e364f70159188a207e20fb93d + last_write_checksum: sha1:170c64fefb80210d20d0baf03184294288f7113e docs/models/customerslistresponse.md: last_write_checksum: sha1:1bd4a389881dabd686b57523ff05032e8f0e8dc6 docs/models/customersortproperty.md: @@ -4940,9 +4972,9 @@ trackedFiles: docs/models/customersubscriptionupdateseats.md: last_write_checksum: sha1:0de805d2e88a1f6ea76ced4d263a768fbdf22b60 docs/models/customersupdateexternalrequest.md: - last_write_checksum: sha1:e2534ae28007211e241ca5392668156a99afe266 + last_write_checksum: sha1:f29681dfb1610d442afb902502eb7daf1b0dd4ef docs/models/customersupdaterequest.md: - last_write_checksum: sha1:e731cd8a0b264fefb522a9a3d723a7acb509e665 + last_write_checksum: sha1:1e071c37ea30d848c52e6d64c6a372d0ca658d6c docs/models/customertaxid.md: last_write_checksum: sha1:cb7c9a256fb019375aabd65ec44a15b7dd239a70 docs/models/customerupdate.md: @@ -5781,6 +5813,8 @@ trackedFiles: last_write_checksum: sha1:9019e47d880cb00a5a5e33369cfc02c3a46a10fb docs/models/permission.md: last_write_checksum: sha1:e1e7122dc6f95239365def34f7c27f1f8de33f20 + docs/models/presentmentcurrency.md: + last_write_checksum: sha1:57b3be41da3c79fca570f247c16511cea065be1f docs/models/prices.md: last_write_checksum: sha1:81e08224e6fab8c1342367d2f4fc4006a4cd0d49 docs/models/product.md: @@ -5832,13 +5866,15 @@ trackedFiles: docs/models/productpricemeteredunitcreate.md: last_write_checksum: sha1:2fefde05724c7957e1bad652476c875f03ac9a7f docs/models/productpriceseatbased.md: - last_write_checksum: sha1:791cc88fce1a4c37dad8d9427330a40e4f70ca3a + last_write_checksum: sha1:c7d77da0d13a8f2fca9b5c914ba94a14f08fdb16 docs/models/productpriceseatbasedcreate.md: - last_write_checksum: sha1:0be26489cabba444b1c7a56f4e99fc94235446ff + last_write_checksum: sha1:ba53d1721ea0f7b42dbeb0ff1365c161e7d53efc docs/models/productpriceseattier.md: last_write_checksum: sha1:03e0d4339c3283177211e8247132c1e95024cffb - docs/models/productpriceseattiers.md: - last_write_checksum: sha1:9cbda2bd688762c2a084ae2af1114bd8c15b9092 + docs/models/productpriceseattiersinput.md: + last_write_checksum: sha1:cadbca817ff6cd5cfae8d0c83119007a0a670a2e + docs/models/productpriceseattiersoutput.md: + last_write_checksum: sha1:e3b6241fd883fc36704d3dcf829b160fc02b861c docs/models/productpricesource.md: last_write_checksum: sha1:e557d41e4fd67d5ff0525d78db4fd76f08d4861e docs/models/productpricetype.md: @@ -6070,7 +6106,7 @@ trackedFiles: docs/models/switchingfrom.md: last_write_checksum: sha1:0ebdd2710bc07ae428fca9310d5ab91cea666d07 docs/models/systemevent.md: - last_write_checksum: sha1:6540f79c679f3404bb8e8df096ebefc4f90194d2 + last_write_checksum: sha1:3884f6136b5f12689bf80e88092c913023f41da4 docs/models/taxid.md: last_write_checksum: sha1:64208aafb3624e2eaf1d29edd54f62caf9bc2951 docs/models/taxidformat.md: @@ -6202,7 +6238,7 @@ trackedFiles: docs/models/webhooksubscriptionrevokedpayload.md: last_write_checksum: sha1:cc89a9a7f6da512b0d57e9fea3c98e20dd28e33d docs/models/webhooksubscriptionuncanceledpayload.md: - last_write_checksum: sha1:4c162299feb7ef21a886c16d075dffaf1351a598 + last_write_checksum: sha1:0fb3f671ef29a23a85676de66d73a5a001ee735d docs/models/webhooksubscriptionupdatedpayload.md: last_write_checksum: sha1:d411e9a212190e06378253b215c90285ea91a62c docs/models/webhooksupdatewebhookendpointrequest.md: @@ -6224,7 +6260,7 @@ trackedFiles: docs/sdks/customermeters/README.md: last_write_checksum: sha1:b90c86939a9133539681534059241026b501c783 docs/sdks/customers/README.md: - last_write_checksum: sha1:a96e5221d4b9821a3c642d07cd069000335a5905 + last_write_checksum: sha1:3a2f5a9072c3092d663f3204e8e538d004cf230e docs/sdks/customerseats/README.md: last_write_checksum: sha1:9511d6a050ff7b4b46b039240ad997ed8b290d5f docs/sdks/customersessions/README.md: @@ -6308,7 +6344,7 @@ trackedFiles: src/polar_sdk/_hooks/types.py: last_write_checksum: sha1:a218c66f3e2d1f1b9af54f270472b970b0cc1913 src/polar_sdk/_version.py: - last_write_checksum: sha1:935da146eb1011efb6680088a12973fe4de47514 + last_write_checksum: sha1:40c4d76f24fc7cf054164cbe34c4ef038fd93b7e src/polar_sdk/basesdk.py: last_write_checksum: sha1:b7c864467a5d9cc82d32d648705c6badb19a7706 src/polar_sdk/benefit_grants.py: @@ -6334,7 +6370,7 @@ trackedFiles: src/polar_sdk/customer_sessions.py: last_write_checksum: sha1:407a79bf8b9c09f7a8038cce8c1537b121f9dcb4 src/polar_sdk/customers.py: - last_write_checksum: sha1:5791b874ea05f5285209d208c59d6ebd8cbca0d1 + last_write_checksum: sha1:17a6cd80240d75725a6b276f60af29997d604d2c src/polar_sdk/discounts.py: last_write_checksum: sha1:df3696d6b393495ac58e9fb7c7eb3145b2666dca src/polar_sdk/disputes.py: @@ -6358,7 +6394,7 @@ trackedFiles: src/polar_sdk/metrics_sdk.py: last_write_checksum: sha1:d35cb2e65dcc84d88d36a8f68ccf5a46868aff0f src/polar_sdk/models/__init__.py: - last_write_checksum: sha1:fa5e9a4407069c8e84810bd6743e5dec7930374d + last_write_checksum: sha1:1755da407366e216358c0e08dbaa1e039a2a09ef src/polar_sdk/models/address.py: last_write_checksum: sha1:d0db9f9f7077e8cca27895bdd29e7627fb4c4b53 src/polar_sdk/models/addressdict.py: @@ -6380,11 +6416,27 @@ trackedFiles: src/polar_sdk/models/authorizeorganization.py: last_write_checksum: sha1:68ae4bbffb168321ecf121bd07b83965660204b4 src/polar_sdk/models/authorizeresponseorganization.py: - last_write_checksum: sha1:d7626ae63de40fa0300fa44329085520827c1219 + last_write_checksum: sha1:778d24c87a6a1e07e24af9d91fa8a2421c2405ba src/polar_sdk/models/authorizeresponseuser.py: - last_write_checksum: sha1:e9064d02207a91151e5ca92bb652031a08f95227 + last_write_checksum: sha1:2a20e50c1e6936c735d212ffe2f14aba13351bbe src/polar_sdk/models/authorizeuser.py: last_write_checksum: sha1:af05557ed5733db29179b9925a16dd07246435fa + src/polar_sdk/models/balancedisputeevent.py: + last_write_checksum: sha1:b87418f4ab75c384b51f06fbd760309644be9e5b + src/polar_sdk/models/balancedisputemetadata.py: + last_write_checksum: sha1:40fe80222f4260bbc7f0b52e38999ee0574695f0 + src/polar_sdk/models/balancedisputereversalevent.py: + last_write_checksum: sha1:b727409510446daa46e867ffe11a572f037f524a + src/polar_sdk/models/balanceorderevent.py: + last_write_checksum: sha1:38a95b9570c0ba8f1aff3aea2c18eca0685b96ce + src/polar_sdk/models/balanceordermetadata.py: + last_write_checksum: sha1:ff3a45e82c702c65400b3adf8b04bb20d698538a + src/polar_sdk/models/balancerefundevent.py: + last_write_checksum: sha1:0539838cc5f05bc58e9dd00c3797939efab81b96 + src/polar_sdk/models/balancerefundmetadata.py: + last_write_checksum: sha1:4e948bd2b3d8f843dca0c3c14602eeb1023976b8 + src/polar_sdk/models/balancerefundreversalevent.py: + last_write_checksum: sha1:764d83e077e555d91d31f379eaea083c41c610f9 src/polar_sdk/models/benefit.py: last_write_checksum: sha1:09ff85dfdc946b035f96060cb70bee2f7d28c15f src/polar_sdk/models/benefit_grants_listop.py: @@ -6560,7 +6612,7 @@ trackedFiles: src/polar_sdk/models/checkoutconfirmstripe.py: last_write_checksum: sha1:b35de86a06f5de5831ca806a68703952259a50d0 src/polar_sdk/models/checkoutcreate.py: - last_write_checksum: sha1:9443aa43cdae48e10f5520494ef70c471ccf7649 + last_write_checksum: sha1:bcef60a8d7bfeb9d91495c5f015fc4f6ebe1d3d2 src/polar_sdk/models/checkoutcreatedevent.py: last_write_checksum: sha1:830c25e8831611a73dafd03439d5aadbf10437da src/polar_sdk/models/checkoutcreatedmetadata.py: @@ -6616,7 +6668,7 @@ trackedFiles: src/polar_sdk/models/checkoutstatus.py: last_write_checksum: sha1:0119a771c45046a0898c06dc311cd6deadb88555 src/polar_sdk/models/checkoutupdate.py: - last_write_checksum: sha1:d86d04b28a2c8f591e9b9662935ce25269cf4ab0 + last_write_checksum: sha1:3b1f22c071dd1ae719cd3aecf8323bde17e4098a src/polar_sdk/models/checkoutupdatepublic.py: last_write_checksum: sha1:aa912002a97b4945650be1a76f05033e4bf11538 src/polar_sdk/models/costmetadata_input.py: @@ -6825,8 +6877,6 @@ trackedFiles: last_write_checksum: sha1:f3f7e775c73cffc71eb3ba71b3894693cd106471 src/polar_sdk/models/customerproduct.py: last_write_checksum: sha1:782552ecfcca7bff806ca44106c5cd07310cc6ca - src/polar_sdk/models/customers_createop.py: - last_write_checksum: sha1:27f11dc18c0cb270bc2cdadbc79aa54c4dad0768 src/polar_sdk/models/customers_delete_externalop.py: last_write_checksum: sha1:04f739fbf945e2ec3798e39ca83614debea55a17 src/polar_sdk/models/customers_deleteop.py: @@ -6834,19 +6884,19 @@ trackedFiles: src/polar_sdk/models/customers_exportop.py: last_write_checksum: sha1:e670ae3146bdc5739f8f9d6f7e642e384d02d21f src/polar_sdk/models/customers_get_externalop.py: - last_write_checksum: sha1:00ef2cfb4116ce7ac6e97cba5588598a4370154d + last_write_checksum: sha1:e3d21e1110d8f9d89640789df68383fb59d9c0f3 src/polar_sdk/models/customers_get_state_externalop.py: last_write_checksum: sha1:473a7bf236441048d5585917c562eaa1e9cea516 src/polar_sdk/models/customers_get_stateop.py: last_write_checksum: sha1:7a23d4e641a69d7986f75436633b733d696df829 src/polar_sdk/models/customers_getop.py: - last_write_checksum: sha1:396b96dfda9a242aded6ec90fa35eb2b364bb435 + last_write_checksum: sha1:0722e7b84c12d5bb44ab344f2c48ac30a954eecf src/polar_sdk/models/customers_update_externalop.py: - last_write_checksum: sha1:2eaed32ffc742079a59a627e8facfca303d04a98 + last_write_checksum: sha1:84daeab8661879eb52c85644c7de16c1659b7c11 src/polar_sdk/models/customers_updateop.py: - last_write_checksum: sha1:44b24bf05c58e2d5aea80237bb03eaa367ee17ad + last_write_checksum: sha1:70434f0e5a642b2bb8d66d8557d0e241fd6e03a1 src/polar_sdk/models/customerseat.py: - last_write_checksum: sha1:8d4b1c42642883c319866f680589790c0f142119 + last_write_checksum: sha1:28e22ed22f8edfb82ec3b3aa84de0d50f51e18b1 src/polar_sdk/models/customerseatclaimresponse.py: last_write_checksum: sha1:a13f57e778b286d50e5deda5031b62dcfe70ed28 src/polar_sdk/models/customersession.py: @@ -7389,6 +7439,8 @@ trackedFiles: last_write_checksum: sha1:244c8b0d56fc98007d9b0a8d2a58b43367a2ad38 src/polar_sdk/models/polarerror.py: last_write_checksum: sha1:d09a746165d04c355e8bad3d060c49766ca58b32 + src/polar_sdk/models/presentmentcurrency.py: + last_write_checksum: sha1:f1058df4dd9045e75f262e8c566fd420179a9398 src/polar_sdk/models/product.py: last_write_checksum: sha1:0a6a742c48beafceee88336cabfdab9fea3772ad src/polar_sdk/models/productbenefitsupdate.py: @@ -7426,13 +7478,15 @@ trackedFiles: src/polar_sdk/models/productpricemeteredunitcreate.py: last_write_checksum: sha1:0533b4e805deae576428506f526d89537fde003d src/polar_sdk/models/productpriceseatbased.py: - last_write_checksum: sha1:622fbf0de97e39d7f5d59a7d7e0baeaddb94fa8d + last_write_checksum: sha1:ac8f00eb316ab361738c09e4f61153f92529d450 src/polar_sdk/models/productpriceseatbasedcreate.py: - last_write_checksum: sha1:5297a76586726ace5ac18c2d89dc102a9fdfa9ac + last_write_checksum: sha1:ab872a55d3b70ddb9c11a88f1d730237bb02b2b2 src/polar_sdk/models/productpriceseattier.py: last_write_checksum: sha1:d199502771cfc0b386c21a668d24231a9103e3a9 - src/polar_sdk/models/productpriceseattiers.py: - last_write_checksum: sha1:8b2f6d74c51e86f674bc3a8c864337c8f7d028bd + src/polar_sdk/models/productpriceseattiers_input.py: + last_write_checksum: sha1:5187ff879cd656a2859963f42a79aea4b25b44fa + src/polar_sdk/models/productpriceseattiers_output.py: + last_write_checksum: sha1:3dfb38a1679bef3296069be9b7c91e4d4e5f3dfe src/polar_sdk/models/productpricesource.py: last_write_checksum: sha1:65c3c145c1e3f13ba690357a5df9fb5b7065843b src/polar_sdk/models/productpricetype.py: @@ -7554,7 +7608,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:1d904c8cb498190da171707a0aaf1b7c5eb95207 + last_write_checksum: sha1:e26f9d3394489efe93b12b7490b23ffb62ba9705 src/polar_sdk/models/subscriptions_revokeop.py: last_write_checksum: sha1:e1ca41a0bf57c37d748d641ca62cea7b71509537 src/polar_sdk/models/subscriptions_updateop.py: @@ -7586,7 +7640,7 @@ trackedFiles: src/polar_sdk/models/subtype.py: last_write_checksum: sha1:af98f25883c063ee99b2a99ec3e7fb8c5af32957 src/polar_sdk/models/systemevent.py: - last_write_checksum: sha1:02d614defa8dd86539416915423de7920f48fe47 + last_write_checksum: sha1:81ab0d914839c107138c61f81b59eabd320ed182 src/polar_sdk/models/taxidformat.py: last_write_checksum: sha1:4685423a4e360639e0e01b75e1d34dbdb800ae5b src/polar_sdk/models/timeinterval.py: @@ -7698,7 +7752,7 @@ trackedFiles: src/polar_sdk/models/webhooksubscriptionrevokedpayload.py: last_write_checksum: sha1:ed9abf37f53c7d72181d837e667582af62cf5e8a src/polar_sdk/models/webhooksubscriptionuncanceledpayload.py: - last_write_checksum: sha1:1358a06c9f2b2d25ebab9ec5c107574215ee20f8 + last_write_checksum: sha1:ff03d8e8dcdcb054fb44fbf28457803b27ee6470 src/polar_sdk/models/webhooksubscriptionupdatedpayload.py: last_write_checksum: sha1:da9be2657163468252c84bec9edce685bef9d124 src/polar_sdk/models/webtokenrequest.py: @@ -7742,15 +7796,15 @@ trackedFiles: src/polar_sdk/types/__init__.py: last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed src/polar_sdk/types/basemodel.py: - last_write_checksum: sha1:615d0b364fa924b0fef719958df34596cc7c1ae2 + last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 src/polar_sdk/utils/__init__.py: - last_write_checksum: sha1:81e0385b93362e0f3f6911b65bd4cc601ebc11e1 + last_write_checksum: sha1:887f56a717845fab7445cc368d2a17d850c3565a src/polar_sdk/utils/annotations.py: last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc src/polar_sdk/utils/datetimes.py: last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341 src/polar_sdk/utils/enums.py: - last_write_checksum: sha1:786ba597f79dca6fbc0d87c591752bb8d775ecb7 + last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d src/polar_sdk/utils/eventstreaming.py: last_write_checksum: sha1:bababae5d54b7efc360db701daa49e18a92c2f3b src/polar_sdk/utils/forms.py: @@ -7764,13 +7818,13 @@ trackedFiles: src/polar_sdk/utils/queryparams.py: last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 src/polar_sdk/utils/requestbodies.py: - last_write_checksum: sha1:e0a3a78158eba39880475d62d61be906625676b8 + last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 src/polar_sdk/utils/retries.py: last_write_checksum: sha1:5b97ac4f59357d70c2529975d50364c88bcad607 src/polar_sdk/utils/security.py: last_write_checksum: sha1:a17130ace2c0db6394f38dd941ad2b700cc755c8 src/polar_sdk/utils/serializers.py: - last_write_checksum: sha1:a0d184ace7371a14a7d005cca7f358a03e3d4b07 + last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 src/polar_sdk/utils/unmarshal_json_response.py: last_write_checksum: sha1:76e6cf0cea653777132863db171c5a53d187db78 src/polar_sdk/utils/url.py: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2e5965c3..f58e914b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -28,7 +28,7 @@ generation: skipResponseBodyAssertions: false persistentEdits: {} python: - version: 0.28.1 + version: 0.28.2 additionalDependencies: dev: pydantic-ai-slim: ^0.1.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 320377dc..122e786e 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:a2296677356336366c4a76503e7e7ba132842f9a48a84c6ed0dbd330f6960c74 - sourceBlobDigest: sha256:16616e0b00982de0e23eafdc326269a13c6a4de07ba55aaf350f4ee2399e6838 + sourceRevisionDigest: sha256:4e15c43b0a16c8b392fe56db70c1107ff8a5ecc89d70aae1bd14c613e2590b0c + sourceBlobDigest: sha256:6bc8ba317ea34e04d455235054959809e62f20d72ba9461c7ad9a7db9c431ec0 tags: - latest - - speakeasy-sdk-regen-1762301662 + - speakeasy-sdk-regen-1766276214 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:a2296677356336366c4a76503e7e7ba132842f9a48a84c6ed0dbd330f6960c74 - sourceBlobDigest: sha256:16616e0b00982de0e23eafdc326269a13c6a4de07ba55aaf350f4ee2399e6838 + sourceRevisionDigest: sha256:4e15c43b0a16c8b392fe56db70c1107ff8a5ecc89d70aae1bd14c613e2590b0c + sourceBlobDigest: sha256:6bc8ba317ea34e04d455235054959809e62f20d72ba9461c7ad9a7db9c431ec0 codeSamplesNamespace: polar-oas-py-code-samples - codeSamplesRevisionDigest: sha256:1d25f2976eec11421b26ed079aebe38d6567c88c58f902fe28444c512fc090f6 + codeSamplesRevisionDigest: sha256:6d00db5e4cb3968618fa3b7abbc21369242acd60dc8f80c91d519df55d943a1e workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index ed40d25b..21f02ae2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -993,4 +993,14 @@ Based on: ### Generated - [python v0.28.1] . ### Releases -- [PyPI v0.28.1] https://pypi.org/project/polar-sdk/0.28.1 - . \ No newline at end of file +- [PyPI v0.28.1] https://pypi.org/project/polar-sdk/0.28.1 - . + +## 2026-01-13 00:13:45 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.648.0 (2.737.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.28.2] . +### Releases +- [PyPI v0.28.2] https://pypi.org/project/polar-sdk/0.28.2 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index ee3a2520..84cdd583 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -428,13 +428,13 @@ 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.customers.list(organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\", include_members=False, 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.customers.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/customers/"]["post"] update: "x-codeSamples": - "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.customers.create(customer_create={\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"owner\": {\n \"email\": \"member@example.com\",\n \"name\": \"Jane Doe\",\n \"external_id\": \"usr_1337\",\n },\n }, include_members=False)\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.create(request={\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"owner\": {\n \"email\": \"member@example.com\",\n \"name\": \"Jane Doe\",\n \"external_id\": \"usr_1337\",\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/export"]["get"] update: "x-codeSamples": @@ -452,13 +452,13 @@ 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.customers.get_external(external_id=\"\", include_members=False)\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.get_external(external_id=\"\")\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/external/{external_id}"]["patch"] 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.customers.update_external(external_id=\"\", customer_update_external_id={\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": None,\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n }, include_members=False)\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.update_external(external_id=\"\", customer_update_external_id={\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": None,\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/external/{external_id}/state"]["get"] update: "x-codeSamples": @@ -476,13 +476,13 @@ 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.customers.get(id=\"\", include_members=False)\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.get(id=\"\")\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/{id}"]["patch"] update: "x-codeSamples": - "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.customers.update(id=\"\", customer_update={\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"external_id\": \"usr_1337\",\n }, include_members=False)\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.update(id=\"\", customer_update={\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"external_id\": \"usr_1337\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/{id}/state"]["get"] update: "x-codeSamples": @@ -686,13 +686,13 @@ 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(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.quantities(id=\"\", start_timestamp=parse_datetime(\"2025-11-25T04:37:16.823Z\"), end_timestamp=parse_datetime(\"2025-11-26T17:06:00.727Z\"), interval=polar_sdk.TimeInterval.DAY)\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(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.quantities(id=\"\", start_timestamp=parse_datetime(\"2026-11-25T04:37:16.823Z\"), end_timestamp=parse_datetime(\"2026-11-26T17:06:00.727Z\"), interval=polar_sdk.TimeInterval.DAY)\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/metrics/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from datetime import date\nimport polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.metrics.get(start_date=date.fromisoformat(\"2025-03-14\"), end_date=date.fromisoformat(\"2025-03-18\"), interval=polar_sdk.TimeInterval.HOUR, timezone=\"UTC\", organization_id=None)\n\n # Handle response\n print(res)" + "source": "from datetime import date\nimport polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.metrics.get(start_date=date.fromisoformat(\"2026-03-14\"), end_date=date.fromisoformat(\"2026-03-18\"), interval=polar_sdk.TimeInterval.HOUR, timezone=\"UTC\", organization_id=None)\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/metrics/limits"]["get"] update: "x-codeSamples": @@ -902,7 +902,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.subscriptions.update(id=\"\", subscription_update={\n \"trial_end\": parse_datetime(\"2023-12-04T14:44:14.136Z\"),\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.subscriptions.update(id=\"\", subscription_update={\n \"trial_end\": parse_datetime(\"2024-12-03T14:44:14.136Z\"),\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/webhooks/deliveries"]["get"] update: "x-codeSamples": @@ -956,184 +956,184 @@ 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.endpointbenefit_created_post(request={\n \"type\": \"benefit.created\",\n \"timestamp\": parse_datetime(\"2025-10-17T23:42:52.571Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2025-05-24T21:27:59.843Z\"),\n \"modified_at\": parse_datetime(\"2024-07-01T06:29:09.775Z\"),\n \"type\": \"github_repository\",\n \"description\": \"beneath terrorise but about uh-huh\",\n \"selectable\": False,\n \"deletable\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"properties\": {\n \"repository_owner\": \"polarsource\",\n \"repository_name\": \"private_repo\",\n \"permission\": polar_sdk.Permission.PUSH,\n },\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.endpointbenefit_created_post(request={\n \"type\": \"benefit.created\",\n \"timestamp\": parse_datetime(\"2026-10-17T23:42:52.571Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2026-05-24T21:27:59.843Z\"),\n \"modified_at\": parse_datetime(\"2025-07-01T06:29:09.775Z\"),\n \"type\": \"github_repository\",\n \"description\": \"beneath terrorise but about uh-huh\",\n \"selectable\": False,\n \"deletable\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"properties\": {\n \"repository_owner\": \"polarsource\",\n \"repository_name\": \"private_repo\",\n \"permission\": polar_sdk.Permission.PUSH,\n },\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["benefit.updated"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_updated_post(request={\n \"type\": \"benefit.updated\",\n \"timestamp\": parse_datetime(\"2024-09-24T20:33:20.375Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2025-12-28T13:48:13.081Z\"),\n \"modified_at\": parse_datetime(\"2023-10-27T10:32:06.844Z\"),\n \"type\": \"custom\",\n \"description\": \"fooey save simple an prime fast modulo nor randomize worth\",\n \"selectable\": False,\n \"deletable\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"properties\": {\n \"note\": \"\",\n },\n },\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointbenefit_updated_post(request={\n \"type\": \"benefit.updated\",\n \"timestamp\": parse_datetime(\"2025-09-24T20:33:20.375Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2026-12-28T13:48:13.081Z\"),\n \"modified_at\": parse_datetime(\"2024-10-26T10:32:06.844Z\"),\n \"type\": \"custom\",\n \"description\": \"fooey save simple an prime fast modulo nor randomize worth\",\n \"selectable\": False,\n \"deletable\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"properties\": {\n \"note\": \"\",\n },\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["benefit_grant.created"]["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.endpointbenefit_grant_created_post(request=polar_sdk.WebhookBenefitGrantCreatedPayload(\n timestamp=parse_datetime(\"2025-07-29T09:12:26.895Z\"),\n data=polar_sdk.BenefitGrantCustomWebhook(\n created_at=parse_datetime(\"2025-07-26T11:51:14.320Z\"),\n modified_at=parse_datetime(\"2023-06-26T18:19:56.152Z\"),\n id=\"\",\n is_granted=False,\n is_revoked=True,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-05-12T01:27:02.379Z\"),\n modified_at=parse_datetime(\"2023-11-17T04:22:37.821Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2023-02-21T01:01:33.050Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitCustom(\n id=\"\",\n created_at=parse_datetime(\"2023-07-27T17:46:55.663Z\"),\n modified_at=parse_datetime(\"2024-02-04T07:22:26.555Z\"),\n description=\"blah even spirit reprove gee instead that longingly\",\n selectable=False,\n deletable=True,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitCustomProperties(\n note=None,\n ),\n ),\n properties=polar_sdk.BenefitGrantCustomProperties(),\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.endpointbenefit_grant_created_post(request=polar_sdk.WebhookBenefitGrantCreatedPayload(\n timestamp=parse_datetime(\"2026-07-29T09:12:26.895Z\"),\n data=polar_sdk.BenefitGrantCustomWebhook(\n created_at=parse_datetime(\"2026-07-26T11:51:14.320Z\"),\n modified_at=parse_datetime(\"2024-06-25T18:19:56.152Z\"),\n id=\"\",\n is_granted=False,\n is_revoked=True,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-05-12T01:27:02.379Z\"),\n modified_at=parse_datetime(\"2024-11-16T04:22:37.821Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-02-21T01:01:33.050Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitCustom(\n id=\"\",\n created_at=parse_datetime(\"2024-07-26T17:46:55.663Z\"),\n modified_at=parse_datetime(\"2025-02-03T07:22:26.555Z\"),\n description=\"blah even spirit reprove gee instead that longingly\",\n selectable=False,\n deletable=True,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitCustomProperties(\n note=None,\n ),\n ),\n properties=polar_sdk.BenefitGrantCustomProperties(),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["benefit_grant.cycled"]["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.endpointbenefit_grant_cycled_post(request=polar_sdk.WebhookBenefitGrantCycledPayload(\n timestamp=parse_datetime(\"2023-11-21T13:26:50.948Z\"),\n data=polar_sdk.BenefitGrantDiscordWebhook(\n created_at=parse_datetime(\"2023-07-19T03:56:32.649Z\"),\n modified_at=parse_datetime(\"2025-06-08T22:06:37.934Z\"),\n id=\"\",\n is_granted=False,\n is_revoked=False,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-06-18T10:06:52.830Z\"),\n modified_at=parse_datetime(\"2024-06-29T04:36:34.181Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-09-22T10:01:13.690Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitDiscord(\n id=\"\",\n created_at=parse_datetime(\"2024-08-15T00:34:14.846Z\"),\n modified_at=parse_datetime(\"2025-10-24T15:26:44.314Z\"),\n description=\"unimportant ah prickly past\",\n selectable=True,\n deletable=True,\n organization_id=\"\",\n metadata={\n \"key\": \"\",\n },\n properties=polar_sdk.BenefitDiscordProperties(\n guild_id=\"\",\n role_id=\"\",\n kick_member=True,\n guild_token=\"\",\n ),\n ),\n properties=polar_sdk.BenefitGrantDiscordProperties(),\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.endpointbenefit_grant_cycled_post(request=polar_sdk.WebhookBenefitGrantCycledPayload(\n timestamp=parse_datetime(\"2024-11-20T13:26:50.948Z\"),\n data=polar_sdk.BenefitGrantDiscordWebhook(\n created_at=parse_datetime(\"2024-07-18T03:56:32.649Z\"),\n modified_at=parse_datetime(\"2026-06-08T22:06:37.934Z\"),\n id=\"\",\n is_granted=False,\n is_revoked=False,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-06-18T10:06:52.830Z\"),\n modified_at=parse_datetime(\"2025-06-29T04:36:34.181Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-09-22T10:01:13.690Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitDiscord(\n id=\"\",\n created_at=parse_datetime(\"2025-08-15T00:34:14.846Z\"),\n modified_at=parse_datetime(\"2026-10-24T15:26:44.314Z\"),\n description=\"unimportant ah prickly past\",\n selectable=True,\n deletable=True,\n organization_id=\"\",\n metadata={\n \"key\": \"\",\n },\n properties=polar_sdk.BenefitDiscordProperties(\n guild_id=\"\",\n role_id=\"\",\n kick_member=True,\n guild_token=\"\",\n ),\n ),\n properties=polar_sdk.BenefitGrantDiscordProperties(),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["benefit_grant.revoked"]["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.endpointbenefit_grant_revoked_post(request=polar_sdk.WebhookBenefitGrantRevokedPayload(\n timestamp=parse_datetime(\"2025-10-11T18:40:00.865Z\"),\n data=polar_sdk.BenefitGrantDiscordWebhook(\n created_at=parse_datetime(\"2023-04-30T09:48:15.700Z\"),\n modified_at=parse_datetime(\"2024-12-06T00:35:53.453Z\"),\n id=\"\",\n is_granted=True,\n is_revoked=True,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-05-05T05:52:04.552Z\"),\n modified_at=parse_datetime(\"2024-09-18T14:08:44.723Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\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-11-04T03:19:52.925Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitDiscord(\n id=\"\",\n created_at=parse_datetime(\"2024-03-12T16:39:36.178Z\"),\n modified_at=parse_datetime(\"2024-07-08T07:08:59.377Z\"),\n description=\"grandiose royal surface before ouch silently authentic more override reassuringly\",\n selectable=False,\n deletable=True,\n organization_id=\"\",\n metadata={\n \"key\": \"\",\n },\n properties=polar_sdk.BenefitDiscordProperties(\n guild_id=\"\",\n role_id=\"\",\n kick_member=False,\n guild_token=\"\",\n ),\n ),\n properties=polar_sdk.BenefitGrantDiscordProperties(),\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.endpointbenefit_grant_revoked_post(request=polar_sdk.WebhookBenefitGrantRevokedPayload(\n timestamp=parse_datetime(\"2026-10-11T18:40:00.865Z\"),\n data=polar_sdk.BenefitGrantDiscordWebhook(\n created_at=parse_datetime(\"2024-04-29T09:48:15.700Z\"),\n modified_at=parse_datetime(\"2025-12-06T00:35:53.453Z\"),\n id=\"\",\n is_granted=True,\n is_revoked=True,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-05-05T05:52:04.552Z\"),\n modified_at=parse_datetime(\"2025-09-18T14:08:44.723Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\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(\"2026-11-04T03:19:52.925Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitDiscord(\n id=\"\",\n created_at=parse_datetime(\"2025-03-12T16:39:36.178Z\"),\n modified_at=parse_datetime(\"2025-07-08T07:08:59.377Z\"),\n description=\"grandiose royal surface before ouch silently authentic more override reassuringly\",\n selectable=False,\n deletable=True,\n organization_id=\"\",\n metadata={\n \"key\": \"\",\n },\n properties=polar_sdk.BenefitDiscordProperties(\n guild_id=\"\",\n role_id=\"\",\n kick_member=False,\n guild_token=\"\",\n ),\n ),\n properties=polar_sdk.BenefitGrantDiscordProperties(),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["benefit_grant.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.endpointbenefit_grant_updated_post(request=polar_sdk.WebhookBenefitGrantUpdatedPayload(\n timestamp=parse_datetime(\"2023-06-15T00:42:20.858Z\"),\n data=polar_sdk.BenefitGrantDownloadablesWebhook(\n created_at=parse_datetime(\"2023-09-09T02:35:13.085Z\"),\n modified_at=parse_datetime(\"2024-04-28T04:44:42.040Z\"),\n id=\"\",\n is_granted=True,\n is_revoked=False,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-06-22T06:57:35.281Z\"),\n modified_at=parse_datetime(\"2025-06-14T15:07:20.731Z\"),\n metadata={\n \"key\": 322224,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-09-29T05:46:04.457Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitDownloadables(\n id=\"\",\n created_at=parse_datetime(\"2025-09-22T18:19:02.554Z\"),\n modified_at=parse_datetime(\"2023-12-23T22:21:47.780Z\"),\n description=\"diligently phony super boo veg crafty\",\n selectable=False,\n deletable=True,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitDownloadablesProperties(\n archived={\n \"key\": False,\n \"key1\": False,\n \"key2\": True,\n },\n files=[],\n ),\n ),\n properties=polar_sdk.BenefitGrantDownloadablesProperties(),\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.endpointbenefit_grant_updated_post(request=polar_sdk.WebhookBenefitGrantUpdatedPayload(\n timestamp=parse_datetime(\"2024-06-14T00:42:20.858Z\"),\n data=polar_sdk.BenefitGrantDownloadablesWebhook(\n created_at=parse_datetime(\"2024-09-08T02:35:13.085Z\"),\n modified_at=parse_datetime(\"2025-04-28T04:44:42.040Z\"),\n id=\"\",\n is_granted=True,\n is_revoked=False,\n subscription_id=\"\",\n order_id=\"\",\n customer_id=\"\",\n benefit_id=\"\",\n customer=polar_sdk.Customer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-06-22T06:57:35.281Z\"),\n modified_at=parse_datetime(\"2026-06-14T15:07:20.731Z\"),\n metadata={\n \"key\": 322224,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-09-29T05:46:04.457Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n benefit=polar_sdk.BenefitDownloadables(\n id=\"\",\n created_at=parse_datetime(\"2026-09-22T18:19:02.554Z\"),\n modified_at=parse_datetime(\"2024-12-22T22:21:47.780Z\"),\n description=\"diligently phony super boo veg crafty\",\n selectable=False,\n deletable=True,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitDownloadablesProperties(\n archived={\n \"key\": False,\n \"key1\": False,\n \"key2\": True,\n },\n files=[],\n ),\n ),\n properties=polar_sdk.BenefitGrantDownloadablesProperties(),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["checkout.created"]["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.endpointcheckout_created_post(request=polar_sdk.WebhookCheckoutCreatedPayload(\n timestamp=parse_datetime(\"2023-02-15T15:44:21.478Z\"),\n data=polar_sdk.Checkout(\n id=\"\",\n created_at=parse_datetime(\"2025-09-12T19:48:15.814Z\"),\n modified_at=parse_datetime(\"2023-09-14T02:01:27.394Z\"),\n payment_processor=polar_sdk.PaymentProcessor.STRIPE,\n status=polar_sdk.CheckoutStatus.EXPIRED,\n client_secret=\"\",\n url=\"https://agreeable-reboot.biz\",\n expires_at=parse_datetime(\"2024-05-02T18:25:33.974Z\"),\n success_url=\"https://rural-outrun.org\",\n return_url=\"https://clean-humidity.com/\",\n embed_origin=\"\",\n amount=275553,\n discount_amount=9980,\n net_amount=266632,\n tax_amount=348968,\n total_amount=203013,\n currency=\"Australian Dollar\",\n allow_trial=True,\n active_trial_interval=polar_sdk.TrialInterval.MONTH,\n active_trial_interval_count=47757,\n trial_end=None,\n organization_id=\"\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=\"\",\n allow_discount_codes=False,\n require_billing_address=False,\n is_discount_applicable=False,\n is_free_product_price=False,\n is_payment_required=False,\n is_payment_setup_required=False,\n is_payment_form_required=False,\n customer_id=\"\",\n is_business_customer=False,\n customer_name=\"\",\n customer_email=\"\",\n customer_ip_address=\"\",\n customer_billing_name=\"\",\n customer_billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n customer_tax_id=\"\",\n payment_processor_metadata={\n\n },\n billing_address_fields=polar_sdk.CheckoutBillingAddressFields(\n country=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n state=polar_sdk.BillingAddressFieldMode.DISABLED,\n city=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n postal_code=polar_sdk.BillingAddressFieldMode.REQUIRED,\n line1=polar_sdk.BillingAddressFieldMode.DISABLED,\n line2=polar_sdk.BillingAddressFieldMode.REQUIRED,\n ),\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=945017,\n metadata={\n\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[\n polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2023-01-06T18:09:03.676Z\"),\n modified_at=parse_datetime(\"2024-05-28T21:42:41.690Z\"),\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=590205,\n name=\"\",\n description=\"structure tenderly dirty colon though\",\n recurring_interval=None,\n recurring_interval_count=996088,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n prices=[],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/var/yp\",\n mime_type=\"\",\n size=1211,\n storage_version=\"\",\n checksum_etag=None,\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2023-08-11T21:05:07.943Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2024-09-05T01:36:20.132Z\"),\n size_readable=\"\",\n public_url=\"https://next-peninsula.net\",\n ),\n ],\n ),\n ],\n product=polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2025-07-24T22:06:51.276Z\"),\n modified_at=parse_datetime(\"2025-04-12T19:47:40.853Z\"),\n trial_interval=None,\n trial_interval_count=None,\n name=\"\",\n description=\"below presell cleave silky marimba\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=174683,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n prices=[],\n benefits=[],\n medias=[],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2025-09-14T04:08:29.152Z\"),\n modified_at=parse_datetime(\"2025-10-07T17:41:46.324Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n price_amount=489298,\n ),\n prices={\n \"key\": [\n polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2024-10-07T04:25:23.887Z\"),\n modified_at=parse_datetime(\"2023-09-27T23:58:12.698Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n minimum_amount=680201,\n maximum_amount=872809,\n preset_amount=973180,\n ),\n ],\n \"key1\": [\n polar_sdk.LegacyRecurringProductPriceFree(\n created_at=parse_datetime(\"2023-06-29T11:47:03.272Z\"),\n modified_at=parse_datetime(\"2024-03-23T13:16:28.157Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n ),\n ],\n \"key2\": [],\n },\n discount=polar_sdk.CheckoutDiscountFixedRepeatDuration(\n duration=polar_sdk.DiscountDuration.REPEATING,\n duration_in_months=821665,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n id=\"\",\n name=\"\",\n code=\"\",\n ),\n subscription_id=\"\",\n attached_custom_fields=[],\n customer_metadata={\n \"key\": True,\n },\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.endpointcheckout_created_post(request=polar_sdk.WebhookCheckoutCreatedPayload(\n timestamp=parse_datetime(\"2024-02-15T15:44:21.478Z\"),\n data=polar_sdk.Checkout(\n id=\"\",\n created_at=parse_datetime(\"2026-09-12T19:48:15.814Z\"),\n modified_at=parse_datetime(\"2024-09-13T02:01:27.394Z\"),\n payment_processor=polar_sdk.PaymentProcessor.STRIPE,\n status=polar_sdk.CheckoutStatus.EXPIRED,\n client_secret=\"\",\n url=\"https://agreeable-reboot.biz\",\n expires_at=parse_datetime(\"2025-05-02T18:25:33.974Z\"),\n success_url=\"https://rural-outrun.org\",\n return_url=\"https://clean-humidity.com/\",\n embed_origin=\"\",\n amount=275553,\n discount_amount=9980,\n net_amount=266632,\n tax_amount=348968,\n total_amount=203013,\n currency=\"Australian Dollar\",\n allow_trial=True,\n active_trial_interval=polar_sdk.TrialInterval.MONTH,\n active_trial_interval_count=47757,\n trial_end=None,\n organization_id=\"\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=\"\",\n allow_discount_codes=False,\n require_billing_address=False,\n is_discount_applicable=False,\n is_free_product_price=False,\n is_payment_required=False,\n is_payment_setup_required=False,\n is_payment_form_required=False,\n customer_id=\"\",\n is_business_customer=False,\n customer_name=\"\",\n customer_email=\"\",\n customer_ip_address=\"\",\n customer_billing_name=\"\",\n customer_billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n customer_tax_id=\"\",\n payment_processor_metadata={\n\n },\n billing_address_fields=polar_sdk.CheckoutBillingAddressFields(\n country=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n state=polar_sdk.BillingAddressFieldMode.DISABLED,\n city=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n postal_code=polar_sdk.BillingAddressFieldMode.REQUIRED,\n line1=polar_sdk.BillingAddressFieldMode.DISABLED,\n line2=polar_sdk.BillingAddressFieldMode.REQUIRED,\n ),\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=945017,\n metadata={\n\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[\n polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2024-01-06T18:09:03.676Z\"),\n modified_at=parse_datetime(\"2025-05-28T21:42:41.690Z\"),\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=590205,\n name=\"\",\n description=\"structure tenderly dirty colon though\",\n recurring_interval=None,\n recurring_interval_count=996088,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n prices=[],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/var/yp\",\n mime_type=\"\",\n size=1211,\n storage_version=\"\",\n checksum_etag=None,\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-08-10T21:05:07.943Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2025-09-05T01:36:20.132Z\"),\n size_readable=\"\",\n public_url=\"https://next-peninsula.net\",\n ),\n ],\n ),\n ],\n product=polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2026-07-24T22:06:51.276Z\"),\n modified_at=parse_datetime(\"2026-04-12T19:47:40.853Z\"),\n trial_interval=None,\n trial_interval_count=None,\n name=\"\",\n description=\"below presell cleave silky marimba\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=174683,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n prices=[],\n benefits=[],\n medias=[],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2026-09-14T04:08:29.152Z\"),\n modified_at=parse_datetime(\"2026-10-07T17:41:46.324Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n price_amount=489298,\n ),\n prices={\n \"key\": [\n polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2025-10-07T04:25:23.887Z\"),\n modified_at=parse_datetime(\"2024-09-26T23:58:12.698Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n minimum_amount=680201,\n maximum_amount=872809,\n preset_amount=973180,\n ),\n ],\n \"key1\": [\n polar_sdk.LegacyRecurringProductPriceFree(\n created_at=parse_datetime(\"2024-06-28T11:47:03.272Z\"),\n modified_at=parse_datetime(\"2025-03-23T13:16:28.157Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n ),\n ],\n \"key2\": [],\n },\n discount=polar_sdk.CheckoutDiscountFixedRepeatDuration(\n duration=polar_sdk.DiscountDuration.REPEATING,\n duration_in_months=821665,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n id=\"\",\n name=\"\",\n code=\"\",\n ),\n subscription_id=\"\",\n attached_custom_fields=[],\n customer_metadata={\n \"key\": True,\n },\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["checkout.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.endpointcheckout_updated_post(request=polar_sdk.WebhookCheckoutUpdatedPayload(\n timestamp=parse_datetime(\"2023-03-19T05:40:46.816Z\"),\n data=polar_sdk.Checkout(\n id=\"\",\n created_at=parse_datetime(\"2024-09-17T13:52:37.257Z\"),\n modified_at=parse_datetime(\"2024-11-07T08:23:01.152Z\"),\n payment_processor=polar_sdk.PaymentProcessor.STRIPE,\n status=polar_sdk.CheckoutStatus.EXPIRED,\n client_secret=\"\",\n url=\"https://male-punctuation.name\",\n expires_at=parse_datetime(\"2025-03-26T06:13:51.386Z\"),\n success_url=\"https://monumental-mathematics.info\",\n return_url=\"https://scary-valley.com/\",\n embed_origin=\"\",\n amount=867510,\n discount_amount=469340,\n net_amount=139232,\n tax_amount=373760,\n total_amount=41301,\n currency=\"Azerbaijanian Manat\",\n allow_trial=True,\n active_trial_interval=None,\n active_trial_interval_count=669303,\n trial_end=parse_datetime(\"2025-01-10T10:00:41.343Z\"),\n organization_id=\"\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=\"\",\n allow_discount_codes=True,\n require_billing_address=False,\n is_discount_applicable=False,\n is_free_product_price=False,\n is_payment_required=True,\n is_payment_setup_required=True,\n is_payment_form_required=True,\n customer_id=\"\",\n is_business_customer=False,\n customer_name=\"\",\n customer_email=\"\",\n customer_ip_address=\"\",\n customer_billing_name=\"\",\n customer_billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n customer_tax_id=\"\",\n payment_processor_metadata={\n \"key\": \"\",\n \"key1\": \"\",\n \"key2\": \"\",\n },\n billing_address_fields=polar_sdk.CheckoutBillingAddressFields(\n country=polar_sdk.BillingAddressFieldMode.DISABLED,\n state=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n city=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n postal_code=polar_sdk.BillingAddressFieldMode.REQUIRED,\n line1=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n line2=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n ),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=591735,\n metadata={\n\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[\n polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2023-06-21T05:48:31.398Z\"),\n modified_at=parse_datetime(\"2024-09-06T09:34:57.464Z\"),\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=868555,\n name=\"\",\n description=\"tempting by or hippodrome mountain strict militate soupy partially simple\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=787637,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n prices=[],\n benefits=[\n polar_sdk.BenefitPublic(\n id=\"\",\n created_at=parse_datetime(\"2024-03-20T21:54:02.026Z\"),\n modified_at=parse_datetime(\"2025-11-22T22:06:43.546Z\"),\n type=polar_sdk.BenefitType.GITHUB_REPOSITORY,\n description=\"boring mysterious psst though lest\",\n selectable=False,\n deletable=False,\n organization_id=\"\",\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/var/yp\",\n mime_type=\"\",\n size=742109,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-01-05T08:21:09.966Z\"),\n version=None,\n is_uploaded=False,\n created_at=parse_datetime(\"2024-07-12T04:50:26.552Z\"),\n size_readable=\"\",\n public_url=\"https://common-makeover.biz/\",\n ),\n ],\n ),\n ],\n product=polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2024-06-19T06:14:05.114Z\"),\n modified_at=parse_datetime(\"2023-03-11T18:17:16.587Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=392090,\n name=\"\",\n description=\"whereas steeple brr regularly make huzzah cheerfully ignite sense\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=439686,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2025-06-19T15:55:16.121Z\"),\n modified_at=parse_datetime(\"2025-11-24T07:57:40.732Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n price_currency=\"\",\n price_amount=357928,\n ),\n ],\n benefits=[],\n medias=[],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2023-07-25T08:49:00.941Z\"),\n modified_at=parse_datetime(\"2024-02-14T11:02:18.649Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n price_amount=347948,\n ),\n prices={\n \"key\": [],\n },\n discount=polar_sdk.CheckoutDiscountFixedOnceForeverDuration(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n id=\"\",\n name=\"\",\n code=\"\",\n ),\n subscription_id=\"\",\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldNumber(\n created_at=parse_datetime(\"2023-11-25T09:30:53.131Z\"),\n modified_at=parse_datetime(\"2024-10-15T09:09:32.242Z\"),\n id=\"\",\n metadata={\n \"key\": 9467.85,\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldNumberProperties(),\n ),\n order=591165,\n required=False,\n ),\n ],\n customer_metadata={\n\n },\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.endpointcheckout_updated_post(request=polar_sdk.WebhookCheckoutUpdatedPayload(\n timestamp=parse_datetime(\"2024-03-18T05:40:46.816Z\"),\n data=polar_sdk.Checkout(\n id=\"\",\n created_at=parse_datetime(\"2025-09-17T13:52:37.257Z\"),\n modified_at=parse_datetime(\"2025-11-07T08:23:01.152Z\"),\n payment_processor=polar_sdk.PaymentProcessor.STRIPE,\n status=polar_sdk.CheckoutStatus.EXPIRED,\n client_secret=\"\",\n url=\"https://male-punctuation.name\",\n expires_at=parse_datetime(\"2026-03-26T06:13:51.386Z\"),\n success_url=\"https://monumental-mathematics.info\",\n return_url=\"https://scary-valley.com/\",\n embed_origin=\"\",\n amount=867510,\n discount_amount=469340,\n net_amount=139232,\n tax_amount=373760,\n total_amount=41301,\n currency=\"Azerbaijanian Manat\",\n allow_trial=True,\n active_trial_interval=None,\n active_trial_interval_count=669303,\n trial_end=parse_datetime(\"2026-01-10T10:00:41.343Z\"),\n organization_id=\"\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=\"\",\n allow_discount_codes=True,\n require_billing_address=False,\n is_discount_applicable=False,\n is_free_product_price=False,\n is_payment_required=True,\n is_payment_setup_required=True,\n is_payment_form_required=True,\n customer_id=\"\",\n is_business_customer=False,\n customer_name=\"\",\n customer_email=\"\",\n customer_ip_address=\"\",\n customer_billing_name=\"\",\n customer_billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n customer_tax_id=\"\",\n payment_processor_metadata={\n \"key\": \"\",\n \"key1\": \"\",\n \"key2\": \"\",\n },\n billing_address_fields=polar_sdk.CheckoutBillingAddressFields(\n country=polar_sdk.BillingAddressFieldMode.DISABLED,\n state=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n city=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n postal_code=polar_sdk.BillingAddressFieldMode.REQUIRED,\n line1=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n line2=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n ),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=591735,\n metadata={\n\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[\n polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2024-06-20T05:48:31.398Z\"),\n modified_at=parse_datetime(\"2025-09-06T09:34:57.464Z\"),\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=868555,\n name=\"\",\n description=\"tempting by or hippodrome mountain strict militate soupy partially simple\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=787637,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n prices=[],\n benefits=[\n polar_sdk.BenefitPublic(\n id=\"\",\n created_at=parse_datetime(\"2025-03-20T21:54:02.026Z\"),\n modified_at=parse_datetime(\"2026-11-22T22:06:43.546Z\"),\n type=polar_sdk.BenefitType.GITHUB_REPOSITORY,\n description=\"boring mysterious psst though lest\",\n selectable=False,\n deletable=False,\n organization_id=\"\",\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/var/yp\",\n mime_type=\"\",\n size=742109,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-01-04T08:21:09.966Z\"),\n version=None,\n is_uploaded=False,\n created_at=parse_datetime(\"2025-07-12T04:50:26.552Z\"),\n size_readable=\"\",\n public_url=\"https://common-makeover.biz/\",\n ),\n ],\n ),\n ],\n product=polar_sdk.CheckoutProduct(\n id=\"\",\n created_at=parse_datetime(\"2025-06-19T06:14:05.114Z\"),\n modified_at=parse_datetime(\"2024-03-10T18:17:16.587Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=392090,\n name=\"\",\n description=\"whereas steeple brr regularly make huzzah cheerfully ignite sense\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=439686,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2026-06-19T15:55:16.121Z\"),\n modified_at=parse_datetime(\"2026-11-24T07:57:40.732Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n price_currency=\"\",\n price_amount=357928,\n ),\n ],\n benefits=[],\n medias=[],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2024-07-24T08:49:00.941Z\"),\n modified_at=parse_datetime(\"2025-02-13T11:02:18.649Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n price_amount=347948,\n ),\n prices={\n \"key\": [],\n },\n discount=polar_sdk.CheckoutDiscountFixedOnceForeverDuration(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n id=\"\",\n name=\"\",\n code=\"\",\n ),\n subscription_id=\"\",\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldNumber(\n created_at=parse_datetime(\"2024-11-24T09:30:53.131Z\"),\n modified_at=parse_datetime(\"2025-10-15T09:09:32.242Z\"),\n id=\"\",\n metadata={\n \"key\": 9467.85,\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldNumberProperties(),\n ),\n order=591165,\n required=False,\n ),\n ],\n customer_metadata={\n\n },\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["customer.created"]["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.endpointcustomer_created_post(request={\n \"type\": \"customer.created\",\n \"timestamp\": parse_datetime(\"2025-10-24T17:37:29.711Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2025-03-08T02:57:16.205Z\"),\n \"modified_at\": parse_datetime(\"2024-10-31T06:26:45.555Z\"),\n \"metadata\": {\n\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.US,\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"deleted_at\": parse_datetime(\"2023-03-24T20:28:46.681Z\"),\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\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.endpointcustomer_created_post(request={\n \"type\": \"customer.created\",\n \"timestamp\": parse_datetime(\"2026-10-24T17:37:29.711Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2026-03-08T02:57:16.205Z\"),\n \"modified_at\": parse_datetime(\"2025-10-31T06:26:45.555Z\"),\n \"metadata\": {\n\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.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-23T20:28:46.681Z\"),\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["customer.deleted"]["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.endpointcustomer_deleted_post(request={\n \"type\": \"customer.deleted\",\n \"timestamp\": parse_datetime(\"2023-07-12T21:40:34.752Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2025-12-23T11:32:42.100Z\"),\n \"modified_at\": parse_datetime(\"2023-07-09T17:16:24.833Z\"),\n \"metadata\": {\n\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.US,\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"deleted_at\": parse_datetime(\"2023-09-30T09:04:17.770Z\"),\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\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.endpointcustomer_deleted_post(request={\n \"type\": \"customer.deleted\",\n \"timestamp\": parse_datetime(\"2024-07-11T21:40:34.752Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2026-12-23T11:32:42.100Z\"),\n \"modified_at\": parse_datetime(\"2024-07-08T17:16:24.833Z\"),\n \"metadata\": {\n\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.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-09-29T09:04:17.770Z\"),\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["customer.state_changed"]["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.endpointcustomer_state_changed_post(request={\n \"type\": \"customer.state_changed\",\n \"timestamp\": parse_datetime(\"2025-05-22T16:03:32.369Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2023-07-25T20:57:42.542Z\"),\n \"modified_at\": None,\n \"metadata\": {\n\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.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-09-08T18:19:10.187Z\"),\n \"active_subscriptions\": [],\n \"granted_benefits\": [\n {\n \"id\": \"d322132c-a9d0-4e0d-b8d3-d81ad021a3a9\",\n \"created_at\": parse_datetime(\"2025-09-01T02:21:29.525Z\"),\n \"modified_at\": parse_datetime(\"2023-11-12T17:51:37.646Z\"),\n \"granted_at\": parse_datetime(\"2025-01-03T13:37:00Z\"),\n \"benefit_id\": \"397a17aa-15cf-4cb4-9333-18040203cf98\",\n \"benefit_type\": polar_sdk.BenefitType.METER_CREDIT,\n \"benefit_metadata\": {\n\n },\n \"properties\": {},\n },\n ],\n \"active_meters\": [],\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\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.endpointcustomer_state_changed_post(request={\n \"type\": \"customer.state_changed\",\n \"timestamp\": parse_datetime(\"2026-05-22T16:03:32.369Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2024-07-24T20:57:42.542Z\"),\n \"modified_at\": None,\n \"metadata\": {\n\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.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-09-08T18:19:10.187Z\"),\n \"active_subscriptions\": [],\n \"granted_benefits\": [\n {\n \"id\": \"d322132c-a9d0-4e0d-b8d3-d81ad021a3a9\",\n \"created_at\": parse_datetime(\"2026-09-01T02:21:29.525Z\"),\n \"modified_at\": parse_datetime(\"2024-11-11T17:51:37.646Z\"),\n \"granted_at\": parse_datetime(\"2025-01-03T13:37:00Z\"),\n \"benefit_id\": \"397a17aa-15cf-4cb4-9333-18040203cf98\",\n \"benefit_type\": polar_sdk.BenefitType.METER_CREDIT,\n \"benefit_metadata\": {\n\n },\n \"properties\": {},\n },\n ],\n \"active_meters\": [],\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["customer.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.endpointcustomer_updated_post(request={\n \"type\": \"customer.updated\",\n \"timestamp\": parse_datetime(\"2023-07-09T20:22:33.716Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2024-07-18T23:25:12.977Z\"),\n \"modified_at\": parse_datetime(\"2023-04-07T04:58:11.725Z\"),\n \"metadata\": {\n \"key\": 983601,\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.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-01-11T12:43:11.694Z\"),\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\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.endpointcustomer_updated_post(request={\n \"type\": \"customer.updated\",\n \"timestamp\": parse_datetime(\"2024-07-08T20:22:33.716Z\"),\n \"data\": {\n \"id\": \"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n \"created_at\": parse_datetime(\"2025-07-18T23:25:12.977Z\"),\n \"modified_at\": parse_datetime(\"2024-04-06T04:58:11.725Z\"),\n \"metadata\": {\n \"key\": 983601,\n },\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"email_verified\": True,\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2.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-01-11T12:43:11.694Z\"),\n \"avatar_url\": \"https://www.gravatar.com/avatar/xxx?d=404\",\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["customer_seat.assigned"]["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.endpointcustomer_seat_assigned_post(request={\n \"type\": \"customer_seat.assigned\",\n \"timestamp\": parse_datetime(\"2023-01-24T21:46:22.729Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2024-04-02T01:55:00.575Z\"),\n \"modified_at\": parse_datetime(\"2025-03-27T17:16:29.966Z\"),\n \"id\": \"ded032fb-362e-4ae1-83b9-4f4bcab6f430\",\n \"status\": polar_sdk.SeatStatus.REVOKED,\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.endpointcustomer_seat_assigned_post(request={\n \"type\": \"customer_seat.assigned\",\n \"timestamp\": parse_datetime(\"2024-01-24T21:46:22.729Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2025-04-02T01:55:00.575Z\"),\n \"modified_at\": parse_datetime(\"2026-03-27T17:16:29.966Z\"),\n \"id\": \"ded032fb-362e-4ae1-83b9-4f4bcab6f430\",\n \"status\": polar_sdk.SeatStatus.REVOKED,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["customer_seat.claimed"]["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.endpointcustomer_seat_claimed_post(request={\n \"type\": \"customer_seat.claimed\",\n \"timestamp\": parse_datetime(\"2023-08-22T13:16:39.616Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2023-05-10T18:50:40.033Z\"),\n \"modified_at\": parse_datetime(\"2023-07-12T19:06:41.896Z\"),\n \"id\": \"35ac8c8c-dc4e-44ea-9684-2a2c2b600002\",\n \"status\": polar_sdk.SeatStatus.PENDING,\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.endpointcustomer_seat_claimed_post(request={\n \"type\": \"customer_seat.claimed\",\n \"timestamp\": parse_datetime(\"2024-08-21T13:16:39.616Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2024-05-09T18:50:40.033Z\"),\n \"modified_at\": parse_datetime(\"2024-07-11T19:06:41.896Z\"),\n \"id\": \"35ac8c8c-dc4e-44ea-9684-2a2c2b600002\",\n \"status\": polar_sdk.SeatStatus.PENDING,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["customer_seat.revoked"]["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.endpointcustomer_seat_revoked_post(request={\n \"type\": \"customer_seat.revoked\",\n \"timestamp\": parse_datetime(\"2023-11-12T11:49:39.839Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2024-08-05T10:54:13.336Z\"),\n \"modified_at\": parse_datetime(\"2023-12-02T21:24:11.844Z\"),\n \"id\": \"518899df-02c0-4220-abaf-0f2f32e97539\",\n \"status\": polar_sdk.SeatStatus.PENDING,\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.endpointcustomer_seat_revoked_post(request={\n \"type\": \"customer_seat.revoked\",\n \"timestamp\": parse_datetime(\"2024-11-11T11:49:39.839Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2025-08-05T10:54:13.336Z\"),\n \"modified_at\": parse_datetime(\"2024-12-01T21:24:11.844Z\"),\n \"id\": \"518899df-02c0-4220-abaf-0f2f32e97539\",\n \"status\": polar_sdk.SeatStatus.PENDING,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["order.created"]["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_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n timestamp=parse_datetime(\"2024-08-21T06:55:49.348Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2023-01-02T23:31:01.991Z\"),\n modified_at=parse_datetime(\"2025-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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\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(\"2025-08-09T17:02:40.706Z\"),\n modified_at=parse_datetime(\"2025-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 name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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 user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2025-06-03T19:46:15.179Z\"),\n modified_at=parse_datetime(\"2023-10-21T21:28:56.316Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=271259,\n name=\"\",\n description=\"gadzooks trek amid misspend ravioli supposing bare pfft\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=168138,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=260667,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2024-04-11T00:21:08.353Z\"),\n modified_at=parse_datetime(\"2025-05-03T15:56:59.028Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=None,\n starts_at=parse_datetime(\"2023-03-06T18:58:41.541Z\"),\n ends_at=parse_datetime(\"2024-02-07T05:20:48.151Z\"),\n max_redemptions=200286,\n redemptions_count=148325,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-01-04T15:31:18.185Z\"),\n modified_at=parse_datetime(\"2023-12-10T13:26:22.287Z\"),\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 ),\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.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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\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-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 name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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 user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2026-06-03T19:46:15.179Z\"),\n modified_at=parse_datetime(\"2024-10-20T21:28:56.316Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=271259,\n name=\"\",\n description=\"gadzooks trek amid misspend ravioli supposing bare pfft\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=168138,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=260667,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2025-04-11T00:21:08.353Z\"),\n modified_at=parse_datetime(\"2026-05-03T15:56:59.028Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=None,\n starts_at=parse_datetime(\"2024-03-05T18:58:41.541Z\"),\n ends_at=parse_datetime(\"2025-02-06T05:20:48.151Z\"),\n max_redemptions=200286,\n redemptions_count=148325,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2025-01-03T15:31:18.185Z\"),\n modified_at=parse_datetime(\"2024-12-09T13:26:22.287Z\"),\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 ),\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(\"2025-12-05T07:44:21.172Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-07-27T09:45:49.517Z\"),\n modified_at=parse_datetime(\"2024-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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\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(\"2025-08-31T00:54:53.749Z\"),\n modified_at=parse_datetime(\"2025-07-24T12:09:26.716Z\"),\n metadata={\n \"key\": \"\",\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-04-20T14:41:24.727Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2023-06-18T22:24:34.935Z\"),\n modified_at=parse_datetime(\"2025-08-01T03:33:20.782Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=125374,\n name=\"\",\n description=\"easily carouse plus quietly reservation bright injunction plastic gah\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=458129,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=375708,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2024-05-24T21:01:40.292Z\"),\n modified_at=parse_datetime(\"2024-05-25T21:22:06.978Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-14T19:23:38.365Z\"),\n ends_at=parse_datetime(\"2024-10-02T13:51:42.523Z\"),\n max_redemptions=231748,\n redemptions_count=846855,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 5251.57,\n },\n created_at=parse_datetime(\"2025-02-12T23:41:13.290Z\"),\n modified_at=parse_datetime(\"2023-02-24T15:15:22.018Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=310795,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2023-11-20T10:20:23.628Z\"),\n current_period_end=parse_datetime(\"2025-08-05T06:11:40.745Z\"),\n trial_start=parse_datetime(\"2023-12-05T06:32:48.307Z\"),\n trial_end=None,\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-08-08T23:25:37.197Z\"),\n started_at=parse_datetime(\"2024-10-04T00:59:57.339Z\"),\n ends_at=parse_datetime(\"2025-02-01T22:39:43.609Z\"),\n ended_at=parse_datetime(\"2023-08-04T10:17:52.706Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=None,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n description=\"Pro Plan\",\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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\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-31T00:54:53.749Z\"),\n modified_at=parse_datetime(\"2026-07-24T12:09:26.716Z\"),\n metadata={\n \"key\": \"\",\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-04-20T14:41:24.727Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2024-06-17T22:24:34.935Z\"),\n modified_at=parse_datetime(\"2026-08-01T03:33:20.782Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=125374,\n name=\"\",\n description=\"easily carouse plus quietly reservation bright injunction plastic gah\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=458129,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=375708,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2025-05-24T21:01:40.292Z\"),\n modified_at=parse_datetime(\"2025-05-25T21:22:06.978Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-09-14T19:23:38.365Z\"),\n ends_at=parse_datetime(\"2025-10-02T13:51:42.523Z\"),\n max_redemptions=231748,\n redemptions_count=846855,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 5251.57,\n },\n created_at=parse_datetime(\"2026-02-12T23:41:13.290Z\"),\n modified_at=parse_datetime(\"2024-02-24T15:15:22.018Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=310795,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2024-11-19T10:20:23.628Z\"),\n current_period_end=parse_datetime(\"2026-08-05T06:11:40.745Z\"),\n trial_start=parse_datetime(\"2024-12-04T06:32:48.307Z\"),\n trial_end=None,\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-08-07T23:25:37.197Z\"),\n started_at=parse_datetime(\"2025-10-04T00:59:57.339Z\"),\n ends_at=parse_datetime(\"2026-02-01T22:39:43.609Z\"),\n ended_at=parse_datetime(\"2024-08-03T10:17:52.706Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=None,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n description=\"Pro Plan\",\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(\"2024-07-23T18:00:11.615Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-03-19T11:53:59.744Z\"),\n modified_at=parse_datetime(\"2024-12-01T04:03:14.906Z\"),\n status=polar_sdk.OrderStatus.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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\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(\"2024-05-21T22:00:59.902Z\"),\n modified_at=parse_datetime(\"2024-08-24T07:48:58.778Z\"),\n metadata={\n \"key\": 647689,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-08-19T02:54:30.835Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\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 created_at=parse_datetime(\"2023-01-26T21:26:48.872Z\"),\n modified_at=parse_datetime(\"2023-01-16T07:26:04.196Z\"),\n id=\"\",\n metadata={\n \"key\": 4016.73,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-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(\"2024-12-08T10:40:25.472Z\"),\n modified_at=parse_datetime(\"2023-12-20T17: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 ),\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.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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\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(\"2025-05-21T22:00:59.902Z\"),\n modified_at=parse_datetime(\"2025-08-24T07:48:58.778Z\"),\n metadata={\n \"key\": 647689,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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 user_id=\"\",\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 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 ),\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(\"2023-10-25T00:08:50.290Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-04-30T23:35:35.375Z\"),\n modified_at=parse_datetime(\"2025-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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\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(\"2023-12-14T17:38:07.808Z\"),\n modified_at=parse_datetime(\"2024-04-07T10:18:18.539Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-23T02:39:12.424Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2024-12-03T05:16:11.415Z\"),\n modified_at=parse_datetime(\"2023-03-11T05:58:05.184Z\"),\n trial_interval=None,\n trial_interval_count=None,\n name=\"\",\n description=\"simple eventually briskly considering\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=None,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=976971,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2024-02-28T06:12:39.096Z\"),\n modified_at=parse_datetime(\"2023-10-01T05:16:42.046Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-08-28T07:16:56.183Z\"),\n ends_at=parse_datetime(\"2023-02-25T14:55:58.248Z\"),\n max_redemptions=970746,\n redemptions_count=314425,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-10-24T22:29:24.352Z\"),\n modified_at=parse_datetime(\"2023-05-02T19:12:30.014Z\"),\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 ),\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.CountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\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(\"2024-12-13T17:38:07.808Z\"),\n modified_at=parse_datetime(\"2025-04-07T10:18:18.539Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-10-23T02:39:12.424Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2025-12-03T05:16:11.415Z\"),\n modified_at=parse_datetime(\"2024-03-10T05:58:05.184Z\"),\n trial_interval=None,\n trial_interval_count=None,\n name=\"\",\n description=\"simple eventually briskly considering\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=None,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=976971,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2025-02-27T06:12:39.096Z\"),\n modified_at=parse_datetime(\"2024-09-30T05:16:42.046Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-08-28T07:16:56.183Z\"),\n ends_at=parse_datetime(\"2024-02-25T14:55:58.248Z\"),\n max_redemptions=970746,\n redemptions_count=314425,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2025-10-24T22:29:24.352Z\"),\n modified_at=parse_datetime(\"2024-05-01T19:12:30.014Z\"),\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 ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["organization.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.endpointorganization_updated_post(request=polar_sdk.WebhookOrganizationUpdatedPayload(\n timestamp=parse_datetime(\"2025-08-19T15:02:44.139Z\"),\n data=polar_sdk.Organization(\n created_at=parse_datetime(\"2025-05-07T21:24:48.059Z\"),\n modified_at=parse_datetime(\"2023-04-16T23:18:12.986Z\"),\n id=\"\",\n name=\"\",\n slug=\"\",\n avatar_url=\"https://pessimistic-going.name/\",\n proration_behavior=polar_sdk.SubscriptionProrationBehavior.PRORATE,\n allow_customer_updates=True,\n email=\"Marianne.Haag@yahoo.com\",\n website=None,\n socials=[],\n status=polar_sdk.OrganizationStatus.INITIAL_REVIEW,\n details_submitted_at=parse_datetime(\"2024-06-29T16:05:16.127Z\"),\n feature_settings=polar_sdk.OrganizationFeatureSettings(),\n subscription_settings=polar_sdk.OrganizationSubscriptionSettings(\n allow_multiple_subscriptions=False,\n allow_customer_updates=True,\n proration_behavior=polar_sdk.SubscriptionProrationBehavior.INVOICE,\n benefit_revocation_grace_period=778168,\n prevent_trial_abuse=False,\n ),\n notification_settings=polar_sdk.OrganizationNotificationSettings(\n new_order=True,\n new_subscription=False,\n ),\n customer_email_settings=polar_sdk.OrganizationCustomerEmailSettings(\n order_confirmation=True,\n subscription_cancellation=True,\n subscription_confirmation=True,\n subscription_cycled=False,\n subscription_past_due=True,\n subscription_revoked=False,\n subscription_uncanceled=False,\n subscription_updated=True,\n ),\n customer_portal_settings=polar_sdk.OrganizationCustomerPortalSettings(\n usage=polar_sdk.CustomerPortalUsageSettings(\n show=True,\n ),\n subscription=polar_sdk.CustomerPortalSubscriptionSettings(\n update_seats=True,\n update_plan=False,\n ),\n ),\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.endpointorganization_updated_post(request=polar_sdk.WebhookOrganizationUpdatedPayload(\n timestamp=parse_datetime(\"2026-08-19T15:02:44.139Z\"),\n data=polar_sdk.Organization(\n created_at=parse_datetime(\"2026-05-07T21:24:48.059Z\"),\n modified_at=parse_datetime(\"2024-04-15T23:18:12.986Z\"),\n id=\"\",\n name=\"\",\n slug=\"\",\n avatar_url=\"https://pessimistic-going.name/\",\n proration_behavior=polar_sdk.SubscriptionProrationBehavior.PRORATE,\n allow_customer_updates=True,\n email=\"Marianne.Haag@yahoo.com\",\n website=None,\n socials=[],\n status=polar_sdk.OrganizationStatus.INITIAL_REVIEW,\n details_submitted_at=parse_datetime(\"2025-06-29T16:05:16.127Z\"),\n feature_settings=polar_sdk.OrganizationFeatureSettings(),\n subscription_settings=polar_sdk.OrganizationSubscriptionSettings(\n allow_multiple_subscriptions=False,\n allow_customer_updates=True,\n proration_behavior=polar_sdk.SubscriptionProrationBehavior.INVOICE,\n benefit_revocation_grace_period=778168,\n prevent_trial_abuse=False,\n ),\n notification_settings=polar_sdk.OrganizationNotificationSettings(\n new_order=True,\n new_subscription=False,\n ),\n customer_email_settings=polar_sdk.OrganizationCustomerEmailSettings(\n order_confirmation=True,\n subscription_cancellation=True,\n subscription_confirmation=True,\n subscription_cycled=False,\n subscription_past_due=True,\n subscription_revoked=False,\n subscription_uncanceled=False,\n subscription_updated=True,\n ),\n customer_portal_settings=polar_sdk.OrganizationCustomerPortalSettings(\n usage=polar_sdk.CustomerPortalUsageSettings(\n show=True,\n ),\n subscription=polar_sdk.CustomerPortalSubscriptionSettings(\n update_seats=True,\n update_plan=False,\n ),\n ),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["product.created"]["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.endpointproduct_created_post(request={\n \"type\": \"product.created\",\n \"timestamp\": parse_datetime(\"2023-10-13T02:47:55.082Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2023-01-15T03:15:59.062Z\"),\n \"modified_at\": parse_datetime(\"2023-07-04T11:33:29.001Z\"),\n \"trial_interval\": polar_sdk.TrialInterval.DAY,\n \"trial_interval_count\": 130829,\n \"name\": \"\",\n \"description\": \"generously as at filthy busy athwart\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n \"recurring_interval_count\": 944417,\n \"is_recurring\": False,\n \"is_archived\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"prices\": [],\n \"benefits\": [\n {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2023-03-03T14:19:40.156Z\"),\n \"modified_at\": parse_datetime(\"2025-12-07T23:08:11.973Z\"),\n \"type\": \"discord\",\n \"description\": \"gosh consequently gladly beneath horse\",\n \"selectable\": True,\n \"deletable\": False,\n \"organization_id\": \"\",\n \"metadata\": {\n \"key\": 5806.69,\n },\n \"properties\": {\n \"guild_id\": \"\",\n \"role_id\": \"\",\n \"kick_member\": False,\n \"guild_token\": \"\",\n },\n },\n ],\n \"medias\": [],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": parse_datetime(\"2025-10-04T08:22:15.858Z\"),\n \"modified_at\": None,\n \"id\": \"\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"number\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"properties\": {},\n },\n \"order\": 92084,\n \"required\": True,\n },\n ],\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.endpointproduct_created_post(request={\n \"type\": \"product.created\",\n \"timestamp\": parse_datetime(\"2024-10-12T02:47:55.082Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2024-01-15T03:15:59.062Z\"),\n \"modified_at\": parse_datetime(\"2024-07-03T11:33:29.001Z\"),\n \"trial_interval\": polar_sdk.TrialInterval.DAY,\n \"trial_interval_count\": 130829,\n \"name\": \"\",\n \"description\": \"generously as at filthy busy athwart\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n \"recurring_interval_count\": 944417,\n \"is_recurring\": False,\n \"is_archived\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"prices\": [],\n \"benefits\": [\n {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2024-03-02T14:19:40.156Z\"),\n \"modified_at\": parse_datetime(\"2026-12-07T23:08:11.973Z\"),\n \"type\": \"discord\",\n \"description\": \"gosh consequently gladly beneath horse\",\n \"selectable\": True,\n \"deletable\": False,\n \"organization_id\": \"\",\n \"metadata\": {\n \"key\": 5806.69,\n },\n \"properties\": {\n \"guild_id\": \"\",\n \"role_id\": \"\",\n \"kick_member\": False,\n \"guild_token\": \"\",\n },\n },\n ],\n \"medias\": [],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": parse_datetime(\"2026-10-04T08:22:15.858Z\"),\n \"modified_at\": None,\n \"id\": \"\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"number\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n \"properties\": {},\n },\n \"order\": 92084,\n \"required\": True,\n },\n ],\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["product.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.endpointproduct_updated_post(request={\n \"type\": \"product.updated\",\n \"timestamp\": parse_datetime(\"2024-08-25T02:00:54.049Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2025-02-11T18:19:05.372Z\"),\n \"modified_at\": parse_datetime(\"2025-07-31T19:14:23.351Z\"),\n \"trial_interval\": polar_sdk.TrialInterval.YEAR,\n \"trial_interval_count\": 907633,\n \"name\": \"\",\n \"description\": \"square extract modulo bossy outlandish pecan\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n \"recurring_interval_count\": 731544,\n \"is_recurring\": False,\n \"is_archived\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": parse_datetime(\"2025-06-01T04:39:05.245Z\"),\n \"modified_at\": parse_datetime(\"2024-05-10T10:53:55.427Z\"),\n \"id\": \"\",\n \"source\": polar_sdk.ProductPriceSource.CATALOG,\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.DAY,\n \"legacy\": True,\n },\n ],\n \"benefits\": [],\n \"medias\": [\n {\n \"id\": \"\",\n \"organization_id\": \"\",\n \"name\": \"\",\n \"path\": \"/usr/src\",\n \"mime_type\": \"\",\n \"size\": 825582,\n \"storage_version\": \"\",\n \"checksum_etag\": \"\",\n \"checksum_sha256_base64\": \"\",\n \"checksum_sha256_hex\": \"\",\n \"last_modified_at\": parse_datetime(\"2025-10-10T23:54:17.582Z\"),\n \"version\": \"\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": parse_datetime(\"2023-08-27T11:33:39.456Z\"),\n \"size_readable\": \"\",\n \"public_url\": \"https://equatorial-gerbil.net/\",\n },\n ],\n \"attached_custom_fields\": [],\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.endpointproduct_updated_post(request={\n \"type\": \"product.updated\",\n \"timestamp\": parse_datetime(\"2025-08-25T02:00:54.049Z\"),\n \"data\": {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2026-02-11T18:19:05.372Z\"),\n \"modified_at\": parse_datetime(\"2026-07-31T19:14:23.351Z\"),\n \"trial_interval\": polar_sdk.TrialInterval.YEAR,\n \"trial_interval_count\": 907633,\n \"name\": \"\",\n \"description\": \"square extract modulo bossy outlandish pecan\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.YEAR,\n \"recurring_interval_count\": 731544,\n \"is_recurring\": False,\n \"is_archived\": True,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": parse_datetime(\"2026-06-01T04:39:05.245Z\"),\n \"modified_at\": parse_datetime(\"2025-05-10T10:53:55.427Z\"),\n \"id\": \"\",\n \"source\": polar_sdk.ProductPriceSource.CATALOG,\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.DAY,\n \"legacy\": True,\n },\n ],\n \"benefits\": [],\n \"medias\": [\n {\n \"id\": \"\",\n \"organization_id\": \"\",\n \"name\": \"\",\n \"path\": \"/usr/src\",\n \"mime_type\": \"\",\n \"size\": 825582,\n \"storage_version\": \"\",\n \"checksum_etag\": \"\",\n \"checksum_sha256_base64\": \"\",\n \"checksum_sha256_hex\": \"\",\n \"last_modified_at\": parse_datetime(\"2026-10-10T23:54:17.582Z\"),\n \"version\": \"\",\n \"service\": \"product_media\",\n \"is_uploaded\": True,\n \"created_at\": parse_datetime(\"2024-08-26T11:33:39.456Z\"),\n \"size_readable\": \"\",\n \"public_url\": \"https://equatorial-gerbil.net/\",\n },\n ],\n \"attached_custom_fields\": [],\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["refund.created"]["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.endpointrefund_created_post(request={\n \"type\": \"refund.created\",\n \"timestamp\": parse_datetime(\"2025-02-15T13:46:01.700Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2023-12-02T00:48:24.931Z\"),\n \"modified_at\": parse_datetime(\"2025-08-16T15:26:20.191Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"status\": polar_sdk.RefundStatus.PENDING,\n \"reason\": polar_sdk.RefundReason.OTHER,\n \"amount\": 104569,\n \"tax_amount\": 295454,\n \"currency\": \"Solomon Islands Dollar\",\n \"organization_id\": \"\",\n \"order_id\": \"\",\n \"subscription_id\": \"\",\n \"customer_id\": \"\",\n \"revoke_benefits\": False,\n \"dispute\": {\n \"created_at\": parse_datetime(\"2024-03-16T20:15:18.116Z\"),\n \"modified_at\": parse_datetime(\"2023-02-15T15:17:05.328Z\"),\n \"id\": \"\",\n \"status\": polar_sdk.DisputeStatus.WON,\n \"resolved\": False,\n \"closed\": False,\n \"amount\": 1000,\n \"tax_amount\": 200,\n \"currency\": \"usd\",\n \"order_id\": \"57107b74-8400-4d80-a2fc-54c2b4239cb3\",\n \"payment_id\": \"42b94870-36b9-4573-96b6-b90b1c99a353\",\n },\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.endpointrefund_created_post(request={\n \"type\": \"refund.created\",\n \"timestamp\": parse_datetime(\"2026-02-15T13:46:01.700Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2024-12-01T00:48:24.931Z\"),\n \"modified_at\": parse_datetime(\"2026-08-16T15:26:20.191Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"status\": polar_sdk.RefundStatus.PENDING,\n \"reason\": polar_sdk.RefundReason.OTHER,\n \"amount\": 104569,\n \"tax_amount\": 295454,\n \"currency\": \"Solomon Islands Dollar\",\n \"organization_id\": \"\",\n \"order_id\": \"\",\n \"subscription_id\": \"\",\n \"customer_id\": \"\",\n \"revoke_benefits\": False,\n \"dispute\": {\n \"created_at\": parse_datetime(\"2025-03-16T20:15:18.116Z\"),\n \"modified_at\": parse_datetime(\"2024-02-15T15:17:05.328Z\"),\n \"id\": \"\",\n \"status\": polar_sdk.DisputeStatus.WON,\n \"resolved\": False,\n \"closed\": False,\n \"amount\": 1000,\n \"tax_amount\": 200,\n \"currency\": \"usd\",\n \"order_id\": \"57107b74-8400-4d80-a2fc-54c2b4239cb3\",\n \"payment_id\": \"42b94870-36b9-4573-96b6-b90b1c99a353\",\n },\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["refund.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.endpointrefund_updated_post(request={\n \"type\": \"refund.updated\",\n \"timestamp\": parse_datetime(\"2023-01-08T20:35:39.672Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2025-03-28T13:42:04.506Z\"),\n \"modified_at\": parse_datetime(\"2024-08-07T08:31:25.154Z\"),\n \"id\": \"\",\n \"metadata\": {\n\n },\n \"status\": polar_sdk.RefundStatus.CANCELED,\n \"reason\": polar_sdk.RefundReason.SERVICE_DISRUPTION,\n \"amount\": 986698,\n \"tax_amount\": 785012,\n \"currency\": \"Congolese Franc\",\n \"organization_id\": \"\",\n \"order_id\": \"\",\n \"subscription_id\": \"\",\n \"customer_id\": \"\",\n \"revoke_benefits\": False,\n \"dispute\": {\n \"created_at\": parse_datetime(\"2023-11-30T11:41:55.571Z\"),\n \"modified_at\": parse_datetime(\"2023-03-06T22:25:19.966Z\"),\n \"id\": \"\",\n \"status\": polar_sdk.DisputeStatus.PREVENTED,\n \"resolved\": False,\n \"closed\": False,\n \"amount\": 1000,\n \"tax_amount\": 200,\n \"currency\": \"usd\",\n \"order_id\": \"57107b74-8400-4d80-a2fc-54c2b4239cb3\",\n \"payment_id\": \"42b94870-36b9-4573-96b6-b90b1c99a353\",\n },\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.endpointrefund_updated_post(request={\n \"type\": \"refund.updated\",\n \"timestamp\": parse_datetime(\"2024-01-08T20:35:39.672Z\"),\n \"data\": {\n \"created_at\": parse_datetime(\"2026-03-28T13:42:04.506Z\"),\n \"modified_at\": parse_datetime(\"2025-08-07T08:31:25.154Z\"),\n \"id\": \"\",\n \"metadata\": {\n\n },\n \"status\": polar_sdk.RefundStatus.CANCELED,\n \"reason\": polar_sdk.RefundReason.SERVICE_DISRUPTION,\n \"amount\": 986698,\n \"tax_amount\": 785012,\n \"currency\": \"Congolese Franc\",\n \"organization_id\": \"\",\n \"order_id\": \"\",\n \"subscription_id\": \"\",\n \"customer_id\": \"\",\n \"revoke_benefits\": False,\n \"dispute\": {\n \"created_at\": parse_datetime(\"2024-11-29T11:41:55.571Z\"),\n \"modified_at\": parse_datetime(\"2024-03-05T22:25:19.966Z\"),\n \"id\": \"\",\n \"status\": polar_sdk.DisputeStatus.PREVENTED,\n \"resolved\": False,\n \"closed\": False,\n \"amount\": 1000,\n \"tax_amount\": 200,\n \"currency\": \"usd\",\n \"order_id\": \"57107b74-8400-4d80-a2fc-54c2b4239cb3\",\n \"payment_id\": \"42b94870-36b9-4573-96b6-b90b1c99a353\",\n },\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.active"]["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.endpointsubscription_active_post(request=polar_sdk.WebhookSubscriptionActivePayload(\n timestamp=parse_datetime(\"2023-08-13T01:28:21.362Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2023-10-12T10:17:29.274Z\"),\n modified_at=parse_datetime(\"2023-12-18T04:45:55.702Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=291908,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2023-06-09T14:14:48.363Z\"),\n current_period_end=None,\n trial_start=None,\n trial_end=None,\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-09-14T15:19:58.463Z\"),\n started_at=parse_datetime(\"2024-07-30T05:01:30.550Z\"),\n ends_at=parse_datetime(\"2024-02-02T06:13:13.441Z\"),\n ended_at=parse_datetime(\"2023-10-10T03:15:20.759Z\"),\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 metadata={\n \"key\": 667866,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-02-14T12:59:50.680Z\"),\n modified_at=parse_datetime(\"2025-03-11T11:17:02.540Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2023-04-08T22:28:00.101Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2025-11-05T10:18:40.300Z\"),\n modified_at=parse_datetime(\"2024-04-23T18:24:43.408Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=714669,\n name=\"\",\n description=\"amongst incidentally irritably cauliflower antique\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=48572,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": False,\n },\n prices=[\n polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2025-03-24T10:57:36.466Z\"),\n modified_at=parse_datetime(\"2024-10-17T11:42:46.643Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n minimum_amount=389288,\n maximum_amount=177303,\n preset_amount=561657,\n ),\n ],\n benefits=[],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldCheckbox(\n created_at=parse_datetime(\"2024-01-12T08:39:00.463Z\"),\n modified_at=parse_datetime(\"2025-03-02T23:03:24.214Z\"),\n id=\"\",\n metadata={\n\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldCheckboxProperties(),\n ),\n order=977457,\n required=False,\n ),\n ],\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2023-01-15T17:33:02.691Z\"),\n modified_at=parse_datetime(\"2024-04-26T17:17:19.419Z\"),\n id=\"\",\n metadata={\n \"key\": 123196,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-04-09T13:01:30.211Z\"),\n ends_at=parse_datetime(\"2025-04-05T20:05:32.381Z\"),\n max_redemptions=751909,\n redemptions_count=518919,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2024-02-21T06:23:41.365Z\"),\n modified_at=parse_datetime(\"2025-09-30T12:23:41.262Z\"),\n id=\"\",\n consumed_units=25,\n credited_units=100,\n amount=0,\n meter_id=\"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n meter=polar_sdk.Meter(\n metadata={\n \"key\": True,\n },\n created_at=parse_datetime(\"2023-11-13T01:54:07.938Z\"),\n modified_at=parse_datetime(\"2023-12-18T08:10:47.455Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.SUM,\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\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.endpointsubscription_active_post(request=polar_sdk.WebhookSubscriptionActivePayload(\n timestamp=parse_datetime(\"2024-08-12T01:28:21.362Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2024-10-11T10:17:29.274Z\"),\n modified_at=parse_datetime(\"2024-12-17T04:45:55.702Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=291908,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2024-06-08T14:14:48.363Z\"),\n current_period_end=None,\n trial_start=None,\n trial_end=None,\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2025-09-14T15:19:58.463Z\"),\n started_at=parse_datetime(\"2025-07-30T05:01:30.550Z\"),\n ends_at=parse_datetime(\"2025-02-01T06:13:13.441Z\"),\n ended_at=parse_datetime(\"2024-10-09T03:15:20.759Z\"),\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 metadata={\n \"key\": 667866,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-02-14T12:59:50.680Z\"),\n modified_at=parse_datetime(\"2026-03-11T11:17:02.540Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-04-07T22:28:00.101Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2026-11-05T10:18:40.300Z\"),\n modified_at=parse_datetime(\"2025-04-23T18:24:43.408Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=714669,\n name=\"\",\n description=\"amongst incidentally irritably cauliflower antique\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=48572,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": False,\n },\n prices=[\n polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2026-03-24T10:57:36.466Z\"),\n modified_at=parse_datetime(\"2025-10-17T11:42:46.643Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n minimum_amount=389288,\n maximum_amount=177303,\n preset_amount=561657,\n ),\n ],\n benefits=[],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldCheckbox(\n created_at=parse_datetime(\"2025-01-11T08:39:00.463Z\"),\n modified_at=parse_datetime(\"2026-03-02T23:03:24.214Z\"),\n id=\"\",\n metadata={\n\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldCheckboxProperties(),\n ),\n order=977457,\n required=False,\n ),\n ],\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2024-01-15T17:33:02.691Z\"),\n modified_at=parse_datetime(\"2025-04-26T17:17:19.419Z\"),\n id=\"\",\n metadata={\n \"key\": 123196,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-04-08T13:01:30.211Z\"),\n ends_at=parse_datetime(\"2026-04-05T20:05:32.381Z\"),\n max_redemptions=751909,\n redemptions_count=518919,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2025-02-20T06:23:41.365Z\"),\n modified_at=parse_datetime(\"2026-09-30T12:23:41.262Z\"),\n id=\"\",\n consumed_units=25,\n credited_units=100,\n amount=0,\n meter_id=\"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n meter=polar_sdk.Meter(\n metadata={\n \"key\": True,\n },\n created_at=parse_datetime(\"2024-11-12T01:54:07.938Z\"),\n modified_at=parse_datetime(\"2024-12-17T08:10:47.455Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.SUM,\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.canceled"]["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.endpointsubscription_canceled_post(request=polar_sdk.WebhookSubscriptionCanceledPayload(\n timestamp=parse_datetime(\"2025-02-09T04:39:02.332Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2025-04-09T17:46:08.645Z\"),\n modified_at=None,\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=867179,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2024-08-12T22:41:41.907Z\"),\n current_period_end=parse_datetime(\"2023-08-04T03:14:29.655Z\"),\n trial_start=parse_datetime(\"2025-03-21T15:50:39.816Z\"),\n trial_end=parse_datetime(\"2024-01-07T18:54:45.602Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-05-05T03:28:24.281Z\"),\n started_at=parse_datetime(\"2024-08-20T02:19:30.433Z\"),\n ends_at=parse_datetime(\"2023-01-03T22:38:10.292Z\"),\n ended_at=None,\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 metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-06-06T08:13:58.211Z\"),\n modified_at=parse_datetime(\"2023-06-07T02:15:24.636Z\"),\n metadata={\n \"key\": 1764.16,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-03-18T13:26:34.470Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2024-08-22T01:08:59.550Z\"),\n modified_at=None,\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=920579,\n name=\"\",\n description=\"via hm truly\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=848785,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n metadata={\n \"key\": True,\n },\n prices=[],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/lib\",\n mime_type=\"\",\n size=83334,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-09-21T18:00:22.332Z\"),\n version=\"\",\n is_uploaded=True,\n created_at=parse_datetime(\"2025-04-11T14:16:04.184Z\"),\n size_readable=\"\",\n public_url=\"https://entire-ethyl.org/\",\n ),\n ],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldCheckbox(\n created_at=parse_datetime(\"2024-11-19T14:39:19.899Z\"),\n modified_at=parse_datetime(\"2024-10-07T08:09:01.589Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldCheckboxProperties(),\n ),\n order=350933,\n required=False,\n ),\n ],\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=1000,\n created_at=parse_datetime(\"2023-05-20T18:55:11.120Z\"),\n modified_at=parse_datetime(\"2025-01-19T16:58:36.968Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-20T02:04:48.363Z\"),\n ends_at=parse_datetime(\"2023-02-23T04:10:00.244Z\"),\n max_redemptions=839446,\n redemptions_count=119301,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[],\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.endpointsubscription_canceled_post(request=polar_sdk.WebhookSubscriptionCanceledPayload(\n timestamp=parse_datetime(\"2026-02-09T04:39:02.332Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2026-04-09T17:46:08.645Z\"),\n modified_at=None,\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=867179,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2025-08-12T22:41:41.907Z\"),\n current_period_end=parse_datetime(\"2024-08-03T03:14:29.655Z\"),\n trial_start=parse_datetime(\"2026-03-21T15:50:39.816Z\"),\n trial_end=parse_datetime(\"2025-01-06T18:54:45.602Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-05-04T03:28:24.281Z\"),\n started_at=parse_datetime(\"2025-08-20T02:19:30.433Z\"),\n ends_at=parse_datetime(\"2024-01-03T22:38:10.292Z\"),\n ended_at=None,\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 metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-06-06T08:13:58.211Z\"),\n modified_at=parse_datetime(\"2024-06-06T02:15:24.636Z\"),\n metadata={\n \"key\": 1764.16,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-03-18T13:26:34.470Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2025-08-22T01:08:59.550Z\"),\n modified_at=None,\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=920579,\n name=\"\",\n description=\"via hm truly\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=848785,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n metadata={\n \"key\": True,\n },\n prices=[],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/lib\",\n mime_type=\"\",\n size=83334,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-09-21T18:00:22.332Z\"),\n version=\"\",\n is_uploaded=True,\n created_at=parse_datetime(\"2026-04-11T14:16:04.184Z\"),\n size_readable=\"\",\n public_url=\"https://entire-ethyl.org/\",\n ),\n ],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldCheckbox(\n created_at=parse_datetime(\"2025-11-19T14:39:19.899Z\"),\n modified_at=parse_datetime(\"2025-10-07T08:09:01.589Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldCheckboxProperties(),\n ),\n order=350933,\n required=False,\n ),\n ],\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=1000,\n created_at=parse_datetime(\"2024-05-19T18:55:11.120Z\"),\n modified_at=parse_datetime(\"2026-01-19T16:58:36.968Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-09-20T02:04:48.363Z\"),\n ends_at=parse_datetime(\"2024-02-23T04:10:00.244Z\"),\n max_redemptions=839446,\n redemptions_count=119301,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.created"]["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.endpointsubscription_created_post(request=polar_sdk.WebhookSubscriptionCreatedPayload(\n timestamp=parse_datetime(\"2024-05-03T11:46:21.459Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2023-12-03T10:52:23.880Z\"),\n modified_at=parse_datetime(\"2024-05-29T05:21:44.072Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=990795,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=parse_datetime(\"2024-01-07T06:33:36.381Z\"),\n current_period_end=parse_datetime(\"2024-07-30T16:54:44.427Z\"),\n trial_start=parse_datetime(\"2025-01-24T01:20:23.589Z\"),\n trial_end=parse_datetime(\"2023-09-10T12:12:44.499Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-06-27T22:01:23.333Z\"),\n started_at=parse_datetime(\"2024-07-24T19:43:04.879Z\"),\n ends_at=None,\n ended_at=parse_datetime(\"2024-04-01T08:29:51.925Z\"),\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 metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-09-10T08:59:46.091Z\"),\n modified_at=parse_datetime(\"2024-07-06T00:27:46.272Z\"),\n metadata={\n \"key\": 9576.45,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-26T21:09:46.234Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2023-05-15T22:05:41.858Z\"),\n modified_at=parse_datetime(\"2024-01-31T16:35:38.441Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=271531,\n name=\"\",\n description=\"platypus scrape adventurously which cautiously secret completion\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=803045,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[],\n medias=[],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n duration_in_months=274053,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=1000,\n created_at=parse_datetime(\"2025-09-05T16:45:03.444Z\"),\n modified_at=parse_datetime(\"2025-01-22T02:13:03.697Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-02-18T11:12:06.291Z\"),\n ends_at=parse_datetime(\"2024-01-29T14:46:42.846Z\"),\n max_redemptions=440571,\n redemptions_count=801134,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[],\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.endpointsubscription_created_post(request=polar_sdk.WebhookSubscriptionCreatedPayload(\n timestamp=parse_datetime(\"2025-05-03T11:46:21.459Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2024-12-02T10:52:23.880Z\"),\n modified_at=parse_datetime(\"2025-05-29T05:21:44.072Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=990795,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=parse_datetime(\"2025-01-06T06:33:36.381Z\"),\n current_period_end=parse_datetime(\"2025-07-30T16:54:44.427Z\"),\n trial_start=parse_datetime(\"2026-01-24T01:20:23.589Z\"),\n trial_end=parse_datetime(\"2024-09-09T12:12:44.499Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2025-06-27T22:01:23.333Z\"),\n started_at=parse_datetime(\"2025-07-24T19:43:04.879Z\"),\n ends_at=None,\n ended_at=parse_datetime(\"2025-04-01T08:29:51.925Z\"),\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 metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-09-10T08:59:46.091Z\"),\n modified_at=parse_datetime(\"2025-07-06T00:27:46.272Z\"),\n metadata={\n \"key\": 9576.45,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-26T21:09:46.234Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2024-05-14T22:05:41.858Z\"),\n modified_at=parse_datetime(\"2025-01-30T16:35:38.441Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=271531,\n name=\"\",\n description=\"platypus scrape adventurously which cautiously secret completion\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=803045,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[],\n medias=[],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n duration_in_months=274053,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=1000,\n created_at=parse_datetime(\"2026-09-05T16:45:03.444Z\"),\n modified_at=parse_datetime(\"2026-01-22T02:13:03.697Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-02-18T11:12:06.291Z\"),\n ends_at=parse_datetime(\"2025-01-28T14:46:42.846Z\"),\n max_redemptions=440571,\n redemptions_count=801134,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.past_due"]["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.endpointsubscription_past_due_post(request=polar_sdk.WebhookSubscriptionPastDuePayload(\n timestamp=parse_datetime(\"2024-08-08T08:08:34.879Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2024-08-04T16:17:07.577Z\"),\n modified_at=parse_datetime(\"2024-12-31T22:57:08.265Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=546644,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2024-11-30T09:38:02.409Z\"),\n current_period_end=parse_datetime(\"2025-05-17T12:45:53.215Z\"),\n trial_start=parse_datetime(\"2025-08-11T03:24:52.872Z\"),\n trial_end=parse_datetime(\"2025-11-23T15:14:32.091Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-11-23T20:41:28.274Z\"),\n started_at=parse_datetime(\"2023-06-07T00:58:09.164Z\"),\n ends_at=parse_datetime(\"2023-04-30T18:50:10.865Z\"),\n ended_at=parse_datetime(\"2024-10-24T10:41:48.448Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.CUSTOMER_SERVICE,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": 88296,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-10-23T07:41:47.878Z\"),\n modified_at=parse_datetime(\"2023-03-23T16:08:53.531Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-24T05:44:38.605Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2024-12-22T12:33:51.204Z\"),\n modified_at=parse_datetime(\"2025-12-27T02:54:47.268Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=142723,\n name=\"\",\n description=\"within tomb spectacles um after when chunter inwardly brr\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=49747,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/usr/bin\",\n mime_type=\"\",\n size=189018,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=None,\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-10-16T11:09:40.675Z\"),\n version=None,\n is_uploaded=True,\n created_at=parse_datetime(\"2023-04-25T02:01:36.979Z\"),\n size_readable=\"\",\n public_url=\"https://exalted-unblinking.name\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=1000,\n created_at=parse_datetime(\"2024-09-15T03:00:42.261Z\"),\n modified_at=parse_datetime(\"2023-01-21T01:11:57.675Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-05-03T02:53:30.217Z\"),\n ends_at=parse_datetime(\"2025-12-13T03:09:13.905Z\"),\n max_redemptions=205428,\n redemptions_count=683480,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[],\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.endpointsubscription_past_due_post(request=polar_sdk.WebhookSubscriptionPastDuePayload(\n timestamp=parse_datetime(\"2025-08-08T08:08:34.879Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2025-08-04T16:17:07.577Z\"),\n modified_at=parse_datetime(\"2025-12-31T22:57:08.265Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=546644,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2025-11-30T09:38:02.409Z\"),\n current_period_end=parse_datetime(\"2026-05-17T12:45:53.215Z\"),\n trial_start=parse_datetime(\"2026-08-11T03:24:52.872Z\"),\n trial_end=parse_datetime(\"2026-11-23T15:14:32.091Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2026-11-23T20:41:28.274Z\"),\n started_at=parse_datetime(\"2024-06-06T00:58:09.164Z\"),\n ends_at=parse_datetime(\"2024-04-29T18:50:10.865Z\"),\n ended_at=parse_datetime(\"2025-10-24T10:41:48.448Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.CUSTOMER_SERVICE,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": 88296,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-10-22T07:41:47.878Z\"),\n modified_at=parse_datetime(\"2024-03-22T16:08:53.531Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-03-24T05:44:38.605Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2025-12-22T12:33:51.204Z\"),\n modified_at=parse_datetime(\"2026-12-27T02:54:47.268Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=142723,\n name=\"\",\n description=\"within tomb spectacles um after when chunter inwardly brr\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=49747,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/usr/bin\",\n mime_type=\"\",\n size=189018,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=None,\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-10-16T11:09:40.675Z\"),\n version=None,\n is_uploaded=True,\n created_at=parse_datetime(\"2024-04-24T02:01:36.979Z\"),\n size_readable=\"\",\n public_url=\"https://exalted-unblinking.name\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=1000,\n created_at=parse_datetime(\"2025-09-15T03:00:42.261Z\"),\n modified_at=parse_datetime(\"2024-01-21T01:11:57.675Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-05-03T02:53:30.217Z\"),\n ends_at=parse_datetime(\"2026-12-13T03:09:13.905Z\"),\n max_redemptions=205428,\n redemptions_count=683480,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.revoked"]["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.endpointsubscription_revoked_post(request=polar_sdk.WebhookSubscriptionRevokedPayload(\n timestamp=parse_datetime(\"2024-01-02T06:40:50.860Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2023-03-16T08:42:29.566Z\"),\n modified_at=parse_datetime(\"2023-10-28T01:20:21.930Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=811590,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2023-05-30T02:07:20.021Z\"),\n current_period_end=parse_datetime(\"2023-06-01T18:10:42.435Z\"),\n trial_start=parse_datetime(\"2023-02-17T04:59:11.584Z\"),\n trial_end=parse_datetime(\"2024-02-14T23:20:57.498Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-11-13T16:37:04.348Z\"),\n started_at=parse_datetime(\"2023-12-28T07:35:48.028Z\"),\n ends_at=parse_datetime(\"2024-01-26T10:24:50.250Z\"),\n ended_at=parse_datetime(\"2024-06-20T16:37:33.284Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_EXPENSIVE,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": 8717.41,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-05-28T06:09:58.228Z\"),\n modified_at=parse_datetime(\"2025-01-19T04:39:36.127Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-05-31T05:10:14.997Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2025-06-26T05:35:27.950Z\"),\n modified_at=parse_datetime(\"2024-06-01T00:18:42.763Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=455030,\n name=\"\",\n description=\"overburden quarrelsome outrun phew whose merrily language\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=518934,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[\n polar_sdk.BenefitDiscord(\n id=\"\",\n created_at=parse_datetime(\"2023-12-16T06:31:21.339Z\"),\n modified_at=parse_datetime(\"2024-06-28T04:33:55.419Z\"),\n description=\"yuck after plus meh enrich that\",\n selectable=False,\n deletable=False,\n organization_id=\"\",\n metadata={\n \"key\": 484393,\n },\n properties=polar_sdk.BenefitDiscordProperties(\n guild_id=\"\",\n role_id=\"\",\n kick_member=False,\n guild_token=\"\",\n ),\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/usr/bin\",\n mime_type=\"\",\n size=968821,\n storage_version=None,\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2023-08-08T17:21:00.549Z\"),\n version=\"\",\n is_uploaded=True,\n created_at=parse_datetime(\"2023-09-16T06:24:58.018Z\"),\n size_readable=\"\",\n public_url=\"https://utter-requirement.name\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n duration_in_months=999351,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2024-07-01T13:17:29.420Z\"),\n modified_at=parse_datetime(\"2025-02-23T14:37:34.479Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-12-31T12:49:59.518Z\"),\n ends_at=parse_datetime(\"2024-06-27T11:23:29.412Z\"),\n max_redemptions=437648,\n redemptions_count=444423,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2025-10-03T04:33:30.421Z\"),\n modified_at=parse_datetime(\"2023-02-24T01:04:52.565Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n price_currency=\"\",\n price_amount=366002,\n ),\n ],\n meters=[],\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.endpointsubscription_revoked_post(request=polar_sdk.WebhookSubscriptionRevokedPayload(\n timestamp=parse_datetime(\"2025-01-01T06:40:50.860Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2024-03-15T08:42:29.566Z\"),\n modified_at=parse_datetime(\"2024-10-27T01:20:21.930Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=811590,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2024-05-29T02:07:20.021Z\"),\n current_period_end=parse_datetime(\"2024-05-31T18:10:42.435Z\"),\n trial_start=parse_datetime(\"2024-02-17T04:59:11.584Z\"),\n trial_end=parse_datetime(\"2025-02-13T23:20:57.498Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-11-12T16:37:04.348Z\"),\n started_at=parse_datetime(\"2024-12-27T07:35:48.028Z\"),\n ends_at=parse_datetime(\"2025-01-25T10:24:50.250Z\"),\n ended_at=parse_datetime(\"2025-06-20T16:37:33.284Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_EXPENSIVE,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": 8717.41,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-05-28T06:09:58.228Z\"),\n modified_at=parse_datetime(\"2026-01-19T04:39:36.127Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-05-31T05:10:14.997Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2026-06-26T05:35:27.950Z\"),\n modified_at=parse_datetime(\"2025-06-01T00:18:42.763Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=455030,\n name=\"\",\n description=\"overburden quarrelsome outrun phew whose merrily language\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=518934,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[\n polar_sdk.BenefitDiscord(\n id=\"\",\n created_at=parse_datetime(\"2024-12-15T06:31:21.339Z\"),\n modified_at=parse_datetime(\"2025-06-28T04:33:55.419Z\"),\n description=\"yuck after plus meh enrich that\",\n selectable=False,\n deletable=False,\n organization_id=\"\",\n metadata={\n \"key\": 484393,\n },\n properties=polar_sdk.BenefitDiscordProperties(\n guild_id=\"\",\n role_id=\"\",\n kick_member=False,\n guild_token=\"\",\n ),\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/usr/bin\",\n mime_type=\"\",\n size=968821,\n storage_version=None,\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-08-07T17:21:00.549Z\"),\n version=\"\",\n is_uploaded=True,\n created_at=parse_datetime(\"2024-09-15T06:24:58.018Z\"),\n size_readable=\"\",\n public_url=\"https://utter-requirement.name\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n duration_in_months=999351,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2025-07-01T13:17:29.420Z\"),\n modified_at=parse_datetime(\"2026-02-23T14:37:34.479Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-12-31T12:49:59.518Z\"),\n ends_at=parse_datetime(\"2025-06-27T11:23:29.412Z\"),\n max_redemptions=437648,\n redemptions_count=444423,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2026-10-03T04:33:30.421Z\"),\n modified_at=parse_datetime(\"2024-02-24T01:04:52.565Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.AD_HOC,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n price_currency=\"\",\n price_amount=366002,\n ),\n ],\n meters=[],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.uncanceled"]["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.endpointsubscription_uncanceled_post(request=polar_sdk.WebhookSubscriptionUncanceledPayload(\n timestamp=parse_datetime(\"2023-02-06T17:25:10.106Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2023-05-13T11:53:26.507Z\"),\n modified_at=None,\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=406654,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2025-06-06T02:06:49.326Z\"),\n current_period_end=parse_datetime(\"2023-04-28T08:16:42.068Z\"),\n trial_start=parse_datetime(\"2023-10-03T23:40:30.923Z\"),\n trial_end=parse_datetime(\"2024-11-16T02:01:16.824Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2023-12-23T04:50:00.016Z\"),\n started_at=parse_datetime(\"2024-10-18T16:25:47.209Z\"),\n ends_at=parse_datetime(\"2023-01-21T06:39:24.599Z\"),\n ended_at=parse_datetime(\"2023-06-01T22:55:56.558Z\"),\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 metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-12-23T09:30:11.195Z\"),\n modified_at=parse_datetime(\"2024-12-20T09:31:52.259Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2023-09-22T11:20:51.361Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2024-10-15T19:47:04.648Z\"),\n modified_at=parse_datetime(\"2024-08-04T07:14:33.597Z\"),\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=449040,\n name=\"\",\n description=\"geez proper whenever exaggerate\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=130752,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": 4421.44,\n },\n prices=[\n polar_sdk.ProductPriceSeatBased(\n created_at=parse_datetime(\"2024-02-14T17:42:30.228Z\"),\n modified_at=parse_datetime(\"2023-11-01T03:56:36.911Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n type=polar_sdk.ProductPriceType.ONE_TIME,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n seat_tiers=polar_sdk.ProductPriceSeatTiers(\n tiers=[\n polar_sdk.ProductPriceSeatTier(\n min_seats=810993,\n price_per_seat=930595,\n ),\n ],\n ),\n ),\n ],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/rescue\",\n mime_type=\"\",\n size=664297,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=None,\n version=\"\",\n is_uploaded=True,\n created_at=parse_datetime(\"2023-12-22T07:23:34.509Z\"),\n size_readable=\"\",\n public_url=\"https://jam-packed-lamp.biz\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2025-11-02T19:56:53.453Z\"),\n modified_at=parse_datetime(\"2023-09-06T02:01:21.667Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-11-21T17:11:26.125Z\"),\n ends_at=None,\n max_redemptions=533397,\n redemptions_count=291288,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2025-11-23T09:56:50.130Z\"),\n modified_at=parse_datetime(\"2025-12-02T22:46:25.569Z\"),\n id=\"\",\n consumed_units=25,\n credited_units=100,\n amount=0,\n meter_id=\"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n meter=polar_sdk.Meter(\n metadata={\n\n },\n created_at=parse_datetime(\"2024-05-15T11:20:03.256Z\"),\n modified_at=parse_datetime(\"2023-07-17T10:10:30.145Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.MIN,\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\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.endpointsubscription_uncanceled_post(request=polar_sdk.WebhookSubscriptionUncanceledPayload(\n timestamp=parse_datetime(\"2024-02-06T17:25:10.106Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2024-05-12T11:53:26.507Z\"),\n modified_at=None,\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=406654,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2026-06-06T02:06:49.326Z\"),\n current_period_end=parse_datetime(\"2024-04-27T08:16:42.068Z\"),\n trial_start=parse_datetime(\"2024-10-02T23:40:30.923Z\"),\n trial_end=parse_datetime(\"2025-11-16T02:01:16.824Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-12-22T04:50:00.016Z\"),\n started_at=parse_datetime(\"2025-10-18T16:25:47.209Z\"),\n ends_at=parse_datetime(\"2024-01-21T06:39:24.599Z\"),\n ended_at=parse_datetime(\"2024-05-31T22:55:56.558Z\"),\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 metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-12-23T09:30:11.195Z\"),\n modified_at=parse_datetime(\"2025-12-20T09:31:52.259Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-09-21T11:20:51.361Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2025-10-15T19:47:04.648Z\"),\n modified_at=parse_datetime(\"2025-08-04T07:14:33.597Z\"),\n trial_interval=polar_sdk.TrialInterval.MONTH,\n trial_interval_count=449040,\n name=\"\",\n description=\"geez proper whenever exaggerate\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=130752,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": 4421.44,\n },\n prices=[\n polar_sdk.ProductPriceSeatBased(\n created_at=parse_datetime(\"2025-02-13T17:42:30.228Z\"),\n modified_at=parse_datetime(\"2024-10-31T03:56:36.911Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n type=polar_sdk.ProductPriceType.ONE_TIME,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n seat_tiers=polar_sdk.ProductPriceSeatTiersOutput(\n tiers=[\n polar_sdk.ProductPriceSeatTier(\n min_seats=810993,\n price_per_seat=930595,\n ),\n ],\n minimum_seats=241578,\n maximum_seats=526699,\n ),\n ),\n ],\n benefits=[\n polar_sdk.BenefitDownloadables(\n id=\"\",\n created_at=parse_datetime(\"2025-07-09T11:35:46.121Z\"),\n modified_at=parse_datetime(\"2025-07-14T11:45:04.348Z\"),\n description=\"esteemed aha arcade\",\n selectable=True,\n deletable=False,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitDownloadablesProperties(\n archived={\n \"key\": False,\n },\n files=[\n \"\",\n \"\",\n \"\",\n ],\n ),\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/var/tmp\",\n mime_type=\"\",\n size=22167,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-08-07T07:38:27.510Z\"),\n version=\"\",\n is_uploaded=True,\n created_at=parse_datetime(\"2026-11-02T09:55:02.233Z\"),\n size_readable=\"\",\n public_url=\"https://mediocre-slide.org/\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=1000,\n currency=\"usd\",\n created_at=parse_datetime(\"2024-05-31T04:28:19.613Z\"),\n modified_at=parse_datetime(\"2024-10-10T04:47:47.627Z\"),\n id=\"\",\n metadata={\n \"key\": True,\n },\n name=\"\",\n code=None,\n starts_at=parse_datetime(\"2024-08-16T10:43:36.241Z\"),\n ends_at=parse_datetime(\"2024-03-12T22:18:03.414Z\"),\n max_redemptions=650601,\n redemptions_count=888940,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2025-11-01T15:28:26.266Z\"),\n modified_at=parse_datetime(\"2026-08-21T13:52:57.281Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n price_currency=\"\",\n price_amount=633088,\n ),\n ],\n meters=[],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.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.endpointsubscription_updated_post(request=polar_sdk.WebhookSubscriptionUpdatedPayload(\n timestamp=parse_datetime(\"2023-06-24T13:26:25.969Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2024-05-25T12:11:24.717Z\"),\n modified_at=parse_datetime(\"2024-07-08T02:17:23.799Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=489836,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2024-06-19T12:29:28.503Z\"),\n current_period_end=parse_datetime(\"2023-08-24T22:14:10.131Z\"),\n trial_start=parse_datetime(\"2025-12-11T02:41:54.261Z\"),\n trial_end=parse_datetime(\"2025-12-29T02:13:52.269Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-01-23T22:07:32.693Z\"),\n started_at=parse_datetime(\"2025-05-14T13:55:44.367Z\"),\n ends_at=parse_datetime(\"2024-10-25T00:53:02.943Z\"),\n ended_at=parse_datetime(\"2023-09-29T06:12:50.252Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n customer_cancellation_comment=\"\",\n metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-02-26T04:35:08.698Z\"),\n modified_at=parse_datetime(\"2024-01-10T06:45:35.933Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-04-21T20:23:52.355Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2023-05-10T07:26:17.258Z\"),\n modified_at=parse_datetime(\"2025-07-20T14:48:07.590Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=640251,\n name=\"\",\n description=\"swelter when besides utter phew knottily utilization now\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=None,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": 2229.58,\n },\n prices=[\n polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2024-10-24T03:47:20.035Z\"),\n modified_at=parse_datetime(\"2023-07-28T10:52:24.280Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n minimum_amount=472782,\n maximum_amount=712963,\n preset_amount=361483,\n ),\n ],\n benefits=[],\n medias=[],\n attached_custom_fields=[],\n ),\n discount=None,\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2025-11-18T23:26:50.006Z\"),\n modified_at=parse_datetime(\"2024-05-31T09:53:13.946Z\"),\n id=\"\",\n consumed_units=25,\n credited_units=100,\n amount=0,\n meter_id=\"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n meter=polar_sdk.Meter(\n metadata={\n\n },\n created_at=parse_datetime(\"2025-09-04T19:30:54.013Z\"),\n modified_at=parse_datetime(\"2025-12-28T16:59:30.195Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.SUM,\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\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.endpointsubscription_updated_post(request=polar_sdk.WebhookSubscriptionUpdatedPayload(\n timestamp=parse_datetime(\"2024-06-23T13:26:25.969Z\"),\n data=polar_sdk.Subscription(\n created_at=parse_datetime(\"2025-05-25T12:11:24.717Z\"),\n modified_at=parse_datetime(\"2025-07-08T02:17:23.799Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=489836,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2025-06-19T12:29:28.503Z\"),\n current_period_end=parse_datetime(\"2024-08-23T22:14:10.131Z\"),\n trial_start=parse_datetime(\"2026-12-11T02:41:54.261Z\"),\n trial_end=parse_datetime(\"2026-12-29T02:13:52.269Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2026-01-23T22:07:32.693Z\"),\n started_at=parse_datetime(\"2026-05-14T13:55:44.367Z\"),\n ends_at=parse_datetime(\"2025-10-25T00:53:02.943Z\"),\n ended_at=parse_datetime(\"2024-09-28T06:12:50.252Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n customer_cancellation_comment=\"\",\n metadata={\n\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-02-25T04:35:08.698Z\"),\n modified_at=parse_datetime(\"2025-01-09T06:45:35.933Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.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-04-21T20:23:52.355Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n id=\"\",\n created_at=parse_datetime(\"2024-05-09T07:26:17.258Z\"),\n modified_at=parse_datetime(\"2026-07-20T14:48:07.590Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=640251,\n name=\"\",\n description=\"swelter when besides utter phew knottily utilization now\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=None,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": 2229.58,\n },\n prices=[\n polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2025-10-24T03:47:20.035Z\"),\n modified_at=parse_datetime(\"2024-07-27T10:52:24.280Z\"),\n id=\"\",\n source=polar_sdk.ProductPriceSource.CATALOG,\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n minimum_amount=472782,\n maximum_amount=712963,\n preset_amount=361483,\n ),\n ],\n benefits=[],\n medias=[],\n attached_custom_fields=[],\n ),\n discount=None,\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2026-11-18T23:26:50.006Z\"),\n modified_at=parse_datetime(\"2025-05-31T09:53:13.946Z\"),\n id=\"\",\n consumed_units=25,\n credited_units=100,\n amount=0,\n meter_id=\"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n meter=polar_sdk.Meter(\n metadata={\n\n },\n created_at=parse_datetime(\"2026-09-04T19:30:54.013Z\"),\n modified_at=parse_datetime(\"2026-12-28T16:59:30.195Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.SUM,\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" diff --git a/docs/models/authorizeresponseorganization.md b/docs/models/authorizeresponseorganization.md index 4ef1c408..7c8e5de6 100644 --- a/docs/models/authorizeresponseorganization.md +++ b/docs/models/authorizeresponseorganization.md @@ -9,4 +9,5 @@ | `sub_type` | *Literal["organization"]* | :heavy_check_mark: | N/A | | `sub` | [Nullable[models.AuthorizeOrganization]](../models/authorizeorganization.md) | :heavy_check_mark: | N/A | | `scopes` | List[[models.Scope](../models/scope.md)] | :heavy_check_mark: | N/A | +| `scope_display_names` | Dict[str, *str*] | :heavy_minus_sign: | N/A | | `organizations` | List[[models.AuthorizeOrganization](../models/authorizeorganization.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/authorizeresponseuser.md b/docs/models/authorizeresponseuser.md index 65539df0..ca7092a3 100644 --- a/docs/models/authorizeresponseuser.md +++ b/docs/models/authorizeresponseuser.md @@ -8,4 +8,5 @@ | `client` | [models.OAuth2ClientPublic](../models/oauth2clientpublic.md) | :heavy_check_mark: | N/A | | `sub_type` | *Literal["user"]* | :heavy_check_mark: | N/A | | `sub` | [Nullable[models.AuthorizeUser]](../models/authorizeuser.md) | :heavy_check_mark: | N/A | -| `scopes` | List[[models.Scope](../models/scope.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| `scopes` | List[[models.Scope](../models/scope.md)] | :heavy_check_mark: | N/A | +| `scope_display_names` | Dict[str, *str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/balancedisputeevent.md b/docs/models/balancedisputeevent.md new file mode 100644 index 00000000..4158af73 --- /dev/null +++ b/docs/models/balancedisputeevent.md @@ -0,0 +1,21 @@ +# BalanceDisputeEvent + +An event created by Polar when an order is disputed. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp of the event. | | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | | +| `customer` | [Nullable[models.Customer]](../models/customer.md) | :heavy_check_mark: | The customer associated with the event. | | +| `external_customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your system associated with the event. | | +| `child_count` | *Optional[int]* | :heavy_minus_sign: | Number of direct child events linked to this event. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the parent event. | | +| `label` | *str* | :heavy_check_mark: | Human readable label of the event type. | | +| `source` | *Literal["system"]* | :heavy_check_mark: | The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API. | | +| `name` | *Literal["balance.dispute"]* | :heavy_check_mark: | The name of the event. | | +| `metadata` | [models.BalanceDisputeMetadata](../models/balancedisputemetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/balancedisputemetadata.md b/docs/models/balancedisputemetadata.md new file mode 100644 index 00000000..7af4cd1e --- /dev/null +++ b/docs/models/balancedisputemetadata.md @@ -0,0 +1,20 @@ +# BalanceDisputeMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `transaction_id` | *str* | :heavy_check_mark: | N/A | +| `dispute_id` | *str* | :heavy_check_mark: | N/A | +| `order_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `product_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `subscription_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `amount` | *int* | :heavy_check_mark: | N/A | +| `currency` | *str* | :heavy_check_mark: | N/A | +| `presentment_amount` | *int* | :heavy_check_mark: | N/A | +| `presentment_currency` | *str* | :heavy_check_mark: | N/A | +| `tax_amount` | *int* | :heavy_check_mark: | N/A | +| `tax_state` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `tax_country` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `fee` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/balancedisputereversalevent.md b/docs/models/balancedisputereversalevent.md new file mode 100644 index 00000000..b923835f --- /dev/null +++ b/docs/models/balancedisputereversalevent.md @@ -0,0 +1,21 @@ +# BalanceDisputeReversalEvent + +An event created by Polar when a dispute is won and funds are reinstated. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp of the event. | | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | | +| `customer` | [Nullable[models.Customer]](../models/customer.md) | :heavy_check_mark: | The customer associated with the event. | | +| `external_customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your system associated with the event. | | +| `child_count` | *Optional[int]* | :heavy_minus_sign: | Number of direct child events linked to this event. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the parent event. | | +| `label` | *str* | :heavy_check_mark: | Human readable label of the event type. | | +| `source` | *Literal["system"]* | :heavy_check_mark: | The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API. | | +| `name` | *Literal["balance.dispute_reversal"]* | :heavy_check_mark: | The name of the event. | | +| `metadata` | [models.BalanceDisputeMetadata](../models/balancedisputemetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/balanceorderevent.md b/docs/models/balanceorderevent.md new file mode 100644 index 00000000..48a5e2e3 --- /dev/null +++ b/docs/models/balanceorderevent.md @@ -0,0 +1,21 @@ +# BalanceOrderEvent + +An event created by Polar when an order is paid. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp of the event. | | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | | +| `customer` | [Nullable[models.Customer]](../models/customer.md) | :heavy_check_mark: | The customer associated with the event. | | +| `external_customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your system associated with the event. | | +| `child_count` | *Optional[int]* | :heavy_minus_sign: | Number of direct child events linked to this event. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the parent event. | | +| `label` | *str* | :heavy_check_mark: | Human readable label of the event type. | | +| `source` | *Literal["system"]* | :heavy_check_mark: | The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API. | | +| `name` | *Literal["balance.order"]* | :heavy_check_mark: | The name of the event. | | +| `metadata` | [models.BalanceOrderMetadata](../models/balanceordermetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/balanceordermetadata.md b/docs/models/balanceordermetadata.md new file mode 100644 index 00000000..0d3b11f2 --- /dev/null +++ b/docs/models/balanceordermetadata.md @@ -0,0 +1,19 @@ +# BalanceOrderMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `transaction_id` | *str* | :heavy_check_mark: | N/A | +| `order_id` | *str* | :heavy_check_mark: | N/A | +| `product_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `subscription_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `amount` | *int* | :heavy_check_mark: | N/A | +| `currency` | *str* | :heavy_check_mark: | N/A | +| `presentment_amount` | *int* | :heavy_check_mark: | N/A | +| `presentment_currency` | *str* | :heavy_check_mark: | N/A | +| `tax_amount` | *int* | :heavy_check_mark: | N/A | +| `tax_state` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `tax_country` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `fee` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/balancerefundevent.md b/docs/models/balancerefundevent.md new file mode 100644 index 00000000..8ef28c53 --- /dev/null +++ b/docs/models/balancerefundevent.md @@ -0,0 +1,21 @@ +# BalanceRefundEvent + +An event created by Polar when an order is refunded. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp of the event. | | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | | +| `customer` | [Nullable[models.Customer]](../models/customer.md) | :heavy_check_mark: | The customer associated with the event. | | +| `external_customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your system associated with the event. | | +| `child_count` | *Optional[int]* | :heavy_minus_sign: | Number of direct child events linked to this event. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the parent event. | | +| `label` | *str* | :heavy_check_mark: | Human readable label of the event type. | | +| `source` | *Literal["system"]* | :heavy_check_mark: | The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API. | | +| `name` | *Literal["balance.refund"]* | :heavy_check_mark: | The name of the event. | | +| `metadata` | [models.BalanceRefundMetadata](../models/balancerefundmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/balancerefundmetadata.md b/docs/models/balancerefundmetadata.md new file mode 100644 index 00000000..20575172 --- /dev/null +++ b/docs/models/balancerefundmetadata.md @@ -0,0 +1,21 @@ +# BalanceRefundMetadata + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `transaction_id` | *str* | :heavy_check_mark: | N/A | +| `refund_id` | *str* | :heavy_check_mark: | N/A | +| `order_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `product_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `subscription_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `amount` | *int* | :heavy_check_mark: | N/A | +| `currency` | *str* | :heavy_check_mark: | N/A | +| `presentment_amount` | *int* | :heavy_check_mark: | N/A | +| `presentment_currency` | *str* | :heavy_check_mark: | N/A | +| `refundable_amount` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `tax_amount` | *int* | :heavy_check_mark: | N/A | +| `tax_state` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `tax_country` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `fee` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/balancerefundreversalevent.md b/docs/models/balancerefundreversalevent.md new file mode 100644 index 00000000..5e405b9d --- /dev/null +++ b/docs/models/balancerefundreversalevent.md @@ -0,0 +1,21 @@ +# BalanceRefundReversalEvent + +An event created by Polar when a refund is reverted. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp of the event. | | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | | +| `customer` | [Nullable[models.Customer]](../models/customer.md) | :heavy_check_mark: | The customer associated with the event. | | +| `external_customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your system associated with the event. | | +| `child_count` | *Optional[int]* | :heavy_minus_sign: | Number of direct child events linked to this event. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the parent event. | | +| `label` | *str* | :heavy_check_mark: | Human readable label of the event type. | | +| `source` | *Literal["system"]* | :heavy_check_mark: | The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API. | | +| `name` | *Literal["balance.refund_reversal"]* | :heavy_check_mark: | The name of the event. | | +| `metadata` | [models.BalanceRefundMetadata](../models/balancerefundmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/checkoutcreate.md b/docs/models/checkoutcreate.md index 6676516e..fbf1e74d 100644 --- a/docs/models/checkoutcreate.md +++ b/docs/models/checkoutcreate.md @@ -35,5 +35,6 @@ to the resulting order and/or subscription. | `success_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL where the customer will be redirected after a successful payment.You can add the `checkout_id={CHECKOUT_ID}` query parameter to retrieve the checkout session id. | | | `return_url` | *OptionalNullable[str]* | :heavy_minus_sign: | When set, a back button will be shown in the checkout to return to this URL. | | | `embed_origin` | *OptionalNullable[str]* | :heavy_minus_sign: | If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Polar iframe to communicate with the parent page. | | +| `currency` | [OptionalNullable[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | N/A | | | `products` | List[*str*] | :heavy_check_mark: | List of product IDs available to select at that checkout. The first one will be selected by default. | | | `prices` | Dict[str, List[[models.CheckoutCreatePrices](../models/checkoutcreateprices.md)]] | :heavy_minus_sign: | Optional mapping of product IDs to a list of ad-hoc prices to create for that product. If not set, catalog prices of the product will be used. | | \ No newline at end of file diff --git a/docs/models/checkoutupdate.md b/docs/models/checkoutupdate.md index 7da24241..03e125f4 100644 --- a/docs/models/checkoutupdate.md +++ b/docs/models/checkoutupdate.md @@ -21,6 +21,7 @@ Update an existing checkout session using an access token. | `trial_interval` | [OptionalNullable[models.TrialInterval]](../models/trialinterval.md) | :heavy_minus_sign: | The interval unit for the trial period. | | | `trial_interval_count` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of interval units for the trial period. | | | `metadata` | Dict[str, [models.CheckoutUpdateMetadata](../models/checkoutupdatemetadata.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**. | | +| `currency` | [OptionalNullable[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | N/A | | | `discount_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the discount to apply to the checkout. | | | `allow_discount_codes` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. | | | `require_billing_address` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to require the customer to fill their full billing address, instead of just the country. Customers in the US will always be required to fill their full address, regardless of this setting. If you preset the billing address, this setting will be automatically set to `true`. | | diff --git a/docs/models/customerscreaterequest.md b/docs/models/customerscreaterequest.md deleted file mode 100644 index bbcd7184..00000000 --- a/docs/models/customerscreaterequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# CustomersCreateRequest - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | -| `customer_create` | [models.CustomerCreate](../models/customercreate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/customerseat.md b/docs/models/customerseat.md index 03d2f066..a9a0e6a1 100644 --- a/docs/models/customerseat.md +++ b/docs/models/customerseat.md @@ -3,17 +3,19 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Creation timestamp of the object. | -| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Last modification timestamp of the object. | -| `id` | *str* | :heavy_check_mark: | The seat ID | -| `subscription_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The subscription ID (for recurring seats) | -| `order_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The order ID (for one-time purchase seats) | -| `status` | [models.SeatStatus](../models/seatstatus.md) | :heavy_check_mark: | N/A | -| `customer_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The assigned customer ID | -| `customer_email` | *OptionalNullable[str]* | :heavy_minus_sign: | The assigned customer email | -| `invitation_token_expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the invitation token expires | -| `claimed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the seat was claimed | -| `revoked_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the seat was revoked | -| `seat_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Additional metadata for the seat | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Creation timestamp of the object. | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Last modification timestamp of the object. | +| `id` | *str* | :heavy_check_mark: | The seat ID | +| `subscription_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The subscription ID (for recurring seats) | +| `order_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The order ID (for one-time purchase seats) | +| `status` | [models.SeatStatus](../models/seatstatus.md) | :heavy_check_mark: | N/A | +| `customer_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The customer ID. When member_model_enabled is true, this is the billing customer (purchaser). When false, this is the seat member customer. | +| `member_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The member ID of the seat occupant | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | Email of the seat member (set when member_model_enabled is true) | +| `customer_email` | *OptionalNullable[str]* | :heavy_minus_sign: | The assigned customer email | +| `invitation_token_expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the invitation token expires | +| `claimed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the seat was claimed | +| `revoked_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the seat was revoked | +| `seat_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Additional metadata for the seat | \ No newline at end of file diff --git a/docs/models/customersgetexternalrequest.md b/docs/models/customersgetexternalrequest.md index f1293772..74d69ba5 100644 --- a/docs/models/customersgetexternalrequest.md +++ b/docs/models/customersgetexternalrequest.md @@ -3,7 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `external_id` | *str* | :heavy_check_mark: | The customer external ID. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `external_id` | *str* | :heavy_check_mark: | The customer external ID. | \ No newline at end of file diff --git a/docs/models/customersgetrequest.md b/docs/models/customersgetrequest.md index 66926d35..86b26b4f 100644 --- a/docs/models/customersgetrequest.md +++ b/docs/models/customersgetrequest.md @@ -3,7 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The customer ID. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | The customer ID. | \ No newline at end of file diff --git a/docs/models/customerslistrequest.md b/docs/models/customerslistrequest.md index 11495b21..56d986a7 100644 --- a/docs/models/customerslistrequest.md +++ b/docs/models/customerslistrequest.md @@ -8,7 +8,6 @@ | `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. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `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/customersupdateexternalrequest.md b/docs/models/customersupdateexternalrequest.md index b5539759..3b75e1e8 100644 --- a/docs/models/customersupdateexternalrequest.md +++ b/docs/models/customersupdateexternalrequest.md @@ -6,5 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `external_id` | *str* | :heavy_check_mark: | The customer external ID. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `customer_update_external_id` | [models.CustomerUpdateExternalID](../models/customerupdateexternalid.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/customersupdaterequest.md b/docs/models/customersupdaterequest.md index 9c3abefe..ae0e98db 100644 --- a/docs/models/customersupdaterequest.md +++ b/docs/models/customersupdaterequest.md @@ -3,8 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The customer ID. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | -| `customer_update` | [models.CustomerUpdate](../models/customerupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The customer ID. | +| `customer_update` | [models.CustomerUpdate](../models/customerupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/presentmentcurrency.md b/docs/models/presentmentcurrency.md new file mode 100644 index 00000000..e598a80c --- /dev/null +++ b/docs/models/presentmentcurrency.md @@ -0,0 +1,15 @@ +# PresentmentCurrency + + +## Values + +| Name | Value | +| ----- | ----- | +| `USD` | usd | +| `EUR` | eur | +| `GBP` | gbp | +| `CAD` | cad | +| `AUD` | aud | +| `JPY` | jpy | +| `CHF` | chf | +| `SEK` | sek | \ No newline at end of file diff --git a/docs/models/productpriceseatbased.md b/docs/models/productpriceseatbased.md index c048ed14..6e63cb88 100644 --- a/docs/models/productpriceseatbased.md +++ b/docs/models/productpriceseatbased.md @@ -5,16 +5,16 @@ A seat-based price for a product. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Creation timestamp of the object. | -| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Last modification timestamp of the object. | -| `id` | *str* | :heavy_check_mark: | The ID of the price. | -| `source` | [models.ProductPriceSource](../models/productpricesource.md) | :heavy_check_mark: | N/A | -| `amount_type` | *Literal["seat_based"]* | :heavy_check_mark: | N/A | -| `is_archived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | -| `product_id` | *str* | :heavy_check_mark: | The ID of the product owning the price. | -| `type` | [models.ProductPriceType](../models/productpricetype.md) | :heavy_check_mark: | N/A | -| ~~`recurring_interval`~~ | [Nullable[models.SubscriptionRecurringInterval]](../models/subscriptionrecurringinterval.md) | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | -| `price_currency` | *str* | :heavy_check_mark: | The currency. | -| `seat_tiers` | [models.ProductPriceSeatTiers](../models/productpriceseattiers.md) | :heavy_check_mark: | List of pricing tiers for seat-based pricing. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Creation timestamp of the object. | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Last modification timestamp of the object. | +| `id` | *str* | :heavy_check_mark: | The ID of the price. | +| `source` | [models.ProductPriceSource](../models/productpricesource.md) | :heavy_check_mark: | N/A | +| `amount_type` | *Literal["seat_based"]* | :heavy_check_mark: | N/A | +| `is_archived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | +| `product_id` | *str* | :heavy_check_mark: | The ID of the product owning the price. | +| `type` | [models.ProductPriceType](../models/productpricetype.md) | :heavy_check_mark: | N/A | +| ~~`recurring_interval`~~ | [Nullable[models.SubscriptionRecurringInterval]](../models/subscriptionrecurringinterval.md) | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `price_currency` | *str* | :heavy_check_mark: | The currency. | +| `seat_tiers` | [models.ProductPriceSeatTiersOutput](../models/productpriceseattiersoutput.md) | :heavy_check_mark: | List of pricing tiers for seat-based pricing.

The minimum and maximum seat limits are derived from the tiers:
- minimum_seats = first tier's min_seats
- maximum_seats = last tier's max_seats (None for unlimited) | \ No newline at end of file diff --git a/docs/models/productpriceseatbasedcreate.md b/docs/models/productpriceseatbasedcreate.md index 4fd497cc..0cc7e6ec 100644 --- a/docs/models/productpriceseatbasedcreate.md +++ b/docs/models/productpriceseatbasedcreate.md @@ -5,8 +5,8 @@ Schema to create a seat-based price with volume-based tiers. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `amount_type` | *Literal["seat_based"]* | :heavy_check_mark: | N/A | -| `price_currency` | *Optional[str]* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | -| `seat_tiers` | [models.ProductPriceSeatTiers](../models/productpriceseattiers.md) | :heavy_check_mark: | List of pricing tiers for seat-based pricing. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount_type` | *Literal["seat_based"]* | :heavy_check_mark: | N/A | +| `price_currency` | *Optional[str]* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | +| `seat_tiers` | [models.ProductPriceSeatTiersInput](../models/productpriceseattiersinput.md) | :heavy_check_mark: | List of pricing tiers for seat-based pricing.

The minimum and maximum seat limits are derived from the tiers:
- minimum_seats = first tier's min_seats
- maximum_seats = last tier's max_seats (None for unlimited) | \ No newline at end of file diff --git a/docs/models/productpriceseattiers.md b/docs/models/productpriceseattiersinput.md similarity index 82% rename from docs/models/productpriceseattiers.md rename to docs/models/productpriceseattiersinput.md index 5b7a8d3b..523e4ac1 100644 --- a/docs/models/productpriceseattiers.md +++ b/docs/models/productpriceseattiersinput.md @@ -1,7 +1,11 @@ -# ProductPriceSeatTiers +# ProductPriceSeatTiersInput List of pricing tiers for seat-based pricing. +The minimum and maximum seat limits are derived from the tiers: +- minimum_seats = first tier's min_seats +- maximum_seats = last tier's max_seats (None for unlimited) + ## Fields diff --git a/docs/models/productpriceseattiersoutput.md b/docs/models/productpriceseattiersoutput.md new file mode 100644 index 00000000..1ea05a88 --- /dev/null +++ b/docs/models/productpriceseattiersoutput.md @@ -0,0 +1,16 @@ +# ProductPriceSeatTiersOutput + +List of pricing tiers for seat-based pricing. + +The minimum and maximum seat limits are derived from the tiers: +- minimum_seats = first tier's min_seats +- maximum_seats = last tier's max_seats (None for unlimited) + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `tiers` | List[[models.ProductPriceSeatTier](../models/productpriceseattier.md)] | :heavy_check_mark: | List of pricing tiers | +| `minimum_seats` | *int* | :heavy_check_mark: | Minimum number of seats required for purchase, derived from first tier. | +| `maximum_seats` | *Nullable[int]* | :heavy_check_mark: | Maximum number of seats allowed for purchase, derived from last tier. None for unlimited. | \ No newline at end of file diff --git a/docs/models/systemevent.md b/docs/models/systemevent.md index 790c9448..db31ceed 100644 --- a/docs/models/systemevent.md +++ b/docs/models/systemevent.md @@ -3,6 +3,36 @@ ## Supported Types +### `models.BalanceDisputeEvent` + +```python +value: models.BalanceDisputeEvent = /* values here */ +``` + +### `models.BalanceDisputeReversalEvent` + +```python +value: models.BalanceDisputeReversalEvent = /* values here */ +``` + +### `models.BalanceOrderEvent` + +```python +value: models.BalanceOrderEvent = /* values here */ +``` + +### `models.BalanceRefundEvent` + +```python +value: models.BalanceRefundEvent = /* values here */ +``` + +### `models.BalanceRefundReversalEvent` + +```python +value: models.BalanceRefundReversalEvent = /* values here */ +``` + ### `models.BenefitCycledEvent` ```python diff --git a/docs/models/webhooksubscriptionuncanceledpayload.md b/docs/models/webhooksubscriptionuncanceledpayload.md index f8b86444..00a5f18c 100644 --- a/docs/models/webhooksubscriptionuncanceledpayload.md +++ b/docs/models/webhooksubscriptionuncanceledpayload.md @@ -1,6 +1,10 @@ # WebhookSubscriptionUncanceledPayload -Sent when a subscription is uncanceled. +Sent when a customer revokes a pending cancellation. + +When a customer cancels with "at period end", they retain access until the +subscription would renew. During this time, they can change their mind and +undo the cancellation. This event is triggered when they do so. **Discord & Slack support:** Full diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index 31aa4d1a..66a2ef43 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -34,7 +34,7 @@ with Polar( access_token="", ) as polar: - res = polar.customers.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", include_members=False, page=1, limit=10) + res = polar.customers.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10) while res is not None: # Handle items @@ -50,7 +50,6 @@ 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. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `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. | @@ -86,7 +85,7 @@ with Polar( access_token="", ) as polar: - res = polar.customers.create(customer_create={ + res = polar.customers.create(request={ "external_id": "usr_1337", "email": "customer@example.com", "name": "John Doe", @@ -103,7 +102,7 @@ with Polar( "name": "Jane Doe", "external_id": "usr_1337", }, - }, include_members=False) + }) # Handle response print(res) @@ -114,8 +113,7 @@ with Polar( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `customer_create` | [models.CustomerCreate](../../models/customercreate.md) | :heavy_check_mark: | N/A | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | +| `request` | [models.CustomerCreate](../../models/customercreate.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 @@ -188,7 +186,7 @@ with Polar( access_token="", ) as polar: - res = polar.customers.get(id="", include_members=False) + res = polar.customers.get(id="") # Handle response print(res) @@ -200,7 +198,6 @@ with Polar( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The customer ID. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -244,7 +241,7 @@ with Polar( "us_ein", ], "external_id": "usr_1337", - }, include_members=False) + }) # Handle response print(res) @@ -257,7 +254,6 @@ with Polar( | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The customer ID. | | `customer_update` | [models.CustomerUpdate](../../models/customerupdate.md) | :heavy_check_mark: | N/A | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -339,7 +335,7 @@ with Polar( access_token="", ) as polar: - res = polar.customers.get_external(external_id="", include_members=False) + res = polar.customers.get_external(external_id="") # Handle response print(res) @@ -351,7 +347,6 @@ with Polar( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `external_id` | *str* | :heavy_check_mark: | The customer external ID. | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -391,7 +386,7 @@ with Polar( "911144442", "us_ein", ], - }, include_members=False) + }) # Handle response print(res) @@ -404,7 +399,6 @@ with Polar( | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `external_id` | *str* | :heavy_check_mark: | The customer external ID. | | `customer_update_external_id` | [models.CustomerUpdateExternalID](../../models/customerupdateexternalid.md) | :heavy_check_mark: | N/A | -| `include_members` | *Optional[bool]* | :heavy_minus_sign: | Include members in the response. Only populated when set to true. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/pyproject.toml b/pyproject.toml index b88f227b..7cefb1c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "polar-sdk" -version = "0.28.1" +version = "0.28.2" 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 37640a70..d1849290 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.28.1" +__version__: str = "0.28.2" __openapi_doc_version__: str = "0.1.0" __gen_version__: str = "2.737.0" -__user_agent__: str = "speakeasy-sdk/python 0.28.1 2.737.0 0.1.0 polar-sdk" +__user_agent__: str = "speakeasy-sdk/python 0.28.2 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 48a92185..1de2aee2 100644 --- a/src/polar_sdk/customers.py +++ b/src/polar_sdk/customers.py @@ -4,9 +4,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 Customers(BaseSDK): @@ -21,7 +21,6 @@ def list( ] = UNSET, email: OptionalNullable[str] = UNSET, query: OptionalNullable[str] = UNSET, - include_members: Optional[bool] = False, page: Optional[int] = 1, limit: Optional[int] = 10, sorting: OptionalNullable[List[models.CustomerSortProperty]] = UNSET, @@ -45,7 +44,6 @@ 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 include_members: Include members in the response. Only populated when set to true. :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. @@ -69,7 +67,6 @@ def list( organization_id=organization_id, email=email, query=query, - include_members=include_members, page=page, limit=limit, sorting=sorting, @@ -135,7 +132,6 @@ def next_func() -> Optional[models.CustomersListResponse]: organization_id=organization_id, email=email, query=query, - include_members=include_members, page=next_page, limit=limit, sorting=sorting, @@ -176,7 +172,6 @@ async def list_async( ] = UNSET, email: OptionalNullable[str] = UNSET, query: OptionalNullable[str] = UNSET, - include_members: Optional[bool] = False, page: Optional[int] = 1, limit: Optional[int] = 10, sorting: OptionalNullable[List[models.CustomerSortProperty]] = UNSET, @@ -200,7 +195,6 @@ 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 include_members: Include members in the response. Only populated when set to true. :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. @@ -224,7 +218,6 @@ async def list_async( organization_id=organization_id, email=email, query=query, - include_members=include_members, page=page, limit=limit, sorting=sorting, @@ -290,7 +283,6 @@ def next_func() -> Optional[models.CustomersListResponse]: organization_id=organization_id, email=email, query=query, - include_members=include_members, page=next_page, limit=limit, sorting=sorting, @@ -323,8 +315,7 @@ def next_func() -> Optional[models.CustomersListResponse]: def create( self, *, - customer_create: Union[models.CustomerCreate, models.CustomerCreateTypedDict], - include_members: Optional[bool] = False, + request: Union[models.CustomerCreate, models.CustomerCreateTypedDict], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -336,8 +327,7 @@ def create( **Scopes**: `customers:write` - :param customer_create: - :param include_members: Include members in the response. Only populated when set to true. + :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 @@ -353,12 +343,9 @@ def create( else: base_url = self._get_url(base_url, url_variables) - request = models.CustomersCreateRequest( - include_members=include_members, - customer_create=utils.get_pydantic_model( - customer_create, models.CustomerCreate - ), - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.CustomerCreate) + request = cast(models.CustomerCreate, request) req = self._build_request( method="POST", @@ -374,7 +361,7 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.customer_create, False, False, "json", models.CustomerCreate + request, False, False, "json", models.CustomerCreate ), timeout_ms=timeout_ms, ) @@ -420,8 +407,7 @@ def create( async def create_async( self, *, - customer_create: Union[models.CustomerCreate, models.CustomerCreateTypedDict], - include_members: Optional[bool] = False, + request: Union[models.CustomerCreate, models.CustomerCreateTypedDict], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -433,8 +419,7 @@ async def create_async( **Scopes**: `customers:write` - :param customer_create: - :param include_members: Include members in the response. Only populated when set to true. + :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 @@ -450,12 +435,9 @@ async def create_async( else: base_url = self._get_url(base_url, url_variables) - request = models.CustomersCreateRequest( - include_members=include_members, - customer_create=utils.get_pydantic_model( - customer_create, models.CustomerCreate - ), - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.CustomerCreate) + request = cast(models.CustomerCreate, request) req = self._build_request_async( method="POST", @@ -471,7 +453,7 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.customer_create, False, False, "json", models.CustomerCreate + request, False, False, "json", models.CustomerCreate ), timeout_ms=timeout_ms, ) @@ -706,7 +688,6 @@ def get( self, *, id: str, - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -719,7 +700,6 @@ def get( **Scopes**: `customers:read` `customers:write` :param id: The customer ID. - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -737,7 +717,6 @@ def get( request = models.CustomersGetRequest( id=id, - include_members=include_members, ) req = self._build_request( @@ -803,7 +782,6 @@ async def get_async( self, *, id: str, - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -816,7 +794,6 @@ async def get_async( **Scopes**: `customers:read` `customers:write` :param id: The customer ID. - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -834,7 +811,6 @@ async def get_async( request = models.CustomersGetRequest( id=id, - include_members=include_members, ) req = self._build_request_async( @@ -901,7 +877,6 @@ def update( *, id: str, customer_update: Union[models.CustomerUpdate, models.CustomerUpdateTypedDict], - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -915,7 +890,6 @@ def update( :param id: The customer ID. :param customer_update: - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -933,7 +907,6 @@ def update( request = models.CustomersUpdateRequest( id=id, - include_members=include_members, customer_update=utils.get_pydantic_model( customer_update, models.CustomerUpdate ), @@ -1006,7 +979,6 @@ async def update_async( *, id: str, customer_update: Union[models.CustomerUpdate, models.CustomerUpdateTypedDict], - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1020,7 +992,6 @@ async def update_async( :param id: The customer ID. :param customer_update: - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -1038,7 +1009,6 @@ async def update_async( request = models.CustomersUpdateRequest( id=id, - include_members=include_members, customer_update=utils.get_pydantic_model( customer_update, models.CustomerUpdate ), @@ -1322,7 +1292,6 @@ def get_external( self, *, external_id: str, - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1335,7 +1304,6 @@ def get_external( **Scopes**: `customers:read` `customers:write` :param external_id: The customer external ID. - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -1353,7 +1321,6 @@ def get_external( request = models.CustomersGetExternalRequest( external_id=external_id, - include_members=include_members, ) req = self._build_request( @@ -1419,7 +1386,6 @@ async def get_external_async( self, *, external_id: str, - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1432,7 +1398,6 @@ async def get_external_async( **Scopes**: `customers:read` `customers:write` :param external_id: The customer external ID. - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -1450,7 +1415,6 @@ async def get_external_async( request = models.CustomersGetExternalRequest( external_id=external_id, - include_members=include_members, ) req = self._build_request_async( @@ -1519,7 +1483,6 @@ def update_external( customer_update_external_id: Union[ models.CustomerUpdateExternalID, models.CustomerUpdateExternalIDTypedDict ], - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1533,7 +1496,6 @@ def update_external( :param external_id: The customer external ID. :param customer_update_external_id: - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -1551,7 +1513,6 @@ def update_external( request = models.CustomersUpdateExternalRequest( external_id=external_id, - include_members=include_members, customer_update_external_id=utils.get_pydantic_model( customer_update_external_id, models.CustomerUpdateExternalID ), @@ -1630,7 +1591,6 @@ async def update_external_async( customer_update_external_id: Union[ models.CustomerUpdateExternalID, models.CustomerUpdateExternalIDTypedDict ], - include_members: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1644,7 +1604,6 @@ async def update_external_async( :param external_id: The customer external ID. :param customer_update_external_id: - :param include_members: Include members in the response. Only populated when set to true. :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 @@ -1662,7 +1621,6 @@ async def update_external_async( request = models.CustomersUpdateExternalRequest( external_id=external_id, - include_members=include_members, customer_update_external_id=utils.get_pydantic_model( customer_update_external_id, models.CustomerUpdateExternalID ), diff --git a/src/polar_sdk/models/__init__.py b/src/polar_sdk/models/__init__.py index 2408277c..55490f52 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -42,6 +42,29 @@ AuthorizeResponseUserTypedDict, ) from .authorizeuser import AuthorizeUser, AuthorizeUserTypedDict + from .balancedisputeevent import BalanceDisputeEvent, BalanceDisputeEventTypedDict + from .balancedisputemetadata import ( + BalanceDisputeMetadata, + BalanceDisputeMetadataTypedDict, + ) + from .balancedisputereversalevent import ( + BalanceDisputeReversalEvent, + BalanceDisputeReversalEventTypedDict, + ) + from .balanceorderevent import BalanceOrderEvent, BalanceOrderEventTypedDict + from .balanceordermetadata import ( + BalanceOrderMetadata, + BalanceOrderMetadataTypedDict, + ) + from .balancerefundevent import BalanceRefundEvent, BalanceRefundEventTypedDict + from .balancerefundmetadata import ( + BalanceRefundMetadata, + BalanceRefundMetadataTypedDict, + ) + from .balancerefundreversalevent import ( + BalanceRefundReversalEvent, + BalanceRefundReversalEventTypedDict, + ) from .benefit import Benefit, BenefitTypedDict from .benefit_grants_listop import ( BenefitGrantsListQueryParamCustomerIDFilter, @@ -1050,10 +1073,6 @@ CustomerProductPricesTypedDict, CustomerProductTypedDict, ) - from .customers_createop import ( - CustomersCreateRequest, - CustomersCreateRequestTypedDict, - ) from .customers_delete_externalop import ( CustomersDeleteExternalRequest, CustomersDeleteExternalRequestTypedDict, @@ -2148,6 +2167,7 @@ ) from .paymentsortproperty import PaymentSortProperty from .paymentstatus import PaymentStatus + from .presentmentcurrency import PresentmentCurrency from .product import Prices, PricesTypedDict, Product, ProductTypedDict from .productbenefitsupdate import ( ProductBenefitsUpdate, @@ -2218,9 +2238,13 @@ ProductPriceSeatTier, ProductPriceSeatTierTypedDict, ) - from .productpriceseattiers import ( - ProductPriceSeatTiers, - ProductPriceSeatTiersTypedDict, + from .productpriceseattiers_input import ( + ProductPriceSeatTiersInput, + ProductPriceSeatTiersInputTypedDict, + ) + from .productpriceseattiers_output import ( + ProductPriceSeatTiersOutput, + ProductPriceSeatTiersOutputTypedDict, ) from .productpricesource import ProductPriceSource from .productpricetype import ProductPriceType @@ -2778,6 +2802,22 @@ "AverageOrderValueTypedDict", "AverageRevenuePerUser", "AverageRevenuePerUserTypedDict", + "BalanceDisputeEvent", + "BalanceDisputeEventTypedDict", + "BalanceDisputeMetadata", + "BalanceDisputeMetadataTypedDict", + "BalanceDisputeReversalEvent", + "BalanceDisputeReversalEventTypedDict", + "BalanceOrderEvent", + "BalanceOrderEventTypedDict", + "BalanceOrderMetadata", + "BalanceOrderMetadataTypedDict", + "BalanceRefundEvent", + "BalanceRefundEventTypedDict", + "BalanceRefundMetadata", + "BalanceRefundMetadataTypedDict", + "BalanceRefundReversalEvent", + "BalanceRefundReversalEventTypedDict", "Benefit", "BenefitCreate", "BenefitCreateTypedDict", @@ -3631,8 +3671,6 @@ "CustomerWithMembersTaxID", "CustomerWithMembersTaxIDTypedDict", "CustomerWithMembersTypedDict", - "CustomersCreateRequest", - "CustomersCreateRequestTypedDict", "CustomersDeleteExternalRequest", "CustomersDeleteExternalRequestTypedDict", "CustomersDeleteRequest", @@ -4349,6 +4387,7 @@ "PaymentsListResponseTypedDict", "Permission", "PolarError", + "PresentmentCurrency", "Prices", "PricesTypedDict", "Product", @@ -4402,8 +4441,10 @@ "ProductPriceSeatBasedTypedDict", "ProductPriceSeatTier", "ProductPriceSeatTierTypedDict", - "ProductPriceSeatTiers", - "ProductPriceSeatTiersTypedDict", + "ProductPriceSeatTiersInput", + "ProductPriceSeatTiersInputTypedDict", + "ProductPriceSeatTiersOutput", + "ProductPriceSeatTiersOutputTypedDict", "ProductPriceSource", "ProductPriceType", "ProductPriceTypedDict", @@ -4783,6 +4824,22 @@ "AuthorizeResponseUserTypedDict": ".authorizeresponseuser", "AuthorizeUser": ".authorizeuser", "AuthorizeUserTypedDict": ".authorizeuser", + "BalanceDisputeEvent": ".balancedisputeevent", + "BalanceDisputeEventTypedDict": ".balancedisputeevent", + "BalanceDisputeMetadata": ".balancedisputemetadata", + "BalanceDisputeMetadataTypedDict": ".balancedisputemetadata", + "BalanceDisputeReversalEvent": ".balancedisputereversalevent", + "BalanceDisputeReversalEventTypedDict": ".balancedisputereversalevent", + "BalanceOrderEvent": ".balanceorderevent", + "BalanceOrderEventTypedDict": ".balanceorderevent", + "BalanceOrderMetadata": ".balanceordermetadata", + "BalanceOrderMetadataTypedDict": ".balanceordermetadata", + "BalanceRefundEvent": ".balancerefundevent", + "BalanceRefundEventTypedDict": ".balancerefundevent", + "BalanceRefundMetadata": ".balancerefundmetadata", + "BalanceRefundMetadataTypedDict": ".balancerefundmetadata", + "BalanceRefundReversalEvent": ".balancerefundreversalevent", + "BalanceRefundReversalEventTypedDict": ".balancerefundreversalevent", "Benefit": ".benefit", "BenefitTypedDict": ".benefit", "BenefitGrantsListQueryParamCustomerIDFilter": ".benefit_grants_listop", @@ -5453,8 +5510,6 @@ "CustomerProductPrices": ".customerproduct", "CustomerProductPricesTypedDict": ".customerproduct", "CustomerProductTypedDict": ".customerproduct", - "CustomersCreateRequest": ".customers_createop", - "CustomersCreateRequestTypedDict": ".customers_createop", "CustomersDeleteExternalRequest": ".customers_delete_externalop", "CustomersDeleteExternalRequestTypedDict": ".customers_delete_externalop", "CustomersDeleteRequest": ".customers_deleteop", @@ -6327,6 +6382,7 @@ "PaymentsListResponseTypedDict": ".payments_listop", "PaymentSortProperty": ".paymentsortproperty", "PaymentStatus": ".paymentstatus", + "PresentmentCurrency": ".presentmentcurrency", "Prices": ".product", "PricesTypedDict": ".product", "Product": ".product", @@ -6380,8 +6436,10 @@ "ProductPriceSeatBasedCreateTypedDict": ".productpriceseatbasedcreate", "ProductPriceSeatTier": ".productpriceseattier", "ProductPriceSeatTierTypedDict": ".productpriceseattier", - "ProductPriceSeatTiers": ".productpriceseattiers", - "ProductPriceSeatTiersTypedDict": ".productpriceseattiers", + "ProductPriceSeatTiersInput": ".productpriceseattiers_input", + "ProductPriceSeatTiersInputTypedDict": ".productpriceseattiers_input", + "ProductPriceSeatTiersOutput": ".productpriceseattiers_output", + "ProductPriceSeatTiersOutputTypedDict": ".productpriceseattiers_output", "ProductPriceSource": ".productpricesource", "ProductPriceType": ".productpricetype", "ProductsGetRequest": ".products_getop", diff --git a/src/polar_sdk/models/authorizeresponseorganization.py b/src/polar_sdk/models/authorizeresponseorganization.py index 69735f54..40e5d442 100644 --- a/src/polar_sdk/models/authorizeresponseorganization.py +++ b/src/polar_sdk/models/authorizeresponseorganization.py @@ -9,8 +9,8 @@ import pydantic from pydantic import model_serializer from pydantic.functional_validators import AfterValidator -from typing import List, Literal -from typing_extensions import Annotated, TypedDict +from typing import Dict, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class AuthorizeResponseOrganizationTypedDict(TypedDict): @@ -19,6 +19,7 @@ class AuthorizeResponseOrganizationTypedDict(TypedDict): scopes: List[Scope] organizations: List[AuthorizeOrganizationTypedDict] sub_type: Literal["organization"] + scope_display_names: NotRequired[Dict[str, str]] class AuthorizeResponseOrganization(BaseModel): @@ -37,9 +38,11 @@ class AuthorizeResponseOrganization(BaseModel): pydantic.Field(alias="sub_type"), ] = "organization" + scope_display_names: Optional[Dict[str, str]] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [] + optional_fields = ["scope_display_names"] nullable_fields = ["sub"] null_default_fields = [] diff --git a/src/polar_sdk/models/authorizeresponseuser.py b/src/polar_sdk/models/authorizeresponseuser.py index 0e1d1b59..92e6add6 100644 --- a/src/polar_sdk/models/authorizeresponseuser.py +++ b/src/polar_sdk/models/authorizeresponseuser.py @@ -9,8 +9,8 @@ import pydantic from pydantic import model_serializer from pydantic.functional_validators import AfterValidator -from typing import List, Literal -from typing_extensions import Annotated, TypedDict +from typing import Dict, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class AuthorizeResponseUserTypedDict(TypedDict): @@ -18,6 +18,7 @@ class AuthorizeResponseUserTypedDict(TypedDict): sub: Nullable[AuthorizeUserTypedDict] scopes: List[Scope] sub_type: Literal["user"] + scope_display_names: NotRequired[Dict[str, str]] class AuthorizeResponseUser(BaseModel): @@ -32,9 +33,11 @@ class AuthorizeResponseUser(BaseModel): pydantic.Field(alias="sub_type"), ] = "user" + scope_display_names: Optional[Dict[str, str]] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [] + optional_fields = ["scope_display_names"] nullable_fields = ["sub"] null_default_fields = [] diff --git a/src/polar_sdk/models/balancedisputeevent.py b/src/polar_sdk/models/balancedisputeevent.py new file mode 100644 index 00000000..251537c6 --- /dev/null +++ b/src/polar_sdk/models/balancedisputeevent.py @@ -0,0 +1,127 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balancedisputemetadata import ( + BalanceDisputeMetadata, + BalanceDisputeMetadataTypedDict, +) +from .customer import Customer, CustomerTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BalanceDisputeEventTypedDict(TypedDict): + r"""An event created by Polar when an order is disputed.""" + + id: str + r"""The ID of the object.""" + timestamp: datetime + r"""The timestamp of the event.""" + organization_id: str + r"""The ID of the organization owning the event.""" + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + customer: Nullable[CustomerTypedDict] + r"""The customer associated with the event.""" + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + label: str + r"""Human readable label of the event type.""" + metadata: BalanceDisputeMetadataTypedDict + child_count: NotRequired[int] + r"""Number of direct child events linked to this event.""" + parent_id: NotRequired[Nullable[str]] + r"""The ID of the parent event.""" + source: Literal["system"] + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + name: Literal["balance.dispute"] + r"""The name of the event.""" + + +class BalanceDisputeEvent(BaseModel): + r"""An event created by Polar when an order is disputed.""" + + id: str + r"""The ID of the object.""" + + timestamp: datetime + r"""The timestamp of the event.""" + + organization_id: str + r"""The ID of the organization owning the event.""" + + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + + customer: Nullable[Customer] + r"""The customer associated with the event.""" + + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + label: str + r"""Human readable label of the event type.""" + + metadata: BalanceDisputeMetadata + + child_count: Optional[int] = 0 + r"""Number of direct child events linked to this event.""" + + parent_id: OptionalNullable[str] = UNSET + r"""The ID of the parent event.""" + + SOURCE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="source"), + ] = "system" + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + + NAME: Annotated[ + Annotated[ + Literal["balance.dispute"], + AfterValidator(validate_const("balance.dispute")), + ], + pydantic.Field(alias="name"), + ] = "balance.dispute" + r"""The name of the event.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["child_count", "parent_id"] + nullable_fields = [ + "customer_id", + "customer", + "external_customer_id", + "parent_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/balancedisputemetadata.py b/src/polar_sdk/models/balancedisputemetadata.py new file mode 100644 index 00000000..ee56a0b1 --- /dev/null +++ b/src/polar_sdk/models/balancedisputemetadata.py @@ -0,0 +1,87 @@ +"""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 import Optional +from typing_extensions import NotRequired, TypedDict + + +class BalanceDisputeMetadataTypedDict(TypedDict): + transaction_id: str + dispute_id: str + amount: int + currency: str + presentment_amount: int + presentment_currency: str + tax_amount: int + fee: int + order_id: NotRequired[str] + product_id: NotRequired[str] + subscription_id: NotRequired[str] + tax_state: NotRequired[Nullable[str]] + tax_country: NotRequired[Nullable[str]] + + +class BalanceDisputeMetadata(BaseModel): + transaction_id: str + + dispute_id: str + + amount: int + + currency: str + + presentment_amount: int + + presentment_currency: str + + tax_amount: int + + fee: int + + order_id: Optional[str] = None + + product_id: Optional[str] = None + + subscription_id: Optional[str] = None + + tax_state: OptionalNullable[str] = UNSET + + tax_country: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "order_id", + "product_id", + "subscription_id", + "tax_state", + "tax_country", + ] + nullable_fields = ["tax_state", "tax_country"] + 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/balancedisputereversalevent.py b/src/polar_sdk/models/balancedisputereversalevent.py new file mode 100644 index 00000000..e1b72696 --- /dev/null +++ b/src/polar_sdk/models/balancedisputereversalevent.py @@ -0,0 +1,127 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balancedisputemetadata import ( + BalanceDisputeMetadata, + BalanceDisputeMetadataTypedDict, +) +from .customer import Customer, CustomerTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BalanceDisputeReversalEventTypedDict(TypedDict): + r"""An event created by Polar when a dispute is won and funds are reinstated.""" + + id: str + r"""The ID of the object.""" + timestamp: datetime + r"""The timestamp of the event.""" + organization_id: str + r"""The ID of the organization owning the event.""" + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + customer: Nullable[CustomerTypedDict] + r"""The customer associated with the event.""" + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + label: str + r"""Human readable label of the event type.""" + metadata: BalanceDisputeMetadataTypedDict + child_count: NotRequired[int] + r"""Number of direct child events linked to this event.""" + parent_id: NotRequired[Nullable[str]] + r"""The ID of the parent event.""" + source: Literal["system"] + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + name: Literal["balance.dispute_reversal"] + r"""The name of the event.""" + + +class BalanceDisputeReversalEvent(BaseModel): + r"""An event created by Polar when a dispute is won and funds are reinstated.""" + + id: str + r"""The ID of the object.""" + + timestamp: datetime + r"""The timestamp of the event.""" + + organization_id: str + r"""The ID of the organization owning the event.""" + + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + + customer: Nullable[Customer] + r"""The customer associated with the event.""" + + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + label: str + r"""Human readable label of the event type.""" + + metadata: BalanceDisputeMetadata + + child_count: Optional[int] = 0 + r"""Number of direct child events linked to this event.""" + + parent_id: OptionalNullable[str] = UNSET + r"""The ID of the parent event.""" + + SOURCE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="source"), + ] = "system" + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + + NAME: Annotated[ + Annotated[ + Literal["balance.dispute_reversal"], + AfterValidator(validate_const("balance.dispute_reversal")), + ], + pydantic.Field(alias="name"), + ] = "balance.dispute_reversal" + r"""The name of the event.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["child_count", "parent_id"] + nullable_fields = [ + "customer_id", + "customer", + "external_customer_id", + "parent_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/balanceorderevent.py b/src/polar_sdk/models/balanceorderevent.py new file mode 100644 index 00000000..934bc7d8 --- /dev/null +++ b/src/polar_sdk/models/balanceorderevent.py @@ -0,0 +1,123 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balanceordermetadata import BalanceOrderMetadata, BalanceOrderMetadataTypedDict +from .customer import Customer, CustomerTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BalanceOrderEventTypedDict(TypedDict): + r"""An event created by Polar when an order is paid.""" + + id: str + r"""The ID of the object.""" + timestamp: datetime + r"""The timestamp of the event.""" + organization_id: str + r"""The ID of the organization owning the event.""" + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + customer: Nullable[CustomerTypedDict] + r"""The customer associated with the event.""" + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + label: str + r"""Human readable label of the event type.""" + metadata: BalanceOrderMetadataTypedDict + child_count: NotRequired[int] + r"""Number of direct child events linked to this event.""" + parent_id: NotRequired[Nullable[str]] + r"""The ID of the parent event.""" + source: Literal["system"] + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + name: Literal["balance.order"] + r"""The name of the event.""" + + +class BalanceOrderEvent(BaseModel): + r"""An event created by Polar when an order is paid.""" + + id: str + r"""The ID of the object.""" + + timestamp: datetime + r"""The timestamp of the event.""" + + organization_id: str + r"""The ID of the organization owning the event.""" + + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + + customer: Nullable[Customer] + r"""The customer associated with the event.""" + + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + label: str + r"""Human readable label of the event type.""" + + metadata: BalanceOrderMetadata + + child_count: Optional[int] = 0 + r"""Number of direct child events linked to this event.""" + + parent_id: OptionalNullable[str] = UNSET + r"""The ID of the parent event.""" + + SOURCE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="source"), + ] = "system" + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + + NAME: Annotated[ + Annotated[ + Literal["balance.order"], AfterValidator(validate_const("balance.order")) + ], + pydantic.Field(alias="name"), + ] = "balance.order" + r"""The name of the event.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["child_count", "parent_id"] + nullable_fields = [ + "customer_id", + "customer", + "external_customer_id", + "parent_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/balanceordermetadata.py b/src/polar_sdk/models/balanceordermetadata.py new file mode 100644 index 00000000..895c1c98 --- /dev/null +++ b/src/polar_sdk/models/balanceordermetadata.py @@ -0,0 +1,78 @@ +"""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 import Optional +from typing_extensions import NotRequired, TypedDict + + +class BalanceOrderMetadataTypedDict(TypedDict): + transaction_id: str + order_id: str + amount: int + currency: str + presentment_amount: int + presentment_currency: str + tax_amount: int + fee: int + product_id: NotRequired[str] + subscription_id: NotRequired[str] + tax_state: NotRequired[Nullable[str]] + tax_country: NotRequired[Nullable[str]] + + +class BalanceOrderMetadata(BaseModel): + transaction_id: str + + order_id: str + + amount: int + + currency: str + + presentment_amount: int + + presentment_currency: str + + tax_amount: int + + fee: int + + product_id: Optional[str] = None + + subscription_id: Optional[str] = None + + tax_state: OptionalNullable[str] = UNSET + + tax_country: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["product_id", "subscription_id", "tax_state", "tax_country"] + nullable_fields = ["tax_state", "tax_country"] + 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/balancerefundevent.py b/src/polar_sdk/models/balancerefundevent.py new file mode 100644 index 00000000..67ee92f0 --- /dev/null +++ b/src/polar_sdk/models/balancerefundevent.py @@ -0,0 +1,123 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balancerefundmetadata import BalanceRefundMetadata, BalanceRefundMetadataTypedDict +from .customer import Customer, CustomerTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BalanceRefundEventTypedDict(TypedDict): + r"""An event created by Polar when an order is refunded.""" + + id: str + r"""The ID of the object.""" + timestamp: datetime + r"""The timestamp of the event.""" + organization_id: str + r"""The ID of the organization owning the event.""" + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + customer: Nullable[CustomerTypedDict] + r"""The customer associated with the event.""" + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + label: str + r"""Human readable label of the event type.""" + metadata: BalanceRefundMetadataTypedDict + child_count: NotRequired[int] + r"""Number of direct child events linked to this event.""" + parent_id: NotRequired[Nullable[str]] + r"""The ID of the parent event.""" + source: Literal["system"] + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + name: Literal["balance.refund"] + r"""The name of the event.""" + + +class BalanceRefundEvent(BaseModel): + r"""An event created by Polar when an order is refunded.""" + + id: str + r"""The ID of the object.""" + + timestamp: datetime + r"""The timestamp of the event.""" + + organization_id: str + r"""The ID of the organization owning the event.""" + + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + + customer: Nullable[Customer] + r"""The customer associated with the event.""" + + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + label: str + r"""Human readable label of the event type.""" + + metadata: BalanceRefundMetadata + + child_count: Optional[int] = 0 + r"""Number of direct child events linked to this event.""" + + parent_id: OptionalNullable[str] = UNSET + r"""The ID of the parent event.""" + + SOURCE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="source"), + ] = "system" + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + + NAME: Annotated[ + Annotated[ + Literal["balance.refund"], AfterValidator(validate_const("balance.refund")) + ], + pydantic.Field(alias="name"), + ] = "balance.refund" + r"""The name of the event.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["child_count", "parent_id"] + nullable_fields = [ + "customer_id", + "customer", + "external_customer_id", + "parent_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/balancerefundmetadata.py b/src/polar_sdk/models/balancerefundmetadata.py new file mode 100644 index 00000000..879de76f --- /dev/null +++ b/src/polar_sdk/models/balancerefundmetadata.py @@ -0,0 +1,91 @@ +"""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 import Optional +from typing_extensions import NotRequired, TypedDict + + +class BalanceRefundMetadataTypedDict(TypedDict): + transaction_id: str + refund_id: str + amount: int + currency: str + presentment_amount: int + presentment_currency: str + tax_amount: int + fee: int + order_id: NotRequired[str] + product_id: NotRequired[str] + subscription_id: NotRequired[str] + refundable_amount: NotRequired[int] + tax_state: NotRequired[Nullable[str]] + tax_country: NotRequired[Nullable[str]] + + +class BalanceRefundMetadata(BaseModel): + transaction_id: str + + refund_id: str + + amount: int + + currency: str + + presentment_amount: int + + presentment_currency: str + + tax_amount: int + + fee: int + + order_id: Optional[str] = None + + product_id: Optional[str] = None + + subscription_id: Optional[str] = None + + refundable_amount: Optional[int] = None + + tax_state: OptionalNullable[str] = UNSET + + tax_country: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "order_id", + "product_id", + "subscription_id", + "refundable_amount", + "tax_state", + "tax_country", + ] + nullable_fields = ["tax_state", "tax_country"] + 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/balancerefundreversalevent.py b/src/polar_sdk/models/balancerefundreversalevent.py new file mode 100644 index 00000000..d3371bb6 --- /dev/null +++ b/src/polar_sdk/models/balancerefundreversalevent.py @@ -0,0 +1,124 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balancerefundmetadata import BalanceRefundMetadata, BalanceRefundMetadataTypedDict +from .customer import Customer, CustomerTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BalanceRefundReversalEventTypedDict(TypedDict): + r"""An event created by Polar when a refund is reverted.""" + + id: str + r"""The ID of the object.""" + timestamp: datetime + r"""The timestamp of the event.""" + organization_id: str + r"""The ID of the organization owning the event.""" + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + customer: Nullable[CustomerTypedDict] + r"""The customer associated with the event.""" + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + label: str + r"""Human readable label of the event type.""" + metadata: BalanceRefundMetadataTypedDict + child_count: NotRequired[int] + r"""Number of direct child events linked to this event.""" + parent_id: NotRequired[Nullable[str]] + r"""The ID of the parent event.""" + source: Literal["system"] + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + name: Literal["balance.refund_reversal"] + r"""The name of the event.""" + + +class BalanceRefundReversalEvent(BaseModel): + r"""An event created by Polar when a refund is reverted.""" + + id: str + r"""The ID of the object.""" + + timestamp: datetime + r"""The timestamp of the event.""" + + organization_id: str + r"""The ID of the organization owning the event.""" + + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + + customer: Nullable[Customer] + r"""The customer associated with the event.""" + + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + label: str + r"""Human readable label of the event type.""" + + metadata: BalanceRefundMetadata + + child_count: Optional[int] = 0 + r"""Number of direct child events linked to this event.""" + + parent_id: OptionalNullable[str] = UNSET + r"""The ID of the parent event.""" + + SOURCE: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="source"), + ] = "system" + r"""The source of the event. `system` events are created by Polar. `user` events are the one you create through our ingestion API.""" + + NAME: Annotated[ + Annotated[ + Literal["balance.refund_reversal"], + AfterValidator(validate_const("balance.refund_reversal")), + ], + pydantic.Field(alias="name"), + ] = "balance.refund_reversal" + r"""The name of the event.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["child_count", "parent_id"] + nullable_fields = [ + "customer_id", + "customer", + "external_customer_id", + "parent_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/checkoutcreate.py b/src/polar_sdk/models/checkoutcreate.py index 8e1fccd9..5f32ea65 100644 --- a/src/polar_sdk/models/checkoutcreate.py +++ b/src/polar_sdk/models/checkoutcreate.py @@ -2,6 +2,7 @@ from __future__ import annotations from .addressinput import AddressInput, AddressInputTypedDict +from .presentmentcurrency import PresentmentCurrency from .productpricecustomcreate import ( ProductPriceCustomCreate, ProductPriceCustomCreateTypedDict, @@ -160,6 +161,7 @@ class CheckoutCreateTypedDict(TypedDict): r"""When set, a back button will be shown in the checkout to return to this URL.""" embed_origin: NotRequired[Nullable[str]] r"""If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Polar iframe to communicate with the parent page.""" + currency: NotRequired[Nullable[PresentmentCurrency]] prices: NotRequired[Nullable[Dict[str, List[CheckoutCreatePricesTypedDict]]]] r"""Optional mapping of product IDs to a list of ad-hoc prices to create for that product. If not set, catalog prices of the product will be used.""" @@ -264,6 +266,8 @@ class CheckoutCreate(BaseModel): embed_origin: OptionalNullable[str] = UNSET r"""If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Polar iframe to communicate with the parent page.""" + currency: OptionalNullable[PresentmentCurrency] = UNSET + prices: OptionalNullable[Dict[str, List[CheckoutCreatePrices]]] = UNSET r"""Optional mapping of product IDs to a list of ad-hoc prices to create for that product. If not set, catalog prices of the product will be used.""" @@ -294,6 +298,7 @@ def serialize_model(self, handler): "success_url", "return_url", "embed_origin", + "currency", "prices", ] nullable_fields = [ @@ -314,6 +319,7 @@ def serialize_model(self, handler): "success_url", "return_url", "embed_origin", + "currency", "prices", ] null_default_fields = [] diff --git a/src/polar_sdk/models/checkoutupdate.py b/src/polar_sdk/models/checkoutupdate.py index fe24491d..c025819f 100644 --- a/src/polar_sdk/models/checkoutupdate.py +++ b/src/polar_sdk/models/checkoutupdate.py @@ -2,6 +2,7 @@ from __future__ import annotations from .addressinput import AddressInput, AddressInputTypedDict +from .presentmentcurrency import PresentmentCurrency from .trialinterval import TrialInterval from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL @@ -78,6 +79,7 @@ class CheckoutUpdateTypedDict(TypedDict): You can store up to **50 key-value pairs**. """ + currency: NotRequired[Nullable[PresentmentCurrency]] discount_id: NotRequired[Nullable[str]] r"""ID of the discount to apply to the checkout.""" allow_discount_codes: NotRequired[Nullable[bool]] @@ -166,6 +168,8 @@ class CheckoutUpdate(BaseModel): You can store up to **50 key-value pairs**. """ + currency: OptionalNullable[PresentmentCurrency] = UNSET + discount_id: OptionalNullable[str] = UNSET r"""ID of the discount to apply to the checkout.""" @@ -222,6 +226,7 @@ def serialize_model(self, handler): "trial_interval", "trial_interval_count", "metadata", + "currency", "discount_id", "allow_discount_codes", "require_billing_address", @@ -245,6 +250,7 @@ def serialize_model(self, handler): "customer_tax_id", "trial_interval", "trial_interval_count", + "currency", "discount_id", "allow_discount_codes", "require_billing_address", diff --git a/src/polar_sdk/models/customers_createop.py b/src/polar_sdk/models/customers_createop.py deleted file mode 100644 index dbb833e6..00000000 --- a/src/polar_sdk/models/customers_createop.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .customercreate import CustomerCreate, CustomerCreateTypedDict -from polar_sdk.types import BaseModel -from polar_sdk.utils import FieldMetadata, QueryParamMetadata, RequestMetadata -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class CustomersCreateRequestTypedDict(TypedDict): - customer_create: CustomerCreateTypedDict - include_members: NotRequired[bool] - r"""Include members in the response. Only populated when set to true.""" - - -class CustomersCreateRequest(BaseModel): - customer_create: Annotated[ - CustomerCreate, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - include_members: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""Include members in the response. Only populated when set to true.""" diff --git a/src/polar_sdk/models/customers_get_externalop.py b/src/polar_sdk/models/customers_get_externalop.py index 0385281f..4581808f 100644 --- a/src/polar_sdk/models/customers_get_externalop.py +++ b/src/polar_sdk/models/customers_get_externalop.py @@ -2,16 +2,13 @@ from __future__ import annotations from polar_sdk.types import BaseModel -from polar_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict +from polar_sdk.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict class CustomersGetExternalRequestTypedDict(TypedDict): external_id: str r"""The customer external ID.""" - include_members: NotRequired[bool] - r"""Include members in the response. Only populated when set to true.""" class CustomersGetExternalRequest(BaseModel): @@ -19,9 +16,3 @@ class CustomersGetExternalRequest(BaseModel): str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] r"""The customer external ID.""" - - include_members: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""Include members in the response. Only populated when set to true.""" diff --git a/src/polar_sdk/models/customers_getop.py b/src/polar_sdk/models/customers_getop.py index 1c5173ef..85cc68d2 100644 --- a/src/polar_sdk/models/customers_getop.py +++ b/src/polar_sdk/models/customers_getop.py @@ -2,16 +2,13 @@ from __future__ import annotations from polar_sdk.types import BaseModel -from polar_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict +from polar_sdk.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict class CustomersGetRequestTypedDict(TypedDict): id: str r"""The customer ID.""" - include_members: NotRequired[bool] - r"""Include members in the response. Only populated when set to true.""" class CustomersGetRequest(BaseModel): @@ -19,9 +16,3 @@ class CustomersGetRequest(BaseModel): str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] r"""The customer ID.""" - - include_members: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""Include members in the response. Only populated when set to true.""" diff --git a/src/polar_sdk/models/customers_update_externalop.py b/src/polar_sdk/models/customers_update_externalop.py index b80db210..4ad51505 100644 --- a/src/polar_sdk/models/customers_update_externalop.py +++ b/src/polar_sdk/models/customers_update_externalop.py @@ -6,22 +6,14 @@ CustomerUpdateExternalIDTypedDict, ) from polar_sdk.types import BaseModel -from polar_sdk.utils import ( - FieldMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, -) -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict +from polar_sdk.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict class CustomersUpdateExternalRequestTypedDict(TypedDict): external_id: str r"""The customer external ID.""" customer_update_external_id: CustomerUpdateExternalIDTypedDict - include_members: NotRequired[bool] - r"""Include members in the response. Only populated when set to true.""" class CustomersUpdateExternalRequest(BaseModel): @@ -34,9 +26,3 @@ class CustomersUpdateExternalRequest(BaseModel): CustomerUpdateExternalID, FieldMetadata(request=RequestMetadata(media_type="application/json")), ] - - include_members: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""Include members in the response. Only populated when set to true.""" diff --git a/src/polar_sdk/models/customers_updateop.py b/src/polar_sdk/models/customers_updateop.py index 6632a3fe..4e572d22 100644 --- a/src/polar_sdk/models/customers_updateop.py +++ b/src/polar_sdk/models/customers_updateop.py @@ -3,22 +3,14 @@ from __future__ import annotations from .customerupdate import CustomerUpdate, CustomerUpdateTypedDict from polar_sdk.types import BaseModel -from polar_sdk.utils import ( - FieldMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, -) -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict +from polar_sdk.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict class CustomersUpdateRequestTypedDict(TypedDict): id: str r"""The customer ID.""" customer_update: CustomerUpdateTypedDict - include_members: NotRequired[bool] - r"""Include members in the response. Only populated when set to true.""" class CustomersUpdateRequest(BaseModel): @@ -31,9 +23,3 @@ class CustomersUpdateRequest(BaseModel): CustomerUpdate, FieldMetadata(request=RequestMetadata(media_type="application/json")), ] - - include_members: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""Include members in the response. Only populated when set to true.""" diff --git a/src/polar_sdk/models/customerseat.py b/src/polar_sdk/models/customerseat.py index fd456135..75dafcd0 100644 --- a/src/polar_sdk/models/customerseat.py +++ b/src/polar_sdk/models/customerseat.py @@ -22,7 +22,11 @@ class CustomerSeatTypedDict(TypedDict): order_id: NotRequired[Nullable[str]] r"""The order ID (for one-time purchase seats)""" customer_id: NotRequired[Nullable[str]] - r"""The assigned customer ID""" + r"""The customer ID. When member_model_enabled is true, this is the billing customer (purchaser). When false, this is the seat member customer.""" + member_id: NotRequired[Nullable[str]] + r"""The member ID of the seat occupant""" + email: NotRequired[Nullable[str]] + r"""Email of the seat member (set when member_model_enabled is true)""" customer_email: NotRequired[Nullable[str]] r"""The assigned customer email""" invitation_token_expires_at: NotRequired[Nullable[datetime]] @@ -54,7 +58,13 @@ class CustomerSeat(BaseModel): r"""The order ID (for one-time purchase seats)""" customer_id: OptionalNullable[str] = UNSET - r"""The assigned customer ID""" + r"""The customer ID. When member_model_enabled is true, this is the billing customer (purchaser). When false, this is the seat member customer.""" + + member_id: OptionalNullable[str] = UNSET + r"""The member ID of the seat occupant""" + + email: OptionalNullable[str] = UNSET + r"""Email of the seat member (set when member_model_enabled is true)""" customer_email: OptionalNullable[str] = UNSET r"""The assigned customer email""" @@ -77,6 +87,8 @@ def serialize_model(self, handler): "subscription_id", "order_id", "customer_id", + "member_id", + "email", "customer_email", "invitation_token_expires_at", "claimed_at", @@ -88,6 +100,8 @@ def serialize_model(self, handler): "subscription_id", "order_id", "customer_id", + "member_id", + "email", "customer_email", "invitation_token_expires_at", "claimed_at", diff --git a/src/polar_sdk/models/presentmentcurrency.py b/src/polar_sdk/models/presentmentcurrency.py new file mode 100644 index 00000000..a6194268 --- /dev/null +++ b/src/polar_sdk/models/presentmentcurrency.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PresentmentCurrency(str, Enum): + USD = "usd" + EUR = "eur" + GBP = "gbp" + CAD = "cad" + AUD = "aud" + JPY = "jpy" + CHF = "chf" + SEK = "sek" diff --git a/src/polar_sdk/models/productpriceseatbased.py b/src/polar_sdk/models/productpriceseatbased.py index e37e2ee3..b41b2c05 100644 --- a/src/polar_sdk/models/productpriceseatbased.py +++ b/src/polar_sdk/models/productpriceseatbased.py @@ -1,7 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .productpriceseattiers import ProductPriceSeatTiers, ProductPriceSeatTiersTypedDict +from .productpriceseattiers_output import ( + ProductPriceSeatTiersOutput, + ProductPriceSeatTiersOutputTypedDict, +) from .productpricesource import ProductPriceSource from .productpricetype import ProductPriceType from .subscriptionrecurringinterval import SubscriptionRecurringInterval @@ -33,8 +36,13 @@ class ProductPriceSeatBasedTypedDict(TypedDict): recurring_interval: Nullable[SubscriptionRecurringInterval] price_currency: str r"""The currency.""" - seat_tiers: ProductPriceSeatTiersTypedDict - r"""List of pricing tiers for seat-based pricing.""" + seat_tiers: ProductPriceSeatTiersOutputTypedDict + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ amount_type: Literal["seat_based"] @@ -70,8 +78,13 @@ class ProductPriceSeatBased(BaseModel): price_currency: str r"""The currency.""" - seat_tiers: ProductPriceSeatTiers - r"""List of pricing tiers for seat-based pricing.""" + seat_tiers: ProductPriceSeatTiersOutput + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ AMOUNT_TYPE: Annotated[ Annotated[Literal["seat_based"], AfterValidator(validate_const("seat_based"))], diff --git a/src/polar_sdk/models/productpriceseatbasedcreate.py b/src/polar_sdk/models/productpriceseatbasedcreate.py index 28c3b399..f9a31927 100644 --- a/src/polar_sdk/models/productpriceseatbasedcreate.py +++ b/src/polar_sdk/models/productpriceseatbasedcreate.py @@ -1,7 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .productpriceseattiers import ProductPriceSeatTiers, ProductPriceSeatTiersTypedDict +from .productpriceseattiers_input import ( + ProductPriceSeatTiersInput, + ProductPriceSeatTiersInputTypedDict, +) from polar_sdk.types import BaseModel from polar_sdk.utils import validate_const import pydantic @@ -13,8 +16,13 @@ class ProductPriceSeatBasedCreateTypedDict(TypedDict): r"""Schema to create a seat-based price with volume-based tiers.""" - seat_tiers: ProductPriceSeatTiersTypedDict - r"""List of pricing tiers for seat-based pricing.""" + seat_tiers: ProductPriceSeatTiersInputTypedDict + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ amount_type: Literal["seat_based"] price_currency: NotRequired[str] r"""The currency. Currently, only `usd` is supported.""" @@ -23,8 +31,13 @@ class ProductPriceSeatBasedCreateTypedDict(TypedDict): class ProductPriceSeatBasedCreate(BaseModel): r"""Schema to create a seat-based price with volume-based tiers.""" - seat_tiers: ProductPriceSeatTiers - r"""List of pricing tiers for seat-based pricing.""" + seat_tiers: ProductPriceSeatTiersInput + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ AMOUNT_TYPE: Annotated[ Annotated[Literal["seat_based"], AfterValidator(validate_const("seat_based"))], diff --git a/src/polar_sdk/models/productpriceseattiers.py b/src/polar_sdk/models/productpriceseattiers.py deleted file mode 100644 index 8bc031cc..00000000 --- a/src/polar_sdk/models/productpriceseattiers.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .productpriceseattier import ProductPriceSeatTier, ProductPriceSeatTierTypedDict -from polar_sdk.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ProductPriceSeatTiersTypedDict(TypedDict): - r"""List of pricing tiers for seat-based pricing.""" - - tiers: List[ProductPriceSeatTierTypedDict] - r"""List of pricing tiers""" - - -class ProductPriceSeatTiers(BaseModel): - r"""List of pricing tiers for seat-based pricing.""" - - tiers: List[ProductPriceSeatTier] - r"""List of pricing tiers""" diff --git a/src/polar_sdk/models/productpriceseattiers_input.py b/src/polar_sdk/models/productpriceseattiers_input.py new file mode 100644 index 00000000..8f85f00c --- /dev/null +++ b/src/polar_sdk/models/productpriceseattiers_input.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .productpriceseattier import ProductPriceSeatTier, ProductPriceSeatTierTypedDict +from polar_sdk.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ProductPriceSeatTiersInputTypedDict(TypedDict): + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ + + tiers: List[ProductPriceSeatTierTypedDict] + r"""List of pricing tiers""" + + +class ProductPriceSeatTiersInput(BaseModel): + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ + + tiers: List[ProductPriceSeatTier] + r"""List of pricing tiers""" diff --git a/src/polar_sdk/models/productpriceseattiers_output.py b/src/polar_sdk/models/productpriceseattiers_output.py new file mode 100644 index 00000000..41fddcb1 --- /dev/null +++ b/src/polar_sdk/models/productpriceseattiers_output.py @@ -0,0 +1,72 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .productpriceseattier import ProductPriceSeatTier, ProductPriceSeatTierTypedDict +from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class ProductPriceSeatTiersOutputTypedDict(TypedDict): + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ + + tiers: List[ProductPriceSeatTierTypedDict] + r"""List of pricing tiers""" + minimum_seats: int + r"""Minimum number of seats required for purchase, derived from first tier.""" + maximum_seats: Nullable[int] + r"""Maximum number of seats allowed for purchase, derived from last tier. None for unlimited.""" + + +class ProductPriceSeatTiersOutput(BaseModel): + r"""List of pricing tiers for seat-based pricing. + + The minimum and maximum seat limits are derived from the tiers: + - minimum_seats = first tier's min_seats + - maximum_seats = last tier's max_seats (None for unlimited) + """ + + tiers: List[ProductPriceSeatTier] + r"""List of pricing tiers""" + + minimum_seats: int + r"""Minimum number of seats required for purchase, derived from first tier.""" + + maximum_seats: Nullable[int] + r"""Maximum number of seats allowed for purchase, derived from last tier. None for unlimited.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["maximum_seats"] + 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/subscriptions_listop.py b/src/polar_sdk/models/subscriptions_listop.py index 3a90a5bd..d58993b6 100644 --- a/src/polar_sdk/models/subscriptions_listop.py +++ b/src/polar_sdk/models/subscriptions_listop.py @@ -852,8 +852,6 @@ class CustomersListRequestTypedDict(TypedDict): r"""Filter by exact email.""" query: NotRequired[Nullable[str]] r"""Filter by name, email, or external ID.""" - include_members: NotRequired[bool] - r"""Include members in the response. Only populated when set to true.""" page: NotRequired[int] r"""Page number, defaults to 1.""" limit: NotRequired[int] @@ -883,12 +881,6 @@ class CustomersListRequest(BaseModel): ] = UNSET r"""Filter by name, email, or external ID.""" - include_members: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""Include members in the response. Only populated when set to true.""" - page: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -919,7 +911,6 @@ def serialize_model(self, handler): "organization_id", "email", "query", - "include_members", "page", "limit", "sorting", diff --git a/src/polar_sdk/models/systemevent.py b/src/polar_sdk/models/systemevent.py index af65507f..aa7cca7c 100644 --- a/src/polar_sdk/models/systemevent.py +++ b/src/polar_sdk/models/systemevent.py @@ -1,6 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .balancedisputeevent import BalanceDisputeEvent, BalanceDisputeEventTypedDict +from .balancedisputereversalevent import ( + BalanceDisputeReversalEvent, + BalanceDisputeReversalEventTypedDict, +) +from .balanceorderevent import BalanceOrderEvent, BalanceOrderEventTypedDict +from .balancerefundevent import BalanceRefundEvent, BalanceRefundEventTypedDict +from .balancerefundreversalevent import ( + BalanceRefundReversalEvent, + BalanceRefundReversalEventTypedDict, +) from .benefitcycledevent import BenefitCycledEvent, BenefitCycledEventTypedDict from .benefitgrantedevent import BenefitGrantedEvent, BenefitGrantedEventTypedDict from .benefitrevokedevent import BenefitRevokedEvent, BenefitRevokedEventTypedDict @@ -74,12 +85,22 @@ CustomerCreatedEventTypedDict, CustomerUpdatedEventTypedDict, CustomerDeletedEventTypedDict, + BalanceOrderEventTypedDict, + BalanceRefundEventTypedDict, + BalanceRefundReversalEventTypedDict, + BalanceDisputeEventTypedDict, + BalanceDisputeReversalEventTypedDict, ], ) SystemEvent = Annotated[ Union[ + Annotated[BalanceDisputeEvent, Tag("balance.dispute")], + Annotated[BalanceDisputeReversalEvent, Tag("balance.dispute_reversal")], + Annotated[BalanceOrderEvent, Tag("balance.order")], + Annotated[BalanceRefundEvent, Tag("balance.refund")], + Annotated[BalanceRefundReversalEvent, Tag("balance.refund_reversal")], Annotated[BenefitCycledEvent, Tag("benefit.cycled")], Annotated[BenefitGrantedEvent, Tag("benefit.granted")], Annotated[BenefitRevokedEvent, Tag("benefit.revoked")], diff --git a/src/polar_sdk/models/webhooksubscriptionuncanceledpayload.py b/src/polar_sdk/models/webhooksubscriptionuncanceledpayload.py index 5cd763d5..d6c2d3fc 100644 --- a/src/polar_sdk/models/webhooksubscriptionuncanceledpayload.py +++ b/src/polar_sdk/models/webhooksubscriptionuncanceledpayload.py @@ -12,7 +12,11 @@ class WebhookSubscriptionUncanceledPayloadTypedDict(TypedDict): - r"""Sent when a subscription is uncanceled. + r"""Sent when a customer revokes a pending cancellation. + + When a customer cancels with \"at period end\", they retain access until the + subscription would renew. During this time, they can change their mind and + undo the cancellation. This event is triggered when they do so. **Discord & Slack support:** Full """ @@ -23,7 +27,11 @@ class WebhookSubscriptionUncanceledPayloadTypedDict(TypedDict): class WebhookSubscriptionUncanceledPayload(BaseModel): - r"""Sent when a subscription is uncanceled. + r"""Sent when a customer revokes a pending cancellation. + + When a customer cancels with \"at period end\", they retain access until the + subscription would renew. During this time, they can change their mind and + undo the cancellation. This event is triggered when they do so. **Discord & Slack support:** Full """ From b8b89df13843d9af6f54821684a51fddd30180c6 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 00:17:49 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow