diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 8eec4918..2c150810 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: 49ddfc0c8803b87fc256e9762ba74fb2 + docChecksum: 3597ad429475c8e399d53578075ba7d3 docVersion: 0.1.0 - speakeasyVersion: 1.615.2 - generationVersion: 2.698.4 - releaseVersion: 0.23.1 - configChecksum: 9e3d4839404aa139f527a844e995c547 + speakeasyVersion: 1.622.1 + generationVersion: 2.709.0 + releaseVersion: 0.24.0 + configChecksum: 6a0009453dd72cb731fa558bbe61456d repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -20,6 +20,7 @@ features: deprecations: 3.0.2 devContainers: 3.0.0 enumUnions: 0.1.0 + enums: 3.2.0 envVarSecurityUsage: 0.3.2 errorUnions: 1.0.2 flattening: 3.1.1 @@ -48,6 +49,7 @@ generatedFiles: - USAGE.md - docs/models/activesubscriptions.md - docs/models/address.md + - docs/models/addressinput.md - docs/models/aggregation.md - docs/models/alreadyactivesubscriptionerror.md - docs/models/alreadycanceledsubscription.md @@ -124,6 +126,11 @@ generatedFiles: - docs/models/benefitgrantmetadata.md - docs/models/benefitgrantmetercreditproperties.md - docs/models/benefitgrantmetercreditwebhook.md + - docs/models/benefitgrantslistqueryparamcustomeridfilter.md + - docs/models/benefitgrantslistqueryparamorganizationidfilter.md + - docs/models/benefitgrantslistrequest.md + - docs/models/benefitgrantslistresponse.md + - docs/models/benefitgrantsortproperty.md - docs/models/benefitgrantwebhook.md - docs/models/benefitidfilter.md - docs/models/benefitlicensekeyactivationcreateproperties.md @@ -167,6 +174,15 @@ generatedFiles: - docs/models/benefittypefilter.md - docs/models/benefitupdatedevent.md - docs/models/billingaddressfieldmode.md + - docs/models/canceledsubscriptions.md + - docs/models/canceledsubscriptionscustomerservice.md + - docs/models/canceledsubscriptionslowquality.md + - docs/models/canceledsubscriptionsmissingfeatures.md + - docs/models/canceledsubscriptionsother.md + - docs/models/canceledsubscriptionsswitchedservice.md + - docs/models/canceledsubscriptionstoocomplex.md + - docs/models/canceledsubscriptionstooexpensive.md + - docs/models/canceledsubscriptionsunused.md - docs/models/cardpayment.md - docs/models/cardpaymentmetadata.md - docs/models/checkout.md @@ -244,6 +260,8 @@ generatedFiles: - docs/models/committedmonthlyrecurringrevenue.md - docs/models/conditions.md - docs/models/countaggregation.md + - docs/models/countryalpha2.md + - docs/models/countryalpha2input.md - docs/models/cumulativerevenue.md - docs/models/customer.md - docs/models/customerbenefitgrant.md @@ -372,6 +390,8 @@ generatedFiles: - docs/models/customersessioncustomerexternalidcreate.md - docs/models/customersessioncustomeridcreate.md - docs/models/customersessionscreatecustomersessioncreate.md + - docs/models/customersexportqueryparamorganizationid.md + - docs/models/customersexportrequest.md - docs/models/customersgetexternalrequest.md - docs/models/customersgetrequest.md - docs/models/customersgetstateexternalrequest.md @@ -649,6 +669,15 @@ generatedFiles: - docs/models/metricstotals.md - docs/models/metricstotalsactivesubscriptions.md - docs/models/metricstotalsaverageordervalue.md + - docs/models/metricstotalscanceledsubscriptions.md + - docs/models/metricstotalscanceledsubscriptionscustomerservice.md + - docs/models/metricstotalscanceledsubscriptionslowquality.md + - docs/models/metricstotalscanceledsubscriptionsmissingfeatures.md + - docs/models/metricstotalscanceledsubscriptionsother.md + - docs/models/metricstotalscanceledsubscriptionsswitchedservice.md + - docs/models/metricstotalscanceledsubscriptionstoocomplex.md + - docs/models/metricstotalscanceledsubscriptionstooexpensive.md + - docs/models/metricstotalscanceledsubscriptionsunused.md - docs/models/metricstotalscheckouts.md - docs/models/metricstotalscheckoutsconversion.md - docs/models/metricstotalscommittedmonthlyrecurringrevenue.md @@ -954,6 +983,7 @@ generatedFiles: - docs/sdks/organizations/README.md - docs/sdks/payments/README.md - docs/sdks/polar/README.md + - docs/sdks/polarbenefitgrants/README.md - docs/sdks/polarcustomermeters/README.md - docs/sdks/polarcustomers/README.md - docs/sdks/polarlicensekeys/README.md @@ -995,6 +1025,7 @@ generatedFiles: - src/polar_sdk/metrics_sdk.py - src/polar_sdk/models/__init__.py - src/polar_sdk/models/address.py + - src/polar_sdk/models/addressinput.py - src/polar_sdk/models/alreadyactivesubscriptionerror.py - src/polar_sdk/models/alreadycanceledsubscription.py - src/polar_sdk/models/attachedcustomfield.py @@ -1005,6 +1036,7 @@ generatedFiles: - src/polar_sdk/models/authorizeresponseuser.py - src/polar_sdk/models/authorizeuser.py - src/polar_sdk/models/benefit.py + - src/polar_sdk/models/benefit_grants_listop.py - src/polar_sdk/models/benefitcreate.py - src/polar_sdk/models/benefitcustom.py - src/polar_sdk/models/benefitcustomcreate.py @@ -1051,6 +1083,7 @@ generatedFiles: - src/polar_sdk/models/benefitgrantmetadata.py - src/polar_sdk/models/benefitgrantmetercreditproperties.py - src/polar_sdk/models/benefitgrantmetercreditwebhook.py + - src/polar_sdk/models/benefitgrantsortproperty.py - src/polar_sdk/models/benefitgrantwebhook.py - src/polar_sdk/models/benefitlicensekeyactivationcreateproperties.py - src/polar_sdk/models/benefitlicensekeyactivationproperties.py @@ -1191,6 +1224,7 @@ generatedFiles: - src/polar_sdk/models/customerproduct.py - src/polar_sdk/models/customers_delete_externalop.py - src/polar_sdk/models/customers_deleteop.py + - src/polar_sdk/models/customers_exportop.py - src/polar_sdk/models/customers_get_externalop.py - src/polar_sdk/models/customers_get_state_externalop.py - src/polar_sdk/models/customers_get_stateop.py @@ -1548,6 +1582,7 @@ generatedFiles: - src/polar_sdk/orders.py - src/polar_sdk/organizations.py - src/polar_sdk/payments.py + - src/polar_sdk/polar_benefit_grants.py - src/polar_sdk/polar_customer_meters.py - src/polar_sdk/polar_customers.py - src/polar_sdk/polar_license_keys.py @@ -1638,7 +1673,7 @@ examples: _endpointorder_created_post: speakeasy-default-endpointorder-created-post: requestBody: - application/json: {"type": "order.created", "timestamp": "2024-08-21T06:55:49.348Z", "data": {"id": "", "created_at": "2024-08-21T06:55:49.348Z", "modified_at": null, "status": "refunded", "paid": true, "subtotal_amount": 952546, "discount_amount": 47294, "net_amount": 220865, "tax_amount": 913636, "total_amount": 727987, "refunded_amount": 597376, "refunded_tax_amount": 864844, "currency": "Kip", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": true, "key1": 2184.01, "key2": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-11-07T09:52:21.455Z", "modified_at": "2025-06-03T19:46:15.179Z", "metadata": {"key": 526331}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-10-25T07:11:48.501Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-09T20:19:15.400Z", "modified_at": "2023-03-30T07:05:37.419Z", "id": "", "name": "", "description": "against outbid to petty yeast off meanwhile colonialism", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 425196, "type": "fixed", "amount": 778891, "currency": "Armenian Dram", "created_at": "2023-03-20T16:46:25.677Z", "modified_at": "2023-03-06T18:58:41.541Z", "id": "", "metadata": {"key": 298954}, "name": "", "code": "", "starts_at": "2023-04-08T15:39:19.572Z", "ends_at": "2024-01-04T15:31:18.185Z", "max_redemptions": 313467, "redemptions_count": 237254, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": [{"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}, {"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}]}} + application/json: {"type": "order.created", "timestamp": "2024-08-21T06:55:49.348Z", "data": {"id": "", "created_at": "2024-08-21T06:55:49.348Z", "modified_at": null, "status": "refunded", "paid": true, "subtotal_amount": 952546, "discount_amount": 47294, "net_amount": 220865, "tax_amount": 913636, "total_amount": 727987, "from_balance_amount": 545884, "refunded_amount": 597376, "refunded_tax_amount": 864844, "currency": "Kip", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": true, "key1": 2184.01, "key2": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-11-07T09:52:21.455Z", "modified_at": "2025-06-03T19:46:15.179Z", "metadata": {"key": 526331}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-10-25T07:11:48.501Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-09T20:19:15.400Z", "modified_at": "2023-03-30T07:05:37.419Z", "id": "", "name": "", "description": "against outbid to petty yeast off meanwhile colonialism", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 425196, "type": "fixed", "amount": 778891, "currency": "Armenian Dram", "created_at": "2023-03-20T16:46:25.677Z", "modified_at": "2023-03-06T18:58:41.541Z", "id": "", "metadata": {"key": 298954}, "name": "", "code": "", "starts_at": "2023-04-08T15:39:19.572Z", "ends_at": "2024-01-04T15:31:18.185Z", "max_redemptions": 313467, "redemptions_count": 237254, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": [{"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}, {"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}]}} responses: "200": application/json: "" @@ -1647,7 +1682,7 @@ examples: _endpointorder_updated_post: speakeasy-default-endpointorder-updated-post: requestBody: - application/json: {"type": "order.updated", "timestamp": "2023-10-25T00:08:50.290Z", "data": {"id": "", "created_at": "2023-10-25T00:08:50.290Z", "modified_at": "2024-01-08T20:00:47.692Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 198772, "discount_amount": 338283, "net_amount": 321919, "tax_amount": 380359, "total_amount": 596980, "refunded_amount": 404069, "refunded_tax_amount": 718668, "currency": "Nuevo Sol", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": false, "key1": 187509}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-12-03T05:16:11.415Z", "modified_at": "2023-03-11T05:58:05.184Z", "metadata": {}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-06-26T15:51:37.068Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2024-07-10T12:45:44.731Z", "modified_at": "2024-09-19T13:13:25.785Z", "id": "", "name": "", "description": "bossy direct reservation quaintly atop interestingly", "recurring_interval": "month", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 227959, "type": "fixed", "amount": 785594, "currency": "Barbados Dollar", "created_at": "2025-08-02T14:17:04.679Z", "modified_at": "2023-04-10T21:27:35.876Z", "id": "", "metadata": {"key": "", "key1": 330083}, "name": "", "code": "", "starts_at": "2023-09-01T14:56:03.459Z", "ends_at": "2024-10-01T02:03:16.161Z", "max_redemptions": 723901, "redemptions_count": 125128, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2024-10-31T22:22:01.280Z", "modified_at": "2025-05-03T18:27:32.620Z", "id": "", "amount": 405025, "currency": "Pa'anga", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-08-26T12:56:24.423Z", "current_period_end": "2024-02-06T09:06:51.703Z", "cancel_at_period_end": true, "canceled_at": "2024-03-28T15:10:13.508Z", "started_at": "2023-11-03T05:13:30.202Z", "ends_at": "2024-03-03T03:52:46.888Z", "ended_at": "2025-07-30T00:35:38.035Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": null, "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}]}} + application/json: {"type": "order.updated", "timestamp": "2023-10-25T00:08:50.290Z", "data": {"id": "", "created_at": "2023-10-25T00:08:50.290Z", "modified_at": "2024-01-08T20:00:47.692Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 198772, "discount_amount": 338283, "net_amount": 321919, "tax_amount": 380359, "total_amount": 596980, "from_balance_amount": 270991, "refunded_amount": 404069, "refunded_tax_amount": 718668, "currency": "Nuevo Sol", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": false, "key1": 187509}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-12-03T05:16:11.415Z", "modified_at": "2023-03-11T05:58:05.184Z", "metadata": {}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-06-26T15:51:37.068Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2024-07-10T12:45:44.731Z", "modified_at": "2024-09-19T13:13:25.785Z", "id": "", "name": "", "description": "bossy direct reservation quaintly atop interestingly", "recurring_interval": "month", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 227959, "type": "fixed", "amount": 785594, "currency": "Barbados Dollar", "created_at": "2025-08-02T14:17:04.679Z", "modified_at": "2023-04-10T21:27:35.876Z", "id": "", "metadata": {"key": "", "key1": 330083}, "name": "", "code": "", "starts_at": "2023-09-01T14:56:03.459Z", "ends_at": "2024-10-01T02:03:16.161Z", "max_redemptions": 723901, "redemptions_count": 125128, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2024-10-31T22:22:01.280Z", "modified_at": "2025-05-03T18:27:32.620Z", "id": "", "amount": 405025, "currency": "Pa'anga", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-08-26T12:56:24.423Z", "current_period_end": "2024-02-06T09:06:51.703Z", "cancel_at_period_end": true, "canceled_at": "2024-03-28T15:10:13.508Z", "started_at": "2023-11-03T05:13:30.202Z", "ends_at": "2024-03-03T03:52:46.888Z", "ended_at": "2025-07-30T00:35:38.035Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": null, "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}]}} responses: "200": application/json: "" @@ -1656,7 +1691,7 @@ examples: _endpointorder_paid_post: speakeasy-default-endpointorder-paid-post: requestBody: - application/json: {"type": "order.paid", "timestamp": "2025-12-05T07:44:21.172Z", "data": {"id": "", "created_at": "2025-12-05T07:44:21.172Z", "modified_at": "2024-12-11T22:14:44.762Z", "status": "refunded", "paid": true, "subtotal_amount": 806442, "discount_amount": 990825, "net_amount": 746396, "tax_amount": 486648, "total_amount": 562504, "refunded_amount": 314047, "refunded_tax_amount": 570780, "currency": "Norwegian Krone", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2023-08-30T09:47:22.437Z", "modified_at": "2025-04-20T14:41:24.727Z", "metadata": {"key": 154136, "key1": false, "key2": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2024-06-08T00:11:47.056Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": "", "key1": false, "key2": 1122.47}, "created_at": "2024-03-19T01:07:15.346Z", "modified_at": "2025-03-22T13:41:39.854Z", "id": "", "name": "", "description": "instead unnaturally curly scared but definite knowledgeably", "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 458129, "type": "fixed", "basis_points": 400985, "created_at": "2025-12-02T15:10:04.656Z", "modified_at": "2024-10-30T18:07:50.242Z", "id": "", "metadata": {"key": 4652.15}, "name": "", "code": "", "starts_at": "2023-11-24T17:59:56.836Z", "ends_at": "2025-08-12T18:11:29.547Z", "max_redemptions": 727805, "redemptions_count": 584469, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2025-07-17T03:39:23.964Z", "modified_at": "2025-10-30T20:20:46.051Z", "id": "", "amount": 540428, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-02-24T15:15:22.018Z", "current_period_end": "2023-12-07T15:09:08.144Z", "cancel_at_period_end": false, "canceled_at": "2023-07-01T03:36:16.430Z", "started_at": "2024-09-21T14:56:16.106Z", "ends_at": "2023-01-21T03:35:38.158Z", "ended_at": "2023-12-02T06:46:04.196Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}, "items": []}} + application/json: {"type": "order.paid", "timestamp": "2025-12-05T07:44:21.172Z", "data": {"id": "", "created_at": "2025-12-05T07:44:21.172Z", "modified_at": "2024-12-11T22:14:44.762Z", "status": "refunded", "paid": true, "subtotal_amount": 806442, "discount_amount": 990825, "net_amount": 746396, "tax_amount": 486648, "total_amount": 562504, "from_balance_amount": 975660, "refunded_amount": 314047, "refunded_tax_amount": 570780, "currency": "Norwegian Krone", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2023-08-30T09:47:22.437Z", "modified_at": "2025-04-20T14:41:24.727Z", "metadata": {"key": 154136, "key1": false, "key2": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2024-06-08T00:11:47.056Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": "", "key1": false, "key2": 1122.47}, "created_at": "2024-03-19T01:07:15.346Z", "modified_at": "2025-03-22T13:41:39.854Z", "id": "", "name": "", "description": "instead unnaturally curly scared but definite knowledgeably", "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 458129, "type": "fixed", "basis_points": 400985, "created_at": "2025-12-02T15:10:04.656Z", "modified_at": "2024-10-30T18:07:50.242Z", "id": "", "metadata": {"key": 4652.15}, "name": "", "code": "", "starts_at": "2023-11-24T17:59:56.836Z", "ends_at": "2025-08-12T18:11:29.547Z", "max_redemptions": 727805, "redemptions_count": 584469, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2025-07-17T03:39:23.964Z", "modified_at": "2025-10-30T20:20:46.051Z", "id": "", "amount": 540428, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-02-24T15:15:22.018Z", "current_period_end": "2023-12-07T15:09:08.144Z", "cancel_at_period_end": false, "canceled_at": "2023-07-01T03:36:16.430Z", "started_at": "2024-09-21T14:56:16.106Z", "ends_at": "2023-01-21T03:35:38.158Z", "ended_at": "2023-12-02T06:46:04.196Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}, "items": []}} responses: "200": application/json: "" @@ -1665,7 +1700,7 @@ examples: _endpointorder_refunded_post: speakeasy-default-endpointorder-refunded-post: requestBody: - application/json: {"type": "order.refunded", "timestamp": "2024-07-23T18:00:11.615Z", "data": {"id": "", "created_at": "2024-07-23T18:00:11.615Z", "modified_at": "2024-08-23T03:13:11.383Z", "status": "refunded", "paid": true, "subtotal_amount": 678552, "discount_amount": 294178, "net_amount": 721778, "tax_amount": 518308, "total_amount": 820663, "refunded_amount": 472431, "refunded_tax_amount": 879331, "currency": "Hong Kong Dollar", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": 4542.91}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-08-11T17:50:11.031Z", "modified_at": "2023-02-24T05:25:29.794Z", "metadata": {"key": 97027, "key1": 958634}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-01-16T07:26:04.196Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 4016.73, "key1": 9058.31, "key2": true}, "created_at": "2024-10-26T18:25:25.517Z", "modified_at": "2023-07-26T10:28:20.791Z", "id": "", "name": "", "description": null, "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 333301, "type": "percentage", "amount": 985928, "currency": "Tunisian Dinar", "created_at": "2025-03-31T17:18:12.309Z", "modified_at": "2025-04-04T07:20:27.321Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": null, "ends_at": "2025-11-07T12:21:07.975Z", "max_redemptions": 986922, "redemptions_count": 691292, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2023-03-16T14:38:58.849Z", "modified_at": "2024-08-12T02:18:50.288Z", "id": "", "amount": 443730, "currency": "Pa'anga", "recurring_interval": "month", "status": "past_due", "current_period_start": "2025-08-22T13:19:25.286Z", "current_period_end": "2025-05-03T08:49:50.424Z", "cancel_at_period_end": true, "canceled_at": "2023-11-21T12:57:47.903Z", "started_at": "2023-09-21T04:07:05.991Z", "ends_at": "2023-10-30T23:29:28.584Z", "ended_at": "2025-05-20T18:28:46.249Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-01-22T05:05:29.797Z", "modified_at": "2025-11-07T21:20:59.535Z", "id": "", "label": "", "amount": 287841, "tax_amount": 922801, "proration": false, "product_price_id": ""}]}} + application/json: {"type": "order.refunded", "timestamp": "2024-07-23T18:00:11.615Z", "data": {"id": "", "created_at": "2024-07-23T18:00:11.615Z", "modified_at": "2024-08-23T03:13:11.383Z", "status": "refunded", "paid": true, "subtotal_amount": 678552, "discount_amount": 294178, "net_amount": 721778, "tax_amount": 518308, "total_amount": 820663, "from_balance_amount": 519845, "refunded_amount": 472431, "refunded_tax_amount": 879331, "currency": "Hong Kong Dollar", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": 4542.91}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-08-11T17:50:11.031Z", "modified_at": "2023-02-24T05:25:29.794Z", "metadata": {"key": 97027, "key1": 958634}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-01-16T07:26:04.196Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 4016.73, "key1": 9058.31, "key2": true}, "created_at": "2024-10-26T18:25:25.517Z", "modified_at": "2023-07-26T10:28:20.791Z", "id": "", "name": "", "description": null, "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 333301, "type": "percentage", "amount": 985928, "currency": "Tunisian Dinar", "created_at": "2025-03-31T17:18:12.309Z", "modified_at": "2025-04-04T07:20:27.321Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": null, "ends_at": "2025-11-07T12:21:07.975Z", "max_redemptions": 986922, "redemptions_count": 691292, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2023-03-16T14:38:58.849Z", "modified_at": "2024-08-12T02:18:50.288Z", "id": "", "amount": 443730, "currency": "Pa'anga", "recurring_interval": "month", "status": "past_due", "current_period_start": "2025-08-22T13:19:25.286Z", "current_period_end": "2025-05-03T08:49:50.424Z", "cancel_at_period_end": true, "canceled_at": "2023-11-21T12:57:47.903Z", "started_at": "2023-09-21T04:07:05.991Z", "ends_at": "2023-10-30T23:29:28.584Z", "ended_at": "2025-05-20T18:28:46.249Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-01-22T05:05:29.797Z", "modified_at": "2025-11-07T21:20:59.535Z", "id": "", "label": "", "amount": 287841, "tax_amount": 922801, "proration": false, "product_price_id": ""}]}} responses: "200": application/json: "" @@ -2171,7 +2206,7 @@ examples: limit: 10 responses: "200": - application/json: {"items": [{"id": "", "created_at": "2023-03-26T01:22:53.189Z", "modified_at": "2024-02-10T15:29:33.963Z", "status": "refunded", "paid": true, "subtotal_amount": 15468, "discount_amount": 962179, "net_amount": 308936, "tax_amount": 449820, "total_amount": 375942, "refunded_amount": 70124, "refunded_tax_amount": 297395, "currency": "Balboa", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-16T14:29:40.056Z", "modified_at": "2024-12-01T04:46:22.222Z", "metadata": {"key": 7966.23}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2025-09-01T05:52:58.262Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=blank"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-24T18:51:29.694Z", "modified_at": "2025-04-13T23:14:41.573Z", "id": "", "name": "", "description": "expense pip blue furthermore gnash frail yet ugly", "recurring_interval": "year", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 782667, "type": "percentage", "basis_points": 224838, "created_at": "2024-11-05T22:56:54.203Z", "modified_at": "2024-08-14T13:19:22.767Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-03-15T19:46:41.506Z", "ends_at": "2025-06-29T08:50:29.569Z", "max_redemptions": 759343, "redemptions_count": 214063, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": false, "key1": 6606.6}, "created_at": "2024-07-13T07:19:52.472Z", "modified_at": "2023-05-30T18:04:05.234Z", "id": "", "amount": 941727, "currency": "CFA Franc BCEAO", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-08-06T07:04:45.093Z", "current_period_end": "2024-09-25T19:02:24.370Z", "cancel_at_period_end": true, "canceled_at": "2023-09-12T07:04:22.765Z", "started_at": "2023-01-18T06:49:58.589Z", "ends_at": "2023-10-25T10:02:37.340Z", "ended_at": "2023-07-26T14:27:14.451Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}, {"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}]}], "pagination": {"total_count": 754496, "max_page": 599128}} + application/json: {"items": [{"id": "", "created_at": "2023-03-26T01:22:53.189Z", "modified_at": "2024-02-10T15:29:33.963Z", "status": "refunded", "paid": true, "subtotal_amount": 15468, "discount_amount": 962179, "net_amount": 308936, "tax_amount": 449820, "total_amount": 375942, "from_balance_amount": 901379, "refunded_amount": 70124, "refunded_tax_amount": 297395, "currency": "Balboa", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-16T14:29:40.056Z", "modified_at": "2024-12-01T04:46:22.222Z", "metadata": {"key": 7966.23}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2025-09-01T05:52:58.262Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=blank"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-24T18:51:29.694Z", "modified_at": "2025-04-13T23:14:41.573Z", "id": "", "name": "", "description": "expense pip blue furthermore gnash frail yet ugly", "recurring_interval": "year", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 782667, "type": "percentage", "basis_points": 224838, "created_at": "2024-11-05T22:56:54.203Z", "modified_at": "2024-08-14T13:19:22.767Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-03-15T19:46:41.506Z", "ends_at": "2025-06-29T08:50:29.569Z", "max_redemptions": 759343, "redemptions_count": 214063, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": false, "key1": 6606.6}, "created_at": "2024-07-13T07:19:52.472Z", "modified_at": "2023-05-30T18:04:05.234Z", "id": "", "amount": 941727, "currency": "CFA Franc BCEAO", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-08-06T07:04:45.093Z", "current_period_end": "2024-09-25T19:02:24.370Z", "cancel_at_period_end": true, "canceled_at": "2023-09-12T07:04:22.765Z", "started_at": "2023-01-18T06:49:58.589Z", "ends_at": "2023-10-25T10:02:37.340Z", "ended_at": "2023-07-26T14:27:14.451Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}, {"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}]}], "pagination": {"total_count": 754496, "max_page": 599128}} "422": application/json: {} orders:get: @@ -2181,7 +2216,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "created_at": "2023-12-28T18:05:05.494Z", "modified_at": "2025-08-19T01:46:15.037Z", "status": "paid", "paid": true, "subtotal_amount": 194509, "discount_amount": 199674, "net_amount": 462739, "tax_amount": 174590, "total_amount": 271911, "refunded_amount": 378922, "refunded_tax_amount": 960251, "currency": "Naira", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-07-30T11:43:08.034Z", "modified_at": "2025-11-17T01:23:41.514Z", "metadata": {"key": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-03-07T16:00:18.030Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 709557, "key1": true, "key2": 1589.86}, "created_at": "2024-06-13T05:22:39.981Z", "modified_at": "2025-08-06T17:05:37.045Z", "id": "", "name": "", "description": "tarry subexpression brr huzzah officially", "recurring_interval": "year", "is_recurring": false, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "type": "percentage", "basis_points": 815092, "created_at": "2025-09-19T21:21:56.106Z", "modified_at": "2024-05-14T12:13:50.338Z", "id": "", "metadata": {"key": false}, "name": "", "code": null, "starts_at": "2025-01-27T04:15:28.556Z", "ends_at": "2023-02-03T06:50:58.764Z", "max_redemptions": 31256, "redemptions_count": 737846, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": []} + application/json: {"id": "", "created_at": "2023-12-28T18:05:05.494Z", "modified_at": "2025-08-19T01:46:15.037Z", "status": "paid", "paid": true, "subtotal_amount": 194509, "discount_amount": 199674, "net_amount": 462739, "tax_amount": 174590, "total_amount": 271911, "from_balance_amount": 330067, "refunded_amount": 378922, "refunded_tax_amount": 960251, "currency": "Naira", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-07-30T11:43:08.034Z", "modified_at": "2025-11-17T01:23:41.514Z", "metadata": {"key": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-03-07T16:00:18.030Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 709557, "key1": true, "key2": 1589.86}, "created_at": "2024-06-13T05:22:39.981Z", "modified_at": "2025-08-06T17:05:37.045Z", "id": "", "name": "", "description": "tarry subexpression brr huzzah officially", "recurring_interval": "year", "is_recurring": false, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "type": "percentage", "basis_points": 815092, "created_at": "2025-09-19T21:21:56.106Z", "modified_at": "2024-05-14T12:13:50.338Z", "id": "", "metadata": {"key": false}, "name": "", "code": null, "starts_at": "2025-01-27T04:15:28.556Z", "ends_at": "2023-02-03T06:50:58.764Z", "max_redemptions": 31256, "redemptions_count": 737846, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": []} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -2400,7 +2435,7 @@ examples: timezone: "UTC" responses: "200": - application/json: {"periods": [{"timestamp": "2024-11-05T16:37:46.152Z", "orders": 2313.41, "revenue": 3697.18, "net_revenue": 7366.16, "cumulative_revenue": 160547, "net_cumulative_revenue": 620.86, "average_order_value": 8348.91, "net_average_order_value": 615596, "one_time_products": 6315.62, "one_time_products_revenue": 271957, "one_time_products_net_revenue": 2313.41, "new_subscriptions": 225346, "new_subscriptions_revenue": 5903.37, "new_subscriptions_net_revenue": 3697.18, "renewed_subscriptions": 146.2, "renewed_subscriptions_revenue": 3772.41, "renewed_subscriptions_net_revenue": 160547, "active_subscriptions": 1692.89, "monthly_recurring_revenue": 5809.97, "committed_monthly_recurring_revenue": 7366.16, "checkouts": 6229.46, "succeeded_checkouts": 464.75, "checkouts_conversion": 536209}], "totals": {"orders": 300394, "revenue": 980988, "net_revenue": 8348.91, "cumulative_revenue": 5367.66, "net_cumulative_revenue": 6315.62, "average_order_value": 7320.73, "net_average_order_value": 271957, "one_time_products": 772559, "one_time_products_revenue": 875093, "one_time_products_net_revenue": 225346, "new_subscriptions": 903196, "new_subscriptions_revenue": 18.97, "new_subscriptions_net_revenue": 5903.37, "renewed_subscriptions": 723.93, "renewed_subscriptions_revenue": 846052, "renewed_subscriptions_net_revenue": 146.2, "active_subscriptions": 5698.58, "monthly_recurring_revenue": 180851, "committed_monthly_recurring_revenue": 620.86, "checkouts": 5307.17, "succeeded_checkouts": 9995.79, "checkouts_conversion": 5883.46}, "metrics": {"orders": {"slug": "", "display_name": "Mortimer35", "type": "percentage"}, "revenue": {"slug": "", "display_name": "Cruz.Yundt29", "type": "scalar"}, "net_revenue": {"slug": "", "display_name": "Noemie.Pagac", "type": "currency"}, "cumulative_revenue": {"slug": "", "display_name": "Keshaun_Mraz87", "type": "scalar"}, "net_cumulative_revenue": {"slug": "", "display_name": "Lina.Bayer53", "type": "scalar"}, "average_order_value": {"slug": "", "display_name": "Therese_Marks93", "type": "percentage"}, "net_average_order_value": {"slug": "", "display_name": "Christine_Mertz-Leuschke73", "type": "percentage"}, "one_time_products": {"slug": "", "display_name": "Roslyn.White86", "type": "scalar"}, "one_time_products_revenue": {"slug": "", "display_name": "Henderson.Herman17", "type": "percentage"}, "one_time_products_net_revenue": {"slug": "", "display_name": "Daniella_Herzog72", "type": "percentage"}, "new_subscriptions": {"slug": "", "display_name": "Jamaal_Mueller91", "type": "percentage"}, "new_subscriptions_revenue": {"slug": "", "display_name": "Kaylee25", "type": "currency"}, "new_subscriptions_net_revenue": {"slug": "", "display_name": "Antonina_Stamm", "type": "scalar"}, "renewed_subscriptions": {"slug": "", "display_name": "Leland_Yundt", "type": "scalar"}, "renewed_subscriptions_revenue": {"slug": "", "display_name": "Dalton_Waters92", "type": "scalar"}, "renewed_subscriptions_net_revenue": {"slug": "", "display_name": "Vincenza_Yundt", "type": "percentage"}, "active_subscriptions": {"slug": "", "display_name": "Alfonzo_Daugherty", "type": "percentage"}, "monthly_recurring_revenue": {"slug": "", "display_name": "Diana97", "type": "currency"}, "committed_monthly_recurring_revenue": {"slug": "", "display_name": "Garrett.Stokes", "type": "scalar"}, "checkouts": {"slug": "", "display_name": "Magdalen_Goodwin-Schoen", "type": "scalar"}, "succeeded_checkouts": {"slug": "", "display_name": "Ida37", "type": "scalar"}, "checkouts_conversion": {"slug": "", "display_name": "Savion.Gerlach", "type": "percentage"}}} + application/json: {"periods": [{"timestamp": "2024-11-05T16:37:46.152Z", "orders": 2313.41, "revenue": 3697.18, "net_revenue": 7366.16, "cumulative_revenue": 160547, "net_cumulative_revenue": 620.86, "average_order_value": 8348.91, "net_average_order_value": 615596, "one_time_products": 6315.62, "one_time_products_revenue": 271957, "one_time_products_net_revenue": 2313.41, "new_subscriptions": 225346, "new_subscriptions_revenue": 5903.37, "new_subscriptions_net_revenue": 3697.18, "renewed_subscriptions": 146.2, "renewed_subscriptions_revenue": 3772.41, "renewed_subscriptions_net_revenue": 160547, "active_subscriptions": 1692.89, "monthly_recurring_revenue": 5809.97, "committed_monthly_recurring_revenue": 7366.16, "checkouts": 6229.46, "succeeded_checkouts": 464.75, "checkouts_conversion": 536209, "canceled_subscriptions": 7366.16, "canceled_subscriptions_customer_service": 620.86, "canceled_subscriptions_low_quality": 615596, "canceled_subscriptions_missing_features": 2313.41, "canceled_subscriptions_switched_service": 3697.18, "canceled_subscriptions_too_complex": 160547, "canceled_subscriptions_too_expensive": 8348.91, "canceled_subscriptions_unused": 6315.62, "canceled_subscriptions_other": 271957}], "totals": {"orders": 300394, "revenue": 980988, "net_revenue": 8348.91, "cumulative_revenue": 5367.66, "net_cumulative_revenue": 6315.62, "average_order_value": 7320.73, "net_average_order_value": 271957, "one_time_products": 772559, "one_time_products_revenue": 875093, "one_time_products_net_revenue": 225346, "new_subscriptions": 903196, "new_subscriptions_revenue": 18.97, "new_subscriptions_net_revenue": 5903.37, "renewed_subscriptions": 723.93, "renewed_subscriptions_revenue": 846052, "renewed_subscriptions_net_revenue": 146.2, "active_subscriptions": 5698.58, "monthly_recurring_revenue": 180851, "committed_monthly_recurring_revenue": 620.86, "checkouts": 5307.17, "succeeded_checkouts": 9995.79, "checkouts_conversion": 5883.46, "canceled_subscriptions": 225346, "canceled_subscriptions_customer_service": 5903.37, "canceled_subscriptions_low_quality": 146.2, "canceled_subscriptions_missing_features": 3772.41, "canceled_subscriptions_switched_service": 1692.89, "canceled_subscriptions_too_complex": 5809.97, "canceled_subscriptions_too_expensive": 6229.46, "canceled_subscriptions_unused": 464.75, "canceled_subscriptions_other": 536209}, "metrics": {"orders": {"slug": "", "display_name": "Mortimer35", "type": "percentage"}, "revenue": {"slug": "", "display_name": "Cruz.Yundt29", "type": "scalar"}, "net_revenue": {"slug": "", "display_name": "Noemie.Pagac", "type": "currency"}, "cumulative_revenue": {"slug": "", "display_name": "Keshaun_Mraz87", "type": "scalar"}, "net_cumulative_revenue": {"slug": "", "display_name": "Lina.Bayer53", "type": "scalar"}, "average_order_value": {"slug": "", "display_name": "Therese_Marks93", "type": "percentage"}, "net_average_order_value": {"slug": "", "display_name": "Christine_Mertz-Leuschke73", "type": "percentage"}, "one_time_products": {"slug": "", "display_name": "Roslyn.White86", "type": "scalar"}, "one_time_products_revenue": {"slug": "", "display_name": "Henderson.Herman17", "type": "percentage"}, "one_time_products_net_revenue": {"slug": "", "display_name": "Daniella_Herzog72", "type": "percentage"}, "new_subscriptions": {"slug": "", "display_name": "Jamaal_Mueller91", "type": "percentage"}, "new_subscriptions_revenue": {"slug": "", "display_name": "Kaylee25", "type": "currency"}, "new_subscriptions_net_revenue": {"slug": "", "display_name": "Antonina_Stamm", "type": "scalar"}, "renewed_subscriptions": {"slug": "", "display_name": "Leland_Yundt", "type": "scalar"}, "renewed_subscriptions_revenue": {"slug": "", "display_name": "Dalton_Waters92", "type": "scalar"}, "renewed_subscriptions_net_revenue": {"slug": "", "display_name": "Vincenza_Yundt", "type": "percentage"}, "active_subscriptions": {"slug": "", "display_name": "Alfonzo_Daugherty", "type": "percentage"}, "monthly_recurring_revenue": {"slug": "", "display_name": "Diana97", "type": "currency"}, "committed_monthly_recurring_revenue": {"slug": "", "display_name": "Garrett.Stokes", "type": "scalar"}, "checkouts": {"slug": "", "display_name": "Magdalen_Goodwin-Schoen", "type": "scalar"}, "succeeded_checkouts": {"slug": "", "display_name": "Ida37", "type": "scalar"}, "checkouts_conversion": {"slug": "", "display_name": "Savion.Gerlach", "type": "percentage"}, "canceled_subscriptions": {"slug": "", "display_name": "Corine_Denesik", "type": "percentage"}, "canceled_subscriptions_customer_service": {"slug": "", "display_name": "Moses.Rutherford", "type": "percentage"}, "canceled_subscriptions_low_quality": {"slug": "", "display_name": "Modesta6", "type": "percentage"}, "canceled_subscriptions_missing_features": {"slug": "", "display_name": "Kevon53", "type": "percentage"}, "canceled_subscriptions_switched_service": {"slug": "", "display_name": "Wilmer_Renner55", "type": "currency"}, "canceled_subscriptions_too_complex": {"slug": "", "display_name": "Maximo.Emard98", "type": "scalar"}, "canceled_subscriptions_too_expensive": {"slug": "", "display_name": "Eleazar_Mante", "type": "percentage"}, "canceled_subscriptions_unused": {"slug": "", "display_name": "Alford.Walker", "type": "percentage"}, "canceled_subscriptions_other": {"slug": "", "display_name": "Arnold.Stanton94", "type": "percentage"}}} "422": application/json: {} metrics:limits: @@ -2958,7 +2993,7 @@ examples: limit: 10 responses: "200": - application/json: {"items": [{"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "tax_amount": 598982, "total_amount": 539673, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "status": "onboarding_started", "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}, {"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "tax_amount": 598982, "total_amount": 539673, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "status": "denied", "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}], "pagination": {"total_count": 449940, "max_page": 933681}} + application/json: {"items": [{"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "tax_amount": 598982, "total_amount": 539673, "from_balance_amount": 281470, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "status": "onboarding_started", "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}, {"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "tax_amount": 598982, "total_amount": 539673, "from_balance_amount": 702832, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "status": "denied", "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}], "pagination": {"total_count": 449940, "max_page": 933681}} "422": application/json: {} customer_portal:orders:get: @@ -2968,7 +3003,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "created_at": "2025-11-07T01:29:33.239Z", "modified_at": "2025-10-01T14:10:31.444Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 955067, "discount_amount": 688152, "net_amount": 70935, "tax_amount": 1252, "total_amount": 953506, "refunded_amount": 31567, "refunded_tax_amount": 929652, "currency": "CFP Franc", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2023-11-19T04:53:34.522Z", "modified_at": "2025-11-25T20:27:43.607Z", "id": "", "name": "", "description": "too jubilantly empty meh", "recurring_interval": "month", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-10-01T14:10:31.444Z", "modified_at": "2025-11-12T18:03:36.492Z", "id": "", "amount_type": "fixed", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "price_currency": "", "price_amount": 953506, "legacy": true}, {"created_at": "2025-11-13T23:04:52.208Z", "modified_at": "2023-07-18T15:45:42.662Z", "id": "", "amount_type": "free", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "legacy": true}], "benefits": [{"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-07-27T19:30:57.624Z", "modified_at": "2025-02-13T12:23:44.948Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://hot-amendment.biz/", "email": "Damaris4@hotmail.com", "website": "", "socials": [{"platform": "youtube", "url": "https://stupendous-advancement.name"}], "status": "active", "details_submitted_at": "2024-10-04T10:38:48.094Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": false, "new_subscription": true}}}, "subscription": {"created_at": "2025-03-12T22:14:21.224Z", "modified_at": "2024-03-29T21:03:44.806Z", "id": "", "amount": 726603, "currency": "Som", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-10-08T20:14:11.453Z", "current_period_end": "2023-01-11T05:31:47.928Z", "cancel_at_period_end": true, "canceled_at": "2024-11-02T16:16:11.516Z", "started_at": "2024-04-10T15:06:14.767Z", "ends_at": "2023-08-09T06:47:34.634Z", "ended_at": "2023-05-14T07:05:36.107Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}, {"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}]} + application/json: {"id": "", "created_at": "2025-11-07T01:29:33.239Z", "modified_at": "2025-10-01T14:10:31.444Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 955067, "discount_amount": 688152, "net_amount": 70935, "tax_amount": 1252, "total_amount": 953506, "from_balance_amount": 949875, "refunded_amount": 31567, "refunded_tax_amount": 929652, "currency": "CFP Franc", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2023-11-19T04:53:34.522Z", "modified_at": "2025-11-25T20:27:43.607Z", "id": "", "name": "", "description": "too jubilantly empty meh", "recurring_interval": "month", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-10-01T14:10:31.444Z", "modified_at": "2025-11-12T18:03:36.492Z", "id": "", "amount_type": "fixed", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "price_currency": "", "price_amount": 953506, "legacy": true}, {"created_at": "2025-11-13T23:04:52.208Z", "modified_at": "2023-07-18T15:45:42.662Z", "id": "", "amount_type": "free", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "legacy": true}], "benefits": [{"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-07-27T19:30:57.624Z", "modified_at": "2025-02-13T12:23:44.948Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://hot-amendment.biz/", "email": "Damaris4@hotmail.com", "website": "", "socials": [{"platform": "youtube", "url": "https://stupendous-advancement.name"}], "status": "active", "details_submitted_at": "2024-10-04T10:38:48.094Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": false, "new_subscription": true}}}, "subscription": {"created_at": "2025-03-12T22:14:21.224Z", "modified_at": "2024-03-29T21:03:44.806Z", "id": "", "amount": 726603, "currency": "Som", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-10-08T20:14:11.453Z", "current_period_end": "2023-01-11T05:31:47.928Z", "cancel_at_period_end": true, "canceled_at": "2024-11-02T16:16:11.516Z", "started_at": "2024-04-10T15:06:14.767Z", "ends_at": "2023-08-09T06:47:34.634Z", "ended_at": "2023-05-14T07:05:36.107Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}, {"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}]} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3225,7 +3260,7 @@ examples: application/json: {"billing_name": "", "billing_address": {"country": "US"}} responses: "200": - application/json: {"id": "", "created_at": "2023-07-07T02:27:33.933Z", "modified_at": "2025-12-06T08:14:38.290Z", "status": "pending", "paid": true, "subtotal_amount": 666528, "discount_amount": 690049, "net_amount": 679795, "tax_amount": 307125, "total_amount": 717730, "refunded_amount": 731967, "refunded_tax_amount": 29529, "currency": "Sri Lanka Rupee", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-05-10T23:50:32.891Z", "modified_at": "2023-02-18T10:28:10.963Z", "metadata": {"key": false}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-09-27T12:39:54.419Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 364993, "key1": true, "key2": true}, "created_at": "2023-04-12T21:30:23.720Z", "modified_at": "2025-07-30T06:39:42.272Z", "id": "", "name": "", "description": "yippee amid wire knowingly an er reproachfully mechanically who gym", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 919384, "type": "fixed", "basis_points": 485397, "created_at": "2023-04-20T01:15:36.927Z", "modified_at": "2025-08-12T14:50:46.554Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-06-20T13:39:02.935Z", "ends_at": "2024-06-17T01:44:44.306Z", "max_redemptions": 991144, "redemptions_count": 882356, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": true, "key1": false}, "created_at": "2025-05-14T12:37:49.790Z", "modified_at": "2023-07-19T20:08:36.520Z", "id": "", "amount": 328171, "currency": "Rand", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-06-29T04:23:47.957Z", "current_period_end": "2024-06-02T02:08:37.593Z", "cancel_at_period_end": true, "canceled_at": "2024-06-26T07:14:15.241Z", "started_at": "2025-06-03T07:15:00.193Z", "ends_at": "2023-09-17T15:31:40.614Z", "ended_at": "2024-06-15T15:33:26.067Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}]} + application/json: {"id": "", "created_at": "2023-07-07T02:27:33.933Z", "modified_at": "2025-12-06T08:14:38.290Z", "status": "pending", "paid": true, "subtotal_amount": 666528, "discount_amount": 690049, "net_amount": 679795, "tax_amount": 307125, "total_amount": 717730, "from_balance_amount": 979625, "refunded_amount": 731967, "refunded_tax_amount": 29529, "currency": "Sri Lanka Rupee", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-05-10T23:50:32.891Z", "modified_at": "2023-02-18T10:28:10.963Z", "metadata": {"key": false}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-09-27T12:39:54.419Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 364993, "key1": true, "key2": true}, "created_at": "2023-04-12T21:30:23.720Z", "modified_at": "2025-07-30T06:39:42.272Z", "id": "", "name": "", "description": "yippee amid wire knowingly an er reproachfully mechanically who gym", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 919384, "type": "fixed", "basis_points": 485397, "created_at": "2023-04-20T01:15:36.927Z", "modified_at": "2025-08-12T14:50:46.554Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-06-20T13:39:02.935Z", "ends_at": "2024-06-17T01:44:44.306Z", "max_redemptions": 991144, "redemptions_count": 882356, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": true, "key1": false}, "created_at": "2025-05-14T12:37:49.790Z", "modified_at": "2023-07-19T20:08:36.520Z", "id": "", "amount": 328171, "currency": "Rand", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-06-29T04:23:47.957Z", "current_period_end": "2024-06-02T02:08:37.593Z", "cancel_at_period_end": true, "canceled_at": "2024-06-26T07:14:15.241Z", "started_at": "2025-06-03T07:15:00.193Z", "ends_at": "2023-09-17T15:31:40.614Z", "ended_at": "2024-06-15T15:33:26.067Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}]} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3251,7 +3286,7 @@ examples: application/json: {"billing_name": "", "billing_address": {"country": "US"}} responses: "200": - application/json: {"id": "", "created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "status": "paid", "paid": true, "subtotal_amount": 779370, "discount_amount": 293701, "net_amount": 728297, "tax_amount": 459195, "total_amount": 683124, "refunded_amount": 579814, "refunded_tax_amount": 755690, "currency": "Cape Verde Escudo", "billing_reason": "purchase", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2024-02-03T21:16:03.609Z", "modified_at": null, "id": "", "name": "", "description": "gee present next brief till or", "recurring_interval": "year", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "id": "", "amount_type": "metered_unit", "is_archived": true, "product_id": "", "type": "recurring", "recurring_interval": "year", "price_currency": "", "unit_amount": "", "cap_amount": 459195, "meter_id": "", "meter": {"id": "", "name": ""}}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 245978, "storage_version": "", "checksum_etag": null, "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-02T01:31:39.639Z", "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2024-04-27T06:51:48.796Z", "size_readable": "", "public_url": "https://monthly-concentration.com"}], "organization": {"created_at": "2024-05-09T04:05:31.223Z", "modified_at": "2025-07-23T21:23:51.247Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://finished-language.org/", "email": "Junior80@hotmail.com", "website": "", "socials": [], "status": "denied", "details_submitted_at": "2023-09-01T22:21:18.571Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}, "notification_settings": {"new_order": false, "new_subscription": false}}}, "subscription": {"created_at": "2025-08-10T03:04:21.532Z", "modified_at": "2024-08-23T05:41:16.519Z", "id": "", "amount": 210189, "currency": "Algerian Dinar", "recurring_interval": "month", "status": "incomplete_expired", "current_period_start": "2024-07-27T23:16:23.597Z", "current_period_end": "2025-01-04T16:08:44.590Z", "cancel_at_period_end": true, "canceled_at": "2025-03-10T21:35:49.211Z", "started_at": "2023-10-24T00:47:38.683Z", "ends_at": "2024-08-10T21:46:10.059Z", "ended_at": "2023-10-02T07:02:51.789Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}]} + application/json: {"id": "", "created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "status": "paid", "paid": true, "subtotal_amount": 779370, "discount_amount": 293701, "net_amount": 728297, "tax_amount": 459195, "total_amount": 683124, "from_balance_amount": 774330, "refunded_amount": 579814, "refunded_tax_amount": 755690, "currency": "Cape Verde Escudo", "billing_reason": "purchase", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2024-02-03T21:16:03.609Z", "modified_at": null, "id": "", "name": "", "description": "gee present next brief till or", "recurring_interval": "year", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "id": "", "amount_type": "metered_unit", "is_archived": true, "product_id": "", "type": "recurring", "recurring_interval": "year", "price_currency": "", "unit_amount": "", "cap_amount": 459195, "meter_id": "", "meter": {"id": "", "name": ""}}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 245978, "storage_version": "", "checksum_etag": null, "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-02T01:31:39.639Z", "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2024-04-27T06:51:48.796Z", "size_readable": "", "public_url": "https://monthly-concentration.com"}], "organization": {"created_at": "2024-05-09T04:05:31.223Z", "modified_at": "2025-07-23T21:23:51.247Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://finished-language.org/", "email": "Junior80@hotmail.com", "website": "", "socials": [], "status": "denied", "details_submitted_at": "2023-09-01T22:21:18.571Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}, "notification_settings": {"new_order": false, "new_subscription": false}}}, "subscription": {"created_at": "2025-08-10T03:04:21.532Z", "modified_at": "2024-08-23T05:41:16.519Z", "id": "", "amount": 210189, "currency": "Algerian Dinar", "recurring_interval": "month", "status": "incomplete_expired", "current_period_start": "2024-07-27T23:16:23.597Z", "current_period_end": "2025-01-04T16:08:44.590Z", "cancel_at_period_end": true, "canceled_at": "2025-03-10T21:35:49.211Z", "started_at": "2023-10-24T00:47:38.683Z", "ends_at": "2024-08-10T21:46:10.059Z", "ended_at": "2023-10-02T07:02:51.789Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}]} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3446,12 +3481,28 @@ examples: application/json: {"error": "PaymentAlreadyInProgress", "detail": ""} "422": application/json: {"error": "OrderNotEligibleForRetry", "detail": ""} + benefit-grants:list: + speakeasy-default-benefit-grants:list: + parameters: + query: + organization_id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737" + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [{"created_at": "2024-08-12T11:30:34.106Z", "modified_at": "2024-09-26T02:26:48.405Z", "id": "", "is_granted": true, "is_revoked": true, "subscription_id": "", "order_id": "", "customer_id": "", "benefit_id": "", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2023-06-01T22:42:28.725Z", "modified_at": "2025-01-17T12:45:17.064Z", "metadata": {}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2025-05-30T19:02:44.214Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "benefit": {"id": "", "created_at": "2024-11-24T19:12:31.430Z", "modified_at": "2023-04-29T21:15:24.343Z", "type": "discord", "description": "foot pro completion nor which worthy geez slimy zany", "selectable": true, "deletable": true, "organization_id": "", "metadata": {"key": true}, "properties": {"guild_id": "", "role_id": "", "kick_member": false, "guild_token": ""}}, "properties": {}}], "pagination": {"total_count": 61031, "max_page": 387885}} + "422": + application/json: {} + customers:export: + speakeasy-default-customers:export: + parameters: + query: + organization_id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737" + responses: + "200": + application/json: "" + "422": + application/json: {} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: | - ## Python SDK Changes Detected: - * `polar.webhooks.list_webhook_deliveries()`: `response.items.[]` **Changed** **Breaking** :warning: - * `polar.benefits.list()`: `request.sorting` **Changed** - * `polar.customer_portal.benefit-grants.list()`: `response.items.[].[customer_benefit_grant_meter_credit].properties` **Changed** - * `polar.customer_portal.benefit-grants.get()`: `response.[customer_benefit_grant_meter_credit].properties` **Changed** - * `polar.customer_portal.benefit-grants.update()`: `response.[customer_benefit_grant_meter_credit].properties` **Changed** +releaseNotes: "## Python SDK Changes Detected:\n* `polar.license_keys.validate()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.get()`: `response` **Changed** **Breaking** :warning:\n* `polar.subscriptions.revoke()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.subscriptions.update()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.benefits.grants()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.orders.list()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.orders.get()`: `response` **Changed** **Breaking** :warning:\n* `polar.customer_meters.get()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_meters.list()`: `response.items.[].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.orders.update()`: \n * `request.order_update.billing_address.country` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `polar.checkouts.list()`: `response.items.[].customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.checkouts.create()`: \n * `request.customer_billing_address.country` **Changed** **Breaking** :warning:\n * `response.customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.checkouts.get()`: `response.customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.checkouts.update()`: \n * `request.checkout_update.customer_billing_address.country` **Changed** **Breaking** :warning:\n * `response.customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.checkouts.client_get()`: `response.customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.checkouts.client_update()`: \n * `request.checkout_update_public.customer_billing_address.country` **Changed** **Breaking** :warning:\n * `response.customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.checkouts.client_confirm()`: \n * `request.checkout_confirm_stripe.customer_billing_address.country` **Changed** **Breaking** :warning:\n * `response.customer_billing_address.country` **Changed** **Breaking** :warning:\n* `polar.events.get()`: `response.[user_event].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.events.list()`: `response.items.[].[user_event].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer-sessions.create()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.license_keys.list()`: `response.items.[].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.license_keys.get()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.license_keys.update()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.license_keys.get_activation()`: `response.license_key.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.subscriptions.get()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.subscriptions.list()`: `response.items.[].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.benefit-grants.get()`: `response.[customer_benefit_grant_downloadables].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.create()`: \n * `request.billing_address.country` **Changed** **Breaking** :warning:\n * `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.get()`: `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.update()`: \n * `request.customer_update.billing_address.country` **Changed** **Breaking** :warning:\n * `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.get_external()`: `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.update_external()`: \n * `request.customer_update_external_id.billing_address.country` **Changed** **Breaking** :warning:\n * `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.get_state()`: `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.get_state_external()`: `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.benefit-grants.list()`: `response.items.[].[customer_benefit_grant_downloadables].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customers.list()`: `response.items.[].billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.benefit-grants.update()`: `response.[customer_benefit_grant_discord].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.customers.get()`: `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.customers.update()`: \n * `request.billing_address.country` **Changed** **Breaking** :warning:\n * `response.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.license_keys.list()`: `response.items.[].customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.license_keys.get()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.license_keys.validate()`: `response.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.license_keys.activate()`: `response.license_key.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.list()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.license_keys.activate()`: `response.license_key.customer.billing_address.country` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.update()`: \n * `request.customer_order_update.billing_address.country` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `polar.metrics.get()`: `response` **Changed**\n* `polar.webhooks.list_webhook_deliveries()`: `request` **Changed**\n* `polar.organizations.list()`: `request.sorting` **Changed**\n* `polar.customers.export()`: **Added**\n* `polar.benefit-grants.list()`: **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index b1bedafa..2cfd5f18 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -25,7 +25,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 0.23.1 + version: 0.24.0 additionalDependencies: dev: pydantic-ai-slim: ^0.1.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index e4a3dd1c..70ecec49 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.615.2 +speakeasyVersion: 1.622.1 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:0609c2f786cf41c405047e351611a410c5e1993dd3edb8e1c8607a800d9ba45f - sourceBlobDigest: sha256:a63f46911db62fcac2879f63c5173739ee400f0b9439775e24615d8e3b8039d8 + sourceRevisionDigest: sha256:47837d6f2cf7820fbd3dbee4fd522889f82cf335e84f6b3672668e14263d5272 + sourceBlobDigest: sha256:234e8874f8abab225bb7a1edb367cbd3acb7a3aef04eae2dfdf7195a7ef2709a tags: - latest - - speakeasy-sdk-regen-1757117557 + - speakeasy-sdk-regen-1758068009 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:0609c2f786cf41c405047e351611a410c5e1993dd3edb8e1c8607a800d9ba45f - sourceBlobDigest: sha256:a63f46911db62fcac2879f63c5173739ee400f0b9439775e24615d8e3b8039d8 + sourceRevisionDigest: sha256:47837d6f2cf7820fbd3dbee4fd522889f82cf335e84f6b3672668e14263d5272 + sourceBlobDigest: sha256:234e8874f8abab225bb7a1edb367cbd3acb7a3aef04eae2dfdf7195a7ef2709a codeSamplesNamespace: polar-oas-py-code-samples - codeSamplesRevisionDigest: sha256:02a649ad7724ad6c84fe2565e5629bccf761c08396baf4c0b9289cc1d9f25148 + codeSamplesRevisionDigest: sha256:eb1ae75d0a64a498ab1f2e6b949e48b7969291defd4fdb56e3186465980afb86 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 755fe2a7..29a6fbf2 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,10 @@ def webhook():
Available methods +### [benefit_grants](docs/sdks/benefitgrants/README.md) + +* [list](docs/sdks/benefitgrants/README.md#list) - List Benefit Grants + ### [benefits](docs/sdks/benefits/README.md) * [list](docs/sdks/benefits/README.md#list) - List Benefits @@ -228,11 +232,11 @@ def webhook(): ### [customer_portal](docs/sdks/customerportal/README.md) -#### [customer_portal.benefit_grants](docs/sdks/benefitgrants/README.md) +#### [customer_portal.benefit_grants](docs/sdks/polarbenefitgrants/README.md) -* [list](docs/sdks/benefitgrants/README.md#list) - List Benefit Grants -* [get](docs/sdks/benefitgrants/README.md#get) - Get Benefit Grant -* [update](docs/sdks/benefitgrants/README.md#update) - Update Benefit Grant +* [list](docs/sdks/polarbenefitgrants/README.md#list) - List Benefit Grants +* [get](docs/sdks/polarbenefitgrants/README.md#get) - Get Benefit Grant +* [update](docs/sdks/polarbenefitgrants/README.md#update) - Update Benefit Grant #### [customer_portal.customer_meters](docs/sdks/polarcustomermeters/README.md) @@ -288,6 +292,7 @@ def webhook(): * [list](docs/sdks/customers/README.md#list) - List Customers * [create](docs/sdks/customers/README.md#create) - Create Customer +* [export](docs/sdks/customers/README.md#export) - Export Customers * [get](docs/sdks/customers/README.md#get) - Get Customer * [update](docs/sdks/customers/README.md#update) - Update Customer * [delete](docs/sdks/customers/README.md#delete) - Delete Customer @@ -516,24 +521,24 @@ with Polar( **Inherit from [`PolarError`](./src/polar_sdk/models/polarerror.py)**: -* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 76 of 128 methods.* -* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 128 methods.* -* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 128 methods.* -* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 128 methods.* -* [`AlreadyActiveSubscriptionError`](./src/polar_sdk/models/alreadyactivesubscriptionerror.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 128 methods.* -* [`NotOpenCheckout`](./src/polar_sdk/models/notopencheckout.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 128 methods.* -* [`PaymentNotReady`](./src/polar_sdk/models/paymentnotready.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 128 methods.* -* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 128 methods.* -* [`SubscriptionLocked`](./src/polar_sdk/models/subscriptionlocked.py): Subscription is pending an update. Status code `409`. Applicable to 2 of 128 methods.* -* [`InvoiceAlreadyExists`](./src/polar_sdk/models/invoicealreadyexists.py): Order already has an invoice. Status code `409`. Applicable to 2 of 128 methods.* -* [`MissingInvoiceBillingDetails`](./src/polar_sdk/models/missinginvoicebillingdetails.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 128 methods.* -* [`NotPaidOrder`](./src/polar_sdk/models/notpaidorder.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 128 methods.* -* [`RefundAmountTooHigh`](./src/polar_sdk/models/refundamounttoohigh.py): Refund amount exceeds remaining order balance. Status code `400`. Applicable to 1 of 128 methods.* -* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 128 methods.* -* [`PaymentMethodInUseByActiveSubscription`](./src/polar_sdk/models/paymentmethodinusebyactivesubscription.py): Payment method is used by active subscription(s). Status code `400`. Applicable to 1 of 128 methods.* -* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 128 methods.* -* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 128 methods.* -* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 128 methods.* +* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 76 of 130 methods.* +* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 130 methods.* +* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 130 methods.* +* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 130 methods.* +* [`AlreadyActiveSubscriptionError`](./src/polar_sdk/models/alreadyactivesubscriptionerror.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 130 methods.* +* [`NotOpenCheckout`](./src/polar_sdk/models/notopencheckout.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 130 methods.* +* [`PaymentNotReady`](./src/polar_sdk/models/paymentnotready.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 130 methods.* +* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 130 methods.* +* [`SubscriptionLocked`](./src/polar_sdk/models/subscriptionlocked.py): Subscription is pending an update. Status code `409`. Applicable to 2 of 130 methods.* +* [`InvoiceAlreadyExists`](./src/polar_sdk/models/invoicealreadyexists.py): Order already has an invoice. Status code `409`. Applicable to 2 of 130 methods.* +* [`MissingInvoiceBillingDetails`](./src/polar_sdk/models/missinginvoicebillingdetails.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 130 methods.* +* [`NotPaidOrder`](./src/polar_sdk/models/notpaidorder.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 130 methods.* +* [`RefundAmountTooHigh`](./src/polar_sdk/models/refundamounttoohigh.py): Refund amount exceeds remaining order balance. Status code `400`. Applicable to 1 of 130 methods.* +* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 130 methods.* +* [`PaymentMethodInUseByActiveSubscription`](./src/polar_sdk/models/paymentmethodinusebyactivesubscription.py): Payment method is used by active subscription(s). Status code `400`. Applicable to 1 of 130 methods.* +* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 130 methods.* +* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 130 methods.* +* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 130 methods.* * [`ResponseValidationError`](./src/polar_sdk/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
@@ -800,7 +805,7 @@ with Polar( Polar API: Polar HTTP and Webhooks API -Read the docs at https://docs.polar.sh/api-reference +Read the docs at https://polar.sh/docs/api-reference diff --git a/RELEASES.md b/RELEASES.md index 66c31ea3..cf42be38 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -893,4 +893,14 @@ Based on: ### Generated - [python v0.23.1] . ### Releases -- [PyPI v0.23.1] https://pypi.org/project/polar-sdk/0.23.1 - . \ No newline at end of file +- [PyPI v0.23.1] https://pypi.org/project/polar-sdk/0.23.1 - . + +## 2025-09-22 10:13:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.622.1 (2.709.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.24.0] . +### Releases +- [PyPI v0.24.0] https://pypi.org/project/polar-sdk/0.24.0 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index af5ecdbe..2333aaa0 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,12 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: + - target: $["paths"]["/v1/benefit-grants/"]["get"] + 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.benefit_grants.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/benefits/"]["get"] update: "x-codeSamples": @@ -80,7 +86,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkouts.create(request={\n \"customer_billing_address\": {\n \"country\": \"US\",\n },\n \"products\": [\n \"\",\n \"\",\n \"\",\n ],\n })\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.checkouts.create(request={\n \"customer_billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n \"products\": [\n \"\",\n \"\",\n \"\",\n ],\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/checkouts/client/{client_secret}"]["get"] update: "x-codeSamples": @@ -98,7 +104,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkouts.client_confirm(client_secret=\"\", checkout_confirm_stripe={\n \"customer_billing_address\": {\n \"country\": \"US\",\n },\n })\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.checkouts.client_confirm(client_secret=\"\", checkout_confirm_stripe={\n \"customer_billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/checkouts/{id}"]["get"] update: "x-codeSamples": @@ -110,7 +116,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkouts.update(id=\"\", checkout_update={\n \"customer_billing_address\": {\n \"country\": \"US\",\n },\n })\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.checkouts.update(id=\"\", checkout_update={\n \"customer_billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/custom-fields/"]["get"] update: "x-codeSamples": @@ -182,7 +188,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar() as polar:\n\n res = polar.customer_portal.customers.update(security=polar_sdk.CustomerPortalCustomersUpdateSecurity(\n customer_session=\"\",\n ), request={\n \"billing_address\": {\n \"country\": \"US\",\n },\n })\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar() as polar:\n\n res = polar.customer_portal.customers.update(security=polar_sdk.CustomerPortalCustomersUpdateSecurity(\n customer_session=\"\",\n ), request={\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customer-portal/customers/me/payment-methods"]["get"] update: "x-codeSamples": @@ -266,7 +272,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar() as polar:\n\n res = polar.customer_portal.orders.update(security=polar_sdk.CustomerPortalOrdersUpdateSecurity(\n customer_session=\"\",\n ), id=\"\", customer_order_update={\n \"billing_name\": \"\",\n \"billing_address\": {\n \"country\": \"US\",\n },\n })\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar() as polar:\n\n res = polar.customer_portal.orders.update(security=polar_sdk.CustomerPortalOrdersUpdateSecurity(\n customer_session=\"\",\n ), id=\"\", customer_order_update={\n \"billing_name\": \"\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customer-portal/orders/{id}/confirm-payment"]["post"] update: "x-codeSamples": @@ -338,7 +344,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.create(request={\n \"external_id\": \"usr_1337\",\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": \"US\",\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"organization_id\": \"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n })\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 })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/customers/export"]["get"] + 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.export(organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\")\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/external/{external_id}"]["delete"] update: "x-codeSamples": @@ -380,7 +392,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.update(id=\"\", customer_update={\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\",\n \"billing_address\": {\n \"country\": \"US\",\n },\n \"tax_id\": [\n \"911144442\",\n \"us_ein\",\n ],\n \"external_id\": \"usr_1337\",\n })\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": @@ -602,7 +614,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.update(id=\"\", order_update={\n \"billing_name\": \"\",\n \"billing_address\": {\n \"country\": \"US\",\n },\n })\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.orders.update(id=\"\", order_update={\n \"billing_name\": \"\",\n \"billing_address\": {\n \"country\": polar_sdk.CountryAlpha2Input.US,\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/orders/{id}/invoice"]["get"] update: "x-codeSamples": @@ -788,13 +800,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() 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=\"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(\"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)" - 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=\"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(\"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)" - target: $["paths"]["benefit_grant.revoked"]["post"] update: "x-codeSamples": @@ -806,67 +818,67 @@ 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_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=\"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(\"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)" - 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 created_at=parse_datetime(\"2025-09-12T19:48:15.814Z\"),\n modified_at=parse_datetime(\"2023-09-14T02:01:27.394Z\"),\n id=\"\",\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 embed_origin=\"\",\n amount=323773,\n discount_amount=115799,\n net_amount=436964,\n tax_amount=None,\n total_amount=859980,\n currency=\"Fiji Dollar\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=None,\n allow_discount_codes=True,\n require_billing_address=True,\n is_discount_applicable=True,\n is_free_product_price=True,\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=None,\n customer_ip_address=None,\n customer_billing_name=\"\",\n customer_billing_address=polar_sdk.Address(\n country=\"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.DISABLED,\n city=polar_sdk.BillingAddressFieldMode.DISABLED,\n postal_code=polar_sdk.BillingAddressFieldMode.DISABLED,\n line1=polar_sdk.BillingAddressFieldMode.DISABLED,\n line2=polar_sdk.BillingAddressFieldMode.DISABLED,\n ),\n metadata={\n\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[],\n product=polar_sdk.CheckoutProduct(\n created_at=parse_datetime(\"2024-09-25T08:09:25.820Z\"),\n modified_at=parse_datetime(\"2025-04-15T15:50:37.647Z\"),\n id=\"\",\n name=\"\",\n description=\"gee noisily mouser tentacle\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n prices=[],\n benefits=[],\n medias=[],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceFree(\n created_at=parse_datetime(\"2023-10-02T03:50:07.919Z\"),\n modified_at=parse_datetime(\"2025-06-07T12:37:50.969Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n ),\n discount=polar_sdk.CheckoutDiscountFixedOnceForeverDuration(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=168537,\n currency=\"Tala\",\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(\"2023-02-15T15:44:21.478Z\"),\n data=polar_sdk.Checkout(\n created_at=parse_datetime(\"2025-09-12T19:48:15.814Z\"),\n modified_at=parse_datetime(\"2023-09-14T02:01:27.394Z\"),\n id=\"\",\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 embed_origin=\"\",\n amount=323773,\n discount_amount=115799,\n net_amount=436964,\n tax_amount=None,\n total_amount=859980,\n currency=\"Fiji Dollar\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=None,\n allow_discount_codes=True,\n require_billing_address=True,\n is_discount_applicable=True,\n is_free_product_price=True,\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=None,\n customer_ip_address=None,\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.DISABLED,\n city=polar_sdk.BillingAddressFieldMode.DISABLED,\n postal_code=polar_sdk.BillingAddressFieldMode.DISABLED,\n line1=polar_sdk.BillingAddressFieldMode.DISABLED,\n line2=polar_sdk.BillingAddressFieldMode.DISABLED,\n ),\n metadata={\n\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[],\n product=polar_sdk.CheckoutProduct(\n created_at=parse_datetime(\"2024-09-25T08:09:25.820Z\"),\n modified_at=parse_datetime(\"2025-04-15T15:50:37.647Z\"),\n id=\"\",\n name=\"\",\n description=\"gee noisily mouser tentacle\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n prices=[],\n benefits=[],\n medias=[],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceFree(\n created_at=parse_datetime(\"2023-10-02T03:50:07.919Z\"),\n modified_at=parse_datetime(\"2025-06-07T12:37:50.969Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n ),\n discount=polar_sdk.CheckoutDiscountFixedOnceForeverDuration(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=168537,\n currency=\"Tala\",\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 created_at=parse_datetime(\"2024-09-17T13:52:37.257Z\"),\n modified_at=parse_datetime(\"2024-11-07T08:23:01.152Z\"),\n id=\"\",\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 embed_origin=\"\",\n amount=67168,\n discount_amount=710560,\n net_amount=954738,\n tax_amount=754328,\n total_amount=867510,\n currency=\"Kuwaiti Dinar\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=\"\",\n allow_discount_codes=True,\n require_billing_address=True,\n is_discount_applicable=True,\n is_free_product_price=True,\n is_payment_required=False,\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=\"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.DISABLED,\n city=polar_sdk.BillingAddressFieldMode.REQUIRED,\n postal_code=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n line1=polar_sdk.BillingAddressFieldMode.REQUIRED,\n line2=polar_sdk.BillingAddressFieldMode.DISABLED,\n ),\n metadata={\n \"key\": 795829,\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[],\n product=polar_sdk.CheckoutProduct(\n created_at=parse_datetime(\"2025-11-27T17:16:31.119Z\"),\n modified_at=parse_datetime(\"2025-06-04T15:43:18.802Z\"),\n id=\"\",\n name=\"\",\n description=\"own obtrude spew cloudy rapidly ugh\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\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=\"/home\",\n mime_type=\"\",\n size=727381,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-12-05T19:37:31.286Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2024-05-01T10:03:11.361Z\"),\n size_readable=\"\",\n public_url=\"https://strict-encouragement.name\",\n ),\n ],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2023-04-04T12:37:13.536Z\"),\n modified_at=parse_datetime(\"2024-07-15T17:22:02.691Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n minimum_amount=557949,\n maximum_amount=600909,\n preset_amount=637755,\n ),\n discount=polar_sdk.CheckoutDiscountPercentageOnceForeverDuration(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=340460,\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_updated_post(request=polar_sdk.WebhookCheckoutUpdatedPayload(\n timestamp=parse_datetime(\"2023-03-19T05:40:46.816Z\"),\n data=polar_sdk.Checkout(\n created_at=parse_datetime(\"2024-09-17T13:52:37.257Z\"),\n modified_at=parse_datetime(\"2024-11-07T08:23:01.152Z\"),\n id=\"\",\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 embed_origin=\"\",\n amount=67168,\n discount_amount=710560,\n net_amount=954738,\n tax_amount=754328,\n total_amount=867510,\n currency=\"Kuwaiti Dinar\",\n product_id=\"\",\n product_price_id=\"\",\n discount_id=\"\",\n allow_discount_codes=True,\n require_billing_address=True,\n is_discount_applicable=True,\n is_free_product_price=True,\n is_payment_required=False,\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.DISABLED,\n city=polar_sdk.BillingAddressFieldMode.REQUIRED,\n postal_code=polar_sdk.BillingAddressFieldMode.OPTIONAL,\n line1=polar_sdk.BillingAddressFieldMode.REQUIRED,\n line2=polar_sdk.BillingAddressFieldMode.DISABLED,\n ),\n metadata={\n \"key\": 795829,\n },\n external_customer_id=\"\",\n customer_external_id=\"\",\n products=[],\n product=polar_sdk.CheckoutProduct(\n created_at=parse_datetime(\"2025-11-27T17:16:31.119Z\"),\n modified_at=parse_datetime(\"2025-06-04T15:43:18.802Z\"),\n id=\"\",\n name=\"\",\n description=\"own obtrude spew cloudy rapidly ugh\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\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=\"/home\",\n mime_type=\"\",\n size=727381,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-12-05T19:37:31.286Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2024-05-01T10:03:11.361Z\"),\n size_readable=\"\",\n public_url=\"https://strict-encouragement.name\",\n ),\n ],\n ),\n product_price=polar_sdk.LegacyRecurringProductPriceCustom(\n created_at=parse_datetime(\"2023-04-04T12:37:13.536Z\"),\n modified_at=parse_datetime(\"2024-07-15T17:22:02.691Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n minimum_amount=557949,\n maximum_amount=600909,\n preset_amount=637755,\n ),\n discount=polar_sdk.CheckoutDiscountPercentageOnceForeverDuration(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=340460,\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"]["customer.created"]["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.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\": \"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(\"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)" - target: $["paths"]["customer.deleted"]["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.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\": \"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(\"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)" - 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\": \"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 \"key\": \"value\",\n },\n \"properties\": {},\n },\n ],\n \"active_meters\": [\n {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2023-08-10T12:57:32.427Z\"),\n \"modified_at\": parse_datetime(\"2024-11-09T02:09:01.550Z\"),\n \"meter_id\": \"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n \"consumed_units\": 25,\n \"credited_units\": 100,\n \"balance\": 75,\n },\n ],\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(\"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 \"key\": \"value\",\n },\n \"properties\": {},\n },\n ],\n \"active_meters\": [\n {\n \"id\": \"\",\n \"created_at\": parse_datetime(\"2023-08-10T12:57:32.427Z\"),\n \"modified_at\": parse_datetime(\"2024-11-09T02:09:01.550Z\"),\n \"meter_id\": \"d498a884-e2cd-4d3e-8002-f536468a8b22\",\n \"consumed_units\": 25,\n \"credited_units\": 100,\n \"balance\": 75,\n },\n ],\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": "from 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\": \"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(\"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)" - 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=220865,\n discount_amount=835005,\n net_amount=913636,\n tax_amount=727987,\n total_amount=597376,\n refunded_amount=864844,\n refunded_tax_amount=493180,\n currency=\"Malaysian Ringgit\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CYCLE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\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 customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-03-27T11:03:51.570Z\"),\n modified_at=parse_datetime(\"2024-06-30T16:49:49.935Z\"),\n metadata={\n \"key\": 268152,\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=\"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-10-18T19:16:06.791Z\"),\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 created_at=parse_datetime(\"2023-07-25T14:06:55.496Z\"),\n modified_at=parse_datetime(\"2023-08-23T12:17:55.172Z\"),\n id=\"\",\n name=\"\",\n description=None,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=89700,\n currency=\"Somali Shilling\",\n created_at=parse_datetime(\"2024-06-03T22:49:40.494Z\"),\n modified_at=parse_datetime(\"2024-04-12T09:11:00.490Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-08-12T07:51:56.436Z\"),\n ends_at=parse_datetime(\"2023-05-06T17:33:16.103Z\"),\n max_redemptions=254706,\n redemptions_count=852483,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 5558.24,\n },\n created_at=parse_datetime(\"2024-05-10T05:33:12.990Z\"),\n modified_at=parse_datetime(\"2024-10-27T02:55:38.822Z\"),\n id=\"\",\n amount=515872,\n currency=\"Jamaican Dollar\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2023-01-30T13:01:14.788Z\"),\n current_period_end=parse_datetime(\"2025-12-27T11:04:16.188Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-10-16T20:18:34.908Z\"),\n started_at=parse_datetime(\"2025-03-18T15:38:59.923Z\"),\n ends_at=parse_datetime(\"2024-11-16T22:02:37.250Z\"),\n ended_at=parse_datetime(\"2024-09-10T19:42:40.294Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=None,\n checkout_id=\"\",\n customer_cancellation_reason=None,\n customer_cancellation_comment=\"\",\n ),\n items=[],\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(\"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=220865,\n discount_amount=835005,\n net_amount=913636,\n tax_amount=727987,\n total_amount=597376,\n from_balance_amount=864844,\n refunded_amount=493180,\n refunded_tax_amount=603288,\n currency=\"Norwegian Krone\",\n billing_reason=polar_sdk.OrderBillingReason.PURCHASE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.CountryAlpha2.US,\n ),\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 customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-03-27T11:03:51.570Z\"),\n modified_at=parse_datetime(\"2024-06-30T16:49:49.935Z\"),\n metadata={\n \"key\": 268152,\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-10-18T19:16:06.791Z\"),\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 created_at=parse_datetime(\"2023-07-25T14:06:55.496Z\"),\n modified_at=parse_datetime(\"2023-08-23T12:17:55.172Z\"),\n id=\"\",\n name=\"\",\n description=None,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n amount=89700,\n currency=\"Somali Shilling\",\n created_at=parse_datetime(\"2024-06-03T22:49:40.494Z\"),\n modified_at=parse_datetime(\"2024-04-12T09:11:00.490Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-08-12T07:51:56.436Z\"),\n ends_at=parse_datetime(\"2023-05-06T17:33:16.103Z\"),\n max_redemptions=254706,\n redemptions_count=852483,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 5558.24,\n },\n created_at=parse_datetime(\"2024-05-10T05:33:12.990Z\"),\n modified_at=parse_datetime(\"2024-10-27T02:55:38.822Z\"),\n id=\"\",\n amount=515872,\n currency=\"Jamaican Dollar\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2023-01-30T13:01:14.788Z\"),\n current_period_end=parse_datetime(\"2025-12-27T11:04:16.188Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-10-16T20:18:34.908Z\"),\n started_at=parse_datetime(\"2025-03-18T15:38:59.923Z\"),\n ends_at=parse_datetime(\"2024-11-16T22:02:37.250Z\"),\n ended_at=parse_datetime(\"2024-09-10T19:42:40.294Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=None,\n checkout_id=\"\",\n customer_cancellation_reason=None,\n customer_cancellation_comment=\"\",\n ),\n items=[],\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=990825,\n discount_amount=746396,\n net_amount=341385,\n tax_amount=486648,\n total_amount=562504,\n refunded_amount=314047,\n refunded_tax_amount=570780,\n currency=\"Norwegian Krone\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=None,\n checkout_id=\"\",\n metadata={\n \"key\": False,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-06-20T08:16:19.561Z\"),\n modified_at=parse_datetime(\"2025-11-18T04:42:58.995Z\"),\n metadata={\n \"key\": True,\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=\"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-06-08T00:11:47.056Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": \"\",\n },\n created_at=parse_datetime(\"2025-10-14T16:14:37.497Z\"),\n modified_at=parse_datetime(\"2024-07-05T21:05:22.131Z\"),\n id=\"\",\n name=\"\",\n description=\"unlike hutch nor table reproachfully eulogise\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\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=678845,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=307762,\n created_at=parse_datetime(\"2024-04-10T18:11:00.918Z\"),\n modified_at=parse_datetime(\"2024-12-20T04:35:24.232Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-05-13T02:34:59.052Z\"),\n ends_at=parse_datetime(\"2024-05-17T02:38:00.485Z\"),\n max_redemptions=400985,\n redemptions_count=973205,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 568756,\n },\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 amount=299042,\n currency=\"Pound Sterling\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2025-03-08T16:10:05.952Z\"),\n current_period_end=parse_datetime(\"2024-09-10T07:58:34.888Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2023-09-16T09:43:57.152Z\"),\n started_at=parse_datetime(\"2024-08-15T07:25:23.875Z\"),\n ends_at=parse_datetime(\"2025-02-12T23:41:13.290Z\"),\n ended_at=parse_datetime(\"2023-02-24T15:15:22.018Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-09-21T14:56:16.106Z\"),\n modified_at=parse_datetime(\"2023-01-21T03:35:38.158Z\"),\n id=\"\",\n label=\"\",\n amount=870773,\n tax_amount=305914,\n proration=True,\n product_price_id=\"\",\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.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=990825,\n discount_amount=746396,\n net_amount=341385,\n tax_amount=486648,\n total_amount=562504,\n from_balance_amount=314047,\n refunded_amount=570780,\n refunded_tax_amount=627737,\n currency=\"Hong Kong Dollar\",\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 is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=None,\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": True,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-06-18T22:24:34.935Z\"),\n modified_at=parse_datetime(\"2025-08-01T03:33:20.782Z\"),\n metadata={\n \"key\": 179185,\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-07-31T08:10:01.120Z\"),\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 created_at=parse_datetime(\"2025-10-14T16:14:37.497Z\"),\n modified_at=parse_datetime(\"2024-07-05T21:05:22.131Z\"),\n id=\"\",\n name=\"\",\n description=\"unlike hutch nor table reproachfully eulogise\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\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=678845,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=307762,\n created_at=parse_datetime(\"2024-04-10T18:11:00.918Z\"),\n modified_at=parse_datetime(\"2024-12-20T04:35:24.232Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-05-13T02:34:59.052Z\"),\n ends_at=parse_datetime(\"2024-05-17T02:38:00.485Z\"),\n max_redemptions=400985,\n redemptions_count=973205,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 568756,\n },\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 amount=299042,\n currency=\"Pound Sterling\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2025-03-08T16:10:05.952Z\"),\n current_period_end=parse_datetime(\"2024-09-10T07:58:34.888Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2023-09-16T09:43:57.152Z\"),\n started_at=parse_datetime(\"2024-08-15T07:25:23.875Z\"),\n ends_at=parse_datetime(\"2025-02-12T23:41:13.290Z\"),\n ended_at=parse_datetime(\"2023-02-24T15:15:22.018Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-09-21T14:56:16.106Z\"),\n modified_at=parse_datetime(\"2023-01-21T03:35:38.158Z\"),\n id=\"\",\n label=\"\",\n amount=870773,\n tax_amount=305914,\n proration=True,\n product_price_id=\"\",\n ),\n ],\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=294178,\n discount_amount=721778,\n net_amount=913001,\n tax_amount=518308,\n total_amount=820663,\n refunded_amount=472431,\n refunded_tax_amount=879331,\n currency=\"Hong Kong Dollar\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\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 customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-08-11T17:50:11.031Z\"),\n modified_at=parse_datetime(\"2023-02-24T05:25:29.794Z\"),\n metadata={\n \"key\": 97027,\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=\"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-01-26T21:26:48.872Z\"),\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 created_at=parse_datetime(\"2023-01-16T07:26:04.196Z\"),\n modified_at=parse_datetime(\"2025-01-18T16:58:42.976Z\"),\n id=\"\",\n name=\"\",\n description=\"anxiously notwithstanding softly wilderness drat helpless conservation ew\",\n recurring_interval=None,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=177173,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=175227,\n created_at=parse_datetime(\"2024-06-23T22:24:00.212Z\"),\n modified_at=parse_datetime(\"2025-09-20T03:04:20.355Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-22T11:17:00.498Z\"),\n ends_at=parse_datetime(\"2023-01-04T20:02:20.162Z\"),\n max_redemptions=477690,\n redemptions_count=429180,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": True,\n },\n created_at=parse_datetime(\"2023-12-28T02:40:16.151Z\"),\n modified_at=None,\n id=\"\",\n amount=801440,\n currency=\"Kwanza\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n status=polar_sdk.SubscriptionStatus.UNPAID,\n current_period_start=parse_datetime(\"2025-12-13T00:18:40.316Z\"),\n current_period_end=parse_datetime(\"2025-09-10T16:01:49.333Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-11-12T03:39:13.416Z\"),\n started_at=parse_datetime(\"2024-11-06T04:39:52.000Z\"),\n ends_at=parse_datetime(\"2024-06-22T23:44:00.447Z\"),\n ended_at=parse_datetime(\"2024-11-02T04:41:56.340Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-06-01T22:10:54.514Z\"),\n modified_at=None,\n id=\"\",\n label=\"\",\n amount=584605,\n tax_amount=493789,\n proration=True,\n product_price_id=\"\",\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.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=294178,\n discount_amount=721778,\n net_amount=913001,\n tax_amount=518308,\n total_amount=820663,\n from_balance_amount=472431,\n refunded_amount=879331,\n refunded_tax_amount=342380,\n currency=\"Lebanese Pound\",\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 is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 494.76,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-12-27T19:16:00.555Z\"),\n modified_at=parse_datetime(\"2023-04-17T08:12:37.300Z\"),\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=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 created_at=parse_datetime(\"2023-01-16T07:26:04.196Z\"),\n modified_at=parse_datetime(\"2025-01-18T16:58:42.976Z\"),\n id=\"\",\n name=\"\",\n description=\"anxiously notwithstanding softly wilderness drat helpless conservation ew\",\n recurring_interval=None,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=177173,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=175227,\n created_at=parse_datetime(\"2024-06-23T22:24:00.212Z\"),\n modified_at=parse_datetime(\"2025-09-20T03:04:20.355Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-22T11:17:00.498Z\"),\n ends_at=parse_datetime(\"2023-01-04T20:02:20.162Z\"),\n max_redemptions=477690,\n redemptions_count=429180,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": True,\n },\n created_at=parse_datetime(\"2023-12-28T02:40:16.151Z\"),\n modified_at=None,\n id=\"\",\n amount=801440,\n currency=\"Kwanza\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n status=polar_sdk.SubscriptionStatus.UNPAID,\n current_period_start=parse_datetime(\"2025-12-13T00:18:40.316Z\"),\n current_period_end=parse_datetime(\"2025-09-10T16:01:49.333Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-11-12T03:39:13.416Z\"),\n started_at=parse_datetime(\"2024-11-06T04:39:52.000Z\"),\n ends_at=parse_datetime(\"2024-06-22T23:44:00.447Z\"),\n ended_at=parse_datetime(\"2024-11-02T04:41:56.340Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-06-01T22:10:54.514Z\"),\n modified_at=None,\n id=\"\",\n label=\"\",\n amount=584605,\n tax_amount=493789,\n proration=True,\n product_price_id=\"\",\n ),\n ],\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=338283,\n discount_amount=321919,\n net_amount=827864,\n tax_amount=380359,\n total_amount=596980,\n refunded_amount=404069,\n refunded_tax_amount=718668,\n currency=\"Nuevo Sol\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 187509,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-12-03T05:16:11.415Z\"),\n modified_at=parse_datetime(\"2023-03-11T05:58:05.184Z\"),\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(\"2023-06-26T15:51:37.068Z\"),\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 created_at=parse_datetime(\"2024-07-10T12:45:44.731Z\"),\n modified_at=parse_datetime(\"2024-09-19T13:13:25.785Z\"),\n id=\"\",\n name=\"\",\n description=\"bossy direct reservation quaintly atop interestingly\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=227959,\n type=polar_sdk.DiscountType.FIXED,\n amount=785594,\n currency=\"Barbados Dollar\",\n created_at=parse_datetime(\"2025-08-02T14:17:04.679Z\"),\n modified_at=parse_datetime(\"2023-04-10T21:27:35.876Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-05-20T13:29:26.710Z\"),\n ends_at=parse_datetime(\"2023-09-01T14:56:03.459Z\"),\n max_redemptions=583107,\n redemptions_count=378993,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2025-11-15T17:24:36.671Z\"),\n modified_at=parse_datetime(\"2024-10-31T22:22:01.280Z\"),\n id=\"\",\n amount=531188,\n currency=\"Leone\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2024-03-12T02:07:55.904Z\"),\n current_period_end=parse_datetime(\"2023-08-26T12:56:24.423Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-02-18T06:04:41.480Z\"),\n started_at=parse_datetime(\"2024-03-28T15:10:13.508Z\"),\n ends_at=parse_datetime(\"2023-11-03T05:13:30.202Z\"),\n ended_at=parse_datetime(\"2024-03-03T03:52:46.888Z\"),\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 ),\n items=[],\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(\"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=338283,\n discount_amount=321919,\n net_amount=827864,\n tax_amount=380359,\n total_amount=596980,\n from_balance_amount=404069,\n refunded_amount=718668,\n refunded_tax_amount=655991,\n currency=\"Rupiah\",\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 is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-07-25T12:14:47.758Z\"),\n modified_at=parse_datetime(\"2023-10-28T19:38:51.490Z\"),\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=None,\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": \"\",\n },\n created_at=parse_datetime(\"2023-09-09T23:29:46.282Z\"),\n modified_at=parse_datetime(\"2023-12-07T14:52:42.853Z\"),\n id=\"\",\n name=\"\",\n description=\"uniform waver pish coliseum consign absent drat cap including oof\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=860052,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=650798,\n created_at=parse_datetime(\"2024-02-06T09:06:51.703Z\"),\n modified_at=None,\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-11-03T05:13:30.202Z\"),\n ends_at=parse_datetime(\"2024-03-03T03:52:46.888Z\"),\n max_redemptions=858600,\n redemptions_count=637128,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-02-19T19:25:59.986Z\"),\n modified_at=parse_datetime(\"2025-07-23T06:42:36.223Z\"),\n id=\"\",\n label=\"\",\n amount=669405,\n tax_amount=12321,\n proration=False,\n product_price_id=None,\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["organization.updated"]["post"] update: "x-codeSamples": @@ -902,34 +914,34 @@ 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.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=898742,\n currency=\"Pound Sterling\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2023-04-09T09:06:19.384Z\"),\n current_period_end=None,\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2023-07-21T07:29:31.409Z\"),\n started_at=parse_datetime(\"2025-08-05T11:38:46.213Z\"),\n ends_at=parse_datetime(\"2024-09-05T04:27:23.768Z\"),\n ended_at=parse_datetime(\"2024-06-17T20:38:09.011Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": 4786.4,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-01-01T23:32:39.659Z\"),\n modified_at=parse_datetime(\"2025-01-01T03:00:09.282Z\"),\n metadata={\n \"key\": 796236,\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=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=None,\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2025-11-05T10:18:40.300Z\"),\n modified_at=parse_datetime(\"2024-04-23T18:24:43.408Z\"),\n id=\"\",\n name=\"\",\n description=\"athwart fail wound oh nor boohoo reasoning against since\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[\n polar_sdk.BenefitCustom(\n id=\"\",\n created_at=parse_datetime(\"2025-12-07T07:01:30.650Z\"),\n modified_at=parse_datetime(\"2025-05-21T10:49:13.924Z\"),\n description=\"effector as upbeat\",\n selectable=False,\n deletable=False,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitCustomProperties(\n note=\"\",\n ),\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/net\",\n mime_type=\"\",\n size=11881,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=None,\n last_modified_at=parse_datetime(\"2023-11-14T06:50:49.907Z\"),\n version=None,\n is_uploaded=False,\n created_at=parse_datetime(\"2025-10-14T21:02:51.234Z\"),\n size_readable=\"\",\n public_url=\"https://precious-passport.com\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=None,\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2023-10-17T15:57:30.746Z\"),\n modified_at=parse_datetime(\"2023-01-26T13:42:22.194Z\"),\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-10-16T02:50:36.102Z\"),\n modified_at=parse_datetime(\"2024-11-23T13:29:39.753Z\"),\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.AVG,\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(\"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=898742,\n currency=\"Pound Sterling\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2023-04-09T09:06:19.384Z\"),\n current_period_end=None,\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2023-07-21T07:29:31.409Z\"),\n started_at=parse_datetime(\"2025-08-05T11:38:46.213Z\"),\n ends_at=parse_datetime(\"2024-09-05T04:27:23.768Z\"),\n ended_at=parse_datetime(\"2024-06-17T20:38:09.011Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": 4786.4,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-01-01T23:32:39.659Z\"),\n modified_at=parse_datetime(\"2025-01-01T03:00:09.282Z\"),\n metadata={\n \"key\": 796236,\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 product=polar_sdk.Product(\n created_at=parse_datetime(\"2025-11-05T10:18:40.300Z\"),\n modified_at=parse_datetime(\"2024-04-23T18:24:43.408Z\"),\n id=\"\",\n name=\"\",\n description=\"athwart fail wound oh nor boohoo reasoning against since\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[\n polar_sdk.BenefitCustom(\n id=\"\",\n created_at=parse_datetime(\"2025-12-07T07:01:30.650Z\"),\n modified_at=parse_datetime(\"2025-05-21T10:49:13.924Z\"),\n description=\"effector as upbeat\",\n selectable=False,\n deletable=False,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitCustomProperties(\n note=\"\",\n ),\n ),\n ],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/net\",\n mime_type=\"\",\n size=11881,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=None,\n last_modified_at=parse_datetime(\"2023-11-14T06:50:49.907Z\"),\n version=None,\n is_uploaded=False,\n created_at=parse_datetime(\"2025-10-14T21:02:51.234Z\"),\n size_readable=\"\",\n public_url=\"https://precious-passport.com\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=None,\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2023-10-17T15:57:30.746Z\"),\n modified_at=parse_datetime(\"2023-01-26T13:42:22.194Z\"),\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-10-16T02:50:36.102Z\"),\n modified_at=parse_datetime(\"2024-11-23T13:29:39.753Z\"),\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.AVG,\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=137392,\n currency=\"New Taiwan Dollar\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2023-06-17T04:15:56.819Z\"),\n current_period_end=parse_datetime(\"2023-06-02T15:48:16.857Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-01-07T18:54:45.602Z\"),\n started_at=parse_datetime(\"2025-02-23T12:23:49.579Z\"),\n ends_at=parse_datetime(\"2023-11-16T08:24:59.166Z\"),\n ended_at=parse_datetime(\"2023-07-21T16:25:14.433Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=None,\n checkout_id=None,\n customer_cancellation_reason=None,\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(\"2023-10-25T05:52:42.846Z\"),\n modified_at=parse_datetime(\"2023-09-20T10:20:50.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=\"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-15T00:52:17.297Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2024-10-18T00:58:28.923Z\"),\n modified_at=parse_datetime(\"2025-06-11T17:21:10.206Z\"),\n id=\"\",\n name=\"\",\n description=\"rekindle very whoever happily provision pfft outrun surface\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": True,\n },\n prices=[],\n benefits=[\n polar_sdk.BenefitLicenseKeys(\n id=\"\",\n created_at=parse_datetime(\"2024-10-21T11:59:45.315Z\"),\n modified_at=parse_datetime(\"2025-06-11T03:26:05.845Z\"),\n description=\"yippee broadcast er yowza\",\n selectable=True,\n deletable=True,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitLicenseKeysProperties(\n prefix=\"\",\n expires=polar_sdk.BenefitLicenseKeyExpirationProperties(\n ttl=156565,\n timeframe=polar_sdk.Timeframe.YEAR,\n ),\n activations=polar_sdk.BenefitLicenseKeyActivationProperties(\n limit=676095,\n enable_customer_admin=False,\n ),\n limit_usage=637284,\n ),\n ),\n ],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldText(\n created_at=parse_datetime(\"2023-03-07T15:42:46.324Z\"),\n modified_at=parse_datetime(\"2024-09-08T21:12:01.583Z\"),\n id=\"\",\n metadata={\n\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldTextProperties(),\n ),\n order=147849,\n required=False,\n ),\n ],\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=162086,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=280213,\n currency=\"Mexican Peso\",\n created_at=parse_datetime(\"2024-09-21T23:00:18.902Z\"),\n modified_at=parse_datetime(\"2024-06-12T08:11:27.558Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-04-30T07:29:19.925Z\"),\n ends_at=parse_datetime(\"2025-12-08T04:46:29.428Z\"),\n max_redemptions=264852,\n redemptions_count=579638,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2024-05-17T23:59:28.786Z\"),\n modified_at=parse_datetime(\"2024-05-31T09:51:13.446Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n price_amount=57753,\n ),\n ],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2023-04-20T13:22:47.883Z\"),\n modified_at=parse_datetime(\"2024-05-07T04:06:16.229Z\"),\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\": False,\n },\n created_at=parse_datetime(\"2024-05-08T15:55:55.133Z\"),\n modified_at=parse_datetime(\"2024-02-15T18:41:28.030Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.CountAggregation(),\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_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=137392,\n currency=\"New Taiwan Dollar\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2023-06-17T04:15:56.819Z\"),\n current_period_end=parse_datetime(\"2023-06-02T15:48:16.857Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2024-01-07T18:54:45.602Z\"),\n started_at=parse_datetime(\"2025-02-23T12:23:49.579Z\"),\n ends_at=parse_datetime(\"2023-11-16T08:24:59.166Z\"),\n ended_at=parse_datetime(\"2023-07-21T16:25:14.433Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=None,\n checkout_id=None,\n customer_cancellation_reason=None,\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(\"2023-10-25T05:52:42.846Z\"),\n modified_at=parse_datetime(\"2023-09-20T10:20:50.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(\"2025-04-15T00:52:17.297Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2024-10-18T00:58:28.923Z\"),\n modified_at=parse_datetime(\"2025-06-11T17:21:10.206Z\"),\n id=\"\",\n name=\"\",\n description=\"rekindle very whoever happily provision pfft outrun surface\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n metadata={\n \"key\": True,\n },\n prices=[],\n benefits=[\n polar_sdk.BenefitLicenseKeys(\n id=\"\",\n created_at=parse_datetime(\"2024-10-21T11:59:45.315Z\"),\n modified_at=parse_datetime(\"2025-06-11T03:26:05.845Z\"),\n description=\"yippee broadcast er yowza\",\n selectable=True,\n deletable=True,\n organization_id=\"\",\n metadata={\n\n },\n properties=polar_sdk.BenefitLicenseKeysProperties(\n prefix=\"\",\n expires=polar_sdk.BenefitLicenseKeyExpirationProperties(\n ttl=156565,\n timeframe=polar_sdk.Timeframe.YEAR,\n ),\n activations=polar_sdk.BenefitLicenseKeyActivationProperties(\n limit=676095,\n enable_customer_admin=False,\n ),\n limit_usage=637284,\n ),\n ),\n ],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldText(\n created_at=parse_datetime(\"2023-03-07T15:42:46.324Z\"),\n modified_at=parse_datetime(\"2024-09-08T21:12:01.583Z\"),\n id=\"\",\n metadata={\n\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldTextProperties(),\n ),\n order=147849,\n required=False,\n ),\n ],\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=162086,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=280213,\n currency=\"Mexican Peso\",\n created_at=parse_datetime(\"2024-09-21T23:00:18.902Z\"),\n modified_at=parse_datetime(\"2024-06-12T08:11:27.558Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-04-30T07:29:19.925Z\"),\n ends_at=parse_datetime(\"2025-12-08T04:46:29.428Z\"),\n max_redemptions=264852,\n redemptions_count=579638,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2024-05-17T23:59:28.786Z\"),\n modified_at=parse_datetime(\"2024-05-31T09:51:13.446Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n price_amount=57753,\n ),\n ],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2023-04-20T13:22:47.883Z\"),\n modified_at=parse_datetime(\"2024-05-07T04:06:16.229Z\"),\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\": False,\n },\n created_at=parse_datetime(\"2024-05-08T15:55:55.133Z\"),\n modified_at=parse_datetime(\"2024-02-15T18:41:28.030Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[],\n ),\n aggregation=polar_sdk.CountAggregation(),\n organization_id=\"\",\n ),\n ),\n ],\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=119240,\n currency=\"Zambian Kwacha\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n status=polar_sdk.SubscriptionStatus.TRIALING,\n current_period_start=parse_datetime(\"2024-02-03T21:22:53.116Z\"),\n current_period_end=parse_datetime(\"2023-10-20T18:48:25.568Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-09-10T12:12:44.499Z\"),\n started_at=parse_datetime(\"2024-09-02T19:02:23.015Z\"),\n ends_at=parse_datetime(\"2023-08-19T21:45:43.735Z\"),\n ended_at=parse_datetime(\"2023-03-15T19:14:53.866Z\"),\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\": 1258.71,\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=\"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 created_at=parse_datetime(\"2023-05-15T22:05:41.858Z\"),\n modified_at=parse_datetime(\"2024-01-31T16:35:38.441Z\"),\n id=\"\",\n name=\"\",\n description=\"around disposer scholarship zowie chow pish afore typify harvest\",\n recurring_interval=None,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n metadata={\n \"key\": 751680,\n },\n prices=[\n polar_sdk.LegacyRecurringProductPriceFree(\n created_at=parse_datetime(\"2023-06-14T06:12:12.351Z\"),\n modified_at=parse_datetime(\"2025-12-04T13:50:03.874Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n ),\n ],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/etc/namedb\",\n mime_type=\"\",\n size=377784,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-01-27T12:39:41.519Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2025-11-29T13:54:30.761Z\"),\n size_readable=\"\",\n public_url=\"https://tangible-maintainer.name/\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=728623,\n created_at=parse_datetime(\"2025-12-01T13:59:05.249Z\"),\n modified_at=parse_datetime(\"2023-05-31T15:26:51.884Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-12-18T04:49:27.384Z\"),\n ends_at=parse_datetime(\"2024-07-25T11:55:55.184Z\"),\n max_redemptions=166124,\n redemptions_count=123839,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2025-12-26T01:33:27.412Z\"),\n modified_at=parse_datetime(\"2025-01-02T18:50:53.887Z\"),\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-23T22:50:26.075Z\"),\n modified_at=None,\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.OR,\n clauses=[\n polar_sdk.FilterClause(\n property=\"\",\n operator=polar_sdk.FilterOperator.NE,\n value=\"\",\n ),\n ],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.MAX,\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_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=119240,\n currency=\"Zambian Kwacha\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n status=polar_sdk.SubscriptionStatus.TRIALING,\n current_period_start=parse_datetime(\"2024-02-03T21:22:53.116Z\"),\n current_period_end=parse_datetime(\"2023-10-20T18:48:25.568Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-09-10T12:12:44.499Z\"),\n started_at=parse_datetime(\"2024-09-02T19:02:23.015Z\"),\n ends_at=parse_datetime(\"2023-08-19T21:45:43.735Z\"),\n ended_at=parse_datetime(\"2023-03-15T19:14:53.866Z\"),\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\": 1258.71,\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 created_at=parse_datetime(\"2023-05-15T22:05:41.858Z\"),\n modified_at=parse_datetime(\"2024-01-31T16:35:38.441Z\"),\n id=\"\",\n name=\"\",\n description=\"around disposer scholarship zowie chow pish afore typify harvest\",\n recurring_interval=None,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n metadata={\n \"key\": 751680,\n },\n prices=[\n polar_sdk.LegacyRecurringProductPriceFree(\n created_at=parse_datetime(\"2023-06-14T06:12:12.351Z\"),\n modified_at=parse_datetime(\"2025-12-04T13:50:03.874Z\"),\n id=\"\",\n is_archived=True,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n ),\n ],\n benefits=[],\n medias=[\n polar_sdk.ProductMediaFileRead(\n id=\"\",\n organization_id=\"\",\n name=\"\",\n path=\"/etc/namedb\",\n mime_type=\"\",\n size=377784,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2025-01-27T12:39:41.519Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2025-11-29T13:54:30.761Z\"),\n size_readable=\"\",\n public_url=\"https://tangible-maintainer.name/\",\n ),\n ],\n attached_custom_fields=[],\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=728623,\n created_at=parse_datetime(\"2025-12-01T13:59:05.249Z\"),\n modified_at=parse_datetime(\"2023-05-31T15:26:51.884Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-12-18T04:49:27.384Z\"),\n ends_at=parse_datetime(\"2024-07-25T11:55:55.184Z\"),\n max_redemptions=166124,\n redemptions_count=123839,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2025-12-26T01:33:27.412Z\"),\n modified_at=parse_datetime(\"2025-01-02T18:50:53.887Z\"),\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-23T22:50:26.075Z\"),\n modified_at=None,\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.OR,\n clauses=[\n polar_sdk.FilterClause(\n property=\"\",\n operator=polar_sdk.FilterOperator.NE,\n value=\"\",\n ),\n ],\n ),\n aggregation=polar_sdk.PropertyAggregation(\n func=polar_sdk.Func.MAX,\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\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=88813,\n currency=\"Syrian Pound\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=parse_datetime(\"2025-03-19T11:29:47.842Z\"),\n current_period_end=parse_datetime(\"2023-11-20T08:24:19.529Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-02-14T23:20:57.498Z\"),\n started_at=parse_datetime(\"2025-04-28T23:19:31.379Z\"),\n ends_at=parse_datetime(\"2023-04-29T06:37:50.213Z\"),\n ended_at=parse_datetime(\"2024-02-16T22:20:38.685Z\"),\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 \"key\": 8599.31,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-12-12T02:48:12.123Z\"),\n modified_at=parse_datetime(\"2025-08-13T10:16:30.587Z\"),\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=\"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-12-02T01:39:05.956Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2023-07-14T08:43:45.509Z\"),\n modified_at=parse_datetime(\"2025-05-31T05:10:14.997Z\"),\n id=\"\",\n name=\"\",\n description=\"inside overburden quarrelsome outrun phew whose\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldSelect(\n created_at=parse_datetime(\"2024-11-20T10:35:27.268Z\"),\n modified_at=parse_datetime(\"2024-12-28T11:50:23.357Z\"),\n id=\"\",\n metadata={\n \"key\": 939457,\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldSelectProperties(\n options=[],\n ),\n ),\n order=518934,\n required=True,\n ),\n ],\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=956675,\n type=polar_sdk.DiscountType.FIXED,\n amount=318678,\n currency=\"Won\",\n created_at=parse_datetime(\"2024-06-28T04:33:55.419Z\"),\n modified_at=parse_datetime(\"2023-04-08T23:58:31.520Z\"),\n id=\"\",\n metadata={\n \"key\": True,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-01-18T23:12:00.000Z\"),\n ends_at=None,\n max_redemptions=841467,\n redemptions_count=431905,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2023-01-12T15:01:17.401Z\"),\n modified_at=parse_datetime(\"2024-03-19T23:35:08.612Z\"),\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\": 463129,\n },\n created_at=parse_datetime(\"2023-11-24T08:24:04.782Z\"),\n modified_at=parse_datetime(\"2025-06-04T07:43:03.654Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[\n polar_sdk.FilterClause(\n property=\"\",\n operator=polar_sdk.FilterOperator.GTE,\n value=True,\n ),\n ],\n ),\n aggregation=polar_sdk.UniqueAggregation(\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_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=88813,\n currency=\"Syrian Pound\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=parse_datetime(\"2025-03-19T11:29:47.842Z\"),\n current_period_end=parse_datetime(\"2023-11-20T08:24:19.529Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-02-14T23:20:57.498Z\"),\n started_at=parse_datetime(\"2025-04-28T23:19:31.379Z\"),\n ends_at=parse_datetime(\"2023-04-29T06:37:50.213Z\"),\n ended_at=parse_datetime(\"2024-02-16T22:20:38.685Z\"),\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 \"key\": 8599.31,\n },\n customer=polar_sdk.SubscriptionCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-12-12T02:48:12.123Z\"),\n modified_at=parse_datetime(\"2025-08-13T10:16:30.587Z\"),\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-12-02T01:39:05.956Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2023-07-14T08:43:45.509Z\"),\n modified_at=parse_datetime(\"2025-05-31T05:10:14.997Z\"),\n id=\"\",\n name=\"\",\n description=\"inside overburden quarrelsome outrun phew whose\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n metadata={\n\n },\n prices=[],\n benefits=[],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldSelect(\n created_at=parse_datetime(\"2024-11-20T10:35:27.268Z\"),\n modified_at=parse_datetime(\"2024-12-28T11:50:23.357Z\"),\n id=\"\",\n metadata={\n \"key\": 939457,\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldSelectProperties(\n options=[],\n ),\n ),\n order=518934,\n required=True,\n ),\n ],\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=956675,\n type=polar_sdk.DiscountType.FIXED,\n amount=318678,\n currency=\"Won\",\n created_at=parse_datetime(\"2024-06-28T04:33:55.419Z\"),\n modified_at=parse_datetime(\"2023-04-08T23:58:31.520Z\"),\n id=\"\",\n metadata={\n \"key\": True,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-01-18T23:12:00.000Z\"),\n ends_at=None,\n max_redemptions=841467,\n redemptions_count=431905,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[],\n meters=[\n polar_sdk.SubscriptionMeter(\n created_at=parse_datetime(\"2023-01-12T15:01:17.401Z\"),\n modified_at=parse_datetime(\"2024-03-19T23:35:08.612Z\"),\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\": 463129,\n },\n created_at=parse_datetime(\"2023-11-24T08:24:04.782Z\"),\n modified_at=parse_datetime(\"2025-06-04T07:43:03.654Z\"),\n id=\"\",\n name=\"\",\n filter_=polar_sdk.Filter(\n conjunction=polar_sdk.FilterConjunction.AND,\n clauses=[\n polar_sdk.FilterClause(\n property=\"\",\n operator=polar_sdk.FilterOperator.GTE,\n value=True,\n ),\n ],\n ),\n aggregation=polar_sdk.UniqueAggregation(\n property=\"\",\n ),\n organization_id=\"\",\n ),\n ),\n ],\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=755736,\n currency=\"Iceland Krona\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2024-04-11T19:08:16.655Z\"),\n current_period_end=parse_datetime(\"2023-08-23T01:03:59.107Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-11-16T02:01:16.824Z\"),\n started_at=None,\n ends_at=parse_datetime(\"2023-12-23T04:50:00.016Z\"),\n ended_at=parse_datetime(\"2024-10-18T16:25:47.209Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=None,\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.LOW_QUALITY,\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-10-01T20:42:25.530Z\"),\n modified_at=parse_datetime(\"2024-07-04T17:30:56.477Z\"),\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=\"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-12-20T09:31:52.259Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2024-03-26T06:19:23.237Z\"),\n modified_at=parse_datetime(\"2024-05-11T18:08:21.251Z\"),\n id=\"\",\n name=\"\",\n description=\"questioningly proliferate yet vanish mooch yowza hopeful\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=True,\n is_archived=True,\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/local/src\",\n mime_type=\"\",\n size=930595,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-07-09T11:35:46.121Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2023-01-04T05:09:14.269Z\"),\n size_readable=\"\",\n public_url=\"https://distant-fen.org/\",\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=930,\n currency=\"Armenian Dram\",\n created_at=parse_datetime(\"2024-08-04T07:10:18.397Z\"),\n modified_at=parse_datetime(\"2024-03-24T21:29:58.344Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-01-07T18:49:53.331Z\"),\n ends_at=parse_datetime(\"2023-11-21T17:11:26.125Z\"),\n max_redemptions=None,\n redemptions_count=198129,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2024-08-25T04:34:39.417Z\"),\n modified_at=parse_datetime(\"2024-09-10T10:32:32.710Z\"),\n id=\"\",\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n price_currency=\"\",\n price_amount=456635,\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_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=755736,\n currency=\"Iceland Krona\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2024-04-11T19:08:16.655Z\"),\n current_period_end=parse_datetime(\"2023-08-23T01:03:59.107Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2024-11-16T02:01:16.824Z\"),\n started_at=None,\n ends_at=parse_datetime(\"2023-12-23T04:50:00.016Z\"),\n ended_at=parse_datetime(\"2024-10-18T16:25:47.209Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=None,\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.LOW_QUALITY,\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-10-01T20:42:25.530Z\"),\n modified_at=parse_datetime(\"2024-07-04T17:30:56.477Z\"),\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-12-20T09:31:52.259Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2024-03-26T06:19:23.237Z\"),\n modified_at=parse_datetime(\"2024-05-11T18:08:21.251Z\"),\n id=\"\",\n name=\"\",\n description=\"questioningly proliferate yet vanish mooch yowza hopeful\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=True,\n is_archived=True,\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/local/src\",\n mime_type=\"\",\n size=930595,\n storage_version=\"\",\n checksum_etag=\"\",\n checksum_sha256_base64=\"\",\n checksum_sha256_hex=\"\",\n last_modified_at=parse_datetime(\"2024-07-09T11:35:46.121Z\"),\n version=\"\",\n is_uploaded=False,\n created_at=parse_datetime(\"2023-01-04T05:09:14.269Z\"),\n size_readable=\"\",\n public_url=\"https://distant-fen.org/\",\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=930,\n currency=\"Armenian Dram\",\n created_at=parse_datetime(\"2024-08-04T07:10:18.397Z\"),\n modified_at=parse_datetime(\"2024-03-24T21:29:58.344Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-01-07T18:49:53.331Z\"),\n ends_at=parse_datetime(\"2023-11-21T17:11:26.125Z\"),\n max_redemptions=None,\n redemptions_count=198129,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n prices=[\n polar_sdk.LegacyRecurringProductPriceFixed(\n created_at=parse_datetime(\"2024-08-25T04:34:39.417Z\"),\n modified_at=parse_datetime(\"2024-09-10T10:32:32.710Z\"),\n id=\"\",\n is_archived=False,\n product_id=\"\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n price_currency=\"\",\n price_amount=456635,\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=337528,\n currency=\"Kip\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2023-06-14T15:07:05.619Z\"),\n current_period_end=parse_datetime(\"2025-04-17T18:51:57.213Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2025-12-29T02:13:52.269Z\"),\n started_at=parse_datetime(\"2024-10-12T01:39:46.850Z\"),\n ends_at=parse_datetime(\"2024-08-23T08:17:41.246Z\"),\n ended_at=parse_datetime(\"2025-04-28T14:07:35.212Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_COMPLEX,\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-07T17:53:19.130Z\"),\n modified_at=parse_datetime(\"2024-03-22T08:08:02.561Z\"),\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=\"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-20T00:06:47.924Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2024-01-24T02:08:13.039Z\"),\n modified_at=parse_datetime(\"2024-04-21T20:23:52.355Z\"),\n id=\"\",\n name=\"\",\n description=\"what swelter when besides utter phew knottily\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n metadata={\n\n },\n prices=[\n polar_sdk.ProductPriceMeteredUnit(\n created_at=parse_datetime(\"2025-11-03T01:17:12.036Z\"),\n modified_at=parse_datetime(\"2025-08-26T21:48:44.664Z\"),\n id=\"\",\n is_archived=False,\n product_id=\"\",\n type=polar_sdk.ProductPriceType.ONE_TIME,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n unit_amount=\"\",\n cap_amount=71731,\n meter_id=\"\",\n meter=polar_sdk.ProductPriceMeter(\n id=\"\",\n name=\"\",\n ),\n ),\n ],\n benefits=[],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldSelect(\n created_at=parse_datetime(\"2023-09-02T08:42:27.221Z\"),\n modified_at=parse_datetime(\"2024-10-15T08:38:18.868Z\"),\n id=\"\",\n metadata={\n\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldSelectProperties(\n options=[\n polar_sdk.CustomFieldSelectOption(\n value=\"\",\n label=\"\",\n ),\n ],\n ),\n ),\n order=132406,\n required=True,\n ),\n ],\n ),\n discount=None,\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_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=337528,\n currency=\"Kip\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2023-06-14T15:07:05.619Z\"),\n current_period_end=parse_datetime(\"2025-04-17T18:51:57.213Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2025-12-29T02:13:52.269Z\"),\n started_at=parse_datetime(\"2024-10-12T01:39:46.850Z\"),\n ends_at=parse_datetime(\"2024-08-23T08:17:41.246Z\"),\n ended_at=parse_datetime(\"2025-04-28T14:07:35.212Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.TOO_COMPLEX,\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-07T17:53:19.130Z\"),\n modified_at=parse_datetime(\"2024-03-22T08:08:02.561Z\"),\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-20T00:06:47.924Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.Product(\n created_at=parse_datetime(\"2024-01-24T02:08:13.039Z\"),\n modified_at=parse_datetime(\"2024-04-21T20:23:52.355Z\"),\n id=\"\",\n name=\"\",\n description=\"what swelter when besides utter phew knottily\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n metadata={\n\n },\n prices=[\n polar_sdk.ProductPriceMeteredUnit(\n created_at=parse_datetime(\"2025-11-03T01:17:12.036Z\"),\n modified_at=parse_datetime(\"2025-08-26T21:48:44.664Z\"),\n id=\"\",\n is_archived=False,\n product_id=\"\",\n type=polar_sdk.ProductPriceType.ONE_TIME,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n price_currency=\"\",\n unit_amount=\"\",\n cap_amount=71731,\n meter_id=\"\",\n meter=polar_sdk.ProductPriceMeter(\n id=\"\",\n name=\"\",\n ),\n ),\n ],\n benefits=[],\n medias=[],\n attached_custom_fields=[\n polar_sdk.AttachedCustomField(\n custom_field_id=\"\",\n custom_field=polar_sdk.CustomFieldSelect(\n created_at=parse_datetime(\"2023-09-02T08:42:27.221Z\"),\n modified_at=parse_datetime(\"2024-10-15T08:38:18.868Z\"),\n id=\"\",\n metadata={\n\n },\n slug=\"\",\n name=\"\",\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n properties=polar_sdk.CustomFieldSelectProperties(\n options=[\n polar_sdk.CustomFieldSelectOption(\n value=\"\",\n label=\"\",\n ),\n ],\n ),\n ),\n order=132406,\n required=True,\n ),\n ],\n ),\n discount=None,\n prices=[],\n meters=[],\n ),\n ))\n\n # Handle response\n print(res)" diff --git a/docs/models/address.md b/docs/models/address.md index 6ec38d4b..4024d518 100644 --- a/docs/models/address.md +++ b/docs/models/address.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `line1` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `line2` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `postal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `state` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `country` | *str* | :heavy_check_mark: | N/A | US | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `line1` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `line2` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `postal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `state` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `country` | [models.CountryAlpha2](../models/countryalpha2.md) | :heavy_check_mark: | N/A | US | \ No newline at end of file diff --git a/docs/models/addressinput.md b/docs/models/addressinput.md new file mode 100644 index 00000000..efeb0382 --- /dev/null +++ b/docs/models/addressinput.md @@ -0,0 +1,13 @@ +# AddressInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `line1` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `line2` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `postal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `state` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `country` | [models.CountryAlpha2Input](../models/countryalpha2input.md) | :heavy_check_mark: | N/A | US | \ No newline at end of file diff --git a/docs/models/benefitgrant.md b/docs/models/benefitgrant.md index 7ce68ef6..1f94aaa2 100644 --- a/docs/models/benefitgrant.md +++ b/docs/models/benefitgrant.md @@ -18,4 +18,5 @@ | `benefit_id` | *str* | :heavy_check_mark: | The ID of the benefit concerned by this grant. | | `error` | [OptionalNullable[models.BenefitGrantError]](../models/benefitgranterror.md) | :heavy_minus_sign: | The error information if the benefit grant failed with an unrecoverable error. | | `customer` | [models.Customer](../models/customer.md) | :heavy_check_mark: | A customer in an organization. | +| `benefit` | [models.Benefit](../models/benefit.md) | :heavy_check_mark: | N/A | | `properties` | [models.Properties](../models/properties.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/benefitgrantslistqueryparamcustomeridfilter.md b/docs/models/benefitgrantslistqueryparamcustomeridfilter.md new file mode 100644 index 00000000..1508fef1 --- /dev/null +++ b/docs/models/benefitgrantslistqueryparamcustomeridfilter.md @@ -0,0 +1,19 @@ +# BenefitGrantsListQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/benefitgrantslistqueryparamorganizationidfilter.md b/docs/models/benefitgrantslistqueryparamorganizationidfilter.md new file mode 100644 index 00000000..081df438 --- /dev/null +++ b/docs/models/benefitgrantslistqueryparamorganizationidfilter.md @@ -0,0 +1,19 @@ +# BenefitGrantsListQueryParamOrganizationIDFilter + +Filter by organization ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/benefitgrantslistrequest.md b/docs/models/benefitgrantslistrequest.md new file mode 100644 index 00000000..a4e855c5 --- /dev/null +++ b/docs/models/benefitgrantslistrequest.md @@ -0,0 +1,13 @@ +# BenefitGrantsListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.BenefitGrantsListQueryParamOrganizationIDFilter]](../models/benefitgrantslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.BenefitGrantsListQueryParamCustomerIDFilter]](../models/benefitgrantslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `is_granted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned. | +| `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.BenefitGrantSortProperty](../models/benefitgrantsortproperty.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. | \ No newline at end of file diff --git a/docs/models/benefitgrantslistresponse.md b/docs/models/benefitgrantslistresponse.md new file mode 100644 index 00000000..44fa213e --- /dev/null +++ b/docs/models/benefitgrantslistresponse.md @@ -0,0 +1,8 @@ +# BenefitGrantsListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `result` | [models.ListResourceBenefitGrant](../models/listresourcebenefitgrant.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/benefitgrantsortproperty.md b/docs/models/benefitgrantsortproperty.md new file mode 100644 index 00000000..c1c0ac1f --- /dev/null +++ b/docs/models/benefitgrantsortproperty.md @@ -0,0 +1,13 @@ +# BenefitGrantSortProperty + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `CREATED_AT` | created_at | +| `MINUS_CREATED_AT` | -created_at | +| `GRANTED_AT` | granted_at | +| `MINUS_GRANTED_AT` | -granted_at | +| `REVOKED_AT` | revoked_at | +| `MINUS_REVOKED_AT` | -revoked_at | \ No newline at end of file diff --git a/docs/models/canceledsubscriptions.md b/docs/models/canceledsubscriptions.md new file mode 100644 index 00000000..73d2cd4e --- /dev/null +++ b/docs/models/canceledsubscriptions.md @@ -0,0 +1,17 @@ +# CanceledSubscriptions + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionscustomerservice.md b/docs/models/canceledsubscriptionscustomerservice.md new file mode 100644 index 00000000..6b69b109 --- /dev/null +++ b/docs/models/canceledsubscriptionscustomerservice.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsCustomerService + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionslowquality.md b/docs/models/canceledsubscriptionslowquality.md new file mode 100644 index 00000000..c7381337 --- /dev/null +++ b/docs/models/canceledsubscriptionslowquality.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsLowQuality + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionsmissingfeatures.md b/docs/models/canceledsubscriptionsmissingfeatures.md new file mode 100644 index 00000000..10d8d9d4 --- /dev/null +++ b/docs/models/canceledsubscriptionsmissingfeatures.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsMissingFeatures + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionsother.md b/docs/models/canceledsubscriptionsother.md new file mode 100644 index 00000000..e9813e10 --- /dev/null +++ b/docs/models/canceledsubscriptionsother.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsOther + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionsswitchedservice.md b/docs/models/canceledsubscriptionsswitchedservice.md new file mode 100644 index 00000000..259b27f2 --- /dev/null +++ b/docs/models/canceledsubscriptionsswitchedservice.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsSwitchedService + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionstoocomplex.md b/docs/models/canceledsubscriptionstoocomplex.md new file mode 100644 index 00000000..0ed235bc --- /dev/null +++ b/docs/models/canceledsubscriptionstoocomplex.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsTooComplex + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionstooexpensive.md b/docs/models/canceledsubscriptionstooexpensive.md new file mode 100644 index 00000000..91385f10 --- /dev/null +++ b/docs/models/canceledsubscriptionstooexpensive.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsTooExpensive + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/canceledsubscriptionsunused.md b/docs/models/canceledsubscriptionsunused.md new file mode 100644 index 00000000..9825c7bf --- /dev/null +++ b/docs/models/canceledsubscriptionsunused.md @@ -0,0 +1,17 @@ +# CanceledSubscriptionsUnused + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/checkoutconfirmstripe.md b/docs/models/checkoutconfirmstripe.md index 55e472a9..504aca92 100644 --- a/docs/models/checkoutconfirmstripe.md +++ b/docs/models/checkoutconfirmstripe.md @@ -15,7 +15,7 @@ Confirm a checkout session using a Stripe confirmation token. | `customer_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `customer_billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | +| `customer_billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | `customer_tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `discount_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Discount code to apply to the checkout. | | `confirmation_token_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the Stripe confirmation token. Required for fixed prices and custom prices. | \ No newline at end of file diff --git a/docs/models/checkoutcreate.md b/docs/models/checkoutcreate.md index de4a4020..8dc601ac 100644 --- a/docs/models/checkoutcreate.md +++ b/docs/models/checkoutcreate.md @@ -24,7 +24,7 @@ to the resulting order and/or subscription. | `customer_email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_ip_address` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `customer_billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | +| `customer_billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | `customer_tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_metadata` | Dict[str, [models.CheckoutCreateCustomerMetadata](../models/checkoutcreatecustomermetadata.md)] | :heavy_minus_sign: | Key-value object allowing you to store additional information that'll be copied to the created customer.

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**. | | `subscription_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of a subscription to upgrade. It must be on a free pricing. If checkout is successful, metadata set on this checkout will be copied to the subscription, and existing keys will be overwritten. | diff --git a/docs/models/checkoutupdate.md b/docs/models/checkoutupdate.md index dc60b065..68804767 100644 --- a/docs/models/checkoutupdate.md +++ b/docs/models/checkoutupdate.md @@ -15,7 +15,7 @@ Update an existing checkout session using an access token. | `customer_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `customer_billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | +| `customer_billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | `customer_tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `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**. | | `discount_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the discount to apply to the checkout. | diff --git a/docs/models/checkoutupdatepublic.md b/docs/models/checkoutupdatepublic.md index db9a63fe..492be53a 100644 --- a/docs/models/checkoutupdatepublic.md +++ b/docs/models/checkoutupdatepublic.md @@ -15,6 +15,6 @@ Update an existing checkout session using the client secret. | `customer_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `customer_billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `customer_billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | +| `customer_billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | `customer_tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `discount_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Discount code to apply to the checkout. | \ No newline at end of file diff --git a/docs/models/countryalpha2.md b/docs/models/countryalpha2.md new file mode 100644 index 00000000..9ebbef1e --- /dev/null +++ b/docs/models/countryalpha2.md @@ -0,0 +1,256 @@ +# CountryAlpha2 + + +## Values + +| Name | Value | +| ----- | ----- | +| `BH` | BH | +| `CI` | CI | +| `CW` | CW | +| `BS` | BS | +| `RE` | RE | +| `GD` | GD | +| `TN` | TN | +| `NC` | NC | +| `CC` | CC | +| `MG` | MG | +| `VE` | VE | +| `GY` | GY | +| `DJ` | DJ | +| `SJ` | SJ | +| `TM` | TM | +| `SG` | SG | +| `AO` | AO | +| `ID` | ID | +| `JM` | JM | +| `JO` | JO | +| `GG` | GG | +| `FM` | FM | +| `BO` | BO | +| `NU` | NU | +| `SI` | SI | +| `BV` | BV | +| `CM` | CM | +| `LA` | LA | +| `KG` | KG | +| `LC` | LC | +| `MV` | MV | +| `TT` | TT | +| `TO` | TO | +| `GB` | GB | +| `UG` | UG | +| `TR` | TR | +| `AI` | AI | +| `SH` | SH | +| `BF` | BF | +| `RU` | RU | +| `IT` | IT | +| `KW` | KW | +| `TW` | TW | +| `HK` | HK | +| `AW` | AW | +| `LB` | LB | +| `LY` | LY | +| `VI` | VI | +| `CD` | CD | +| `ES` | ES | +| `PA` | PA | +| `MN` | MN | +| `MS` | MS | +| `VG` | VG | +| `SA` | SA | +| `BT` | BT | +| `ER` | ER | +| `UA` | UA | +| `HN` | HN | +| `AG` | AG | +| `VN` | VN | +| `MA` | MA | +| `PG` | PG | +| `TH` | TH | +| `KP` | KP | +| `EE` | EE | +| `MU` | MU | +| `CR` | CR | +| `GE` | GE | +| `GR` | GR | +| `MR` | MR | +| `ZW` | ZW | +| `TC` | TC | +| `CK` | CK | +| `GW` | GW | +| `HR` | HR | +| `LT` | LT | +| `QA` | QA | +| `MO` | MO | +| `AD` | AD | +| `FR` | FR | +| `KM` | KM | +| `GS` | GS | +| `BG` | BG | +| `NG` | NG | +| `AS` | AS | +| `ZA` | ZA | +| `PT` | PT | +| `NP` | NP | +| `RW` | RW | +| `GL` | GL | +| `RS` | RS | +| `MQ` | MQ | +| `CV` | CV | +| `GQ` | GQ | +| `MF` | MF | +| `MH` | MH | +| `GP` | GP | +| `KN` | KN | +| `WF` | WF | +| `FJ` | FJ | +| `FK` | FK | +| `ME` | ME | +| `NE` | NE | +| `GM` | GM | +| `GH` | GH | +| `SV` | SV | +| `HM` | HM | +| `BN` | BN | +| `GA` | GA | +| `PY` | PY | +| `BL` | BL | +| `EG` | EG | +| `SE` | SE | +| `FO` | FO | +| `VA` | VA | +| `TK` | TK | +| `YE` | YE | +| `DM` | DM | +| `NL` | NL | +| `MK` | MK | +| `UZ` | UZ | +| `IN` | IN | +| `TL` | TL | +| `IQ` | IQ | +| `BZ` | BZ | +| `MC` | MC | +| `BJ` | BJ | +| `AE` | AE | +| `PN` | PN | +| `KE` | KE | +| `CX` | CX | +| `AQ` | AQ | +| `EH` | EH | +| `IR` | IR | +| `ST` | ST | +| `MZ` | MZ | +| `SC` | SC | +| `SM` | SM | +| `IM` | IM | +| `TJ` | TJ | +| `PS` | PS | +| `MT` | MT | +| `SK` | SK | +| `BY` | BY | +| `IL` | IL | +| `CY` | CY | +| `BM` | BM | +| `SR` | SR | +| `AM` | AM | +| `PE` | PE | +| `WS` | WS | +| `FI` | FI | +| `LI` | LI | +| `NO` | NO | +| `GF` | GF | +| `NR` | NR | +| `BI` | BI | +| `SD` | SD | +| `MP` | MP | +| `JE` | JE | +| `CA` | CA | +| `EC` | EC | +| `HU` | HU | +| `SO` | SO | +| `TZ` | TZ | +| `CN` | CN | +| `VC` | VC | +| `SZ` | SZ | +| `ML` | ML | +| `BD` | BD | +| `GN` | GN | +| `KI` | KI | +| `DO` | DO | +| `SX` | SX | +| `UM` | UM | +| `CF` | CF | +| `PW` | PW | +| `ZM` | ZM | +| `TF` | TF | +| `TG` | TG | +| `IS` | IS | +| `YT` | YT | +| `DE` | DE | +| `DZ` | DZ | +| `UY` | UY | +| `AF` | AF | +| `BE` | BE | +| `KZ` | KZ | +| `NZ` | NZ | +| `PL` | PL | +| `PF` | PF | +| `AT` | AT | +| `AZ` | AZ | +| `BR` | BR | +| `GI` | GI | +| `TD` | TD | +| `CO` | CO | +| `ET` | ET | +| `MD` | MD | +| `MW` | MW | +| `OM` | OM | +| `PH` | PH | +| `IE` | IE | +| `KR` | KR | +| `PK` | PK | +| `AU` | AU | +| `NI` | NI | +| `RO` | RO | +| `SY` | SY | +| `CU` | CU | +| `LU` | LU | +| `MX` | MX | +| `AR` | AR | +| `NA` | NA | +| `DK` | DK | +| `MM` | MM | +| `AX` | AX | +| `CH` | CH | +| `NF` | NF | +| `LR` | LR | +| `SN` | SN | +| `GU` | GU | +| `CL` | CL | +| `PM` | PM | +| `US` | US | +| `GT` | GT | +| `AL` | AL | +| `VU` | VU | +| `PR` | PR | +| `SB` | SB | +| `SS` | SS | +| `JP` | JP | +| `KH` | KH | +| `LS` | LS | +| `SL` | SL | +| `KY` | KY | +| `IO` | IO | +| `BB` | BB | +| `HT` | HT | +| `CZ` | CZ | +| `LV` | LV | +| `BA` | BA | +| `MY` | MY | +| `BW` | BW | +| `TV` | TV | +| `BQ` | BQ | +| `LK` | LK | +| `CG` | CG | \ No newline at end of file diff --git a/docs/models/countryalpha2input.md b/docs/models/countryalpha2input.md new file mode 100644 index 00000000..c98d7b2f --- /dev/null +++ b/docs/models/countryalpha2input.md @@ -0,0 +1,251 @@ +# CountryAlpha2Input + + +## Values + +| Name | Value | +| ----- | ----- | +| `BH` | BH | +| `CI` | CI | +| `CW` | CW | +| `BS` | BS | +| `RE` | RE | +| `GD` | GD | +| `TN` | TN | +| `NC` | NC | +| `CC` | CC | +| `MG` | MG | +| `VE` | VE | +| `GY` | GY | +| `DJ` | DJ | +| `SJ` | SJ | +| `TM` | TM | +| `SG` | SG | +| `AO` | AO | +| `ID` | ID | +| `JM` | JM | +| `JO` | JO | +| `GG` | GG | +| `FM` | FM | +| `BO` | BO | +| `NU` | NU | +| `SI` | SI | +| `BV` | BV | +| `CM` | CM | +| `LA` | LA | +| `KG` | KG | +| `LC` | LC | +| `MV` | MV | +| `TT` | TT | +| `TO` | TO | +| `GB` | GB | +| `UG` | UG | +| `TR` | TR | +| `AI` | AI | +| `SH` | SH | +| `BF` | BF | +| `IT` | IT | +| `KW` | KW | +| `TW` | TW | +| `HK` | HK | +| `AW` | AW | +| `LB` | LB | +| `LY` | LY | +| `VI` | VI | +| `CD` | CD | +| `ES` | ES | +| `PA` | PA | +| `MN` | MN | +| `MS` | MS | +| `VG` | VG | +| `SA` | SA | +| `BT` | BT | +| `ER` | ER | +| `UA` | UA | +| `HN` | HN | +| `AG` | AG | +| `VN` | VN | +| `MA` | MA | +| `PG` | PG | +| `TH` | TH | +| `EE` | EE | +| `MU` | MU | +| `CR` | CR | +| `GE` | GE | +| `GR` | GR | +| `MR` | MR | +| `ZW` | ZW | +| `TC` | TC | +| `CK` | CK | +| `GW` | GW | +| `HR` | HR | +| `LT` | LT | +| `QA` | QA | +| `MO` | MO | +| `AD` | AD | +| `FR` | FR | +| `KM` | KM | +| `GS` | GS | +| `BG` | BG | +| `NG` | NG | +| `AS` | AS | +| `ZA` | ZA | +| `PT` | PT | +| `NP` | NP | +| `RW` | RW | +| `GL` | GL | +| `RS` | RS | +| `MQ` | MQ | +| `CV` | CV | +| `GQ` | GQ | +| `MF` | MF | +| `MH` | MH | +| `GP` | GP | +| `KN` | KN | +| `WF` | WF | +| `FJ` | FJ | +| `FK` | FK | +| `ME` | ME | +| `NE` | NE | +| `GM` | GM | +| `GH` | GH | +| `SV` | SV | +| `HM` | HM | +| `BN` | BN | +| `GA` | GA | +| `PY` | PY | +| `BL` | BL | +| `EG` | EG | +| `SE` | SE | +| `FO` | FO | +| `VA` | VA | +| `TK` | TK | +| `YE` | YE | +| `DM` | DM | +| `NL` | NL | +| `MK` | MK | +| `UZ` | UZ | +| `IN` | IN | +| `TL` | TL | +| `IQ` | IQ | +| `BZ` | BZ | +| `MC` | MC | +| `BJ` | BJ | +| `AE` | AE | +| `PN` | PN | +| `KE` | KE | +| `CX` | CX | +| `AQ` | AQ | +| `EH` | EH | +| `ST` | ST | +| `MZ` | MZ | +| `SC` | SC | +| `SM` | SM | +| `IM` | IM | +| `TJ` | TJ | +| `PS` | PS | +| `MT` | MT | +| `SK` | SK | +| `BY` | BY | +| `IL` | IL | +| `CY` | CY | +| `BM` | BM | +| `SR` | SR | +| `AM` | AM | +| `PE` | PE | +| `WS` | WS | +| `FI` | FI | +| `LI` | LI | +| `NO` | NO | +| `GF` | GF | +| `NR` | NR | +| `BI` | BI | +| `SD` | SD | +| `MP` | MP | +| `JE` | JE | +| `CA` | CA | +| `EC` | EC | +| `HU` | HU | +| `SO` | SO | +| `TZ` | TZ | +| `CN` | CN | +| `VC` | VC | +| `SZ` | SZ | +| `ML` | ML | +| `BD` | BD | +| `GN` | GN | +| `KI` | KI | +| `DO` | DO | +| `SX` | SX | +| `UM` | UM | +| `CF` | CF | +| `PW` | PW | +| `ZM` | ZM | +| `TF` | TF | +| `TG` | TG | +| `IS` | IS | +| `YT` | YT | +| `DE` | DE | +| `DZ` | DZ | +| `UY` | UY | +| `AF` | AF | +| `BE` | BE | +| `KZ` | KZ | +| `NZ` | NZ | +| `PL` | PL | +| `PF` | PF | +| `AT` | AT | +| `AZ` | AZ | +| `BR` | BR | +| `GI` | GI | +| `TD` | TD | +| `CO` | CO | +| `ET` | ET | +| `MD` | MD | +| `MW` | MW | +| `OM` | OM | +| `PH` | PH | +| `IE` | IE | +| `KR` | KR | +| `PK` | PK | +| `AU` | AU | +| `NI` | NI | +| `RO` | RO | +| `LU` | LU | +| `MX` | MX | +| `AR` | AR | +| `NA` | NA | +| `DK` | DK | +| `MM` | MM | +| `AX` | AX | +| `CH` | CH | +| `NF` | NF | +| `LR` | LR | +| `SN` | SN | +| `GU` | GU | +| `CL` | CL | +| `PM` | PM | +| `US` | US | +| `GT` | GT | +| `AL` | AL | +| `VU` | VU | +| `PR` | PR | +| `SB` | SB | +| `SS` | SS | +| `JP` | JP | +| `KH` | KH | +| `LS` | LS | +| `SL` | SL | +| `KY` | KY | +| `IO` | IO | +| `BB` | BB | +| `HT` | HT | +| `CZ` | CZ | +| `LV` | LV | +| `BA` | BA | +| `MY` | MY | +| `BW` | BW | +| `TV` | TV | +| `BQ` | BQ | +| `LK` | LK | +| `CG` | CG | \ No newline at end of file diff --git a/docs/models/customercreate.md b/docs/models/customercreate.md index c7b979e3..cba7ed6c 100644 --- a/docs/models/customercreate.md +++ b/docs/models/customercreate.md @@ -9,6 +9,6 @@ | `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated. | usr_1337 | | `email` | *str* | :heavy_check_mark: | The email address of the customer. This must be unique within the organization. | customer@example.com | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the customer. | John Doe | -| `billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | | +| `billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | | `tax_id` | List[[Nullable[models.CustomerCreateTaxID]](../models/customercreatetaxid.md)] | :heavy_minus_sign: | N/A | [
"911144442",
"us_ein"
] | | `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the customer. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | \ No newline at end of file diff --git a/docs/models/customerorder.md b/docs/models/customerorder.md index d3ebc4c0..07f16d46 100644 --- a/docs/models/customerorder.md +++ b/docs/models/customerorder.md @@ -15,6 +15,7 @@ | `net_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts but before taxes. | | | `tax_amount` | *int* | :heavy_check_mark: | Sales tax amount in cents. | | | `total_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts and taxes. | | +| `from_balance_amount` | *int* | :heavy_check_mark: | How much of this invoice was paid using the customer's balance. Amount in cents. | | | `refunded_amount` | *int* | :heavy_check_mark: | Amount refunded in cents. | | | `refunded_tax_amount` | *int* | :heavy_check_mark: | Sales tax refunded in cents. | | | `currency` | *str* | :heavy_check_mark: | N/A | | diff --git a/docs/models/customerorderupdate.md b/docs/models/customerorderupdate.md index 189cef8e..c295d6cb 100644 --- a/docs/models/customerorderupdate.md +++ b/docs/models/customerorderupdate.md @@ -8,4 +8,4 @@ Schema to update an order. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. Can't be updated after the invoice is generated. | -| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated. | \ No newline at end of file +| `billing_address` | [Nullable[models.AddressInput]](../models/addressinput.md) | :heavy_check_mark: | The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated. | \ No newline at end of file diff --git a/docs/models/customerportalcustomerupdate.md b/docs/models/customerportalcustomerupdate.md index 4770cb91..c4b3b8f8 100644 --- a/docs/models/customerportalcustomerupdate.md +++ b/docs/models/customerportalcustomerupdate.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | -| `tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `billing_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | +| `tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/customersexportqueryparamorganizationid.md b/docs/models/customersexportqueryparamorganizationid.md new file mode 100644 index 00000000..c9a135c0 --- /dev/null +++ b/docs/models/customersexportqueryparamorganizationid.md @@ -0,0 +1,19 @@ +# CustomersExportQueryParamOrganizationID + +Filter by organization ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/customersexportrequest.md b/docs/models/customersexportrequest.md new file mode 100644 index 00000000..86d46db7 --- /dev/null +++ b/docs/models/customersexportrequest.md @@ -0,0 +1,8 @@ +# CustomersExportRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `organization_id` | [OptionalNullable[models.CustomersExportQueryParamOrganizationID]](../models/customersexportqueryparamorganizationid.md) | :heavy_minus_sign: | Filter by organization ID. | \ No newline at end of file diff --git a/docs/models/customerupdate.md b/docs/models/customerupdate.md index 209a70d3..79332344 100644 --- a/docs/models/customerupdate.md +++ b/docs/models/customerupdate.md @@ -8,6 +8,6 @@ | `metadata` | Dict[str, [models.CustomerUpdateMetadata](../models/customerupdatemetadata.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**. | | | `email` | *OptionalNullable[str]* | :heavy_minus_sign: | The email address of the customer. This must be unique within the organization. | customer@example.com | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the customer. | John Doe | -| `billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | | +| `billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | | `tax_id` | List[[Nullable[models.CustomerUpdateTaxID]](../models/customerupdatetaxid.md)] | :heavy_minus_sign: | N/A | [
"911144442",
"us_ein"
] | | `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated. | usr_1337 | \ No newline at end of file diff --git a/docs/models/customerupdateexternalid.md b/docs/models/customerupdateexternalid.md index b7723369..9be13009 100644 --- a/docs/models/customerupdateexternalid.md +++ b/docs/models/customerupdateexternalid.md @@ -8,5 +8,5 @@ | `metadata` | Dict[str, [models.CustomerUpdateExternalIDMetadata](../models/customerupdateexternalidmetadata.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**. | | | `email` | *OptionalNullable[str]* | :heavy_minus_sign: | The email address of the customer. This must be unique within the organization. | customer@example.com | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the customer. | John Doe | -| `billing_address` | [OptionalNullable[models.Address]](../models/address.md) | :heavy_minus_sign: | N/A | | +| `billing_address` | [OptionalNullable[models.AddressInput]](../models/addressinput.md) | :heavy_minus_sign: | N/A | | | `tax_id` | List[[Nullable[models.CustomerUpdateExternalIDTaxID]](../models/customerupdateexternalidtaxid.md)] | :heavy_minus_sign: | N/A | [
"911144442",
"us_ein"
] | \ No newline at end of file diff --git a/docs/models/metricperiod.md b/docs/models/metricperiod.md index 4b30a0b1..acaabe44 100644 --- a/docs/models/metricperiod.md +++ b/docs/models/metricperiod.md @@ -3,28 +3,37 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp of this period data. | -| `orders` | [models.OrdersModel](../models/ordersmodel.md) | :heavy_check_mark: | N/A | -| `revenue` | [models.Revenue](../models/revenue.md) | :heavy_check_mark: | N/A | -| `net_revenue` | [models.NetRevenue](../models/netrevenue.md) | :heavy_check_mark: | N/A | -| `cumulative_revenue` | [models.CumulativeRevenue](../models/cumulativerevenue.md) | :heavy_check_mark: | N/A | -| `net_cumulative_revenue` | [models.NetCumulativeRevenue](../models/netcumulativerevenue.md) | :heavy_check_mark: | N/A | -| `average_order_value` | [models.AverageOrderValue](../models/averageordervalue.md) | :heavy_check_mark: | N/A | -| `net_average_order_value` | [models.NetAverageOrderValue](../models/netaverageordervalue.md) | :heavy_check_mark: | N/A | -| `one_time_products` | [models.OneTimeProducts](../models/onetimeproducts.md) | :heavy_check_mark: | N/A | -| `one_time_products_revenue` | [models.OneTimeProductsRevenue](../models/onetimeproductsrevenue.md) | :heavy_check_mark: | N/A | -| `one_time_products_net_revenue` | [models.OneTimeProductsNetRevenue](../models/onetimeproductsnetrevenue.md) | :heavy_check_mark: | N/A | -| `new_subscriptions` | [models.NewSubscriptions](../models/newsubscriptions.md) | :heavy_check_mark: | N/A | -| `new_subscriptions_revenue` | [models.NewSubscriptionsRevenue](../models/newsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | -| `new_subscriptions_net_revenue` | [models.NewSubscriptionsNetRevenue](../models/newsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | -| `renewed_subscriptions` | [models.RenewedSubscriptions](../models/renewedsubscriptions.md) | :heavy_check_mark: | N/A | -| `renewed_subscriptions_revenue` | [models.RenewedSubscriptionsRevenue](../models/renewedsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | -| `renewed_subscriptions_net_revenue` | [models.RenewedSubscriptionsNetRevenue](../models/renewedsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | -| `active_subscriptions` | [models.ActiveSubscriptions](../models/activesubscriptions.md) | :heavy_check_mark: | N/A | -| `monthly_recurring_revenue` | [models.MonthlyRecurringRevenue](../models/monthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | -| `committed_monthly_recurring_revenue` | [models.CommittedMonthlyRecurringRevenue](../models/committedmonthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | -| `checkouts` | [models.CheckoutsModel](../models/checkoutsmodel.md) | :heavy_check_mark: | N/A | -| `succeeded_checkouts` | [models.SucceededCheckouts](../models/succeededcheckouts.md) | :heavy_check_mark: | N/A | -| `checkouts_conversion` | [models.CheckoutsConversion](../models/checkoutsconversion.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp of this period data. | +| `orders` | [models.OrdersModel](../models/ordersmodel.md) | :heavy_check_mark: | N/A | +| `revenue` | [models.Revenue](../models/revenue.md) | :heavy_check_mark: | N/A | +| `net_revenue` | [models.NetRevenue](../models/netrevenue.md) | :heavy_check_mark: | N/A | +| `cumulative_revenue` | [models.CumulativeRevenue](../models/cumulativerevenue.md) | :heavy_check_mark: | N/A | +| `net_cumulative_revenue` | [models.NetCumulativeRevenue](../models/netcumulativerevenue.md) | :heavy_check_mark: | N/A | +| `average_order_value` | [models.AverageOrderValue](../models/averageordervalue.md) | :heavy_check_mark: | N/A | +| `net_average_order_value` | [models.NetAverageOrderValue](../models/netaverageordervalue.md) | :heavy_check_mark: | N/A | +| `one_time_products` | [models.OneTimeProducts](../models/onetimeproducts.md) | :heavy_check_mark: | N/A | +| `one_time_products_revenue` | [models.OneTimeProductsRevenue](../models/onetimeproductsrevenue.md) | :heavy_check_mark: | N/A | +| `one_time_products_net_revenue` | [models.OneTimeProductsNetRevenue](../models/onetimeproductsnetrevenue.md) | :heavy_check_mark: | N/A | +| `new_subscriptions` | [models.NewSubscriptions](../models/newsubscriptions.md) | :heavy_check_mark: | N/A | +| `new_subscriptions_revenue` | [models.NewSubscriptionsRevenue](../models/newsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | +| `new_subscriptions_net_revenue` | [models.NewSubscriptionsNetRevenue](../models/newsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | +| `renewed_subscriptions` | [models.RenewedSubscriptions](../models/renewedsubscriptions.md) | :heavy_check_mark: | N/A | +| `renewed_subscriptions_revenue` | [models.RenewedSubscriptionsRevenue](../models/renewedsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | +| `renewed_subscriptions_net_revenue` | [models.RenewedSubscriptionsNetRevenue](../models/renewedsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | +| `active_subscriptions` | [models.ActiveSubscriptions](../models/activesubscriptions.md) | :heavy_check_mark: | N/A | +| `monthly_recurring_revenue` | [models.MonthlyRecurringRevenue](../models/monthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | +| `committed_monthly_recurring_revenue` | [models.CommittedMonthlyRecurringRevenue](../models/committedmonthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | +| `checkouts` | [models.CheckoutsModel](../models/checkoutsmodel.md) | :heavy_check_mark: | N/A | +| `succeeded_checkouts` | [models.SucceededCheckouts](../models/succeededcheckouts.md) | :heavy_check_mark: | N/A | +| `checkouts_conversion` | [models.CheckoutsConversion](../models/checkoutsconversion.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions` | [models.CanceledSubscriptions](../models/canceledsubscriptions.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_customer_service` | [models.CanceledSubscriptionsCustomerService](../models/canceledsubscriptionscustomerservice.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_low_quality` | [models.CanceledSubscriptionsLowQuality](../models/canceledsubscriptionslowquality.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_missing_features` | [models.CanceledSubscriptionsMissingFeatures](../models/canceledsubscriptionsmissingfeatures.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_switched_service` | [models.CanceledSubscriptionsSwitchedService](../models/canceledsubscriptionsswitchedservice.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_too_complex` | [models.CanceledSubscriptionsTooComplex](../models/canceledsubscriptionstoocomplex.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_too_expensive` | [models.CanceledSubscriptionsTooExpensive](../models/canceledsubscriptionstooexpensive.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_unused` | [models.CanceledSubscriptionsUnused](../models/canceledsubscriptionsunused.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_other` | [models.CanceledSubscriptionsOther](../models/canceledsubscriptionsother.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/metrics.md b/docs/models/metrics.md index 6e181236..b23b12a5 100644 --- a/docs/models/metrics.md +++ b/docs/models/metrics.md @@ -3,27 +3,36 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | -| `orders` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `cumulative_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `net_cumulative_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `average_order_value` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `net_average_order_value` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `one_time_products` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `one_time_products_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `one_time_products_net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `new_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `new_subscriptions_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `new_subscriptions_net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `renewed_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `renewed_subscriptions_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `renewed_subscriptions_net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `active_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `monthly_recurring_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `committed_monthly_recurring_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `checkouts` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `succeeded_checkouts` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | -| `checkouts_conversion` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `orders` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `cumulative_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `net_cumulative_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `average_order_value` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `net_average_order_value` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `one_time_products` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `one_time_products_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `one_time_products_net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `new_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `new_subscriptions_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `new_subscriptions_net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `renewed_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `renewed_subscriptions_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `renewed_subscriptions_net_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `active_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `monthly_recurring_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `committed_monthly_recurring_revenue` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `checkouts` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `succeeded_checkouts` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `checkouts_conversion` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_customer_service` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_low_quality` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_missing_features` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_switched_service` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_too_complex` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_too_expensive` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_unused` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | +| `canceled_subscriptions_other` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Information about a metric. | \ No newline at end of file diff --git a/docs/models/metricstotals.md b/docs/models/metricstotals.md index fd86a3a3..f3074ea1 100644 --- a/docs/models/metricstotals.md +++ b/docs/models/metricstotals.md @@ -3,27 +3,36 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `orders` | [models.MetricsTotalsOrders](../models/metricstotalsorders.md) | :heavy_check_mark: | N/A | -| `revenue` | [models.MetricsTotalsRevenue](../models/metricstotalsrevenue.md) | :heavy_check_mark: | N/A | -| `net_revenue` | [models.MetricsTotalsNetRevenue](../models/metricstotalsnetrevenue.md) | :heavy_check_mark: | N/A | -| `cumulative_revenue` | [models.MetricsTotalsCumulativeRevenue](../models/metricstotalscumulativerevenue.md) | :heavy_check_mark: | N/A | -| `net_cumulative_revenue` | [models.MetricsTotalsNetCumulativeRevenue](../models/metricstotalsnetcumulativerevenue.md) | :heavy_check_mark: | N/A | -| `average_order_value` | [models.MetricsTotalsAverageOrderValue](../models/metricstotalsaverageordervalue.md) | :heavy_check_mark: | N/A | -| `net_average_order_value` | [models.MetricsTotalsNetAverageOrderValue](../models/metricstotalsnetaverageordervalue.md) | :heavy_check_mark: | N/A | -| `one_time_products` | [models.MetricsTotalsOneTimeProducts](../models/metricstotalsonetimeproducts.md) | :heavy_check_mark: | N/A | -| `one_time_products_revenue` | [models.MetricsTotalsOneTimeProductsRevenue](../models/metricstotalsonetimeproductsrevenue.md) | :heavy_check_mark: | N/A | -| `one_time_products_net_revenue` | [models.MetricsTotalsOneTimeProductsNetRevenue](../models/metricstotalsonetimeproductsnetrevenue.md) | :heavy_check_mark: | N/A | -| `new_subscriptions` | [models.MetricsTotalsNewSubscriptions](../models/metricstotalsnewsubscriptions.md) | :heavy_check_mark: | N/A | -| `new_subscriptions_revenue` | [models.MetricsTotalsNewSubscriptionsRevenue](../models/metricstotalsnewsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | -| `new_subscriptions_net_revenue` | [models.MetricsTotalsNewSubscriptionsNetRevenue](../models/metricstotalsnewsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | -| `renewed_subscriptions` | [models.MetricsTotalsRenewedSubscriptions](../models/metricstotalsrenewedsubscriptions.md) | :heavy_check_mark: | N/A | -| `renewed_subscriptions_revenue` | [models.MetricsTotalsRenewedSubscriptionsRevenue](../models/metricstotalsrenewedsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | -| `renewed_subscriptions_net_revenue` | [models.MetricsTotalsRenewedSubscriptionsNetRevenue](../models/metricstotalsrenewedsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | -| `active_subscriptions` | [models.MetricsTotalsActiveSubscriptions](../models/metricstotalsactivesubscriptions.md) | :heavy_check_mark: | N/A | -| `monthly_recurring_revenue` | [models.MetricsTotalsMonthlyRecurringRevenue](../models/metricstotalsmonthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | -| `committed_monthly_recurring_revenue` | [models.MetricsTotalsCommittedMonthlyRecurringRevenue](../models/metricstotalscommittedmonthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | -| `checkouts` | [models.MetricsTotalsCheckouts](../models/metricstotalscheckouts.md) | :heavy_check_mark: | N/A | -| `succeeded_checkouts` | [models.MetricsTotalsSucceededCheckouts](../models/metricstotalssucceededcheckouts.md) | :heavy_check_mark: | N/A | -| `checkouts_conversion` | [models.MetricsTotalsCheckoutsConversion](../models/metricstotalscheckoutsconversion.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `orders` | [models.MetricsTotalsOrders](../models/metricstotalsorders.md) | :heavy_check_mark: | N/A | +| `revenue` | [models.MetricsTotalsRevenue](../models/metricstotalsrevenue.md) | :heavy_check_mark: | N/A | +| `net_revenue` | [models.MetricsTotalsNetRevenue](../models/metricstotalsnetrevenue.md) | :heavy_check_mark: | N/A | +| `cumulative_revenue` | [models.MetricsTotalsCumulativeRevenue](../models/metricstotalscumulativerevenue.md) | :heavy_check_mark: | N/A | +| `net_cumulative_revenue` | [models.MetricsTotalsNetCumulativeRevenue](../models/metricstotalsnetcumulativerevenue.md) | :heavy_check_mark: | N/A | +| `average_order_value` | [models.MetricsTotalsAverageOrderValue](../models/metricstotalsaverageordervalue.md) | :heavy_check_mark: | N/A | +| `net_average_order_value` | [models.MetricsTotalsNetAverageOrderValue](../models/metricstotalsnetaverageordervalue.md) | :heavy_check_mark: | N/A | +| `one_time_products` | [models.MetricsTotalsOneTimeProducts](../models/metricstotalsonetimeproducts.md) | :heavy_check_mark: | N/A | +| `one_time_products_revenue` | [models.MetricsTotalsOneTimeProductsRevenue](../models/metricstotalsonetimeproductsrevenue.md) | :heavy_check_mark: | N/A | +| `one_time_products_net_revenue` | [models.MetricsTotalsOneTimeProductsNetRevenue](../models/metricstotalsonetimeproductsnetrevenue.md) | :heavy_check_mark: | N/A | +| `new_subscriptions` | [models.MetricsTotalsNewSubscriptions](../models/metricstotalsnewsubscriptions.md) | :heavy_check_mark: | N/A | +| `new_subscriptions_revenue` | [models.MetricsTotalsNewSubscriptionsRevenue](../models/metricstotalsnewsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | +| `new_subscriptions_net_revenue` | [models.MetricsTotalsNewSubscriptionsNetRevenue](../models/metricstotalsnewsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | +| `renewed_subscriptions` | [models.MetricsTotalsRenewedSubscriptions](../models/metricstotalsrenewedsubscriptions.md) | :heavy_check_mark: | N/A | +| `renewed_subscriptions_revenue` | [models.MetricsTotalsRenewedSubscriptionsRevenue](../models/metricstotalsrenewedsubscriptionsrevenue.md) | :heavy_check_mark: | N/A | +| `renewed_subscriptions_net_revenue` | [models.MetricsTotalsRenewedSubscriptionsNetRevenue](../models/metricstotalsrenewedsubscriptionsnetrevenue.md) | :heavy_check_mark: | N/A | +| `active_subscriptions` | [models.MetricsTotalsActiveSubscriptions](../models/metricstotalsactivesubscriptions.md) | :heavy_check_mark: | N/A | +| `monthly_recurring_revenue` | [models.MetricsTotalsMonthlyRecurringRevenue](../models/metricstotalsmonthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | +| `committed_monthly_recurring_revenue` | [models.MetricsTotalsCommittedMonthlyRecurringRevenue](../models/metricstotalscommittedmonthlyrecurringrevenue.md) | :heavy_check_mark: | N/A | +| `checkouts` | [models.MetricsTotalsCheckouts](../models/metricstotalscheckouts.md) | :heavy_check_mark: | N/A | +| `succeeded_checkouts` | [models.MetricsTotalsSucceededCheckouts](../models/metricstotalssucceededcheckouts.md) | :heavy_check_mark: | N/A | +| `checkouts_conversion` | [models.MetricsTotalsCheckoutsConversion](../models/metricstotalscheckoutsconversion.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions` | [models.MetricsTotalsCanceledSubscriptions](../models/metricstotalscanceledsubscriptions.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_customer_service` | [models.MetricsTotalsCanceledSubscriptionsCustomerService](../models/metricstotalscanceledsubscriptionscustomerservice.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_low_quality` | [models.MetricsTotalsCanceledSubscriptionsLowQuality](../models/metricstotalscanceledsubscriptionslowquality.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_missing_features` | [models.MetricsTotalsCanceledSubscriptionsMissingFeatures](../models/metricstotalscanceledsubscriptionsmissingfeatures.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_switched_service` | [models.MetricsTotalsCanceledSubscriptionsSwitchedService](../models/metricstotalscanceledsubscriptionsswitchedservice.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_too_complex` | [models.MetricsTotalsCanceledSubscriptionsTooComplex](../models/metricstotalscanceledsubscriptionstoocomplex.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_too_expensive` | [models.MetricsTotalsCanceledSubscriptionsTooExpensive](../models/metricstotalscanceledsubscriptionstooexpensive.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_unused` | [models.MetricsTotalsCanceledSubscriptionsUnused](../models/metricstotalscanceledsubscriptionsunused.md) | :heavy_check_mark: | N/A | +| `canceled_subscriptions_other` | [models.MetricsTotalsCanceledSubscriptionsOther](../models/metricstotalscanceledsubscriptionsother.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/metricstotalscanceledsubscriptions.md b/docs/models/metricstotalscanceledsubscriptions.md new file mode 100644 index 00000000..8ccdfbaf --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptions.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptions + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionscustomerservice.md b/docs/models/metricstotalscanceledsubscriptionscustomerservice.md new file mode 100644 index 00000000..e004a7c8 --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionscustomerservice.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsCustomerService + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionslowquality.md b/docs/models/metricstotalscanceledsubscriptionslowquality.md new file mode 100644 index 00000000..2ffd640a --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionslowquality.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsLowQuality + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionsmissingfeatures.md b/docs/models/metricstotalscanceledsubscriptionsmissingfeatures.md new file mode 100644 index 00000000..41902beb --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionsmissingfeatures.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsMissingFeatures + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionsother.md b/docs/models/metricstotalscanceledsubscriptionsother.md new file mode 100644 index 00000000..de38ba9d --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionsother.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsOther + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionsswitchedservice.md b/docs/models/metricstotalscanceledsubscriptionsswitchedservice.md new file mode 100644 index 00000000..161c6884 --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionsswitchedservice.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsSwitchedService + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionstoocomplex.md b/docs/models/metricstotalscanceledsubscriptionstoocomplex.md new file mode 100644 index 00000000..86e7f6eb --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionstoocomplex.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsTooComplex + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionstooexpensive.md b/docs/models/metricstotalscanceledsubscriptionstooexpensive.md new file mode 100644 index 00000000..e11aea2b --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionstooexpensive.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsTooExpensive + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/metricstotalscanceledsubscriptionsunused.md b/docs/models/metricstotalscanceledsubscriptionsunused.md new file mode 100644 index 00000000..a67c65ef --- /dev/null +++ b/docs/models/metricstotalscanceledsubscriptionsunused.md @@ -0,0 +1,17 @@ +# MetricsTotalsCanceledSubscriptionsUnused + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/order.md b/docs/models/order.md index 28084a3c..5298eaa8 100644 --- a/docs/models/order.md +++ b/docs/models/order.md @@ -15,6 +15,7 @@ | `net_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts but before taxes. | | | `tax_amount` | *int* | :heavy_check_mark: | Sales tax amount in cents. | | | `total_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts and taxes. | | +| `from_balance_amount` | *int* | :heavy_check_mark: | How much of this invoice was paid using the customer's balance. Amount in cents. | | | `refunded_amount` | *int* | :heavy_check_mark: | Amount refunded in cents. | | | `refunded_tax_amount` | *int* | :heavy_check_mark: | Sales tax refunded in cents. | | | `currency` | *str* | :heavy_check_mark: | N/A | | diff --git a/docs/models/orderupdate.md b/docs/models/orderupdate.md index 8f17fea7..4551a37c 100644 --- a/docs/models/orderupdate.md +++ b/docs/models/orderupdate.md @@ -8,4 +8,4 @@ Schema to update an order. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. Can't be updated after the invoice is generated. | -| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated. | \ No newline at end of file +| `billing_address` | [Nullable[models.AddressInput]](../models/addressinput.md) | :heavy_check_mark: | The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated. | \ No newline at end of file diff --git a/docs/models/organizationsortproperty.md b/docs/models/organizationsortproperty.md index 44a0c13f..78503e44 100644 --- a/docs/models/organizationsortproperty.md +++ b/docs/models/organizationsortproperty.md @@ -3,11 +3,15 @@ ## Values -| Name | Value | -| ------------------ | ------------------ | -| `CREATED_AT` | created_at | -| `MINUS_CREATED_AT` | -created_at | -| `SLUG` | slug | -| `MINUS_SLUG` | -slug | -| `NAME` | name | -| `MINUS_NAME` | -name | \ No newline at end of file +| Name | Value | +| ----------------------------- | ----------------------------- | +| `CREATED_AT` | created_at | +| `MINUS_CREATED_AT` | -created_at | +| `SLUG` | slug | +| `MINUS_SLUG` | -slug | +| `NAME` | name | +| `MINUS_NAME` | -name | +| `NEXT_REVIEW_THRESHOLD` | next_review_threshold | +| `MINUS_NEXT_REVIEW_THRESHOLD` | -next_review_threshold | +| `DAYS_IN_STATUS` | days_in_status | +| `MINUS_DAYS_IN_STATUS` | -days_in_status | \ No newline at end of file diff --git a/docs/models/webhookslistwebhookdeliveriesrequest.md b/docs/models/webhookslistwebhookdeliveriesrequest.md index 23410f6b..7043ad30 100644 --- a/docs/models/webhookslistwebhookdeliveriesrequest.md +++ b/docs/models/webhookslistwebhookdeliveriesrequest.md @@ -3,8 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `endpoint_id` | [OptionalNullable[models.EndpointID]](../models/endpointid.md) | :heavy_minus_sign: | Filter by webhook endpoint ID. | -| `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. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `endpoint_id` | [OptionalNullable[models.EndpointID]](../models/endpointid.md) | :heavy_minus_sign: | Filter by webhook endpoint ID. | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter deliveries after this timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter deliveries before this timestamp. | +| `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. | \ No newline at end of file diff --git a/docs/sdks/benefitgrants/README.md b/docs/sdks/benefitgrants/README.md index d7bc3b8c..001569e4 100644 --- a/docs/sdks/benefitgrants/README.md +++ b/docs/sdks/benefitgrants/README.md @@ -1,33 +1,30 @@ # BenefitGrants -(*customer_portal.benefit_grants*) +(*benefit_grants*) ## Overview ### Available Operations * [list](#list) - List Benefit Grants -* [get](#get) - Get Benefit Grant -* [update](#update) - Update Benefit Grant ## list -List benefits grants of the authenticated customer. +List benefit grants across all benefits for the authenticated organization. -**Scopes**: `customer_portal:read` `customer_portal:write` +**Scopes**: `benefits:read` `benefits:write` ### Example Usage - + ```python -import polar_sdk from polar_sdk import Polar -with Polar() as polar: +with Polar( + access_token="", +) as polar: - res = polar.customer_portal.benefit_grants.list(security=polar_sdk.CustomerPortalBenefitGrantsListSecurity( - customer_session="", - ), organization_id=None, page=1, limit=10) + res = polar.benefit_grants.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10) while res is not None: # Handle items @@ -40,119 +37,21 @@ with Polar() as polar: | Parameter | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `security` | [models.CustomerPortalBenefitGrantsListSecurity](../../models/customerportalbenefitgrantslistsecurity.md) | :heavy_check_mark: | N/A | -| `type_filter` | [OptionalNullable[models.QueryParamBenefitTypeFilter]](../../models/queryparambenefittypefilter.md) | :heavy_minus_sign: | Filter by benefit type. | -| `benefit_id` | [OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter]](../../models/customerportalbenefitgrantslistqueryparambenefitidfilter.md) | :heavy_minus_sign: | Filter by benefit ID. | -| `organization_id` | [OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter]](../../models/customerportalbenefitgrantslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | -| `checkout_id` | [OptionalNullable[models.QueryParamCheckoutIDFilter]](../../models/queryparamcheckoutidfilter.md) | :heavy_minus_sign: | Filter by checkout ID. | -| `order_id` | [OptionalNullable[models.QueryParamOrderIDFilter]](../../models/queryparamorderidfilter.md) | :heavy_minus_sign: | Filter by order ID. | -| `subscription_id` | [OptionalNullable[models.QueryParamSubscriptionIDFilter]](../../models/queryparamsubscriptionidfilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `organization_id` | [OptionalNullable[models.BenefitGrantsListQueryParamOrganizationIDFilter]](../../models/benefitgrantslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.BenefitGrantsListQueryParamCustomerIDFilter]](../../models/benefitgrantslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `is_granted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned. | | `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.CustomerBenefitGrantSortProperty](../../models/customerbenefitgrantsortproperty.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. | +| `sorting` | List[[models.BenefitGrantSortProperty](../../models/benefitgrantsortproperty.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. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.CustomerPortalBenefitGrantsListResponse](../../models/customerportalbenefitgrantslistresponse.md)** +**[models.BenefitGrantsListResponse](../../models/benefitgrantslistresponse.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get a benefit grant by ID for the authenticated customer. - -**Scopes**: `customer_portal:read` `customer_portal:write` - -### Example Usage - - -```python -import polar_sdk -from polar_sdk import Polar - - -with Polar() as polar: - - res = polar.customer_portal.benefit_grants.get(security=polar_sdk.CustomerPortalBenefitGrantsGetSecurity( - customer_session="", - ), id="") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `security` | [models.CustomerPortalBenefitGrantsGetSecurity](../../models/customerportalbenefitgrantsgetsecurity.md) | :heavy_check_mark: | N/A | -| `id` | *str* | :heavy_check_mark: | The benefit grant ID. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.CustomerBenefitGrant](../../models/customerbenefitgrant.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.ResourceNotFound | 404 | application/json | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | - -## update - -Update a benefit grant for the authenticated customer. - -**Scopes**: `customer_portal:write` - -### Example Usage - - -```python -import polar_sdk -from polar_sdk import Polar - - -with Polar() as polar: - - res = polar.customer_portal.benefit_grants.update(security=polar_sdk.CustomerPortalBenefitGrantsUpdateSecurity( - customer_session="", - ), id="", customer_benefit_grant_update={ - "benefit_type": "license_keys", - }) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `security` | [models.CustomerPortalBenefitGrantsUpdateSecurity](../../models/customerportalbenefitgrantsupdatesecurity.md) | :heavy_check_mark: | N/A | -| `id` | *str* | :heavy_check_mark: | The benefit grant ID. | -| `customer_benefit_grant_update` | [models.CustomerBenefitGrantUpdate](../../models/customerbenefitgrantupdate.md) | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.CustomerBenefitGrant](../../models/customerbenefitgrant.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.NotPermitted | 403 | application/json | -| models.ResourceNotFound | 404 | application/json | -| models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/checkouts/README.md b/docs/sdks/checkouts/README.md index 8a3f8450..402d6e6f 100644 --- a/docs/sdks/checkouts/README.md +++ b/docs/sdks/checkouts/README.md @@ -74,6 +74,7 @@ Create a checkout session. ```python +import polar_sdk from polar_sdk import Polar @@ -83,7 +84,7 @@ with Polar( res = polar.checkouts.create(request={ "customer_billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, "products": [ "", @@ -168,6 +169,7 @@ Update a checkout session. ```python +import polar_sdk from polar_sdk import Polar @@ -177,7 +179,7 @@ with Polar( res = polar.checkouts.update(id="", checkout_update={ "customer_billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, }) @@ -305,6 +307,7 @@ Orders and subscriptions will be processed. ```python +import polar_sdk from polar_sdk import Polar @@ -314,7 +317,7 @@ with Polar( res = polar.checkouts.client_confirm(client_secret="", checkout_confirm_stripe={ "customer_billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, }) diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index e2d12d3f..6385a586 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -7,6 +7,7 @@ * [list](#list) - List Customers * [create](#create) - Create Customer +* [export](#export) - Export Customers * [get](#get) - Get Customer * [update](#update) - Update Customer * [delete](#delete) - Delete Customer @@ -76,6 +77,7 @@ Create a customer. ```python +import polar_sdk from polar_sdk import Polar @@ -88,7 +90,7 @@ with Polar( "email": "customer@example.com", "name": "John Doe", "billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, "tax_id": [ "911144442", @@ -120,6 +122,48 @@ with Polar( | models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | +## export + +Export customers as a CSV file. + +**Scopes**: `customers:read` `customers:write` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.customers.export(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.CustomersExportQueryParamOrganizationID]](../../models/customersexportqueryparamorganizationid.md) | :heavy_minus_sign: | Filter by organization ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[Any](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## get Get a customer by ID. @@ -173,6 +217,7 @@ Update a customer. ```python +import polar_sdk from polar_sdk import Polar @@ -184,7 +229,7 @@ with Polar( "email": "customer@example.com", "name": "John Doe", "billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, "tax_id": [ "911144442", diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index b0caba8f..a37a5af9 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -117,6 +117,7 @@ Update an order. ```python +import polar_sdk from polar_sdk import Polar @@ -127,7 +128,7 @@ with Polar( res = polar.orders.update(id="", order_update={ "billing_name": "", "billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, }) diff --git a/docs/sdks/polar/README.md b/docs/sdks/polar/README.md index 8c5008c7..89ba9897 100644 --- a/docs/sdks/polar/README.md +++ b/docs/sdks/polar/README.md @@ -2,6 +2,6 @@ ## Overview -Read the docs at https://docs.polar.sh/api-reference +Read the docs at https://polar.sh/docs/api-reference ### Available Operations diff --git a/docs/sdks/polarbenefitgrants/README.md b/docs/sdks/polarbenefitgrants/README.md new file mode 100644 index 00000000..6f2ab4c3 --- /dev/null +++ b/docs/sdks/polarbenefitgrants/README.md @@ -0,0 +1,158 @@ +# PolarBenefitGrants +(*customer_portal.benefit_grants*) + +## Overview + +### Available Operations + +* [list](#list) - List Benefit Grants +* [get](#get) - Get Benefit Grant +* [update](#update) - Update Benefit Grant + +## list + +List benefits grants of the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +### Example Usage + + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.benefit_grants.list(security=polar_sdk.CustomerPortalBenefitGrantsListSecurity( + customer_session="", + ), organization_id=None, page=1, limit=10) + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalBenefitGrantsListSecurity](../../models/customerportalbenefitgrantslistsecurity.md) | :heavy_check_mark: | N/A | +| `type_filter` | [OptionalNullable[models.QueryParamBenefitTypeFilter]](../../models/queryparambenefittypefilter.md) | :heavy_minus_sign: | Filter by benefit type. | +| `benefit_id` | [OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter]](../../models/customerportalbenefitgrantslistqueryparambenefitidfilter.md) | :heavy_minus_sign: | Filter by benefit ID. | +| `organization_id` | [OptionalNullable[models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter]](../../models/customerportalbenefitgrantslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `checkout_id` | [OptionalNullable[models.QueryParamCheckoutIDFilter]](../../models/queryparamcheckoutidfilter.md) | :heavy_minus_sign: | Filter by checkout ID. | +| `order_id` | [OptionalNullable[models.QueryParamOrderIDFilter]](../../models/queryparamorderidfilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `subscription_id` | [OptionalNullable[models.QueryParamSubscriptionIDFilter]](../../models/queryparamsubscriptionidfilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `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.CustomerBenefitGrantSortProperty](../../models/customerbenefitgrantsortproperty.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. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CustomerPortalBenefitGrantsListResponse](../../models/customerportalbenefitgrantslistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get a benefit grant by ID for the authenticated customer. + +**Scopes**: `customer_portal:read` `customer_portal:write` + +### Example Usage + + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.benefit_grants.get(security=polar_sdk.CustomerPortalBenefitGrantsGetSecurity( + customer_session="", + ), id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalBenefitGrantsGetSecurity](../../models/customerportalbenefitgrantsgetsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The benefit grant ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CustomerBenefitGrant](../../models/customerbenefitgrant.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update a benefit grant for the authenticated customer. + +**Scopes**: `customer_portal:write` + +### Example Usage + + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.benefit_grants.update(security=polar_sdk.CustomerPortalBenefitGrantsUpdateSecurity( + customer_session="", + ), id="", customer_benefit_grant_update={ + "benefit_type": "license_keys", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalBenefitGrantsUpdateSecurity](../../models/customerportalbenefitgrantsupdatesecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The benefit grant ID. | +| `customer_benefit_grant_update` | [models.CustomerBenefitGrantUpdate](../../models/customerbenefitgrantupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CustomerBenefitGrant](../../models/customerbenefitgrant.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/polarcustomers/README.md b/docs/sdks/polarcustomers/README.md index 9fad0c61..f1aa2591 100644 --- a/docs/sdks/polarcustomers/README.md +++ b/docs/sdks/polarcustomers/README.md @@ -73,7 +73,7 @@ with Polar() as polar: customer_session="", ), request={ "billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, }) diff --git a/docs/sdks/polarorders/README.md b/docs/sdks/polarorders/README.md index b7614662..5ebefb2b 100644 --- a/docs/sdks/polarorders/README.md +++ b/docs/sdks/polarorders/README.md @@ -132,7 +132,7 @@ with Polar() as polar: ), id="", customer_order_update={ "billing_name": "", "billing_address": { - "country": "US", + "country": polar_sdk.CountryAlpha2Input.US, }, }) diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index f1651cc3..71741d90 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -310,12 +310,14 @@ with Polar( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `endpoint_id` | [OptionalNullable[models.EndpointID]](../../models/endpointid.md) | :heavy_minus_sign: | Filter by webhook endpoint ID. | -| `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. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `endpoint_id` | [OptionalNullable[models.EndpointID]](../../models/endpointid.md) | :heavy_minus_sign: | Filter by webhook endpoint ID. | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter deliveries after this timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter deliveries before this timestamp. | +| `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. | +| `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 2860e82b..4dd0f53d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "polar-sdk" -version = "0.23.1" +version = "0.24.0" description = "Polar SDK for Python" authors = [{ name = "Polar" },] readme = "README-PYPI.md" @@ -40,7 +40,6 @@ build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] asyncio_default_fixture_loop_scope = "function" -asyncio_mode = "auto" pythonpath = ["src"] [tool.mypy] diff --git a/src/polar_sdk/_version.py b/src/polar_sdk/_version.py index 595b1b8e..9c5fd585 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.23.1" +__version__: str = "0.24.0" __openapi_doc_version__: str = "0.1.0" -__gen_version__: str = "2.698.4" -__user_agent__: str = "speakeasy-sdk/python 0.23.1 2.698.4 0.1.0 polar-sdk" +__gen_version__: str = "2.709.0" +__user_agent__: str = "speakeasy-sdk/python 0.24.0 2.709.0 0.1.0 polar-sdk" try: if __package__ is not None: diff --git a/src/polar_sdk/benefit_grants.py b/src/polar_sdk/benefit_grants.py index bd12f50d..998ce9a3 100644 --- a/src/polar_sdk/benefit_grants.py +++ b/src/polar_sdk/benefit_grants.py @@ -13,68 +13,36 @@ class BenefitGrants(BaseSDK): def list( self, *, - security: Union[ - models.CustomerPortalBenefitGrantsListSecurity, - models.CustomerPortalBenefitGrantsListSecurityTypedDict, - ], - type_filter: OptionalNullable[ - Union[ - models.QueryParamBenefitTypeFilter, - models.QueryParamBenefitTypeFilterTypedDict, - ] - ] = UNSET, - benefit_id: OptionalNullable[ - Union[ - models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter, - models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilterTypedDict, - ] - ] = UNSET, organization_id: OptionalNullable[ Union[ - models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter, - models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilterTypedDict, + models.BenefitGrantsListQueryParamOrganizationIDFilter, + models.BenefitGrantsListQueryParamOrganizationIDFilterTypedDict, ] ] = UNSET, - checkout_id: OptionalNullable[ + customer_id: OptionalNullable[ Union[ - models.QueryParamCheckoutIDFilter, - models.QueryParamCheckoutIDFilterTypedDict, - ] - ] = UNSET, - order_id: OptionalNullable[ - Union[ - models.QueryParamOrderIDFilter, models.QueryParamOrderIDFilterTypedDict - ] - ] = UNSET, - subscription_id: OptionalNullable[ - Union[ - models.QueryParamSubscriptionIDFilter, - models.QueryParamSubscriptionIDFilterTypedDict, + models.BenefitGrantsListQueryParamCustomerIDFilter, + models.BenefitGrantsListQueryParamCustomerIDFilterTypedDict, ] ] = UNSET, + is_granted: OptionalNullable[bool] = UNSET, page: Optional[int] = 1, limit: Optional[int] = 10, - sorting: OptionalNullable[ - List[models.CustomerBenefitGrantSortProperty] - ] = UNSET, + sorting: OptionalNullable[List[models.BenefitGrantSortProperty]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + ) -> Optional[models.BenefitGrantsListResponse]: r"""List Benefit Grants - List benefits grants of the authenticated customer. + List benefit grants across all benefits for the authenticated organization. - **Scopes**: `customer_portal:read` `customer_portal:write` + **Scopes**: `benefits:read` `benefits:write` - :param security: - :param type_filter: Filter by benefit type. - :param benefit_id: Filter by benefit ID. :param organization_id: Filter by organization ID. - :param checkout_id: Filter by checkout ID. - :param order_id: Filter by order ID. - :param subscription_id: Filter by subscription ID. + :param customer_id: Filter by customer ID. + :param is_granted: Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned. :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. @@ -93,13 +61,10 @@ def list( else: base_url = self._get_url(base_url, url_variables) - request = models.CustomerPortalBenefitGrantsListRequest( - type_filter=type_filter, - benefit_id=benefit_id, + request = models.BenefitGrantsListRequest( organization_id=organization_id, - checkout_id=checkout_id, - order_id=order_id, - subscription_id=subscription_id, + customer_id=customer_id, + is_granted=is_granted, page=page, limit=limit, sorting=sorting, @@ -107,7 +72,7 @@ def list( req = self._build_request( method="GET", - path="/v1/customer-portal/benefit-grants/", + path="/v1/benefit-grants/", base_url=base_url, url_variables=url_variables, request=request, @@ -117,9 +82,7 @@ def list( user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, - security=utils.get_pydantic_model( - security, models.CustomerPortalBenefitGrantsListSecurity - ), + security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -135,16 +98,16 @@ def list( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="customer_portal:benefit-grants:list", - oauth2_scopes=None, - security_source=security, + operation_id="benefit-grants:list", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, ), request=req, error_status_codes=["422", "4XX", "5XX"], retry_config=retry_config, ) - def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + def next_func() -> Optional[models.BenefitGrantsListResponse]: body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) page = request.page if not request.page is None else 1 next_page = page + 1 @@ -163,13 +126,9 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: return None return self.list( - security=security, - type_filter=type_filter, - benefit_id=benefit_id, organization_id=organization_id, - checkout_id=checkout_id, - order_id=order_id, - subscription_id=subscription_id, + customer_id=customer_id, + is_granted=is_granted, page=next_page, limit=limit, sorting=sorting, @@ -178,9 +137,9 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.CustomerPortalBenefitGrantsListResponse( + return models.BenefitGrantsListResponse( result=unmarshal_json_response( - models.ListResourceCustomerBenefitGrant, http_res + models.ListResourceBenefitGrant, http_res ), next=next_func, ) @@ -201,68 +160,36 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: async def list_async( self, *, - security: Union[ - models.CustomerPortalBenefitGrantsListSecurity, - models.CustomerPortalBenefitGrantsListSecurityTypedDict, - ], - type_filter: OptionalNullable[ - Union[ - models.QueryParamBenefitTypeFilter, - models.QueryParamBenefitTypeFilterTypedDict, - ] - ] = UNSET, - benefit_id: OptionalNullable[ - Union[ - models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter, - models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilterTypedDict, - ] - ] = UNSET, organization_id: OptionalNullable[ Union[ - models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter, - models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilterTypedDict, + models.BenefitGrantsListQueryParamOrganizationIDFilter, + models.BenefitGrantsListQueryParamOrganizationIDFilterTypedDict, ] ] = UNSET, - checkout_id: OptionalNullable[ + customer_id: OptionalNullable[ Union[ - models.QueryParamCheckoutIDFilter, - models.QueryParamCheckoutIDFilterTypedDict, - ] - ] = UNSET, - order_id: OptionalNullable[ - Union[ - models.QueryParamOrderIDFilter, models.QueryParamOrderIDFilterTypedDict - ] - ] = UNSET, - subscription_id: OptionalNullable[ - Union[ - models.QueryParamSubscriptionIDFilter, - models.QueryParamSubscriptionIDFilterTypedDict, + models.BenefitGrantsListQueryParamCustomerIDFilter, + models.BenefitGrantsListQueryParamCustomerIDFilterTypedDict, ] ] = UNSET, + is_granted: OptionalNullable[bool] = UNSET, page: Optional[int] = 1, limit: Optional[int] = 10, - sorting: OptionalNullable[ - List[models.CustomerBenefitGrantSortProperty] - ] = UNSET, + sorting: OptionalNullable[List[models.BenefitGrantSortProperty]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + ) -> Optional[models.BenefitGrantsListResponse]: r"""List Benefit Grants - List benefits grants of the authenticated customer. + List benefit grants across all benefits for the authenticated organization. - **Scopes**: `customer_portal:read` `customer_portal:write` + **Scopes**: `benefits:read` `benefits:write` - :param security: - :param type_filter: Filter by benefit type. - :param benefit_id: Filter by benefit ID. :param organization_id: Filter by organization ID. - :param checkout_id: Filter by checkout ID. - :param order_id: Filter by order ID. - :param subscription_id: Filter by subscription ID. + :param customer_id: Filter by customer ID. + :param is_granted: Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned. :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. @@ -281,13 +208,10 @@ async def list_async( else: base_url = self._get_url(base_url, url_variables) - request = models.CustomerPortalBenefitGrantsListRequest( - type_filter=type_filter, - benefit_id=benefit_id, + request = models.BenefitGrantsListRequest( organization_id=organization_id, - checkout_id=checkout_id, - order_id=order_id, - subscription_id=subscription_id, + customer_id=customer_id, + is_granted=is_granted, page=page, limit=limit, sorting=sorting, @@ -295,7 +219,7 @@ async def list_async( req = self._build_request_async( method="GET", - path="/v1/customer-portal/benefit-grants/", + path="/v1/benefit-grants/", base_url=base_url, url_variables=url_variables, request=request, @@ -305,9 +229,7 @@ async def list_async( user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, - security=utils.get_pydantic_model( - security, models.CustomerPortalBenefitGrantsListSecurity - ), + security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -323,16 +245,16 @@ async def list_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="customer_portal:benefit-grants:list", - oauth2_scopes=None, - security_source=security, + operation_id="benefit-grants:list", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, ), request=req, error_status_codes=["422", "4XX", "5XX"], retry_config=retry_config, ) - def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + def next_func() -> Optional[models.BenefitGrantsListResponse]: body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) page = request.page if not request.page is None else 1 next_page = page + 1 @@ -351,13 +273,9 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: return None return self.list( - security=security, - type_filter=type_filter, - benefit_id=benefit_id, organization_id=organization_id, - checkout_id=checkout_id, - order_id=order_id, - subscription_id=subscription_id, + customer_id=customer_id, + is_granted=is_granted, page=next_page, limit=limit, sorting=sorting, @@ -366,9 +284,9 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return models.CustomerPortalBenefitGrantsListResponse( + return models.BenefitGrantsListResponse( result=unmarshal_json_response( - models.ListResourceCustomerBenefitGrant, http_res + models.ListResourceBenefitGrant, http_res ), next=next_func, ) @@ -385,443 +303,3 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: raise models.SDKError("API error occurred", http_res, http_res_text) raise models.SDKError("Unexpected response received", http_res) - - def get( - self, - *, - security: Union[ - models.CustomerPortalBenefitGrantsGetSecurity, - models.CustomerPortalBenefitGrantsGetSecurityTypedDict, - ], - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.CustomerBenefitGrant: - r"""Get Benefit Grant - - Get a benefit grant by ID for the authenticated customer. - - **Scopes**: `customer_portal:read` `customer_portal:write` - - :param security: - :param id: The benefit grant ID. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.CustomerPortalBenefitGrantsGetRequest( - id=id, - ) - - req = self._build_request( - method="GET", - path="/v1/customer-portal/benefit-grants/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=utils.get_pydantic_model( - security, models.CustomerPortalBenefitGrantsGetSecurity - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="customer_portal:benefit-grants:get", - oauth2_scopes=None, - security_source=security, - ), - request=req, - error_status_codes=["404", "422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.CustomerBenefitGrant, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - models.ResourceNotFoundData, http_res - ) - raise models.ResourceNotFound(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_async( - self, - *, - security: Union[ - models.CustomerPortalBenefitGrantsGetSecurity, - models.CustomerPortalBenefitGrantsGetSecurityTypedDict, - ], - id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.CustomerBenefitGrant: - r"""Get Benefit Grant - - Get a benefit grant by ID for the authenticated customer. - - **Scopes**: `customer_portal:read` `customer_portal:write` - - :param security: - :param id: The benefit grant ID. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.CustomerPortalBenefitGrantsGetRequest( - id=id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/customer-portal/benefit-grants/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=utils.get_pydantic_model( - security, models.CustomerPortalBenefitGrantsGetSecurity - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="customer_portal:benefit-grants:get", - oauth2_scopes=None, - security_source=security, - ), - request=req, - error_status_codes=["404", "422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.CustomerBenefitGrant, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - models.ResourceNotFoundData, http_res - ) - raise models.ResourceNotFound(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def update( - self, - *, - security: Union[ - models.CustomerPortalBenefitGrantsUpdateSecurity, - models.CustomerPortalBenefitGrantsUpdateSecurityTypedDict, - ], - id: str, - customer_benefit_grant_update: Union[ - models.CustomerBenefitGrantUpdate, - models.CustomerBenefitGrantUpdateTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.CustomerBenefitGrant: - r"""Update Benefit Grant - - Update a benefit grant for the authenticated customer. - - **Scopes**: `customer_portal:write` - - :param security: - :param id: The benefit grant ID. - :param customer_benefit_grant_update: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.CustomerPortalBenefitGrantsUpdateRequest( - id=id, - customer_benefit_grant_update=utils.get_pydantic_model( - customer_benefit_grant_update, models.CustomerBenefitGrantUpdate - ), - ) - - req = self._build_request( - method="PATCH", - path="/v1/customer-portal/benefit-grants/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=utils.get_pydantic_model( - security, models.CustomerPortalBenefitGrantsUpdateSecurity - ), - get_serialized_body=lambda: utils.serialize_request_body( - request.customer_benefit_grant_update, - False, - False, - "json", - models.CustomerBenefitGrantUpdate, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="customer_portal:benefit-grants:update", - oauth2_scopes=None, - security_source=security, - ), - request=req, - error_status_codes=["403", "404", "422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.CustomerBenefitGrant, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response(models.NotPermittedData, http_res) - raise models.NotPermitted(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - models.ResourceNotFoundData, http_res - ) - raise models.ResourceNotFound(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def update_async( - self, - *, - security: Union[ - models.CustomerPortalBenefitGrantsUpdateSecurity, - models.CustomerPortalBenefitGrantsUpdateSecurityTypedDict, - ], - id: str, - customer_benefit_grant_update: Union[ - models.CustomerBenefitGrantUpdate, - models.CustomerBenefitGrantUpdateTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.CustomerBenefitGrant: - r"""Update Benefit Grant - - Update a benefit grant for the authenticated customer. - - **Scopes**: `customer_portal:write` - - :param security: - :param id: The benefit grant ID. - :param customer_benefit_grant_update: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.CustomerPortalBenefitGrantsUpdateRequest( - id=id, - customer_benefit_grant_update=utils.get_pydantic_model( - customer_benefit_grant_update, models.CustomerBenefitGrantUpdate - ), - ) - - req = self._build_request_async( - method="PATCH", - path="/v1/customer-portal/benefit-grants/{id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=utils.get_pydantic_model( - security, models.CustomerPortalBenefitGrantsUpdateSecurity - ), - get_serialized_body=lambda: utils.serialize_request_body( - request.customer_benefit_grant_update, - False, - False, - "json", - models.CustomerBenefitGrantUpdate, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="customer_portal:benefit-grants:update", - oauth2_scopes=None, - security_source=security, - ), - request=req, - error_status_codes=["403", "404", "422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.CustomerBenefitGrant, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response(models.NotPermittedData, http_res) - raise models.NotPermitted(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - models.ResourceNotFoundData, http_res - ) - raise models.ResourceNotFound(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) diff --git a/src/polar_sdk/customer_portal.py b/src/polar_sdk/customer_portal.py index 0204261d..d5cf7174 100644 --- a/src/polar_sdk/customer_portal.py +++ b/src/polar_sdk/customer_portal.py @@ -2,8 +2,8 @@ from .basesdk import BaseSDK from .sdkconfiguration import SDKConfiguration -from polar_sdk.benefit_grants import BenefitGrants from polar_sdk.downloadables import Downloadables +from polar_sdk.polar_benefit_grants import PolarBenefitGrants from polar_sdk.polar_customer_meters import PolarCustomerMeters from polar_sdk.polar_customers import PolarCustomers from polar_sdk.polar_license_keys import PolarLicenseKeys @@ -14,7 +14,7 @@ class CustomerPortal(BaseSDK): - benefit_grants: BenefitGrants + benefit_grants: PolarBenefitGrants customers: PolarCustomers customer_meters: PolarCustomerMeters downloadables: Downloadables @@ -31,7 +31,7 @@ def __init__( self._init_sdks() def _init_sdks(self): - self.benefit_grants = BenefitGrants( + self.benefit_grants = PolarBenefitGrants( self.sdk_configuration, parent_ref=self.parent_ref ) self.customers = PolarCustomers( diff --git a/src/polar_sdk/customers.py b/src/polar_sdk/customers.py index ab247a62..981ab802 100644 --- a/src/polar_sdk/customers.py +++ b/src/polar_sdk/customers.py @@ -492,6 +492,194 @@ async def create_async( raise models.SDKError("Unexpected response received", http_res) + def export( + self, + *, + organization_id: OptionalNullable[ + Union[ + models.CustomersExportQueryParamOrganizationID, + models.CustomersExportQueryParamOrganizationIDTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + r"""Export Customers + + Export customers as a CSV file. + + **Scopes**: `customers:read` `customers:write` + + :param organization_id: Filter by organization ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomersExportRequest( + organization_id=organization_id, + ) + + req = self._build_request( + method="GET", + path="/v1/customers/export", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customers:export", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def export_async( + self, + *, + organization_id: OptionalNullable[ + Union[ + models.CustomersExportQueryParamOrganizationID, + models.CustomersExportQueryParamOrganizationIDTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + r"""Export Customers + + Export customers as a CSV file. + + **Scopes**: `customers:read` `customers:write` + + :param organization_id: Filter by organization ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomersExportRequest( + organization_id=organization_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/customers/export", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customers:export", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + def get( self, *, diff --git a/src/polar_sdk/models/__init__.py b/src/polar_sdk/models/__init__.py index bcfb3f7a..0d2f4639 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -8,7 +8,8 @@ import sys if TYPE_CHECKING: - from .address import Address, AddressTypedDict + from .address import Address, AddressTypedDict, CountryAlpha2 + from .addressinput import AddressInput, AddressInputTypedDict, CountryAlpha2Input from .alreadyactivesubscriptionerror import ( AlreadyActiveSubscriptionError, AlreadyActiveSubscriptionErrorData, @@ -40,6 +41,16 @@ ) from .authorizeuser import AuthorizeUser, AuthorizeUserTypedDict from .benefit import Benefit, BenefitTypedDict + from .benefit_grants_listop import ( + BenefitGrantsListQueryParamCustomerIDFilter, + BenefitGrantsListQueryParamCustomerIDFilterTypedDict, + BenefitGrantsListQueryParamOrganizationIDFilter, + BenefitGrantsListQueryParamOrganizationIDFilterTypedDict, + BenefitGrantsListRequest, + BenefitGrantsListRequestTypedDict, + BenefitGrantsListResponse, + BenefitGrantsListResponseTypedDict, + ) from .benefitcreate import BenefitCreate, BenefitCreateTypedDict from .benefitcustom import ( BenefitCustom, @@ -249,6 +260,7 @@ BenefitGrantMeterCreditWebhook, BenefitGrantMeterCreditWebhookTypedDict, ) + from .benefitgrantsortproperty import BenefitGrantSortProperty from .benefitgrantwebhook import BenefitGrantWebhook, BenefitGrantWebhookTypedDict from .benefitlicensekeyactivationcreateproperties import ( BenefitLicenseKeyActivationCreateProperties, @@ -949,6 +961,12 @@ CustomersDeleteRequest, CustomersDeleteRequestTypedDict, ) + from .customers_exportop import ( + CustomersExportQueryParamOrganizationID, + CustomersExportQueryParamOrganizationIDTypedDict, + CustomersExportRequest, + CustomersExportRequestTypedDict, + ) from .customers_get_externalop import ( CustomersGetExternalRequest, CustomersGetExternalRequestTypedDict, @@ -1598,6 +1616,24 @@ ActiveSubscriptionsTypedDict, AverageOrderValue, AverageOrderValueTypedDict, + CanceledSubscriptions, + CanceledSubscriptionsCustomerService, + CanceledSubscriptionsCustomerServiceTypedDict, + CanceledSubscriptionsLowQuality, + CanceledSubscriptionsLowQualityTypedDict, + CanceledSubscriptionsMissingFeatures, + CanceledSubscriptionsMissingFeaturesTypedDict, + CanceledSubscriptionsOther, + CanceledSubscriptionsOtherTypedDict, + CanceledSubscriptionsSwitchedService, + CanceledSubscriptionsSwitchedServiceTypedDict, + CanceledSubscriptionsTooComplex, + CanceledSubscriptionsTooComplexTypedDict, + CanceledSubscriptionsTooExpensive, + CanceledSubscriptionsTooExpensiveTypedDict, + CanceledSubscriptionsTypedDict, + CanceledSubscriptionsUnused, + CanceledSubscriptionsUnusedTypedDict, CheckoutsConversion, CheckoutsConversionTypedDict, CheckoutsModel, @@ -1670,6 +1706,24 @@ MetricsTotalsActiveSubscriptionsTypedDict, MetricsTotalsAverageOrderValue, MetricsTotalsAverageOrderValueTypedDict, + MetricsTotalsCanceledSubscriptions, + MetricsTotalsCanceledSubscriptionsCustomerService, + MetricsTotalsCanceledSubscriptionsCustomerServiceTypedDict, + MetricsTotalsCanceledSubscriptionsLowQuality, + MetricsTotalsCanceledSubscriptionsLowQualityTypedDict, + MetricsTotalsCanceledSubscriptionsMissingFeatures, + MetricsTotalsCanceledSubscriptionsMissingFeaturesTypedDict, + MetricsTotalsCanceledSubscriptionsOther, + MetricsTotalsCanceledSubscriptionsOtherTypedDict, + MetricsTotalsCanceledSubscriptionsSwitchedService, + MetricsTotalsCanceledSubscriptionsSwitchedServiceTypedDict, + MetricsTotalsCanceledSubscriptionsTooComplex, + MetricsTotalsCanceledSubscriptionsTooComplexTypedDict, + MetricsTotalsCanceledSubscriptionsTooExpensive, + MetricsTotalsCanceledSubscriptionsTooExpensiveTypedDict, + MetricsTotalsCanceledSubscriptionsTypedDict, + MetricsTotalsCanceledSubscriptionsUnused, + MetricsTotalsCanceledSubscriptionsUnusedTypedDict, MetricsTotalsCheckouts, MetricsTotalsCheckoutsConversion, MetricsTotalsCheckoutsConversionTypedDict, @@ -2359,6 +2413,8 @@ "ActiveSubscriptions", "ActiveSubscriptionsTypedDict", "Address", + "AddressInput", + "AddressInputTypedDict", "AddressTypedDict", "Aggregation", "AggregationTypedDict", @@ -2506,11 +2562,20 @@ "BenefitGrantMeterCreditPropertiesTypedDict", "BenefitGrantMeterCreditWebhook", "BenefitGrantMeterCreditWebhookTypedDict", + "BenefitGrantSortProperty", "BenefitGrantTypedDict", "BenefitGrantWebhook", "BenefitGrantWebhookTypedDict", "BenefitGrantedEvent", "BenefitGrantedEventTypedDict", + "BenefitGrantsListQueryParamCustomerIDFilter", + "BenefitGrantsListQueryParamCustomerIDFilterTypedDict", + "BenefitGrantsListQueryParamOrganizationIDFilter", + "BenefitGrantsListQueryParamOrganizationIDFilterTypedDict", + "BenefitGrantsListRequest", + "BenefitGrantsListRequestTypedDict", + "BenefitGrantsListResponse", + "BenefitGrantsListResponseTypedDict", "BenefitIDFilter", "BenefitIDFilterTypedDict", "BenefitLicenseKeyActivationCreateProperties", @@ -2593,6 +2658,24 @@ "BenefitsUpdateRequest", "BenefitsUpdateRequestTypedDict", "BillingAddressFieldMode", + "CanceledSubscriptions", + "CanceledSubscriptionsCustomerService", + "CanceledSubscriptionsCustomerServiceTypedDict", + "CanceledSubscriptionsLowQuality", + "CanceledSubscriptionsLowQualityTypedDict", + "CanceledSubscriptionsMissingFeatures", + "CanceledSubscriptionsMissingFeaturesTypedDict", + "CanceledSubscriptionsOther", + "CanceledSubscriptionsOtherTypedDict", + "CanceledSubscriptionsSwitchedService", + "CanceledSubscriptionsSwitchedServiceTypedDict", + "CanceledSubscriptionsTooComplex", + "CanceledSubscriptionsTooComplexTypedDict", + "CanceledSubscriptionsTooExpensive", + "CanceledSubscriptionsTooExpensiveTypedDict", + "CanceledSubscriptionsTypedDict", + "CanceledSubscriptionsUnused", + "CanceledSubscriptionsUnusedTypedDict", "CardPayment", "CardPaymentMetadata", "CardPaymentMetadataTypedDict", @@ -2744,6 +2827,8 @@ "ConditionsTypedDict", "CountAggregation", "CountAggregationTypedDict", + "CountryAlpha2", + "CountryAlpha2Input", "CumulativeRevenue", "CumulativeRevenueTypedDict", "CustomField", @@ -3145,6 +3230,10 @@ "CustomersDeleteExternalRequestTypedDict", "CustomersDeleteRequest", "CustomersDeleteRequestTypedDict", + "CustomersExportQueryParamOrganizationID", + "CustomersExportQueryParamOrganizationIDTypedDict", + "CustomersExportRequest", + "CustomersExportRequestTypedDict", "CustomersGetExternalRequest", "CustomersGetExternalRequestTypedDict", "CustomersGetRequest", @@ -3531,6 +3620,24 @@ "MetricsTotalsActiveSubscriptionsTypedDict", "MetricsTotalsAverageOrderValue", "MetricsTotalsAverageOrderValueTypedDict", + "MetricsTotalsCanceledSubscriptions", + "MetricsTotalsCanceledSubscriptionsCustomerService", + "MetricsTotalsCanceledSubscriptionsCustomerServiceTypedDict", + "MetricsTotalsCanceledSubscriptionsLowQuality", + "MetricsTotalsCanceledSubscriptionsLowQualityTypedDict", + "MetricsTotalsCanceledSubscriptionsMissingFeatures", + "MetricsTotalsCanceledSubscriptionsMissingFeaturesTypedDict", + "MetricsTotalsCanceledSubscriptionsOther", + "MetricsTotalsCanceledSubscriptionsOtherTypedDict", + "MetricsTotalsCanceledSubscriptionsSwitchedService", + "MetricsTotalsCanceledSubscriptionsSwitchedServiceTypedDict", + "MetricsTotalsCanceledSubscriptionsTooComplex", + "MetricsTotalsCanceledSubscriptionsTooComplexTypedDict", + "MetricsTotalsCanceledSubscriptionsTooExpensive", + "MetricsTotalsCanceledSubscriptionsTooExpensiveTypedDict", + "MetricsTotalsCanceledSubscriptionsTypedDict", + "MetricsTotalsCanceledSubscriptionsUnused", + "MetricsTotalsCanceledSubscriptionsUnusedTypedDict", "MetricsTotalsCheckouts", "MetricsTotalsCheckoutsConversion", "MetricsTotalsCheckoutsConversionTypedDict", @@ -4076,6 +4183,10 @@ _dynamic_imports: dict[str, str] = { "Address": ".address", "AddressTypedDict": ".address", + "CountryAlpha2": ".address", + "AddressInput": ".addressinput", + "AddressInputTypedDict": ".addressinput", + "CountryAlpha2Input": ".addressinput", "AlreadyActiveSubscriptionError": ".alreadyactivesubscriptionerror", "AlreadyActiveSubscriptionErrorData": ".alreadyactivesubscriptionerror", "AlreadyCanceledSubscription": ".alreadycanceledsubscription", @@ -4096,6 +4207,14 @@ "AuthorizeUserTypedDict": ".authorizeuser", "Benefit": ".benefit", "BenefitTypedDict": ".benefit", + "BenefitGrantsListQueryParamCustomerIDFilter": ".benefit_grants_listop", + "BenefitGrantsListQueryParamCustomerIDFilterTypedDict": ".benefit_grants_listop", + "BenefitGrantsListQueryParamOrganizationIDFilter": ".benefit_grants_listop", + "BenefitGrantsListQueryParamOrganizationIDFilterTypedDict": ".benefit_grants_listop", + "BenefitGrantsListRequest": ".benefit_grants_listop", + "BenefitGrantsListRequestTypedDict": ".benefit_grants_listop", + "BenefitGrantsListResponse": ".benefit_grants_listop", + "BenefitGrantsListResponseTypedDict": ".benefit_grants_listop", "BenefitCreate": ".benefitcreate", "BenefitCreateTypedDict": ".benefitcreate", "BenefitCustom": ".benefitcustom", @@ -4225,6 +4344,7 @@ "BenefitGrantMeterCreditPropertiesTypedDict": ".benefitgrantmetercreditproperties", "BenefitGrantMeterCreditWebhook": ".benefitgrantmetercreditwebhook", "BenefitGrantMeterCreditWebhookTypedDict": ".benefitgrantmetercreditwebhook", + "BenefitGrantSortProperty": ".benefitgrantsortproperty", "BenefitGrantWebhook": ".benefitgrantwebhook", "BenefitGrantWebhookTypedDict": ".benefitgrantwebhook", "BenefitLicenseKeyActivationCreateProperties": ".benefitlicensekeyactivationcreateproperties", @@ -4709,6 +4829,10 @@ "CustomersDeleteExternalRequestTypedDict": ".customers_delete_externalop", "CustomersDeleteRequest": ".customers_deleteop", "CustomersDeleteRequestTypedDict": ".customers_deleteop", + "CustomersExportQueryParamOrganizationID": ".customers_exportop", + "CustomersExportQueryParamOrganizationIDTypedDict": ".customers_exportop", + "CustomersExportRequest": ".customers_exportop", + "CustomersExportRequestTypedDict": ".customers_exportop", "CustomersGetExternalRequest": ".customers_get_externalop", "CustomersGetExternalRequestTypedDict": ".customers_get_externalop", "CustomersGetStateExternalRequest": ".customers_get_state_externalop", @@ -5180,6 +5304,24 @@ "ActiveSubscriptionsTypedDict": ".metricperiod", "AverageOrderValue": ".metricperiod", "AverageOrderValueTypedDict": ".metricperiod", + "CanceledSubscriptions": ".metricperiod", + "CanceledSubscriptionsCustomerService": ".metricperiod", + "CanceledSubscriptionsCustomerServiceTypedDict": ".metricperiod", + "CanceledSubscriptionsLowQuality": ".metricperiod", + "CanceledSubscriptionsLowQualityTypedDict": ".metricperiod", + "CanceledSubscriptionsMissingFeatures": ".metricperiod", + "CanceledSubscriptionsMissingFeaturesTypedDict": ".metricperiod", + "CanceledSubscriptionsOther": ".metricperiod", + "CanceledSubscriptionsOtherTypedDict": ".metricperiod", + "CanceledSubscriptionsSwitchedService": ".metricperiod", + "CanceledSubscriptionsSwitchedServiceTypedDict": ".metricperiod", + "CanceledSubscriptionsTooComplex": ".metricperiod", + "CanceledSubscriptionsTooComplexTypedDict": ".metricperiod", + "CanceledSubscriptionsTooExpensive": ".metricperiod", + "CanceledSubscriptionsTooExpensiveTypedDict": ".metricperiod", + "CanceledSubscriptionsTypedDict": ".metricperiod", + "CanceledSubscriptionsUnused": ".metricperiod", + "CanceledSubscriptionsUnusedTypedDict": ".metricperiod", "CheckoutsConversion": ".metricperiod", "CheckoutsConversionTypedDict": ".metricperiod", "CheckoutsModel": ".metricperiod", @@ -5247,6 +5389,24 @@ "MetricsTotalsActiveSubscriptionsTypedDict": ".metricstotals", "MetricsTotalsAverageOrderValue": ".metricstotals", "MetricsTotalsAverageOrderValueTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptions": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsCustomerService": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsCustomerServiceTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsLowQuality": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsLowQualityTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsMissingFeatures": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsMissingFeaturesTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsOther": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsOtherTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsSwitchedService": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsSwitchedServiceTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsTooComplex": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsTooComplexTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsTooExpensive": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsTooExpensiveTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsTypedDict": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsUnused": ".metricstotals", + "MetricsTotalsCanceledSubscriptionsUnusedTypedDict": ".metricstotals", "MetricsTotalsCheckouts": ".metricstotals", "MetricsTotalsCheckoutsConversion": ".metricstotals", "MetricsTotalsCheckoutsConversionTypedDict": ".metricstotals", diff --git a/src/polar_sdk/models/address.py b/src/polar_sdk/models/address.py index b44bec45..ae84009d 100644 --- a/src/polar_sdk/models/address.py +++ b/src/polar_sdk/models/address.py @@ -1,13 +1,266 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from enum import Enum from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer from typing_extensions import NotRequired, TypedDict +class CountryAlpha2(str, Enum): + BH = "BH" + CI = "CI" + CW = "CW" + BS = "BS" + RE = "RE" + GD = "GD" + TN = "TN" + NC = "NC" + CC = "CC" + MG = "MG" + VE = "VE" + GY = "GY" + DJ = "DJ" + SJ = "SJ" + TM = "TM" + SG = "SG" + AO = "AO" + ID = "ID" + JM = "JM" + JO = "JO" + GG = "GG" + FM = "FM" + BO = "BO" + NU = "NU" + SI = "SI" + BV = "BV" + CM = "CM" + LA = "LA" + KG = "KG" + LC = "LC" + MV = "MV" + TT = "TT" + TO = "TO" + GB = "GB" + UG = "UG" + TR = "TR" + AI = "AI" + SH = "SH" + BF = "BF" + RU = "RU" + IT = "IT" + KW = "KW" + TW = "TW" + HK = "HK" + AW = "AW" + LB = "LB" + LY = "LY" + VI = "VI" + CD = "CD" + ES = "ES" + PA = "PA" + MN = "MN" + MS = "MS" + VG = "VG" + SA = "SA" + BT = "BT" + ER = "ER" + UA = "UA" + HN = "HN" + AG = "AG" + VN = "VN" + MA = "MA" + PG = "PG" + TH = "TH" + KP = "KP" + EE = "EE" + MU = "MU" + CR = "CR" + GE = "GE" + GR = "GR" + MR = "MR" + ZW = "ZW" + TC = "TC" + CK = "CK" + GW = "GW" + HR = "HR" + LT = "LT" + QA = "QA" + MO = "MO" + AD = "AD" + FR = "FR" + KM = "KM" + GS = "GS" + BG = "BG" + NG = "NG" + AS = "AS" + ZA = "ZA" + PT = "PT" + NP = "NP" + RW = "RW" + GL = "GL" + RS = "RS" + MQ = "MQ" + CV = "CV" + GQ = "GQ" + MF = "MF" + MH = "MH" + GP = "GP" + KN = "KN" + WF = "WF" + FJ = "FJ" + FK = "FK" + ME = "ME" + NE = "NE" + GM = "GM" + GH = "GH" + SV = "SV" + HM = "HM" + BN = "BN" + GA = "GA" + PY = "PY" + BL = "BL" + EG = "EG" + SE = "SE" + FO = "FO" + VA = "VA" + TK = "TK" + YE = "YE" + DM = "DM" + NL = "NL" + MK = "MK" + UZ = "UZ" + IN = "IN" + TL = "TL" + IQ = "IQ" + BZ = "BZ" + MC = "MC" + BJ = "BJ" + AE = "AE" + PN = "PN" + KE = "KE" + CX = "CX" + AQ = "AQ" + EH = "EH" + IR = "IR" + ST = "ST" + MZ = "MZ" + SC = "SC" + SM = "SM" + IM = "IM" + TJ = "TJ" + PS = "PS" + MT = "MT" + SK = "SK" + BY = "BY" + IL = "IL" + CY = "CY" + BM = "BM" + SR = "SR" + AM = "AM" + PE = "PE" + WS = "WS" + FI = "FI" + LI = "LI" + NO = "NO" + GF = "GF" + NR = "NR" + BI = "BI" + SD = "SD" + MP = "MP" + JE = "JE" + CA = "CA" + EC = "EC" + HU = "HU" + SO = "SO" + TZ = "TZ" + CN = "CN" + VC = "VC" + SZ = "SZ" + ML = "ML" + BD = "BD" + GN = "GN" + KI = "KI" + DO = "DO" + SX = "SX" + UM = "UM" + CF = "CF" + PW = "PW" + ZM = "ZM" + TF = "TF" + TG = "TG" + IS = "IS" + YT = "YT" + DE = "DE" + DZ = "DZ" + UY = "UY" + AF = "AF" + BE = "BE" + KZ = "KZ" + NZ = "NZ" + PL = "PL" + PF = "PF" + AT = "AT" + AZ = "AZ" + BR = "BR" + GI = "GI" + TD = "TD" + CO = "CO" + ET = "ET" + MD = "MD" + MW = "MW" + OM = "OM" + PH = "PH" + IE = "IE" + KR = "KR" + PK = "PK" + AU = "AU" + NI = "NI" + RO = "RO" + SY = "SY" + CU = "CU" + LU = "LU" + MX = "MX" + AR = "AR" + NA = "NA" + DK = "DK" + MM = "MM" + AX = "AX" + CH = "CH" + NF = "NF" + LR = "LR" + SN = "SN" + GU = "GU" + CL = "CL" + PM = "PM" + US = "US" + GT = "GT" + AL = "AL" + VU = "VU" + PR = "PR" + SB = "SB" + SS = "SS" + JP = "JP" + KH = "KH" + LS = "LS" + SL = "SL" + KY = "KY" + IO = "IO" + BB = "BB" + HT = "HT" + CZ = "CZ" + LV = "LV" + BA = "BA" + MY = "MY" + BW = "BW" + TV = "TV" + BQ = "BQ" + LK = "LK" + CG = "CG" + + class AddressTypedDict(TypedDict): - country: str + country: CountryAlpha2 line1: NotRequired[Nullable[str]] line2: NotRequired[Nullable[str]] postal_code: NotRequired[Nullable[str]] @@ -16,7 +269,7 @@ class AddressTypedDict(TypedDict): class Address(BaseModel): - country: str + country: CountryAlpha2 line1: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/addressinput.py b/src/polar_sdk/models/addressinput.py new file mode 100644 index 00000000..1e3aa427 --- /dev/null +++ b/src/polar_sdk/models/addressinput.py @@ -0,0 +1,307 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CountryAlpha2Input(str, Enum): + BH = "BH" + CI = "CI" + CW = "CW" + BS = "BS" + RE = "RE" + GD = "GD" + TN = "TN" + NC = "NC" + CC = "CC" + MG = "MG" + VE = "VE" + GY = "GY" + DJ = "DJ" + SJ = "SJ" + TM = "TM" + SG = "SG" + AO = "AO" + ID = "ID" + JM = "JM" + JO = "JO" + GG = "GG" + FM = "FM" + BO = "BO" + NU = "NU" + SI = "SI" + BV = "BV" + CM = "CM" + LA = "LA" + KG = "KG" + LC = "LC" + MV = "MV" + TT = "TT" + TO = "TO" + GB = "GB" + UG = "UG" + TR = "TR" + AI = "AI" + SH = "SH" + BF = "BF" + IT = "IT" + KW = "KW" + TW = "TW" + HK = "HK" + AW = "AW" + LB = "LB" + LY = "LY" + VI = "VI" + CD = "CD" + ES = "ES" + PA = "PA" + MN = "MN" + MS = "MS" + VG = "VG" + SA = "SA" + BT = "BT" + ER = "ER" + UA = "UA" + HN = "HN" + AG = "AG" + VN = "VN" + MA = "MA" + PG = "PG" + TH = "TH" + EE = "EE" + MU = "MU" + CR = "CR" + GE = "GE" + GR = "GR" + MR = "MR" + ZW = "ZW" + TC = "TC" + CK = "CK" + GW = "GW" + HR = "HR" + LT = "LT" + QA = "QA" + MO = "MO" + AD = "AD" + FR = "FR" + KM = "KM" + GS = "GS" + BG = "BG" + NG = "NG" + AS = "AS" + ZA = "ZA" + PT = "PT" + NP = "NP" + RW = "RW" + GL = "GL" + RS = "RS" + MQ = "MQ" + CV = "CV" + GQ = "GQ" + MF = "MF" + MH = "MH" + GP = "GP" + KN = "KN" + WF = "WF" + FJ = "FJ" + FK = "FK" + ME = "ME" + NE = "NE" + GM = "GM" + GH = "GH" + SV = "SV" + HM = "HM" + BN = "BN" + GA = "GA" + PY = "PY" + BL = "BL" + EG = "EG" + SE = "SE" + FO = "FO" + VA = "VA" + TK = "TK" + YE = "YE" + DM = "DM" + NL = "NL" + MK = "MK" + UZ = "UZ" + IN = "IN" + TL = "TL" + IQ = "IQ" + BZ = "BZ" + MC = "MC" + BJ = "BJ" + AE = "AE" + PN = "PN" + KE = "KE" + CX = "CX" + AQ = "AQ" + EH = "EH" + ST = "ST" + MZ = "MZ" + SC = "SC" + SM = "SM" + IM = "IM" + TJ = "TJ" + PS = "PS" + MT = "MT" + SK = "SK" + BY = "BY" + IL = "IL" + CY = "CY" + BM = "BM" + SR = "SR" + AM = "AM" + PE = "PE" + WS = "WS" + FI = "FI" + LI = "LI" + NO = "NO" + GF = "GF" + NR = "NR" + BI = "BI" + SD = "SD" + MP = "MP" + JE = "JE" + CA = "CA" + EC = "EC" + HU = "HU" + SO = "SO" + TZ = "TZ" + CN = "CN" + VC = "VC" + SZ = "SZ" + ML = "ML" + BD = "BD" + GN = "GN" + KI = "KI" + DO = "DO" + SX = "SX" + UM = "UM" + CF = "CF" + PW = "PW" + ZM = "ZM" + TF = "TF" + TG = "TG" + IS = "IS" + YT = "YT" + DE = "DE" + DZ = "DZ" + UY = "UY" + AF = "AF" + BE = "BE" + KZ = "KZ" + NZ = "NZ" + PL = "PL" + PF = "PF" + AT = "AT" + AZ = "AZ" + BR = "BR" + GI = "GI" + TD = "TD" + CO = "CO" + ET = "ET" + MD = "MD" + MW = "MW" + OM = "OM" + PH = "PH" + IE = "IE" + KR = "KR" + PK = "PK" + AU = "AU" + NI = "NI" + RO = "RO" + LU = "LU" + MX = "MX" + AR = "AR" + NA = "NA" + DK = "DK" + MM = "MM" + AX = "AX" + CH = "CH" + NF = "NF" + LR = "LR" + SN = "SN" + GU = "GU" + CL = "CL" + PM = "PM" + US = "US" + GT = "GT" + AL = "AL" + VU = "VU" + PR = "PR" + SB = "SB" + SS = "SS" + JP = "JP" + KH = "KH" + LS = "LS" + SL = "SL" + KY = "KY" + IO = "IO" + BB = "BB" + HT = "HT" + CZ = "CZ" + LV = "LV" + BA = "BA" + MY = "MY" + BW = "BW" + TV = "TV" + BQ = "BQ" + LK = "LK" + CG = "CG" + + +class AddressInputTypedDict(TypedDict): + country: CountryAlpha2Input + line1: NotRequired[Nullable[str]] + line2: NotRequired[Nullable[str]] + postal_code: NotRequired[Nullable[str]] + city: NotRequired[Nullable[str]] + state: NotRequired[Nullable[str]] + + +class AddressInput(BaseModel): + country: CountryAlpha2Input + + line1: OptionalNullable[str] = UNSET + + line2: OptionalNullable[str] = UNSET + + postal_code: OptionalNullable[str] = UNSET + + city: OptionalNullable[str] = UNSET + + state: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["line1", "line2", "postal_code", "city", "state"] + nullable_fields = ["line1", "line2", "postal_code", "city", "state"] + 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/benefit_grants_listop.py b/src/polar_sdk/models/benefit_grants_listop.py new file mode 100644 index 00000000..9ecd33e2 --- /dev/null +++ b/src/polar_sdk/models/benefit_grants_listop.py @@ -0,0 +1,141 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .benefitgrantsortproperty import BenefitGrantSortProperty +from .listresource_benefitgrant_ import ( + ListResourceBenefitGrant, + ListResourceBenefitGrantTypedDict, +) +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Callable, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +BenefitGrantsListQueryParamOrganizationIDFilterTypedDict = TypeAliasType( + "BenefitGrantsListQueryParamOrganizationIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +BenefitGrantsListQueryParamOrganizationIDFilter = TypeAliasType( + "BenefitGrantsListQueryParamOrganizationIDFilter", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +BenefitGrantsListQueryParamCustomerIDFilterTypedDict = TypeAliasType( + "BenefitGrantsListQueryParamCustomerIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +BenefitGrantsListQueryParamCustomerIDFilter = TypeAliasType( + "BenefitGrantsListQueryParamCustomerIDFilter", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +class BenefitGrantsListRequestTypedDict(TypedDict): + organization_id: NotRequired[ + Nullable[BenefitGrantsListQueryParamOrganizationIDFilterTypedDict] + ] + r"""Filter by organization ID.""" + customer_id: NotRequired[ + Nullable[BenefitGrantsListQueryParamCustomerIDFilterTypedDict] + ] + r"""Filter by customer ID.""" + is_granted: NotRequired[Nullable[bool]] + r"""Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned.""" + page: NotRequired[int] + r"""Page number, defaults to 1.""" + limit: NotRequired[int] + r"""Size of a page, defaults to 10. Maximum is 100.""" + sorting: NotRequired[Nullable[List[BenefitGrantSortProperty]]] + r"""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.""" + + +class BenefitGrantsListRequest(BaseModel): + organization_id: Annotated[ + OptionalNullable[BenefitGrantsListQueryParamOrganizationIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by organization ID.""" + + customer_id: Annotated[ + OptionalNullable[BenefitGrantsListQueryParamCustomerIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by customer ID.""" + + is_granted: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned.""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number, defaults to 1.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 10 + r"""Size of a page, defaults to 10. Maximum is 100.""" + + sorting: Annotated[ + OptionalNullable[List[BenefitGrantSortProperty]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "organization_id", + "customer_id", + "is_granted", + "page", + "limit", + "sorting", + ] + nullable_fields = ["organization_id", "customer_id", "is_granted", "sorting"] + 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 + + +class BenefitGrantsListResponseTypedDict(TypedDict): + result: ListResourceBenefitGrantTypedDict + + +class BenefitGrantsListResponse(BaseModel): + next: Callable[[], Optional[BenefitGrantsListResponse]] + + result: ListResourceBenefitGrant diff --git a/src/polar_sdk/models/benefitgrant.py b/src/polar_sdk/models/benefitgrant.py index 39a8c891..b7d2c5c6 100644 --- a/src/polar_sdk/models/benefitgrant.py +++ b/src/polar_sdk/models/benefitgrant.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .benefit import Benefit, BenefitTypedDict from .benefitgrantcustomproperties import ( BenefitGrantCustomProperties, BenefitGrantCustomPropertiesTypedDict, @@ -75,6 +76,7 @@ class BenefitGrantTypedDict(TypedDict): r"""The ID of the benefit concerned by this grant.""" customer: CustomerTypedDict r"""A customer in an organization.""" + benefit: BenefitTypedDict properties: PropertiesTypedDict granted_at: NotRequired[Nullable[datetime]] r"""The timestamp when the benefit was granted. If `None`, the benefit is not granted.""" @@ -115,6 +117,8 @@ class BenefitGrant(BaseModel): customer: Customer r"""A customer in an organization.""" + benefit: Benefit + properties: Properties granted_at: OptionalNullable[datetime] = UNSET diff --git a/src/polar_sdk/models/benefitgrantsortproperty.py b/src/polar_sdk/models/benefitgrantsortproperty.py new file mode 100644 index 00000000..9a51ca94 --- /dev/null +++ b/src/polar_sdk/models/benefitgrantsortproperty.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BenefitGrantSortProperty(str, Enum): + CREATED_AT = "created_at" + MINUS_CREATED_AT = "-created_at" + GRANTED_AT = "granted_at" + MINUS_GRANTED_AT = "-granted_at" + REVOKED_AT = "revoked_at" + MINUS_REVOKED_AT = "-revoked_at" diff --git a/src/polar_sdk/models/checkoutconfirmstripe.py b/src/polar_sdk/models/checkoutconfirmstripe.py index 20c83cc1..7f2973f6 100644 --- a/src/polar_sdk/models/checkoutconfirmstripe.py +++ b/src/polar_sdk/models/checkoutconfirmstripe.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic @@ -36,7 +36,7 @@ class CheckoutConfirmStripeTypedDict(TypedDict): customer_name: NotRequired[Nullable[str]] customer_email: NotRequired[Nullable[str]] customer_billing_name: NotRequired[Nullable[str]] - customer_billing_address: NotRequired[Nullable[AddressTypedDict]] + customer_billing_address: NotRequired[Nullable[AddressInputTypedDict]] customer_tax_id: NotRequired[Nullable[str]] discount_code: NotRequired[Nullable[str]] r"""Discount code to apply to the checkout.""" @@ -73,7 +73,7 @@ class CheckoutConfirmStripe(BaseModel): customer_billing_name: OptionalNullable[str] = UNSET - customer_billing_address: OptionalNullable[Address] = UNSET + customer_billing_address: OptionalNullable[AddressInput] = UNSET customer_tax_id: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/checkoutcreate.py b/src/polar_sdk/models/checkoutcreate.py index 56416889..8a108788 100644 --- a/src/polar_sdk/models/checkoutcreate.py +++ b/src/polar_sdk/models/checkoutcreate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer @@ -83,7 +83,7 @@ class CheckoutCreateTypedDict(TypedDict): customer_email: NotRequired[Nullable[str]] customer_ip_address: NotRequired[Nullable[str]] customer_billing_name: NotRequired[Nullable[str]] - customer_billing_address: NotRequired[Nullable[AddressTypedDict]] + customer_billing_address: NotRequired[Nullable[AddressInputTypedDict]] customer_tax_id: NotRequired[Nullable[str]] customer_metadata: NotRequired[Dict[str, CheckoutCreateCustomerMetadataTypedDict]] r"""Key-value object allowing you to store additional information that'll be copied to the created customer. @@ -164,7 +164,7 @@ class CheckoutCreate(BaseModel): customer_billing_name: OptionalNullable[str] = UNSET - customer_billing_address: OptionalNullable[Address] = UNSET + customer_billing_address: OptionalNullable[AddressInput] = UNSET customer_tax_id: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/checkoutupdate.py b/src/polar_sdk/models/checkoutupdate.py index e7d7a7b5..cb2241ea 100644 --- a/src/polar_sdk/models/checkoutupdate.py +++ b/src/polar_sdk/models/checkoutupdate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic @@ -56,7 +56,7 @@ class CheckoutUpdateTypedDict(TypedDict): customer_name: NotRequired[Nullable[str]] customer_email: NotRequired[Nullable[str]] customer_billing_name: NotRequired[Nullable[str]] - customer_billing_address: NotRequired[Nullable[AddressTypedDict]] + customer_billing_address: NotRequired[Nullable[AddressInputTypedDict]] customer_tax_id: NotRequired[Nullable[str]] metadata: NotRequired[Dict[str, CheckoutUpdateMetadataTypedDict]] r"""Key-value object allowing you to store additional information. @@ -128,7 +128,7 @@ class CheckoutUpdate(BaseModel): customer_billing_name: OptionalNullable[str] = UNSET - customer_billing_address: OptionalNullable[Address] = UNSET + customer_billing_address: OptionalNullable[AddressInput] = UNSET customer_tax_id: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/checkoutupdatepublic.py b/src/polar_sdk/models/checkoutupdatepublic.py index dd07b92a..0c1a5d24 100644 --- a/src/polar_sdk/models/checkoutupdatepublic.py +++ b/src/polar_sdk/models/checkoutupdatepublic.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic @@ -36,7 +36,7 @@ class CheckoutUpdatePublicTypedDict(TypedDict): customer_name: NotRequired[Nullable[str]] customer_email: NotRequired[Nullable[str]] customer_billing_name: NotRequired[Nullable[str]] - customer_billing_address: NotRequired[Nullable[AddressTypedDict]] + customer_billing_address: NotRequired[Nullable[AddressInputTypedDict]] customer_tax_id: NotRequired[Nullable[str]] discount_code: NotRequired[Nullable[str]] r"""Discount code to apply to the checkout.""" @@ -71,7 +71,7 @@ class CheckoutUpdatePublic(BaseModel): customer_billing_name: OptionalNullable[str] = UNSET - customer_billing_address: OptionalNullable[Address] = UNSET + customer_billing_address: OptionalNullable[AddressInput] = UNSET customer_tax_id: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/customercreate.py b/src/polar_sdk/models/customercreate.py index cdeb150f..f0211462 100644 --- a/src/polar_sdk/models/customercreate.py +++ b/src/polar_sdk/models/customercreate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from .taxidformat import TaxIDFormat from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer @@ -47,7 +47,7 @@ class CustomerCreateTypedDict(TypedDict): r"""The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.""" name: NotRequired[Nullable[str]] r"""The name of the customer.""" - billing_address: NotRequired[Nullable[AddressTypedDict]] + billing_address: NotRequired[Nullable[AddressInputTypedDict]] tax_id: NotRequired[Nullable[List[Nullable[CustomerCreateTaxIDTypedDict]]]] organization_id: NotRequired[Nullable[str]] r"""The ID of the organization owning the customer. **Required unless you use an organization token.**""" @@ -77,7 +77,7 @@ class CustomerCreate(BaseModel): name: OptionalNullable[str] = UNSET r"""The name of the customer.""" - billing_address: OptionalNullable[Address] = UNSET + billing_address: OptionalNullable[AddressInput] = UNSET tax_id: OptionalNullable[List[Nullable[CustomerCreateTaxID]]] = UNSET diff --git a/src/polar_sdk/models/customerorder.py b/src/polar_sdk/models/customerorder.py index 5418962a..eeef71ad 100644 --- a/src/polar_sdk/models/customerorder.py +++ b/src/polar_sdk/models/customerorder.py @@ -38,6 +38,8 @@ class CustomerOrderTypedDict(TypedDict): r"""Sales tax amount in cents.""" total_amount: int r"""Amount in cents, after discounts and taxes.""" + from_balance_amount: int + r"""How much of this invoice was paid using the customer's balance. Amount in cents.""" refunded_amount: int r"""Amount refunded in cents.""" refunded_tax_amount: int @@ -93,6 +95,9 @@ class CustomerOrder(BaseModel): total_amount: int r"""Amount in cents, after discounts and taxes.""" + from_balance_amount: int + r"""How much of this invoice was paid using the customer's balance. Amount in cents.""" + refunded_amount: int r"""Amount refunded in cents.""" diff --git a/src/polar_sdk/models/customerorderupdate.py b/src/polar_sdk/models/customerorderupdate.py index 88343b8b..74bcde76 100644 --- a/src/polar_sdk/models/customerorderupdate.py +++ b/src/polar_sdk/models/customerorderupdate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL from pydantic import model_serializer from typing_extensions import TypedDict @@ -12,7 +12,7 @@ class CustomerOrderUpdateTypedDict(TypedDict): billing_name: Nullable[str] r"""The name of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" - billing_address: Nullable[AddressTypedDict] + billing_address: Nullable[AddressInputTypedDict] r"""The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" @@ -22,7 +22,7 @@ class CustomerOrderUpdate(BaseModel): billing_name: Nullable[str] r"""The name of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" - billing_address: Nullable[Address] + billing_address: Nullable[AddressInput] r"""The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" @model_serializer(mode="wrap") diff --git a/src/polar_sdk/models/customerportalcustomerupdate.py b/src/polar_sdk/models/customerportalcustomerupdate.py index 2e4a7e68..7c72fdbb 100644 --- a/src/polar_sdk/models/customerportalcustomerupdate.py +++ b/src/polar_sdk/models/customerportalcustomerupdate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer from typing_extensions import NotRequired, TypedDict @@ -9,14 +9,14 @@ class CustomerPortalCustomerUpdateTypedDict(TypedDict): billing_name: NotRequired[Nullable[str]] - billing_address: NotRequired[Nullable[AddressTypedDict]] + billing_address: NotRequired[Nullable[AddressInputTypedDict]] tax_id: NotRequired[Nullable[str]] class CustomerPortalCustomerUpdate(BaseModel): billing_name: OptionalNullable[str] = UNSET - billing_address: OptionalNullable[Address] = UNSET + billing_address: OptionalNullable[AddressInput] = UNSET tax_id: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/customers_exportop.py b/src/polar_sdk/models/customers_exportop.py new file mode 100644 index 00000000..44f894b3 --- /dev/null +++ b/src/polar_sdk/models/customers_exportop.py @@ -0,0 +1,65 @@ +"""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 polar_sdk.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +CustomersExportQueryParamOrganizationIDTypedDict = TypeAliasType( + "CustomersExportQueryParamOrganizationIDTypedDict", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +CustomersExportQueryParamOrganizationID = TypeAliasType( + "CustomersExportQueryParamOrganizationID", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +class CustomersExportRequestTypedDict(TypedDict): + organization_id: NotRequired[ + Nullable[CustomersExportQueryParamOrganizationIDTypedDict] + ] + r"""Filter by organization ID.""" + + +class CustomersExportRequest(BaseModel): + organization_id: Annotated[ + OptionalNullable[CustomersExportQueryParamOrganizationID], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by organization ID.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["organization_id"] + nullable_fields = ["organization_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/customerupdate.py b/src/polar_sdk/models/customerupdate.py index c3c7d3f1..b5bc8e8d 100644 --- a/src/polar_sdk/models/customerupdate.py +++ b/src/polar_sdk/models/customerupdate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from .taxidformat import TaxIDFormat from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer @@ -45,7 +45,7 @@ class CustomerUpdateTypedDict(TypedDict): r"""The email address of the customer. This must be unique within the organization.""" name: NotRequired[Nullable[str]] r"""The name of the customer.""" - billing_address: NotRequired[Nullable[AddressTypedDict]] + billing_address: NotRequired[Nullable[AddressInputTypedDict]] tax_id: NotRequired[Nullable[List[Nullable[CustomerUpdateTaxIDTypedDict]]]] external_id: NotRequired[Nullable[str]] r"""The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.""" @@ -72,7 +72,7 @@ class CustomerUpdate(BaseModel): name: OptionalNullable[str] = UNSET r"""The name of the customer.""" - billing_address: OptionalNullable[Address] = UNSET + billing_address: OptionalNullable[AddressInput] = UNSET tax_id: OptionalNullable[List[Nullable[CustomerUpdateTaxID]]] = UNSET diff --git a/src/polar_sdk/models/customerupdateexternalid.py b/src/polar_sdk/models/customerupdateexternalid.py index a5dcfb68..a1a128c5 100644 --- a/src/polar_sdk/models/customerupdateexternalid.py +++ b/src/polar_sdk/models/customerupdateexternalid.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from .taxidformat import TaxIDFormat from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer @@ -47,7 +47,7 @@ class CustomerUpdateExternalIDTypedDict(TypedDict): r"""The email address of the customer. This must be unique within the organization.""" name: NotRequired[Nullable[str]] r"""The name of the customer.""" - billing_address: NotRequired[Nullable[AddressTypedDict]] + billing_address: NotRequired[Nullable[AddressInputTypedDict]] tax_id: NotRequired[ Nullable[List[Nullable[CustomerUpdateExternalIDTaxIDTypedDict]]] ] @@ -74,7 +74,7 @@ class CustomerUpdateExternalID(BaseModel): name: OptionalNullable[str] = UNSET r"""The name of the customer.""" - billing_address: OptionalNullable[Address] = UNSET + billing_address: OptionalNullable[AddressInput] = UNSET tax_id: OptionalNullable[List[Nullable[CustomerUpdateExternalIDTaxID]]] = UNSET diff --git a/src/polar_sdk/models/metricperiod.py b/src/polar_sdk/models/metricperiod.py index 1883210a..3c4f103c 100644 --- a/src/polar_sdk/models/metricperiod.py +++ b/src/polar_sdk/models/metricperiod.py @@ -183,6 +183,94 @@ CheckoutsConversion = TypeAliasType("CheckoutsConversion", Union[int, float]) +CanceledSubscriptionsTypedDict = TypeAliasType( + "CanceledSubscriptionsTypedDict", Union[int, float] +) + + +CanceledSubscriptions = TypeAliasType("CanceledSubscriptions", Union[int, float]) + + +CanceledSubscriptionsCustomerServiceTypedDict = TypeAliasType( + "CanceledSubscriptionsCustomerServiceTypedDict", Union[int, float] +) + + +CanceledSubscriptionsCustomerService = TypeAliasType( + "CanceledSubscriptionsCustomerService", Union[int, float] +) + + +CanceledSubscriptionsLowQualityTypedDict = TypeAliasType( + "CanceledSubscriptionsLowQualityTypedDict", Union[int, float] +) + + +CanceledSubscriptionsLowQuality = TypeAliasType( + "CanceledSubscriptionsLowQuality", Union[int, float] +) + + +CanceledSubscriptionsMissingFeaturesTypedDict = TypeAliasType( + "CanceledSubscriptionsMissingFeaturesTypedDict", Union[int, float] +) + + +CanceledSubscriptionsMissingFeatures = TypeAliasType( + "CanceledSubscriptionsMissingFeatures", Union[int, float] +) + + +CanceledSubscriptionsSwitchedServiceTypedDict = TypeAliasType( + "CanceledSubscriptionsSwitchedServiceTypedDict", Union[int, float] +) + + +CanceledSubscriptionsSwitchedService = TypeAliasType( + "CanceledSubscriptionsSwitchedService", Union[int, float] +) + + +CanceledSubscriptionsTooComplexTypedDict = TypeAliasType( + "CanceledSubscriptionsTooComplexTypedDict", Union[int, float] +) + + +CanceledSubscriptionsTooComplex = TypeAliasType( + "CanceledSubscriptionsTooComplex", Union[int, float] +) + + +CanceledSubscriptionsTooExpensiveTypedDict = TypeAliasType( + "CanceledSubscriptionsTooExpensiveTypedDict", Union[int, float] +) + + +CanceledSubscriptionsTooExpensive = TypeAliasType( + "CanceledSubscriptionsTooExpensive", Union[int, float] +) + + +CanceledSubscriptionsUnusedTypedDict = TypeAliasType( + "CanceledSubscriptionsUnusedTypedDict", Union[int, float] +) + + +CanceledSubscriptionsUnused = TypeAliasType( + "CanceledSubscriptionsUnused", Union[int, float] +) + + +CanceledSubscriptionsOtherTypedDict = TypeAliasType( + "CanceledSubscriptionsOtherTypedDict", Union[int, float] +) + + +CanceledSubscriptionsOther = TypeAliasType( + "CanceledSubscriptionsOther", Union[int, float] +) + + class MetricPeriodTypedDict(TypedDict): timestamp: datetime r"""Timestamp of this period data.""" @@ -208,6 +296,21 @@ class MetricPeriodTypedDict(TypedDict): checkouts: CheckoutsModelTypedDict succeeded_checkouts: SucceededCheckoutsTypedDict checkouts_conversion: CheckoutsConversionTypedDict + canceled_subscriptions: CanceledSubscriptionsTypedDict + canceled_subscriptions_customer_service: ( + CanceledSubscriptionsCustomerServiceTypedDict + ) + canceled_subscriptions_low_quality: CanceledSubscriptionsLowQualityTypedDict + canceled_subscriptions_missing_features: ( + CanceledSubscriptionsMissingFeaturesTypedDict + ) + canceled_subscriptions_switched_service: ( + CanceledSubscriptionsSwitchedServiceTypedDict + ) + canceled_subscriptions_too_complex: CanceledSubscriptionsTooComplexTypedDict + canceled_subscriptions_too_expensive: CanceledSubscriptionsTooExpensiveTypedDict + canceled_subscriptions_unused: CanceledSubscriptionsUnusedTypedDict + canceled_subscriptions_other: CanceledSubscriptionsOtherTypedDict class MetricPeriod(BaseModel): @@ -257,3 +360,21 @@ class MetricPeriod(BaseModel): succeeded_checkouts: SucceededCheckouts checkouts_conversion: CheckoutsConversion + + canceled_subscriptions: CanceledSubscriptions + + canceled_subscriptions_customer_service: CanceledSubscriptionsCustomerService + + canceled_subscriptions_low_quality: CanceledSubscriptionsLowQuality + + canceled_subscriptions_missing_features: CanceledSubscriptionsMissingFeatures + + canceled_subscriptions_switched_service: CanceledSubscriptionsSwitchedService + + canceled_subscriptions_too_complex: CanceledSubscriptionsTooComplex + + canceled_subscriptions_too_expensive: CanceledSubscriptionsTooExpensive + + canceled_subscriptions_unused: CanceledSubscriptionsUnused + + canceled_subscriptions_other: CanceledSubscriptionsOther diff --git a/src/polar_sdk/models/metrics.py b/src/polar_sdk/models/metrics.py index 6813a97f..c298fbc9 100644 --- a/src/polar_sdk/models/metrics.py +++ b/src/polar_sdk/models/metrics.py @@ -51,6 +51,24 @@ class MetricsTypedDict(TypedDict): r"""Information about a metric.""" checkouts_conversion: MetricTypedDict r"""Information about a metric.""" + canceled_subscriptions: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_customer_service: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_low_quality: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_missing_features: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_switched_service: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_too_complex: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_too_expensive: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_unused: MetricTypedDict + r"""Information about a metric.""" + canceled_subscriptions_other: MetricTypedDict + r"""Information about a metric.""" class Metrics(BaseModel): @@ -119,3 +137,30 @@ class Metrics(BaseModel): checkouts_conversion: Metric r"""Information about a metric.""" + + canceled_subscriptions: Metric + r"""Information about a metric.""" + + canceled_subscriptions_customer_service: Metric + r"""Information about a metric.""" + + canceled_subscriptions_low_quality: Metric + r"""Information about a metric.""" + + canceled_subscriptions_missing_features: Metric + r"""Information about a metric.""" + + canceled_subscriptions_switched_service: Metric + r"""Information about a metric.""" + + canceled_subscriptions_too_complex: Metric + r"""Information about a metric.""" + + canceled_subscriptions_too_expensive: Metric + r"""Information about a metric.""" + + canceled_subscriptions_unused: Metric + r"""Information about a metric.""" + + canceled_subscriptions_other: Metric + r"""Information about a metric.""" diff --git a/src/polar_sdk/models/metricstotals.py b/src/polar_sdk/models/metricstotals.py index 4d6226fd..2dbf6f94 100644 --- a/src/polar_sdk/models/metricstotals.py +++ b/src/polar_sdk/models/metricstotals.py @@ -218,6 +218,96 @@ ) +MetricsTotalsCanceledSubscriptionsTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptions = TypeAliasType( + "MetricsTotalsCanceledSubscriptions", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsCustomerServiceTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsCustomerServiceTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsCustomerService = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsCustomerService", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsLowQualityTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsLowQualityTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsLowQuality = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsLowQuality", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsMissingFeaturesTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsMissingFeaturesTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsMissingFeatures = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsMissingFeatures", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsSwitchedServiceTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsSwitchedServiceTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsSwitchedService = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsSwitchedService", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsTooComplexTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsTooComplexTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsTooComplex = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsTooComplex", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsTooExpensiveTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsTooExpensiveTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsTooExpensive = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsTooExpensive", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsUnusedTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsUnusedTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsUnused = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsUnused", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsOtherTypedDict = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsOtherTypedDict", Union[int, float] +) + + +MetricsTotalsCanceledSubscriptionsOther = TypeAliasType( + "MetricsTotalsCanceledSubscriptionsOther", Union[int, float] +) + + class MetricsTotalsTypedDict(TypedDict): orders: MetricsTotalsOrdersTypedDict revenue: MetricsTotalsRevenueTypedDict @@ -245,6 +335,27 @@ class MetricsTotalsTypedDict(TypedDict): checkouts: MetricsTotalsCheckoutsTypedDict succeeded_checkouts: MetricsTotalsSucceededCheckoutsTypedDict checkouts_conversion: MetricsTotalsCheckoutsConversionTypedDict + canceled_subscriptions: MetricsTotalsCanceledSubscriptionsTypedDict + canceled_subscriptions_customer_service: ( + MetricsTotalsCanceledSubscriptionsCustomerServiceTypedDict + ) + canceled_subscriptions_low_quality: ( + MetricsTotalsCanceledSubscriptionsLowQualityTypedDict + ) + canceled_subscriptions_missing_features: ( + MetricsTotalsCanceledSubscriptionsMissingFeaturesTypedDict + ) + canceled_subscriptions_switched_service: ( + MetricsTotalsCanceledSubscriptionsSwitchedServiceTypedDict + ) + canceled_subscriptions_too_complex: ( + MetricsTotalsCanceledSubscriptionsTooComplexTypedDict + ) + canceled_subscriptions_too_expensive: ( + MetricsTotalsCanceledSubscriptionsTooExpensiveTypedDict + ) + canceled_subscriptions_unused: MetricsTotalsCanceledSubscriptionsUnusedTypedDict + canceled_subscriptions_other: MetricsTotalsCanceledSubscriptionsOtherTypedDict class MetricsTotals(BaseModel): @@ -291,3 +402,27 @@ class MetricsTotals(BaseModel): succeeded_checkouts: MetricsTotalsSucceededCheckouts checkouts_conversion: MetricsTotalsCheckoutsConversion + + canceled_subscriptions: MetricsTotalsCanceledSubscriptions + + canceled_subscriptions_customer_service: ( + MetricsTotalsCanceledSubscriptionsCustomerService + ) + + canceled_subscriptions_low_quality: MetricsTotalsCanceledSubscriptionsLowQuality + + canceled_subscriptions_missing_features: ( + MetricsTotalsCanceledSubscriptionsMissingFeatures + ) + + canceled_subscriptions_switched_service: ( + MetricsTotalsCanceledSubscriptionsSwitchedService + ) + + canceled_subscriptions_too_complex: MetricsTotalsCanceledSubscriptionsTooComplex + + canceled_subscriptions_too_expensive: MetricsTotalsCanceledSubscriptionsTooExpensive + + canceled_subscriptions_unused: MetricsTotalsCanceledSubscriptionsUnused + + canceled_subscriptions_other: MetricsTotalsCanceledSubscriptionsOther diff --git a/src/polar_sdk/models/order.py b/src/polar_sdk/models/order.py index f137d55c..4ef98a08 100644 --- a/src/polar_sdk/models/order.py +++ b/src/polar_sdk/models/order.py @@ -92,6 +92,8 @@ class OrderTypedDict(TypedDict): r"""Sales tax amount in cents.""" total_amount: int r"""Amount in cents, after discounts and taxes.""" + from_balance_amount: int + r"""How much of this invoice was paid using the customer's balance. Amount in cents.""" refunded_amount: int r"""Amount refunded in cents.""" refunded_tax_amount: int @@ -150,6 +152,9 @@ class Order(BaseModel): total_amount: int r"""Amount in cents, after discounts and taxes.""" + from_balance_amount: int + r"""How much of this invoice was paid using the customer's balance. Amount in cents.""" + refunded_amount: int r"""Amount refunded in cents.""" diff --git a/src/polar_sdk/models/orderupdate.py b/src/polar_sdk/models/orderupdate.py index 7147c5c5..eaa79bda 100644 --- a/src/polar_sdk/models/orderupdate.py +++ b/src/polar_sdk/models/orderupdate.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .address import Address, AddressTypedDict +from .addressinput import AddressInput, AddressInputTypedDict from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL from pydantic import model_serializer from typing_extensions import TypedDict @@ -12,7 +12,7 @@ class OrderUpdateTypedDict(TypedDict): billing_name: Nullable[str] r"""The name of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" - billing_address: Nullable[AddressTypedDict] + billing_address: Nullable[AddressInputTypedDict] r"""The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" @@ -22,7 +22,7 @@ class OrderUpdate(BaseModel): billing_name: Nullable[str] r"""The name of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" - billing_address: Nullable[Address] + billing_address: Nullable[AddressInput] r"""The address of the customer that should appear on the invoice. Can't be updated after the invoice is generated.""" @model_serializer(mode="wrap") diff --git a/src/polar_sdk/models/organizationsortproperty.py b/src/polar_sdk/models/organizationsortproperty.py index 56b595d5..69020ffd 100644 --- a/src/polar_sdk/models/organizationsortproperty.py +++ b/src/polar_sdk/models/organizationsortproperty.py @@ -11,3 +11,7 @@ class OrganizationSortProperty(str, Enum): MINUS_SLUG = "-slug" NAME = "name" MINUS_NAME = "-name" + NEXT_REVIEW_THRESHOLD = "next_review_threshold" + MINUS_NEXT_REVIEW_THRESHOLD = "-next_review_threshold" + DAYS_IN_STATUS = "days_in_status" + MINUS_DAYS_IN_STATUS = "-days_in_status" diff --git a/src/polar_sdk/models/webhooks_list_webhook_deliveriesop.py b/src/polar_sdk/models/webhooks_list_webhook_deliveriesop.py index fd191039..7c8fad92 100644 --- a/src/polar_sdk/models/webhooks_list_webhook_deliveriesop.py +++ b/src/polar_sdk/models/webhooks_list_webhook_deliveriesop.py @@ -5,6 +5,7 @@ ListResourceWebhookDelivery, ListResourceWebhookDeliveryTypedDict, ) +from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from polar_sdk.utils import FieldMetadata, QueryParamMetadata from pydantic import model_serializer @@ -23,6 +24,10 @@ class WebhooksListWebhookDeliveriesRequestTypedDict(TypedDict): endpoint_id: NotRequired[Nullable[EndpointIDTypedDict]] r"""Filter by webhook endpoint ID.""" + start_timestamp: NotRequired[Nullable[datetime]] + r"""Filter deliveries after this timestamp.""" + end_timestamp: NotRequired[Nullable[datetime]] + r"""Filter deliveries before this timestamp.""" page: NotRequired[int] r"""Page number, defaults to 1.""" limit: NotRequired[int] @@ -36,6 +41,18 @@ class WebhooksListWebhookDeliveriesRequest(BaseModel): ] = UNSET r"""Filter by webhook endpoint ID.""" + start_timestamp: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter deliveries after this timestamp.""" + + end_timestamp: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter deliveries before this timestamp.""" + page: Annotated[ Optional[int], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -50,8 +67,14 @@ class WebhooksListWebhookDeliveriesRequest(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["endpoint_id", "page", "limit"] - nullable_fields = ["endpoint_id"] + optional_fields = [ + "endpoint_id", + "start_timestamp", + "end_timestamp", + "page", + "limit", + ] + nullable_fields = ["endpoint_id", "start_timestamp", "end_timestamp"] null_default_fields = [] serialized = handler(self) diff --git a/src/polar_sdk/polar_benefit_grants.py b/src/polar_sdk/polar_benefit_grants.py new file mode 100644 index 00000000..f10fbdbc --- /dev/null +++ b/src/polar_sdk/polar_benefit_grants.py @@ -0,0 +1,827 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +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.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class PolarBenefitGrants(BaseSDK): + def list( + self, + *, + security: Union[ + models.CustomerPortalBenefitGrantsListSecurity, + models.CustomerPortalBenefitGrantsListSecurityTypedDict, + ], + type_filter: OptionalNullable[ + Union[ + models.QueryParamBenefitTypeFilter, + models.QueryParamBenefitTypeFilterTypedDict, + ] + ] = UNSET, + benefit_id: OptionalNullable[ + Union[ + models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter, + models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilterTypedDict, + ] + ] = UNSET, + organization_id: OptionalNullable[ + Union[ + models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter, + models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilterTypedDict, + ] + ] = UNSET, + checkout_id: OptionalNullable[ + Union[ + models.QueryParamCheckoutIDFilter, + models.QueryParamCheckoutIDFilterTypedDict, + ] + ] = UNSET, + order_id: OptionalNullable[ + Union[ + models.QueryParamOrderIDFilter, models.QueryParamOrderIDFilterTypedDict + ] + ] = UNSET, + subscription_id: OptionalNullable[ + Union[ + models.QueryParamSubscriptionIDFilter, + models.QueryParamSubscriptionIDFilterTypedDict, + ] + ] = UNSET, + page: Optional[int] = 1, + limit: Optional[int] = 10, + sorting: OptionalNullable[ + List[models.CustomerBenefitGrantSortProperty] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + r"""List Benefit Grants + + List benefits grants of the authenticated customer. + + **Scopes**: `customer_portal:read` `customer_portal:write` + + :param security: + :param type_filter: Filter by benefit type. + :param benefit_id: Filter by benefit ID. + :param organization_id: Filter by organization ID. + :param checkout_id: Filter by checkout ID. + :param order_id: Filter by order ID. + :param subscription_id: Filter by subscription ID. + :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. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomerPortalBenefitGrantsListRequest( + type_filter=type_filter, + benefit_id=benefit_id, + organization_id=organization_id, + checkout_id=checkout_id, + order_id=order_id, + subscription_id=subscription_id, + page=page, + limit=limit, + sorting=sorting, + ) + + req = self._build_request( + method="GET", + path="/v1/customer-portal/benefit-grants/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=utils.get_pydantic_model( + security, models.CustomerPortalBenefitGrantsListSecurity + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customer_portal:benefit-grants:list", + oauth2_scopes=None, + security_source=security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.list( + security=security, + type_filter=type_filter, + benefit_id=benefit_id, + organization_id=organization_id, + checkout_id=checkout_id, + order_id=order_id, + subscription_id=subscription_id, + page=next_page, + limit=limit, + sorting=sorting, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.CustomerPortalBenefitGrantsListResponse( + result=unmarshal_json_response( + models.ListResourceCustomerBenefitGrant, http_res + ), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + security: Union[ + models.CustomerPortalBenefitGrantsListSecurity, + models.CustomerPortalBenefitGrantsListSecurityTypedDict, + ], + type_filter: OptionalNullable[ + Union[ + models.QueryParamBenefitTypeFilter, + models.QueryParamBenefitTypeFilterTypedDict, + ] + ] = UNSET, + benefit_id: OptionalNullable[ + Union[ + models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter, + models.CustomerPortalBenefitGrantsListQueryParamBenefitIDFilterTypedDict, + ] + ] = UNSET, + organization_id: OptionalNullable[ + Union[ + models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter, + models.CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilterTypedDict, + ] + ] = UNSET, + checkout_id: OptionalNullable[ + Union[ + models.QueryParamCheckoutIDFilter, + models.QueryParamCheckoutIDFilterTypedDict, + ] + ] = UNSET, + order_id: OptionalNullable[ + Union[ + models.QueryParamOrderIDFilter, models.QueryParamOrderIDFilterTypedDict + ] + ] = UNSET, + subscription_id: OptionalNullable[ + Union[ + models.QueryParamSubscriptionIDFilter, + models.QueryParamSubscriptionIDFilterTypedDict, + ] + ] = UNSET, + page: Optional[int] = 1, + limit: Optional[int] = 10, + sorting: OptionalNullable[ + List[models.CustomerBenefitGrantSortProperty] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + r"""List Benefit Grants + + List benefits grants of the authenticated customer. + + **Scopes**: `customer_portal:read` `customer_portal:write` + + :param security: + :param type_filter: Filter by benefit type. + :param benefit_id: Filter by benefit ID. + :param organization_id: Filter by organization ID. + :param checkout_id: Filter by checkout ID. + :param order_id: Filter by order ID. + :param subscription_id: Filter by subscription ID. + :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. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomerPortalBenefitGrantsListRequest( + type_filter=type_filter, + benefit_id=benefit_id, + organization_id=organization_id, + checkout_id=checkout_id, + order_id=order_id, + subscription_id=subscription_id, + page=page, + limit=limit, + sorting=sorting, + ) + + req = self._build_request_async( + method="GET", + path="/v1/customer-portal/benefit-grants/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=utils.get_pydantic_model( + security, models.CustomerPortalBenefitGrantsListSecurity + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customer_portal:benefit-grants:list", + oauth2_scopes=None, + security_source=security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.list( + security=security, + type_filter=type_filter, + benefit_id=benefit_id, + organization_id=organization_id, + checkout_id=checkout_id, + order_id=order_id, + subscription_id=subscription_id, + page=next_page, + limit=limit, + sorting=sorting, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.CustomerPortalBenefitGrantsListResponse( + result=unmarshal_json_response( + models.ListResourceCustomerBenefitGrant, http_res + ), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + security: Union[ + models.CustomerPortalBenefitGrantsGetSecurity, + models.CustomerPortalBenefitGrantsGetSecurityTypedDict, + ], + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerBenefitGrant: + r"""Get Benefit Grant + + Get a benefit grant by ID for the authenticated customer. + + **Scopes**: `customer_portal:read` `customer_portal:write` + + :param security: + :param id: The benefit grant ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomerPortalBenefitGrantsGetRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/v1/customer-portal/benefit-grants/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=utils.get_pydantic_model( + security, models.CustomerPortalBenefitGrantsGetSecurity + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customer_portal:benefit-grants:get", + oauth2_scopes=None, + security_source=security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CustomerBenefitGrant, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + security: Union[ + models.CustomerPortalBenefitGrantsGetSecurity, + models.CustomerPortalBenefitGrantsGetSecurityTypedDict, + ], + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerBenefitGrant: + r"""Get Benefit Grant + + Get a benefit grant by ID for the authenticated customer. + + **Scopes**: `customer_portal:read` `customer_portal:write` + + :param security: + :param id: The benefit grant ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomerPortalBenefitGrantsGetRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/customer-portal/benefit-grants/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=utils.get_pydantic_model( + security, models.CustomerPortalBenefitGrantsGetSecurity + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customer_portal:benefit-grants:get", + oauth2_scopes=None, + security_source=security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CustomerBenefitGrant, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + security: Union[ + models.CustomerPortalBenefitGrantsUpdateSecurity, + models.CustomerPortalBenefitGrantsUpdateSecurityTypedDict, + ], + id: str, + customer_benefit_grant_update: Union[ + models.CustomerBenefitGrantUpdate, + models.CustomerBenefitGrantUpdateTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerBenefitGrant: + r"""Update Benefit Grant + + Update a benefit grant for the authenticated customer. + + **Scopes**: `customer_portal:write` + + :param security: + :param id: The benefit grant ID. + :param customer_benefit_grant_update: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomerPortalBenefitGrantsUpdateRequest( + id=id, + customer_benefit_grant_update=utils.get_pydantic_model( + customer_benefit_grant_update, models.CustomerBenefitGrantUpdate + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/customer-portal/benefit-grants/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=utils.get_pydantic_model( + security, models.CustomerPortalBenefitGrantsUpdateSecurity + ), + get_serialized_body=lambda: utils.serialize_request_body( + request.customer_benefit_grant_update, + False, + False, + "json", + models.CustomerBenefitGrantUpdate, + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customer_portal:benefit-grants:update", + oauth2_scopes=None, + security_source=security, + ), + request=req, + error_status_codes=["403", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CustomerBenefitGrant, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(models.NotPermittedData, http_res) + raise models.NotPermitted(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + security: Union[ + models.CustomerPortalBenefitGrantsUpdateSecurity, + models.CustomerPortalBenefitGrantsUpdateSecurityTypedDict, + ], + id: str, + customer_benefit_grant_update: Union[ + models.CustomerBenefitGrantUpdate, + models.CustomerBenefitGrantUpdateTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerBenefitGrant: + r"""Update Benefit Grant + + Update a benefit grant for the authenticated customer. + + **Scopes**: `customer_portal:write` + + :param security: + :param id: The benefit grant ID. + :param customer_benefit_grant_update: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CustomerPortalBenefitGrantsUpdateRequest( + id=id, + customer_benefit_grant_update=utils.get_pydantic_model( + customer_benefit_grant_update, models.CustomerBenefitGrantUpdate + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/customer-portal/benefit-grants/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=utils.get_pydantic_model( + security, models.CustomerPortalBenefitGrantsUpdateSecurity + ), + get_serialized_body=lambda: utils.serialize_request_body( + request.customer_benefit_grant_update, + False, + False, + "json", + models.CustomerBenefitGrantUpdate, + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="customer_portal:benefit-grants:update", + oauth2_scopes=None, + security_source=security, + ), + request=req, + error_status_codes=["403", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CustomerBenefitGrant, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(models.NotPermittedData, http_res) + raise models.NotPermitted(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) diff --git a/src/polar_sdk/sdk.py b/src/polar_sdk/sdk.py index 5b4f95c4..ec351565 100644 --- a/src/polar_sdk/sdk.py +++ b/src/polar_sdk/sdk.py @@ -15,6 +15,7 @@ import weakref if TYPE_CHECKING: + from polar_sdk.benefit_grants import BenefitGrants from polar_sdk.benefits import Benefits from polar_sdk.checkout_links import CheckoutLinks from polar_sdk.checkouts import Checkouts @@ -42,13 +43,14 @@ class Polar(BaseSDK): r"""Polar API: Polar HTTP and Webhooks API - Read the docs at https://docs.polar.sh/api-reference + Read the docs at https://polar.sh/docs/api-reference """ organizations: "Organizations" subscriptions: "Subscriptions" oauth2: "Oauth2" benefits: "Benefits" + benefit_grants: "BenefitGrants" webhooks: "Webhooks" products: "Products" orders: "Orders" @@ -72,6 +74,7 @@ class Polar(BaseSDK): "subscriptions": ("polar_sdk.subscriptions", "Subscriptions"), "oauth2": ("polar_sdk.oauth2", "Oauth2"), "benefits": ("polar_sdk.benefits", "Benefits"), + "benefit_grants": ("polar_sdk.benefit_grants", "BenefitGrants"), "webhooks": ("polar_sdk.webhooks", "Webhooks"), "products": ("polar_sdk.products", "Products"), "orders": ("polar_sdk.orders", "Orders"), diff --git a/src/polar_sdk/webhooks.py b/src/polar_sdk/webhooks.py index 0340e3eb..6315d158 100644 --- a/src/polar_sdk/webhooks.py +++ b/src/polar_sdk/webhooks.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK +from datetime import datetime from jsonpath import JSONPath from polar_sdk import models, utils from polar_sdk._hooks import HookContext @@ -1248,6 +1249,8 @@ def list_webhook_deliveries( endpoint_id: OptionalNullable[ Union[models.EndpointID, models.EndpointIDTypedDict] ] = UNSET, + start_timestamp: OptionalNullable[datetime] = UNSET, + end_timestamp: OptionalNullable[datetime] = UNSET, page: Optional[int] = 1, limit: Optional[int] = 10, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1264,6 +1267,8 @@ def list_webhook_deliveries( **Scopes**: `webhooks:read` `webhooks:write` :param endpoint_id: Filter by webhook endpoint ID. + :param start_timestamp: Filter deliveries after this timestamp. + :param end_timestamp: Filter deliveries before this timestamp. :param page: Page number, defaults to 1. :param limit: Size of a page, defaults to 10. Maximum is 100. :param retries: Override the default retry configuration for this method @@ -1283,6 +1288,8 @@ def list_webhook_deliveries( request = models.WebhooksListWebhookDeliveriesRequest( endpoint_id=endpoint_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, page=page, limit=limit, ) @@ -1344,6 +1351,8 @@ def next_func() -> Optional[models.WebhooksListWebhookDeliveriesResponse]: return self.list_webhook_deliveries( endpoint_id=endpoint_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, page=next_page, limit=limit, retries=retries, @@ -1377,6 +1386,8 @@ async def list_webhook_deliveries_async( endpoint_id: OptionalNullable[ Union[models.EndpointID, models.EndpointIDTypedDict] ] = UNSET, + start_timestamp: OptionalNullable[datetime] = UNSET, + end_timestamp: OptionalNullable[datetime] = UNSET, page: Optional[int] = 1, limit: Optional[int] = 10, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1393,6 +1404,8 @@ async def list_webhook_deliveries_async( **Scopes**: `webhooks:read` `webhooks:write` :param endpoint_id: Filter by webhook endpoint ID. + :param start_timestamp: Filter deliveries after this timestamp. + :param end_timestamp: Filter deliveries before this timestamp. :param page: Page number, defaults to 1. :param limit: Size of a page, defaults to 10. Maximum is 100. :param retries: Override the default retry configuration for this method @@ -1412,6 +1425,8 @@ async def list_webhook_deliveries_async( request = models.WebhooksListWebhookDeliveriesRequest( endpoint_id=endpoint_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, page=page, limit=limit, ) @@ -1473,6 +1488,8 @@ def next_func() -> Optional[models.WebhooksListWebhookDeliveriesResponse]: return self.list_webhook_deliveries( endpoint_id=endpoint_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, page=next_page, limit=limit, retries=retries,