diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index eeb3a836..e0876d25 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: 1a9f907dc5e58152809c9ec402f1c597 + docChecksum: d3bc341da9dfca968eb68558ddfef3ec docVersion: 0.1.0 speakeasyVersion: 1.648.0 generationVersion: 2.737.0 - releaseVersion: 0.31.4 - configChecksum: ec856ac07327b342be114bcf4015df7f + releaseVersion: 0.31.5 + configChecksum: 4c09d6e506f6f20c4d8821ec6e62bb69 repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -359,6 +359,7 @@ generatedFiles: - docs/models/customerorderpaymentstatus.md - docs/models/customerorderproduct.md - docs/models/customerorderproductprices.md + - docs/models/customerorderreceipt.md - docs/models/customerordersortproperty.md - docs/models/customerordersubscription.md - docs/models/customerorderupdate.md @@ -437,6 +438,8 @@ generatedFiles: - docs/models/customerportalorderslistrequest.md - docs/models/customerportalorderslistresponse.md - docs/models/customerportalorderslistsecurity.md + - docs/models/customerportalordersreceiptrequest.md + - docs/models/customerportalordersreceiptsecurity.md - docs/models/customerportalordersupdaterequest.md - docs/models/customerportalordersupdatesecurity.md - docs/models/customerportalorganizationsgetrequest.md @@ -578,23 +581,19 @@ generatedFiles: - docs/models/discount.md - docs/models/discountcreate.md - docs/models/discountduration.md + - docs/models/discountfixedcreate.md + - docs/models/discountfixedcreatemetadata.md - docs/models/discountfixedonceforeverduration.md - docs/models/discountfixedonceforeverdurationbase.md - - docs/models/discountfixedonceforeverdurationcreate.md - - docs/models/discountfixedonceforeverdurationcreatemetadata.md - docs/models/discountfixedrepeatduration.md - docs/models/discountfixedrepeatdurationbase.md - - docs/models/discountfixedrepeatdurationcreate.md - - docs/models/discountfixedrepeatdurationcreatemetadata.md - docs/models/discountidfilter.md + - docs/models/discountpercentagecreate.md + - docs/models/discountpercentagecreatemetadata.md - docs/models/discountpercentageonceforeverduration.md - docs/models/discountpercentageonceforeverdurationbase.md - - docs/models/discountpercentageonceforeverdurationcreate.md - - docs/models/discountpercentageonceforeverdurationcreatemetadata.md - docs/models/discountpercentagerepeatduration.md - docs/models/discountpercentagerepeatdurationbase.md - - docs/models/discountpercentagerepeatdurationcreate.md - - docs/models/discountpercentagerepeatdurationcreatemetadata.md - docs/models/discountproduct.md - docs/models/discountsdeleterequest.md - docs/models/discountsgetrequest.md @@ -915,6 +914,7 @@ generatedFiles: - docs/models/orderpaidevent.md - docs/models/orderpaidmetadata.md - docs/models/orderproduct.md + - docs/models/orderreceipt.md - docs/models/orderrefundedevent.md - docs/models/orderrefundedmetadata.md - docs/models/ordersexportqueryparamorganizationidfilter.md @@ -933,6 +933,7 @@ generatedFiles: - docs/models/orderslistresponse.md - docs/models/ordersmodel.md - docs/models/ordersortproperty.md + - docs/models/ordersreceiptrequest.md - docs/models/orderstatus.md - docs/models/ordersubscription.md - docs/models/ordersupdaterequest.md @@ -1081,6 +1082,7 @@ generatedFiles: - docs/models/revenue.md - docs/models/revoketokenrequest.md - docs/models/revoketokenresponse.md + - docs/models/role.md - docs/models/s3downloadurl.md - docs/models/s3filecreatemultipart.md - docs/models/s3filecreatepart.md @@ -1502,6 +1504,7 @@ generatedFiles: - src/polar_sdk/models/customer_portal_orders_getop.py - src/polar_sdk/models/customer_portal_orders_invoiceop.py - src/polar_sdk/models/customer_portal_orders_listop.py + - src/polar_sdk/models/customer_portal_orders_receiptop.py - src/polar_sdk/models/customer_portal_orders_updateop.py - src/polar_sdk/models/customer_portal_organizations_getop.py - src/polar_sdk/models/customer_portal_seats_assign_seatop.py @@ -1563,6 +1566,7 @@ generatedFiles: - src/polar_sdk/models/customerorderpaymentconfirmation.py - src/polar_sdk/models/customerorderpaymentstatus.py - src/polar_sdk/models/customerorderproduct.py + - src/polar_sdk/models/customerorderreceipt.py - src/polar_sdk/models/customerordersortproperty.py - src/polar_sdk/models/customerordersubscription.py - src/polar_sdk/models/customerorderupdate.py @@ -1655,18 +1659,16 @@ generatedFiles: - src/polar_sdk/models/discount.py - src/polar_sdk/models/discountcreate.py - src/polar_sdk/models/discountduration.py + - src/polar_sdk/models/discountfixedcreate.py - src/polar_sdk/models/discountfixedonceforeverduration.py - src/polar_sdk/models/discountfixedonceforeverdurationbase.py - - src/polar_sdk/models/discountfixedonceforeverdurationcreate.py - src/polar_sdk/models/discountfixedrepeatduration.py - src/polar_sdk/models/discountfixedrepeatdurationbase.py - - src/polar_sdk/models/discountfixedrepeatdurationcreate.py + - src/polar_sdk/models/discountpercentagecreate.py - src/polar_sdk/models/discountpercentageonceforeverduration.py - src/polar_sdk/models/discountpercentageonceforeverdurationbase.py - - src/polar_sdk/models/discountpercentageonceforeverdurationcreate.py - src/polar_sdk/models/discountpercentagerepeatduration.py - src/polar_sdk/models/discountpercentagerepeatdurationbase.py - - src/polar_sdk/models/discountpercentagerepeatdurationcreate.py - src/polar_sdk/models/discountproduct.py - src/polar_sdk/models/discounts_deleteop.py - src/polar_sdk/models/discounts_getop.py @@ -1844,12 +1846,14 @@ generatedFiles: - src/polar_sdk/models/orderpaidevent.py - src/polar_sdk/models/orderpaidmetadata.py - src/polar_sdk/models/orderproduct.py + - src/polar_sdk/models/orderreceipt.py - src/polar_sdk/models/orderrefundedevent.py - src/polar_sdk/models/orderrefundedmetadata.py - src/polar_sdk/models/orders_exportop.py - src/polar_sdk/models/orders_generate_invoiceop.py - src/polar_sdk/models/orders_getop.py - src/polar_sdk/models/orders_invoiceop.py + - src/polar_sdk/models/orders_receiptop.py - src/polar_sdk/models/orders_updateop.py - src/polar_sdk/models/ordersortproperty.py - src/polar_sdk/models/orderstatus.py @@ -2175,7 +2179,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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": true, "key1": 2184.01, "key2": ""}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {}, "id": "", "created_at": "2025-02-09T20:19:15.400Z", "modified_at": "2023-03-30T07:05:37.419Z", "trial_interval": "day", "trial_interval_count": 952546, "name": "", "description": "against outbid to petty yeast off meanwhile colonialism", "visibility": "private", "recurring_interval": "month", "recurring_interval_count": 1806, "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "type": "fixed", "basis_points": 1000, "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": ""}], "description": "Pro Plan"}} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": true, "key1": 2184.01, "key2": ""}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {}, "id": "", "created_at": "2025-02-09T20:19:15.400Z", "modified_at": "2023-03-30T07:05:37.419Z", "trial_interval": "day", "trial_interval_count": 952546, "name": "", "description": "against outbid to petty yeast off meanwhile colonialism", "visibility": "private", "recurring_interval": "month", "recurring_interval_count": 1806, "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "type": "fixed", "basis_points": 1000, "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}} responses: "200": application/json: "" @@ -2184,7 +2188,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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": false, "key1": 187509}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {}, "id": "", "created_at": "2024-07-10T12:45:44.731Z", "modified_at": "2024-09-19T13:13:25.785Z", "trial_interval": "week", "trial_interval_count": 804823, "name": "", "description": "bossy direct reservation quaintly atop interestingly", "visibility": "draft", "recurring_interval": "month", "recurring_interval_count": 443415, "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 227959, "type": "fixed", "amount": 1000, "currency": "usd", "amounts": {"eur": 900, "usd": 1000}, "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": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 340177, "status": "unpaid", "current_period_start": "2023-08-26T12:56:24.423Z", "current_period_end": "2024-02-06T09:06:51.703Z", "trial_start": "2024-01-06T18:11:55.943Z", "trial_end": "2025-06-26T08:06:49.783Z", "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": ""}], "description": "Pro Plan"}} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": false, "key1": 187509}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {}, "id": "", "created_at": "2024-07-10T12:45:44.731Z", "modified_at": "2024-09-19T13:13:25.785Z", "trial_interval": "week", "trial_interval_count": 804823, "name": "", "description": "bossy direct reservation quaintly atop interestingly", "visibility": "draft", "recurring_interval": "month", "recurring_interval_count": 443415, "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 227959, "type": "fixed", "amount": 1000, "currency": "usd", "amounts": {"eur": 900, "usd": 1000}, "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": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 340177, "status": "unpaid", "current_period_start": "2023-08-26T12:56:24.423Z", "current_period_end": "2024-02-06T09:06:51.703Z", "trial_start": "2024-01-06T18:11:55.943Z", "trial_end": "2025-06-26T08:06:49.783Z", "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}} responses: "200": application/json: "" @@ -2193,7 +2197,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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "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, "type": "individual", "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"}, "product": {"metadata": {"key": "", "key1": false, "key2": 1122.47}, "id": "", "created_at": "2024-03-19T01:07:15.346Z", "modified_at": "2025-03-22T13:41:39.854Z", "trial_interval": "year", "trial_interval_count": 650431, "name": "", "description": "instead unnaturally curly scared but definite knowledgeably", "visibility": "public", "recurring_interval": "year", "recurring_interval_count": 856211, "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": 10000, "currency": "usd", "recurring_interval": "year", "recurring_interval_count": 648656, "status": "canceled", "current_period_start": "2023-02-24T15:15:22.018Z", "current_period_end": "2023-12-07T15:09:08.144Z", "trial_start": "2025-12-21T22:38:27.436Z", "trial_end": "2024-01-10T03:46:58.354Z", "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": [], "description": "Pro Plan"}} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "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, "type": "individual", "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"}, "product": {"metadata": {"key": "", "key1": false, "key2": 1122.47}, "id": "", "created_at": "2024-03-19T01:07:15.346Z", "modified_at": "2025-03-22T13:41:39.854Z", "trial_interval": "year", "trial_interval_count": 650431, "name": "", "description": "instead unnaturally curly scared but definite knowledgeably", "visibility": "public", "recurring_interval": "year", "recurring_interval_count": 856211, "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": 10000, "currency": "usd", "recurring_interval": "year", "recurring_interval_count": 648656, "status": "canceled", "current_period_start": "2023-02-24T15:15:22.018Z", "current_period_end": "2023-12-07T15:09:08.144Z", "trial_start": "2025-12-21T22:38:27.436Z", "trial_end": "2024-01-10T03:46:58.354Z", "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": [], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}} responses: "200": application/json: "" @@ -2202,7 +2206,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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": 4542.91}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {"key": 4016.73, "key1": 9058.31, "key2": true}, "id": "", "created_at": "2024-10-26T18:25:25.517Z", "modified_at": "2023-07-26T10:28:20.791Z", "trial_interval": "month", "trial_interval_count": 638840, "name": "", "description": null, "visibility": "private", "recurring_interval": "year", "recurring_interval_count": 737679, "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "type": "percentage", "basis_points": 1000, "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": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 547568, "status": "past_due", "current_period_start": "2025-08-22T13:19:25.286Z", "current_period_end": "2025-05-03T08:49:50.424Z", "trial_start": "2023-11-19T10:04:04.704Z", "trial_end": "2025-09-27T15:34:09.130Z", "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": ""}], "description": "Pro Plan"}} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": 4542.91}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {"key": 4016.73, "key1": 9058.31, "key2": true}, "id": "", "created_at": "2024-10-26T18:25:25.517Z", "modified_at": "2023-07-26T10:28:20.791Z", "trial_interval": "month", "trial_interval_count": 638840, "name": "", "description": null, "visibility": "private", "recurring_interval": "year", "recurring_interval_count": 737679, "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "type": "percentage", "basis_points": 1000, "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": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 547568, "status": "past_due", "current_period_start": "2025-08-22T13:19:25.286Z", "current_period_end": "2025-05-03T08:49:50.424Z", "trial_start": "2023-11-19T10:04:04.704Z", "trial_end": "2025-09-27T15:34:09.130Z", "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}} responses: "200": application/json: "" @@ -2301,7 +2305,7 @@ examples: _endpointorganization_updated_post: speakeasy-default-endpointorganization-updated-post: requestBody: - application/json: {"type": "organization.updated", "timestamp": "2025-08-19T15:02:44.139Z", "data": {"created_at": "2025-08-19T15:02:44.139Z", "modified_at": "2025-08-23T00:45:50.780Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": null, "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Lemuel44@gmail.com", "website": "", "socials": [{"platform": "tiktok", "url": "https://grizzled-patroller.info/"}, {"platform": "tiktok", "url": "https://grizzled-patroller.info/"}], "status": "active", "details_submitted_at": null, "default_presentment_currency": "", "default_tax_behavior": "exclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "tinybird_read": false, "tinybird_compare": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "invoice", "benefit_revocation_grace_period": 877397, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": true, "subscription_cycled_after_trial": false, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": true}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}}} + application/json: {"type": "organization.updated", "timestamp": "2025-08-19T15:02:44.139Z", "data": {"created_at": "2025-08-19T15:02:44.139Z", "modified_at": "2025-08-23T00:45:50.780Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": null, "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Lemuel44@gmail.com", "website": "", "socials": [{"platform": "tiktok", "url": "https://grizzled-patroller.info/"}, {"platform": "tiktok", "url": "https://grizzled-patroller.info/"}], "status": "active", "details_submitted_at": null, "default_presentment_currency": "", "default_tax_behavior": "exclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "invoice", "benefit_revocation_grace_period": 877397, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": true, "subscription_cycled_after_trial": false, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": true}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}}} responses: "200": application/json: "" @@ -2378,7 +2382,7 @@ examples: application/json: {"name": "", "slug": ""} responses: "201": - application/json: {"created_at": "2024-12-19T02:20:41.368Z", "modified_at": "2024-07-08T16:38:56.712Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://menacing-draft.net", "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Ursula99@yahoo.com", "website": "", "socials": [{"platform": "facebook", "url": "https://likable-commodity.biz/"}], "status": "denied", "details_submitted_at": "2024-04-04T18:10:47.254Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "tinybird_read": false, "tinybird_compare": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "prorate", "benefit_revocation_grace_period": 655199, "prevent_trial_abuse": false, "allow_customer_updates": true}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": false, "subscription_past_due": false, "subscription_renewal_reminder": false, "subscription_revoked": false, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": false, "api_access": false, "dashboard_access": false}} + application/json: {"created_at": "2024-12-19T02:20:41.368Z", "modified_at": "2024-07-08T16:38:56.712Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://menacing-draft.net", "proration_behavior": "prorate", "allow_customer_updates": false, "email": "Ursula99@yahoo.com", "website": "", "socials": [{"platform": "facebook", "url": "https://likable-commodity.biz/"}], "status": "denied", "details_submitted_at": "2024-04-04T18:10:47.254Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "prorate", "benefit_revocation_grace_period": 655199, "prevent_trial_abuse": false, "allow_customer_updates": true}, "notification_settings": {"new_order": false, "new_subscription": false}, "customer_email_settings": {"order_confirmation": false, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": false, "subscription_past_due": false, "subscription_renewal_reminder": false, "subscription_revoked": false, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": false, "api_access": false, "dashboard_access": false}} "422": application/json: {} organizations:get: @@ -2388,7 +2392,7 @@ examples: id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737" responses: "200": - application/json: {"created_at": "2024-06-18T23:12:24.609Z", "modified_at": "2023-11-22T07:49:02.109Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://far-off-resource.com", "proration_behavior": "invoice", "allow_customer_updates": true, "email": "Dejon.Jakubowski-Bashirian6@gmail.com", "website": null, "socials": [{"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}], "status": "denied", "details_submitted_at": "2023-07-16T01:59:28.607Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "tinybird_read": false, "tinybird_compare": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "prorate", "benefit_revocation_grace_period": 488109, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": true}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": true, "subscription_confirmation": true, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": false, "subscription_renewal_reminder": true, "subscription_revoked": true, "subscription_trial_conversion_reminder": true, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": true, "subscription_renewals": true, "payouts": false, "refunds": false, "api_access": true, "dashboard_access": false}} + application/json: {"created_at": "2024-06-18T23:12:24.609Z", "modified_at": "2023-11-22T07:49:02.109Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://far-off-resource.com", "proration_behavior": "invoice", "allow_customer_updates": true, "email": "Dejon.Jakubowski-Bashirian6@gmail.com", "website": null, "socials": [{"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}, {"platform": "other", "url": "https://tedious-habit.com"}], "status": "denied", "details_submitted_at": "2023-07-16T01:59:28.607Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "proration_behavior": "prorate", "benefit_revocation_grace_period": 488109, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": true}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": true, "subscription_confirmation": true, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": false, "subscription_renewal_reminder": true, "subscription_revoked": true, "subscription_trial_conversion_reminder": true, "subscription_uncanceled": false, "subscription_updated": true}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": false}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": true, "subscription_renewals": true, "payouts": false, "refunds": false, "api_access": true, "dashboard_access": false}} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -2402,7 +2406,7 @@ examples: application/json: {} responses: "200": - application/json: {"created_at": "2024-01-10T12:09:47.665Z", "modified_at": "2025-07-12T14:18:16.022Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://juvenile-deed.name/", "proration_behavior": "invoice", "allow_customer_updates": false, "email": "Stanford.Streich62@gmail.com", "website": "", "socials": [{"platform": "github", "url": "https://violent-ownership.org/"}], "status": "snoozed", "details_submitted_at": "2024-05-08T13:53:13.516Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "tinybird_read": false, "tinybird_compare": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "invoice", "benefit_revocation_grace_period": 341703, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": false}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}} + application/json: {"created_at": "2024-01-10T12:09:47.665Z", "modified_at": "2025-07-12T14:18:16.022Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://juvenile-deed.name/", "proration_behavior": "invoice", "allow_customer_updates": false, "email": "Stanford.Streich62@gmail.com", "website": "", "socials": [{"platform": "github", "url": "https://violent-ownership.org/"}], "status": "snoozed", "details_submitted_at": "2024-05-08T13:53:13.516Z", "default_presentment_currency": "", "default_tax_behavior": "inclusive", "feature_settings": {"issue_funding_enabled": false, "seat_based_pricing_enabled": false, "wallets_enabled": false, "member_model_enabled": false, "checkout_localization_enabled": false, "reset_proration_behavior_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "proration_behavior": "invoice", "benefit_revocation_grace_period": 341703, "prevent_trial_abuse": false, "allow_customer_updates": false}, "notification_settings": {"new_order": true, "new_subscription": false}, "customer_email_settings": {"order_confirmation": true, "subscription_cancellation": false, "subscription_confirmation": false, "subscription_cycled": false, "subscription_cycled_after_trial": true, "subscription_past_due": true, "subscription_renewal_reminder": false, "subscription_revoked": true, "subscription_trial_conversion_reminder": false, "subscription_uncanceled": true, "subscription_updated": false}, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": true}}, "account_id": "", "payout_account_id": "", "capabilities": {"checkout_payments": false, "subscription_renewals": false, "payouts": false, "refunds": true, "api_access": true, "dashboard_access": true}} "403": application/json: {"error": "NotPermitted", "detail": ""} "404": @@ -2711,7 +2715,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, "applied_balance_amount": 901379, "due_amount": 465509, "refunded_amount": 70124, "refunded_tax_amount": 297395, "currency": "Balboa", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-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, "type": "team", "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"}, "product": {"metadata": {}, "id": "", "created_at": "2025-02-24T18:51:29.694Z", "modified_at": "2025-04-13T23:14:41.573Z", "trial_interval": "week", "trial_interval_count": null, "name": "", "description": "expense pip blue furthermore gnash frail yet ugly", "visibility": "public", "recurring_interval": "year", "recurring_interval_count": 465509, "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", "recurring_interval_count": 76694, "status": "past_due", "current_period_start": "2023-08-06T07:04:45.093Z", "current_period_end": "2024-09-25T19:02:24.370Z", "trial_start": "2024-02-10T15:29:33.963Z", "trial_end": "2023-01-17T22:53:29.526Z", "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": ""}], "description": "Pro Plan"}], "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, "applied_balance_amount": 901379, "due_amount": 465509, "refunded_amount": 70124, "refunded_tax_amount": 297395, "currency": "Balboa", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-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, "type": "team", "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"}, "product": {"metadata": {}, "id": "", "created_at": "2025-02-24T18:51:29.694Z", "modified_at": "2025-04-13T23:14:41.573Z", "trial_interval": "week", "trial_interval_count": null, "name": "", "description": "expense pip blue furthermore gnash frail yet ugly", "visibility": "public", "recurring_interval": "year", "recurring_interval_count": 465509, "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", "recurring_interval_count": 76694, "status": "past_due", "current_period_start": "2023-08-06T07:04:45.093Z", "current_period_end": "2024-09-25T19:02:24.370Z", "trial_start": "2024-02-10T15:29:33.963Z", "trial_end": "2023-01-17T22:53:29.526Z", "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}], "pagination": {"total_count": 754496, "max_page": 599128}} "422": application/json: {} orders:get: @@ -2721,7 +2725,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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": ""}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {"key": 709557, "key1": true, "key2": 1589.86}, "id": "", "created_at": "2024-06-13T05:22:39.981Z", "modified_at": "2025-08-06T17:05:37.045Z", "trial_interval": "month", "trial_interval_count": 421146, "name": "", "description": "tarry subexpression brr huzzah officially", "visibility": "draft", "recurring_interval": "year", "recurring_interval_count": 566234, "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": [], "description": "Pro Plan"} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": ""}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "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, "type": "individual", "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"}, "product": {"metadata": {"key": 709557, "key1": true, "key2": 1589.86}, "id": "", "created_at": "2024-06-13T05:22:39.981Z", "modified_at": "2025-08-06T17:05:37.045Z", "trial_interval": "month", "trial_interval_count": 421146, "name": "", "description": "tarry subexpression brr huzzah officially", "visibility": "draft", "recurring_interval": "year", "recurring_interval_count": 566234, "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": [], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3140,7 +3144,7 @@ examples: discounts:create: speakeasy-default-discounts:create: requestBody: - application/json: {"duration": "once", "type": "fixed", "basis_points": 449604, "name": "", "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"} + application/json: {"name": "", "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "type": "fixed", "duration": "once"} responses: "201": application/json: {"duration": "repeating", "duration_in_months": 585985, "type": "percentage", "basis_points": 554206, "created_at": "2024-06-28T22:01:22.215Z", "modified_at": "2024-08-18T19:27:56.279Z", "id": "", "metadata": {"key": true}, "name": "", "code": "", "starts_at": "2025-04-24T07:32:57.459Z", "ends_at": "2024-12-27T08:56:12.284Z", "max_redemptions": 573217, "redemptions_count": 692992, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "products": []} @@ -3516,7 +3520,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, "applied_balance_amount": 281470, "due_amount": 702832, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "trial_interval": "month", "trial_interval_count": 459585, "name": "", "description": "planula breakable gee stranger", "visibility": "draft", "recurring_interval": null, "recurring_interval_count": 702832, "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, "is_deleted": true, "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, "is_deleted": 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/", "proration_behavior": "invoice", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": 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", "recurring_interval_count": 962124, "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "trial_start": "2025-06-16T19:11:41.518Z", "trial_end": "2025-10-10T11:49:01.641Z", "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": ""}], "description": "Pro Plan"}, {"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, "applied_balance_amount": 962124, "due_amount": 459585, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "trial_interval": null, "trial_interval_count": null, "name": "", "description": "planula breakable gee stranger", "visibility": "public", "recurring_interval": null, "recurring_interval_count": 688736, "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, "is_deleted": 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, "is_deleted": true, "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/", "proration_behavior": "prorate", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": 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", "recurring_interval_count": 819161, "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "trial_start": "2024-08-14T11:34:08.193Z", "trial_end": null, "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": ""}], "description": "Pro Plan"}], "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, "applied_balance_amount": 281470, "due_amount": 702832, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": false, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "trial_interval": "month", "trial_interval_count": 459585, "name": "", "description": "planula breakable gee stranger", "visibility": "draft", "recurring_interval": null, "recurring_interval_count": 702832, "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, "is_deleted": true, "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, "is_deleted": 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/", "proration_behavior": "invoice", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": 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", "recurring_interval_count": 962124, "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "trial_start": "2025-06-16T19:11:41.518Z", "trial_end": "2025-10-10T11:49:01.641Z", "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}, {"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, "applied_balance_amount": 962124, "due_amount": 459585, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "trial_interval": null, "trial_interval_count": null, "name": "", "description": "planula breakable gee stranger", "visibility": "public", "recurring_interval": null, "recurring_interval_count": 688736, "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, "is_deleted": 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, "is_deleted": true, "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/", "proration_behavior": "prorate", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": 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", "recurring_interval_count": 819161, "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "trial_start": "2024-08-14T11:34:08.193Z", "trial_end": null, "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720}], "pagination": {"total_count": 449940, "max_page": 933681}} "422": application/json: {} customer_portal:orders:get: @@ -3526,7 +3530,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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2023-11-19T04:53:34.522Z", "modified_at": "2025-11-25T20:27:43.607Z", "trial_interval": "week", "trial_interval_count": 836532, "name": "", "description": "too jubilantly empty meh", "visibility": "public", "recurring_interval": "month", "recurring_interval_count": 460383, "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": "", "source": "ad_hoc", "amount_type": "fixed", "price_currency": "", "tax_behavior": "inclusive", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "price_amount": 953506, "legacy": true}, {"created_at": "2025-11-13T23:04:52.208Z", "modified_at": "2023-07-18T15:45:42.662Z", "id": "", "source": "catalog", "amount_type": "free", "price_currency": "", "tax_behavior": "exclusive", "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, "is_deleted": false, "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, "is_deleted": 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, "is_deleted": false, "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/", "proration_behavior": "prorate", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": true}}}}, "subscription": {"created_at": "2025-03-12T22:14:21.224Z", "modified_at": "2024-03-29T21:03:44.806Z", "id": "", "amount": 10000, "currency": "usd", "recurring_interval": "year", "recurring_interval_count": 916598, "status": "canceled", "current_period_start": "2023-10-08T20:14:11.453Z", "current_period_end": "2023-01-11T05:31:47.928Z", "trial_start": "2025-01-24T05:08:03.541Z", "trial_end": null, "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": ""}], "description": "Pro Plan"} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2023-11-19T04:53:34.522Z", "modified_at": "2025-11-25T20:27:43.607Z", "trial_interval": "week", "trial_interval_count": 836532, "name": "", "description": "too jubilantly empty meh", "visibility": "public", "recurring_interval": "month", "recurring_interval_count": 460383, "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": "", "source": "ad_hoc", "amount_type": "fixed", "price_currency": "", "tax_behavior": "inclusive", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "price_amount": 953506, "legacy": true}, {"created_at": "2025-11-13T23:04:52.208Z", "modified_at": "2023-07-18T15:45:42.662Z", "id": "", "source": "catalog", "amount_type": "free", "price_currency": "", "tax_behavior": "exclusive", "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, "is_deleted": false, "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, "is_deleted": 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, "is_deleted": false, "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/", "proration_behavior": "prorate", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": false, "update_plan": true}}}}, "subscription": {"created_at": "2025-03-12T22:14:21.224Z", "modified_at": "2024-03-29T21:03:44.806Z", "id": "", "amount": 10000, "currency": "usd", "recurring_interval": "year", "recurring_interval_count": 916598, "status": "canceled", "current_period_start": "2023-10-08T20:14:11.453Z", "current_period_end": "2023-01-11T05:31:47.928Z", "trial_start": "2025-01-24T05:08:03.541Z", "trial_end": null, "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3786,7 +3790,7 @@ examples: application/json: {"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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-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, "type": "individual", "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"}, "product": {"metadata": {"key": 364993, "key1": true, "key2": true}, "id": "", "created_at": "2023-04-12T21:30:23.720Z", "modified_at": "2025-07-30T06:39:42.272Z", "trial_interval": "day", "trial_interval_count": 687169, "name": "", "description": "yippee amid wire knowingly an er reproachfully mechanically who gym", "visibility": "public", "recurring_interval": "month", "recurring_interval_count": 241006, "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": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 170714, "status": "incomplete", "current_period_start": "2025-06-29T04:23:47.957Z", "current_period_end": "2024-06-02T02:08:37.593Z", "trial_start": "2023-01-29T06:32:22.248Z", "trial_end": "2025-01-26T07:02:53.111Z", "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": ""}], "description": "Pro Plan"} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "platform_fee_amount": 500, "platform_fee_currency": "usd", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "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, "type": "individual", "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"}, "product": {"metadata": {"key": 364993, "key1": true, "key2": true}, "id": "", "created_at": "2023-04-12T21:30:23.720Z", "modified_at": "2025-07-30T06:39:42.272Z", "trial_interval": "day", "trial_interval_count": 687169, "name": "", "description": "yippee amid wire knowingly an er reproachfully mechanically who gym", "visibility": "public", "recurring_interval": "month", "recurring_interval_count": 241006, "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": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 170714, "status": "incomplete", "current_period_start": "2025-06-29T04:23:47.957Z", "current_period_end": "2024-06-02T02:08:37.593Z", "trial_start": "2023-01-29T06:32:22.248Z", "trial_end": "2025-01-26T07:02:53.111Z", "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3812,7 +3816,7 @@ examples: application/json: {"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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "purchase", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2024-02-03T21:16:03.609Z", "modified_at": null, "trial_interval": "year", "trial_interval_count": 947072, "name": "", "description": "gee present next brief till or", "visibility": "public", "recurring_interval": "year", "recurring_interval_count": 817410, "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": "", "source": "ad_hoc", "amount_type": "metered_unit", "price_currency": "", "tax_behavior": "exclusive", "is_archived": true, "product_id": "", "unit_amount": "", "cap_amount": 459195, "meter_id": "", "meter": {"id": "", "name": "", "unit": "custom"}}], "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/", "proration_behavior": "prorate", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": true}}}}, "subscription": {"created_at": "2025-08-10T03:04:21.532Z", "modified_at": "2024-08-23T05:41:16.519Z", "id": "", "amount": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 821156, "status": "incomplete_expired", "current_period_start": "2024-07-27T23:16:23.597Z", "current_period_end": "2025-01-04T16:08:44.590Z", "trial_start": null, "trial_end": "2025-05-04T04:31:46.399Z", "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": ""}], "description": "Pro Plan"} + 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": 10000, "discount_amount": 1000, "net_amount": 9000, "tax_amount": 720, "total_amount": 9720, "applied_balance_amount": 0, "due_amount": 0, "refunded_amount": 0, "refunded_tax_amount": 0, "currency": "usd", "billing_reason": "purchase", "billing_name": "", "billing_address": {"country": "US"}, "invoice_number": "", "is_invoice_generated": true, "receipt_number": "", "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "product": {"id": "", "created_at": "2024-02-03T21:16:03.609Z", "modified_at": null, "trial_interval": "year", "trial_interval_count": 947072, "name": "", "description": "gee present next brief till or", "visibility": "public", "recurring_interval": "year", "recurring_interval_count": 817410, "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": "", "source": "ad_hoc", "amount_type": "metered_unit", "price_currency": "", "tax_behavior": "exclusive", "is_archived": true, "product_id": "", "unit_amount": "", "cap_amount": 459195, "meter_id": "", "meter": {"id": "", "name": "", "unit": "custom"}}], "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/", "proration_behavior": "prorate", "allow_customer_updates": false, "customer_portal_settings": {"usage": {"show": false}, "subscription": {"update_seats": true, "update_plan": true}}}}, "subscription": {"created_at": "2025-08-10T03:04:21.532Z", "modified_at": "2024-08-23T05:41:16.519Z", "id": "", "amount": 10000, "currency": "usd", "recurring_interval": "month", "recurring_interval_count": 821156, "status": "incomplete_expired", "current_period_start": "2024-07-27T23:16:23.597Z", "current_period_end": "2025-01-04T16:08:44.590Z", "trial_start": null, "trial_end": "2025-05-04T04:31:46.399Z", "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": ""}], "description": "Pro Plan", "refundable_amount": 9000, "refundable_tax_amount": 720} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -4315,7 +4319,7 @@ examples: members:create_member: speakeasy-default-members:create-member: requestBody: - application/json: {"customer_id": "", "email": "member@example.com", "name": "Jane Doe", "external_id": "usr_1337"} + application/json: {"customer_id": "", "email": "member@example.com", "name": "Jane Doe", "external_id": "usr_1337", "role": "member"} responses: "201": application/json: {"id": "", "created_at": "2023-02-05T01:05:59.075Z", "modified_at": "2024-04-04T21:38:58.207Z", "customer_id": "", "email": "member@example.com", "name": "Jane Doe", "external_id": "usr_1337", "role": "billing_manager"} @@ -4648,9 +4652,33 @@ examples: responses: "200": application/json: {"token": ""} + orders:receipt: + speakeasy-default-orders:receipt: + parameters: + path: + id: "" + responses: + "200": + application/json: {"url": "https://firm-newsprint.org"} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "422": + application/json: {} + customer_portal:orders:receipt: + speakeasy-default-customer-portal:orders:receipt: + parameters: + path: + id: "" + responses: + "200": + application/json: {"url": "https://winding-jet.info"} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "422": + application/json: {} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Python SDK Changes Detected:\n* `polar._endpointcheckout_created_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointcheckout_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointcheckout_expired_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_created_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_updated_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_active_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_canceled_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_uncanceled_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_revoked_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointsubscription_past_due_post()`: \n * `request.data.product.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointproduct_created_post()`: \n * `request.data.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointproduct_updated_post()`: \n * `request.data.benefits.[]` **Changed** **Breaking** :warning:\n* `polar._endpointorganization_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointbenefit_created_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointbenefit_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointbenefit_grant_created_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointbenefit_grant_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointbenefit_grant_cycled_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointbenefit_grant_revoked_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar.organizations.list()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.organizations.create()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `polar.organizations.get()`: `response` **Changed** **Breaking** :warning:\n* `polar.organizations.update()`: \n * `request.organization_update` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `polar.customer_portal.customers.request_email_update()`: **Added**\n* `polar.customer_portal.customers.check_email_update()`: **Added**\n* `polar.customer_portal.customers.verify_email_update()`: **Added**\n* `polar.subscriptions.list()`: `response.items.[].product.benefits.[]` **Changed**\n* `polar.subscriptions.create()`: `response.product.benefits.[]` **Changed**\n* `polar.subscriptions.get()`: `response.product.benefits.[]` **Changed**\n* `polar.subscriptions.revoke()`: `response.product.benefits.[]` **Changed**\n* `polar.subscriptions.update()`: `response.product.benefits.[]` **Changed**\n* `polar.benefits.list()`: `response.items.[]` **Changed**\n* `polar.benefits.create()`: `response` **Changed**\n* `polar.benefits.get()`: `response` **Changed**\n* `polar.benefits.update()`: `response` **Changed**\n* `polar.benefits.grants()`: `response.items.[].benefit` **Changed**\n* `polar.benefit-grants.list()`: `response.items.[].benefit` **Changed**\n* `polar.products.list()`: `response.items.[].benefits.[]` **Changed**\n* `polar.products.create()`: `response.benefits.[]` **Changed**\n* `polar.products.get()`: `response.benefits.[]` **Changed**\n* `polar.products.update()`: `response.benefits.[]` **Changed**\n* `polar.products.update_benefits()`: `response.benefits.[]` **Changed**\n* `polar.checkouts.list()`: `response.items.[]` **Changed**\n* `polar.checkouts.create()`: `response` **Changed**\n* `polar.checkouts.get()`: `response` **Changed**\n* `polar.checkouts.update()`: `response` **Changed**\n* `polar.checkouts.client_get()`: `response` **Changed**\n* `polar.checkouts.client_update()`: `response` **Changed**\n* `polar.checkouts.client_confirm()`: `response` **Changed**\n* `polar.metrics.get()`: `response` **Changed**\n* `polar.license_keys.list()`: `request.status` **Added**\n* `polar.checkout-links.list()`: `response.items.[].products.[].benefits.[].is_deleted` **Added**\n* `polar.checkout-links.create()`: `response.products.[].benefits.[].is_deleted` **Added**\n* `polar.checkout-links.get()`: `response.products.[].benefits.[].is_deleted` **Added**\n* `polar.checkout-links.update()`: `response.products.[].benefits.[].is_deleted` **Added**\n* `polar.members.get_member_by_external_id()`: `request` **Changed**\n* `polar.members.delete_member_by_external_id()`: `request` **Changed**\n* `polar.members.update_member_by_external_id()`: `request` **Changed**\n* `polar.customer_portal.benefit-grants.list()`: `response.items.[]` **Changed**\n* `polar.customer_portal.benefit-grants.get()`: `response` **Changed**\n* `polar.customer_portal.benefit-grants.update()`: `response` **Changed**\n* `polar.customer_portal.seats.assign_seat()`: \n * `request.checkout_client_secret` **Added**\n* `polar.customer_portal.seats.list_claimed_subscriptions()`: `response.items.[].product` **Changed**\n* `polar.customer_portal.orders.list()`: `response.items.[].product` **Changed**\n* `polar.customer_portal.orders.get()`: `response.product` **Changed**\n* `polar.customer_portal.orders.update()`: `response.product` **Changed**\n* `polar.customer_portal.organizations.get()`: `response` **Changed**\n* `polar.customer_portal.subscriptions.list()`: `response.items.[].product` **Changed**\n* `polar.customer_portal.subscriptions.get()`: `response.product` **Changed**\n* `polar.customer_portal.subscriptions.cancel()`: `response.product` **Changed**\n* `polar.customer_portal.subscriptions.update()`: `response.product` **Changed**\n* `polar.customer-seats.assign_seat()`: \n * `request.checkout_client_secret` **Added**\n" +releaseNotes: "## Python SDK Changes Detected:\n* `polar.organizations.update()`: \n * `request.organization_update.feature_settings` **Changed** **Breaking** :warning:\n * `response.feature_settings` **Changed** **Breaking** :warning:\n* `polar.discounts.create()`: `request` **Changed** **Breaking** :warning:\n* `polar._endpointorder_created_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_updated_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_paid_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorder_refunded_post()`: \n * `request.data` **Changed** **Breaking** :warning:\n* `polar._endpointorganization_updated_post()`: \n * `request.data.feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.list()`: `response.items.[].feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.get()`: `response.feature_settings` **Changed** **Breaking** :warning:\n* `polar.organizations.create()`: \n * `request.feature_settings` **Changed** **Breaking** :warning:\n * `response.feature_settings` **Changed** **Breaking** :warning:\n* `polar.event-types.list()`: `response.items.[]` **Changed** **Breaking** :warning:\n* `polar.customer_portal.orders.receipt()`: **Added**\n* `polar.orders.receipt()`: **Added**\n* `polar.orders.update()`: `response` **Changed**\n* `polar.orders.list()`: `response.items.[]` **Changed**\n* `polar.members.create_member()`: \n * `request.role` **Changed**\n* `polar.customer_portal.orders.list()`: `response.items.[]` **Changed**\n* `polar.customer_portal.orders.get()`: `response` **Changed**\n* `polar.customer_portal.orders.update()`: `response` **Changed**\n* `polar.orders.get()`: `response` **Changed**\n" trackedFiles: .devcontainer/README.md: last_write_checksum: sha1:e2a191a1fa8ceb27387eb32eabf36f7ad16a532c @@ -4705,7 +4733,7 @@ trackedFiles: docs/models/authorizeuser.md: last_write_checksum: sha1:e44eafd43e6b2f3c07aca75b5643f609f822bedf docs/models/availablescope.md: - last_write_checksum: sha1:d3159238d27e20bdf66291548653810a03308a6b + last_write_checksum: sha1:d5374b7ed204c423c3c55544f089880a19ae8134 docs/models/averageordervalue.md: last_write_checksum: sha1:cdb0b5525cc2a84fa569f0f1fe9fcfae7fde7fae docs/models/averagerevenueperuser.md: @@ -5273,7 +5301,7 @@ trackedFiles: docs/models/customernotready.md: last_write_checksum: sha1:2faa3980f943abc75095106230343a3e8b67e67a docs/models/customerorder.md: - last_write_checksum: sha1:6da92b5421227b230ed7cc7b6880da33d7937c71 + last_write_checksum: sha1:4650924bfe3aa470634b7cb4ecde3c3b314e8958 docs/models/customerorderconfirmpayment.md: last_write_checksum: sha1:d1082e2ca6e98078093253308617e3f1e9039acc docs/models/customerorderinvoice.md: @@ -5286,6 +5314,8 @@ trackedFiles: last_write_checksum: sha1:913a4cc80c420a0a41c432ebe5ad34548fc44f9c docs/models/customerorderproductprices.md: last_write_checksum: sha1:7b4f72ad6e0771acfae65a99e496380017be3672 + docs/models/customerorderreceipt.md: + last_write_checksum: sha1:575e77fb5c1d85b9ad6b196441aa143c2b90c0ac docs/models/customerordersortproperty.md: last_write_checksum: sha1:2c5ed2215d04834a03a21da08d9abaaea757d8a7 docs/models/customerordersubscription.md: @@ -5442,6 +5472,10 @@ trackedFiles: last_write_checksum: sha1:177ad034a02e0c4215776ccbe4e16a1bc0119037 docs/models/customerportalorderslistsecurity.md: last_write_checksum: sha1:9085bbfdac5ff7a86295bad0e750861ba680876f + docs/models/customerportalordersreceiptrequest.md: + last_write_checksum: sha1:d2686a62451c8b3dfb0e033514186e9e28c9a904 + docs/models/customerportalordersreceiptsecurity.md: + last_write_checksum: sha1:bb5793b40d0eb01da978327084b58a2c494ac3b7 docs/models/customerportalordersupdaterequest.md: last_write_checksum: sha1:7a58b38eb2d91b22f2dee43ca4e534f2943c3023 docs/models/customerportalordersupdatesecurity.md: @@ -5721,43 +5755,35 @@ trackedFiles: docs/models/discount.md: last_write_checksum: sha1:b42a6cb1d8320501c7fd4c824685284b27341e1b docs/models/discountcreate.md: - last_write_checksum: sha1:07831ca12f3ae890453ce3db9cd51cdd0cd2b1a4 + last_write_checksum: sha1:a4442d628398ab8c7db91c41d3f30dd58a30d213 docs/models/discountduration.md: last_write_checksum: sha1:c6a845b1cd4ba784a6164003fb4f6fe05a77aa1f + docs/models/discountfixedcreate.md: + last_write_checksum: sha1:efa30c1d50c29cff7aedfd751d4cd026981b4819 + docs/models/discountfixedcreatemetadata.md: + last_write_checksum: sha1:19ad117e112ddb3a0f8a11006992ca59f7f04ce3 docs/models/discountfixedonceforeverduration.md: last_write_checksum: sha1:1bbdb05dbc56e18c7ee9401a1d2dc2e62109bc78 docs/models/discountfixedonceforeverdurationbase.md: last_write_checksum: sha1:9fa7853739381ad55bb4ca9026254e92c7b1174b - docs/models/discountfixedonceforeverdurationcreate.md: - last_write_checksum: sha1:347c43fd194df712c9148775dcda3029b1d8f431 - docs/models/discountfixedonceforeverdurationcreatemetadata.md: - last_write_checksum: sha1:3b74b2cf43c9fc7f5040f87dd853048b878b60e9 docs/models/discountfixedrepeatduration.md: last_write_checksum: sha1:c42eaf6cf7b79108184e9aa034632e4297411d79 docs/models/discountfixedrepeatdurationbase.md: last_write_checksum: sha1:4f050683ee31803c1ff2370656c009d4658a4e29 - docs/models/discountfixedrepeatdurationcreate.md: - last_write_checksum: sha1:f7fbb4b90b80bc9df2cde2ca24366b106d67ad32 - docs/models/discountfixedrepeatdurationcreatemetadata.md: - last_write_checksum: sha1:20001c81aa0c625adf43bcdb87aa85867a8291c1 docs/models/discountidfilter.md: last_write_checksum: sha1:e1b17ec0ff4bc7263f3462ad611d9527bf033740 + docs/models/discountpercentagecreate.md: + last_write_checksum: sha1:58b5fe77b13552b8e9680fe0331e6780b26be61b + docs/models/discountpercentagecreatemetadata.md: + last_write_checksum: sha1:15b7d6b74b28a57b6c1388e3a8aed16fee965519 docs/models/discountpercentageonceforeverduration.md: last_write_checksum: sha1:4d26b2e80f6934d57792ef220448de112555fde5 docs/models/discountpercentageonceforeverdurationbase.md: last_write_checksum: sha1:8d77698d2411458b5e1b441e0630da95d47689bd - docs/models/discountpercentageonceforeverdurationcreate.md: - last_write_checksum: sha1:be40349a5a4f44a237208113745de87d9a823c97 - docs/models/discountpercentageonceforeverdurationcreatemetadata.md: - last_write_checksum: sha1:b1240832c16bc6f4d6c9c275443e154a04b5182c docs/models/discountpercentagerepeatduration.md: last_write_checksum: sha1:59fa1553350d8f672fa228a6de5759806e70ae37 docs/models/discountpercentagerepeatdurationbase.md: last_write_checksum: sha1:18452516be93cfcf3ca12e1649d6c1c2d5342528 - docs/models/discountpercentagerepeatdurationcreate.md: - last_write_checksum: sha1:faa6524014e56074d6a399052c0473ecfcb36843 - docs/models/discountpercentagerepeatdurationcreatemetadata.md: - last_write_checksum: sha1:7cdc767861e20bf3092d853110dbb849f96e9294 docs/models/discountproduct.md: last_write_checksum: sha1:65e38a0eef0d905674478e762dcdf5b051d9124f docs/models/discountsdeleterequest.md: @@ -5867,7 +5893,7 @@ trackedFiles: docs/models/eventtypeupdate.md: last_write_checksum: sha1:49c668160160630d6d0055f650df772c118f2d46 docs/models/eventtypewithstats.md: - last_write_checksum: sha1:289cba6e9ec569af18dc94c74bda2d3c58b1dd94 + last_write_checksum: sha1:de2b6e4a86732f8ead033ed6d2c61287530656d5 docs/models/excludeids.md: last_write_checksum: sha1:5b3596e68b7c3973e7c80720f883c3a2805e4ff7 docs/models/existingproductprice.md: @@ -6069,7 +6095,7 @@ trackedFiles: docs/models/member.md: last_write_checksum: sha1:afffb5750925ad734d3954da560db65fefed4253 docs/models/membercreate.md: - last_write_checksum: sha1:37c9269a53df9c1cbfa81e4a5e3292b68048497b + last_write_checksum: sha1:e4d76faa22977458ee44faab218c643ff935f59d docs/models/memberidfilter.md: last_write_checksum: sha1:ad7d80f7e079909732dfc4ab78e3bb59c5c693a1 docs/models/memberownercreate.md: @@ -6373,7 +6399,7 @@ trackedFiles: docs/models/onetimeproductsrevenue.md: last_write_checksum: sha1:8e7c90912be37abe552adac8531990fe41efb803 docs/models/order.md: - last_write_checksum: sha1:7c4883cd4844b731692e7366a69e0e7e478819fa + last_write_checksum: sha1:c97dbd8c24dfe435118458b07db40128c6b1cd6c docs/models/orderbillingreason.md: last_write_checksum: sha1:fdbf3af4604ebfc3f7d5cf2b5bed2528ab3d7cab docs/models/ordercustomer.md: @@ -6398,6 +6424,8 @@ trackedFiles: last_write_checksum: sha1:34bc475217f4bd7de6609d41fb1d848c5d9cafde docs/models/orderproduct.md: last_write_checksum: sha1:2402f2a81b88b2ae280e568bc75259c0e614344f + docs/models/orderreceipt.md: + last_write_checksum: sha1:0d88b533beff489174574e4d0ebfcef43edcea5e docs/models/orderrefundedevent.md: last_write_checksum: sha1:0e7849a564e30ecbf643b4ad004a90a256f44fdd docs/models/orderrefundedmetadata.md: @@ -6434,6 +6462,8 @@ trackedFiles: last_write_checksum: sha1:cbf97ed92669d483a9d8d18937732c45f565052f docs/models/ordersortproperty.md: last_write_checksum: sha1:48f61f6ecddb3a9fa931f05a939113fc20b92c49 + docs/models/ordersreceiptrequest.md: + last_write_checksum: sha1:8d8ac3562231bdcd2874873096895bdd09924a9a docs/models/orderstatus.md: last_write_checksum: sha1:ab6604b2d86046ffea690671545d5e80dd5cef2b docs/models/ordersubscription.md: @@ -6485,7 +6515,7 @@ trackedFiles: docs/models/organizationdetails.md: last_write_checksum: sha1:59784eef0c4fcb65f8c7006ffd0c3df8a7cfba0b docs/models/organizationfeaturesettings.md: - last_write_checksum: sha1:8120afe4e4b3c7aa40e622a7b1a996ac9d106ac5 + last_write_checksum: sha1:0af9d146973bae63fd82ae4959a6307eee55be43 docs/models/organizationid.md: last_write_checksum: sha1:5adf4fb1a723f361ac66da12542fedbe34fd9e5d docs/models/organizationidfilter.md: @@ -6730,6 +6760,8 @@ trackedFiles: last_write_checksum: sha1:4ebf5e638287bdb9f918bfe19c1ecb459df8ea7c docs/models/revoketokenresponse.md: last_write_checksum: sha1:bda34ee9091039e3fb750fdad8a8324f9c35f701 + docs/models/role.md: + last_write_checksum: sha1:c5336760651a6de2484a367b70d00680b3e2dc11 docs/models/s3downloadurl.md: last_write_checksum: sha1:f9778a1c244f065ef598e9121026100b703b813a docs/models/s3filecreatemultipart.md: @@ -7067,7 +7099,7 @@ trackedFiles: docs/sdks/customfields/README.md: last_write_checksum: sha1:320b9f3175685350fa119648fd07f51587f57b2b docs/sdks/discounts/README.md: - last_write_checksum: sha1:1de83088046ed155cd8193400da692476b123c38 + last_write_checksum: sha1:72e8e972d4256e4f195406e8ac3797bf81f34e73 docs/sdks/disputes/README.md: last_write_checksum: sha1:7e03b982b08b8c11ba84dae0ae48cfc725103cab docs/sdks/downloadables/README.md: @@ -7089,11 +7121,11 @@ trackedFiles: docs/sdks/oauth2/README.md: last_write_checksum: sha1:41ab71747a1ea845eb6e342b3a827d347b0209d9 docs/sdks/orders/README.md: - last_write_checksum: sha1:9a4722d2b39ae58dde6199c31b9797e93bd684ba + last_write_checksum: sha1:87ae9bc5bc858611760888dabfe63f6a44f43a63 docs/sdks/organizationaccesstokens/README.md: last_write_checksum: sha1:05bb349d7b4ac8d0feda927af81a9a71de2e4684 docs/sdks/organizations/README.md: - last_write_checksum: sha1:539a9bb438f60e85284e0630399d566cdb139b2c + last_write_checksum: sha1:35eaebef963a13f3f806fdab89cdd39b0da973b1 docs/sdks/payments/README.md: last_write_checksum: sha1:c0c2c61bef213dfafcb00274baddd1c43ba3e602 docs/sdks/polarbenefitgrants/README.md: @@ -7107,7 +7139,7 @@ trackedFiles: docs/sdks/polarmembers/README.md: last_write_checksum: sha1:fee692177c33292dcd1d50cd81629bad7f5b8b3f docs/sdks/polarorders/README.md: - last_write_checksum: sha1:687c59d93ee0705b417b5adb23a0e78cd3c48b0e + last_write_checksum: sha1:d1608b0531686cba55afdab92208be84a63ba04f docs/sdks/polarorganizations/README.md: last_write_checksum: sha1:a66f3e70e90bcafd1d61bed65d5dd4e98750fc3d docs/sdks/polarsubscriptions/README.md: @@ -7145,23 +7177,23 @@ trackedFiles: src/polar_sdk/_hooks/types.py: last_write_checksum: sha1:a218c66f3e2d1f1b9af54f270472b970b0cc1913 src/polar_sdk/_version.py: - last_write_checksum: sha1:2cc345ce9add88a4938ae645e180bfbd278e3a12 + last_write_checksum: sha1:5b42a4a2b1395bbca4d5a05f08ec45bee13a5166 src/polar_sdk/basesdk.py: last_write_checksum: sha1:4523ea81f1381f171fe2d4e60f85b82203208d02 src/polar_sdk/benefit_grants.py: - last_write_checksum: sha1:c0841866062266d2154ebf19b7e339966ca9231d + last_write_checksum: sha1:678dd4954862bb778f050d367528ce6a28633307 src/polar_sdk/benefits.py: - last_write_checksum: sha1:ab4a5d6f41fd1165c8b15e2f0008e890c1133e03 + last_write_checksum: sha1:51cf8a6b3ab5341cf80f66b169f3142ec7c58b2e src/polar_sdk/checkout_links.py: - last_write_checksum: sha1:a4c681222167cb91983ff6b2b047cbf7210603eb + last_write_checksum: sha1:4bb556480c7be6a9949c218c4b84e53085a235d6 src/polar_sdk/checkouts.py: - last_write_checksum: sha1:658a65b38acef8f9d0ef025bd73cfc47161ad52b + last_write_checksum: sha1:c550b7a705eda43c27f2419e453b0a92369fbc55 src/polar_sdk/clients.py: last_write_checksum: sha1:6915da8a43d33309b7f6ef14d87447acbd99ae16 src/polar_sdk/custom_fields.py: - last_write_checksum: sha1:bd7b6963eac3c380abdc0b9283035d7f9c223f21 + last_write_checksum: sha1:9d0e904a30ce808ebbbde73195f703f3a5b4ea30 src/polar_sdk/customer_meters.py: - last_write_checksum: sha1:259d55b9f4f3a15542e642ecb34192c2ea5d472e + last_write_checksum: sha1:a08592adaee0d34cd5ef6eebff8f76dc96b7ecef src/polar_sdk/customer_portal.py: last_write_checksum: sha1:c0a5dfdf0dc3b8caea86156f6f5685ab9b73964f src/polar_sdk/customer_seats.py: @@ -7171,31 +7203,31 @@ trackedFiles: src/polar_sdk/customer_sessions.py: last_write_checksum: sha1:25f6cc89c87320a87e76bb4c2548989a145c1303 src/polar_sdk/customers.py: - last_write_checksum: sha1:4a6dbe921aca0d7e9fc7e01ce7edac0f7d714eee + last_write_checksum: sha1:0c7db239381376f161f322b1903df33a6db17cfa src/polar_sdk/discounts.py: - last_write_checksum: sha1:bb3760f5a8f4b446b1637515bef995b08461497a + last_write_checksum: sha1:624026ce7ab6578e5207d7cb7decd3d35e0895a5 src/polar_sdk/disputes.py: - last_write_checksum: sha1:c31839f83f948936e3b0ad31626ea2c18e9c815f + last_write_checksum: sha1:ebb70e09f74d473b96437609301e4a51dcf39a71 src/polar_sdk/downloadables.py: - last_write_checksum: sha1:fce807646154d369af6e50e45d42b4e64ef89728 + last_write_checksum: sha1:92e37791bc08fcfadd53f7d113b57f60741d79a2 src/polar_sdk/event_types.py: - last_write_checksum: sha1:f8c8bfbd644b889b5217893d31f9187a3feae38f + last_write_checksum: sha1:49cc2533d760ad0cf7c9b12ce93dcbed6ebc0a36 src/polar_sdk/events.py: - last_write_checksum: sha1:e0ebce4f8cebaa9fec916e3b0763135d2f9f9839 + last_write_checksum: sha1:413428136c8444dc97a6f0e4409faf1a70e2d4ef src/polar_sdk/files.py: - last_write_checksum: sha1:ac2fb7d8c412dad191e18cde1621c5f9fb54bde5 + last_write_checksum: sha1:c0860ffbb42ada2f1646887efb0de2a752c6e1b3 src/polar_sdk/httpclient.py: last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 src/polar_sdk/license_keys.py: - last_write_checksum: sha1:ea76b7c61c31da0c145db51147d1874f1dd4fb2c + last_write_checksum: sha1:733c273685cb865e31fbc13b33c72beae37650c0 src/polar_sdk/members.py: - last_write_checksum: sha1:a471d6f6d1c569874b845056b37a2039058f50d9 + last_write_checksum: sha1:547cf4c393cab61c6a716c9a7aeaf6b6fb43c338 src/polar_sdk/meters.py: - last_write_checksum: sha1:7835b07a36156ce350772de7962dcac4f2549d48 + last_write_checksum: sha1:b34c6c20fa382d46845215528e2975173984a004 src/polar_sdk/metrics_sdk.py: last_write_checksum: sha1:c30599374f77c15def258831ff82e18b21155976 src/polar_sdk/models/__init__.py: - last_write_checksum: sha1:7d9fafc47cd2ac32d57c1ccdcbe002f76ec7caf7 + last_write_checksum: sha1:b209a435fb43c505b1ea549227758775f2126b95 src/polar_sdk/models/address.py: last_write_checksum: sha1:083edb7f045174ac1aea30545e9981c33f07d57d src/polar_sdk/models/addressdict.py: @@ -7223,7 +7255,7 @@ trackedFiles: src/polar_sdk/models/authorizeuser.py: last_write_checksum: sha1:75fe863046d9f4f5726f04630b18a9da0b8d0360 src/polar_sdk/models/availablescope.py: - last_write_checksum: sha1:46326bd30eff926c09bb3234c25f313004688789 + last_write_checksum: sha1:3d37b8cd5cddd62924c9ab5e6c6c672537925b75 src/polar_sdk/models/balancecreditorderevent.py: last_write_checksum: sha1:d32eb800cc69b764b102575c68f128b22c9c02c9 src/polar_sdk/models/balancecreditordermetadata.py: @@ -7572,6 +7604,8 @@ trackedFiles: last_write_checksum: sha1:dea41dfef4d997e0b6c76700b7925cca558497c7 src/polar_sdk/models/customer_portal_orders_listop.py: last_write_checksum: sha1:27132e0fda7a220c016df0d32d42cd9bcacf94e4 + src/polar_sdk/models/customer_portal_orders_receiptop.py: + last_write_checksum: sha1:e61723681bcdf885781b9a2e001096188f850de3 src/polar_sdk/models/customer_portal_orders_updateop.py: last_write_checksum: sha1:97e2b26dce3c529f8954592b0d5d69cf46a68c19 src/polar_sdk/models/customer_portal_organizations_getop.py: @@ -7683,7 +7717,7 @@ trackedFiles: src/polar_sdk/models/customernotready.py: last_write_checksum: sha1:bfcfe22b088cbbf10854f6e6bb9f22c046362d28 src/polar_sdk/models/customerorder.py: - last_write_checksum: sha1:3031df5ffa9a5d2e51170ebfe928f67bc1391a6f + last_write_checksum: sha1:910f8ec56288b9bc18523f741d3201b6b4bd395f src/polar_sdk/models/customerorderconfirmpayment.py: last_write_checksum: sha1:1a363d74823980436253fc208c5ad3a508e5f97f src/polar_sdk/models/customerorderinvoice.py: @@ -7694,6 +7728,8 @@ trackedFiles: last_write_checksum: sha1:4fecf9c7f44d942f06f815522ab53cae8cbe73e7 src/polar_sdk/models/customerorderproduct.py: last_write_checksum: sha1:945e817fe1cbf2110968b3a018b6c6244807fc0f + src/polar_sdk/models/customerorderreceipt.py: + last_write_checksum: sha1:aad74540220e3f961d4a01fc70d3464d5e18017c src/polar_sdk/models/customerordersortproperty.py: last_write_checksum: sha1:729c15710575f450523ec6cca5f57d3d7044c527 src/polar_sdk/models/customerordersubscription.py: @@ -7875,33 +7911,29 @@ trackedFiles: src/polar_sdk/models/discount.py: last_write_checksum: sha1:2a0b55132c9faa042c5f60ae01094641d3055ca7 src/polar_sdk/models/discountcreate.py: - last_write_checksum: sha1:856e5372e8adf68d75c52b56edccc4b7602eb86c + last_write_checksum: sha1:90965be4093b62316e7f4be30e9446f87be8cefc src/polar_sdk/models/discountduration.py: last_write_checksum: sha1:18772d206aaedfaa7017d5a60b8a356f3525c1b5 + src/polar_sdk/models/discountfixedcreate.py: + last_write_checksum: sha1:8ca328fe7e973bddcbfeb613a1b428995ead578b src/polar_sdk/models/discountfixedonceforeverduration.py: last_write_checksum: sha1:05b590ada3f979aa3df98a8bd990eb010a04e776 src/polar_sdk/models/discountfixedonceforeverdurationbase.py: last_write_checksum: sha1:e5eb9dae3bcff71d4ab442bc0bc6cd3c0416e26d - src/polar_sdk/models/discountfixedonceforeverdurationcreate.py: - last_write_checksum: sha1:151380717c2d934e047b121ae647bea25dab0a92 src/polar_sdk/models/discountfixedrepeatduration.py: last_write_checksum: sha1:4e2f28858fb80b457ed912c6c367b11cf994d997 src/polar_sdk/models/discountfixedrepeatdurationbase.py: last_write_checksum: sha1:4dc2d727e8b58bfcd8869bf41001e8b56695bf21 - src/polar_sdk/models/discountfixedrepeatdurationcreate.py: - last_write_checksum: sha1:50cc5d7d06505eab86b4eef38d5fca45550626ec + src/polar_sdk/models/discountpercentagecreate.py: + last_write_checksum: sha1:f78550b97b65f665d13b9e8f27125e7ff0ebfceb src/polar_sdk/models/discountpercentageonceforeverduration.py: last_write_checksum: sha1:e190bfd94671e1fbcdbd027022feae602e3be993 src/polar_sdk/models/discountpercentageonceforeverdurationbase.py: last_write_checksum: sha1:876acee98d5dc9f5150db1c746fc2d881fa22e0a - src/polar_sdk/models/discountpercentageonceforeverdurationcreate.py: - last_write_checksum: sha1:e0b6c194dee5135d09dd0d4e13eee45b17c176cb src/polar_sdk/models/discountpercentagerepeatduration.py: last_write_checksum: sha1:3c50cc2dc0e33ba19c686730b67cc69b6d9c887e src/polar_sdk/models/discountpercentagerepeatdurationbase.py: last_write_checksum: sha1:6f9daf7d0dc684163e17f2365d48617585848dd3 - src/polar_sdk/models/discountpercentagerepeatdurationcreate.py: - last_write_checksum: sha1:140cbda48b17367b840af3030984adecc567d88c src/polar_sdk/models/discountproduct.py: last_write_checksum: sha1:9813bffa8f88bb8a37b7714afcd1680f199d3b50 src/polar_sdk/models/discounts_deleteop.py: @@ -7971,7 +8003,7 @@ trackedFiles: src/polar_sdk/models/eventtypeupdate.py: last_write_checksum: sha1:978fb3b83a3dcdb781cf3f02fee33395f8067c71 src/polar_sdk/models/eventtypewithstats.py: - last_write_checksum: sha1:ecd4784e9138330a200fc49b5a9fcfd6923c2824 + last_write_checksum: sha1:f1ccf0b8e72686963e898b44c3f714396cc84a3e src/polar_sdk/models/existingproductprice.py: last_write_checksum: sha1:c86b3584d703690296cc4acee02a68f13ce126dc src/polar_sdk/models/expiredcheckouterror.py: @@ -8123,7 +8155,7 @@ trackedFiles: src/polar_sdk/models/member.py: last_write_checksum: sha1:443d5e7ebea45bcc8637d77a6c4605a26c83e0c3 src/polar_sdk/models/membercreate.py: - last_write_checksum: sha1:af33547abf917189af16701cac43bc377ab4874b + last_write_checksum: sha1:245115630b58f9e236e8f5be538e537ed4b60303 src/polar_sdk/models/memberownercreate.py: last_write_checksum: sha1:9ba42af7585c62cc7425b4c2315c37bea4f62f92 src/polar_sdk/models/memberrole.py: @@ -8239,7 +8271,7 @@ trackedFiles: src/polar_sdk/models/oauth2_userinfoop.py: last_write_checksum: sha1:b6b3f96a4dbd2ffe9216d781a6dd997eef4496b8 src/polar_sdk/models/order.py: - last_write_checksum: sha1:819e1348861622f455334c2f632009f976f0bc92 + last_write_checksum: sha1:d75b8f4968b9032376bb6cae348e7b7137c8641b src/polar_sdk/models/orderbillingreason.py: last_write_checksum: sha1:3b294070e89e6d9f91bdd42c34207bc44769b5b1 src/polar_sdk/models/ordercustomer.py: @@ -8256,6 +8288,8 @@ trackedFiles: last_write_checksum: sha1:4f0ee4229ab6a6d8867cd3962ec5ca9beb5e7fc1 src/polar_sdk/models/orderproduct.py: last_write_checksum: sha1:ebd239f2edd30810b00b7c37fc0a64da0b0511fb + src/polar_sdk/models/orderreceipt.py: + last_write_checksum: sha1:e604791f84136674720964010a90bfb81b30d42c src/polar_sdk/models/orderrefundedevent.py: last_write_checksum: sha1:2045ace66c04e985c8fe2e82bcbce6d3b5f95cb0 src/polar_sdk/models/orderrefundedmetadata.py: @@ -8268,6 +8302,8 @@ trackedFiles: last_write_checksum: sha1:23e161223672c30de58d0f01f82e42f48b339bad src/polar_sdk/models/orders_invoiceop.py: last_write_checksum: sha1:b238c7926f3e877f213580c2b55b2bf06984bcd0 + src/polar_sdk/models/orders_receiptop.py: + last_write_checksum: sha1:6f6b70a9e3ea0da9110ae7a7384aaae1afe729d3 src/polar_sdk/models/orders_updateop.py: last_write_checksum: sha1:0a132c027034084cadb6b9300d7443f0d0e29cad src/polar_sdk/models/ordersortproperty.py: @@ -8317,7 +8353,7 @@ trackedFiles: src/polar_sdk/models/organizationdetails.py: last_write_checksum: sha1:74233062d4ab6a42a6799705ac3cfd820ba3244c src/polar_sdk/models/organizationfeaturesettings.py: - last_write_checksum: sha1:85fc718ea713810ef845fa3b450583605a0f76d4 + last_write_checksum: sha1:12ad4a4f8acc738b086093f9b2c6b8fa0ccfe7d1 src/polar_sdk/models/organizationindividuallegalentityschema.py: last_write_checksum: sha1:33b021299f8a9ef86b315e3030acf6e34ccedeb4 src/polar_sdk/models/organizationnotificationsettings.py: @@ -8723,43 +8759,43 @@ trackedFiles: src/polar_sdk/oauth2.py: last_write_checksum: sha1:4d04c5a98c3a4b5219d1ff484e7e1c8295b01f47 src/polar_sdk/orders.py: - last_write_checksum: sha1:25c6f548c8772265811e1d0faa305c02af340ecb + last_write_checksum: sha1:54324f8787d3e8b07925d79ea3eec3ef4b59b52d src/polar_sdk/organization_access_tokens.py: - last_write_checksum: sha1:e54fd21fe0744e52eff83173a74cf7e7f8b84ab0 + last_write_checksum: sha1:fc169e6debb5c6918755d3c3ce2dfdda2fad8ce0 src/polar_sdk/organizations.py: - last_write_checksum: sha1:eb5c3a6049c4a282a7672a4b9e2d533b4e9ad1cc + last_write_checksum: sha1:9dee898e58238f633fc590fb257b7b98f8fac73b src/polar_sdk/payments.py: - last_write_checksum: sha1:4c78cc079f2f5faf577bb1d987b512d3eb8f0141 + last_write_checksum: sha1:a5dded8ecdfef5faf4ce25fedaeed39c10adb881 src/polar_sdk/polar_benefit_grants.py: - last_write_checksum: sha1:02f3a3871168faeb0fc806eccf65511b92eee4de + last_write_checksum: sha1:0f8f499e162deaa8e1a570afc9327be5f24cda38 src/polar_sdk/polar_customer_meters.py: - last_write_checksum: sha1:5794bf9d92e43900d5d6c193e9aca65b037ad675 + last_write_checksum: sha1:b2831a77fd6408b00f32ff405a6815865673d569 src/polar_sdk/polar_customers.py: - last_write_checksum: sha1:1e314d7f38746070a53be455bf247688b0c4b3b6 + last_write_checksum: sha1:2e9118e4bea24cfcd8ff21571c1f55826c816fae src/polar_sdk/polar_license_keys.py: - last_write_checksum: sha1:520b34a2b26842ab41125cf19771751906210342 + last_write_checksum: sha1:21662dddfbe9a0df7f9e4d2992bb493d6fc60f4b src/polar_sdk/polar_members.py: - last_write_checksum: sha1:26c8fa4403753adbe6c904ad7f55d953004ef457 + last_write_checksum: sha1:c695ea4a45b91db28e39c6f427b6172903877931 src/polar_sdk/polar_orders.py: - last_write_checksum: sha1:d0006408527184d68b3a3b0946a310a6225d1e1f + last_write_checksum: sha1:b569cd8e5ea957712afb261308da7f4460056590 src/polar_sdk/polar_organizations.py: last_write_checksum: sha1:08700e2912aa022146b05d0d1ba74b433b9b5feb src/polar_sdk/polar_subscriptions.py: - last_write_checksum: sha1:257c60bc9e0f16f093fa9e42e56e84832b275813 + last_write_checksum: sha1:4272081e88bf956808a7924272cdbf8406ca6825 src/polar_sdk/products.py: - last_write_checksum: sha1:c9545832c5f924c770f742cc638f8813d5f1849f + last_write_checksum: sha1:6de5f2eec4f55ea52527d9a3fde6dccb0726bdd8 src/polar_sdk/py.typed: last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 src/polar_sdk/refunds.py: - last_write_checksum: sha1:7b11a3a72f3e09d58c9936aabdc47b7cafeed420 + last_write_checksum: sha1:3a40acdfa627d784ed220738c094536dbcd1a60f src/polar_sdk/sdk.py: last_write_checksum: sha1:8546539ea54f6b9708eff5e463e91e3059f27273 src/polar_sdk/sdkconfiguration.py: last_write_checksum: sha1:b9b14902f71407dd21a4b209f2e342c54a0a86a7 src/polar_sdk/seats.py: - last_write_checksum: sha1:54577a2e2d43519a3a6ee3abaa984862704818fa + last_write_checksum: sha1:49433bb0a4909e8b67345c7a51f42c89c06a784c src/polar_sdk/subscriptions.py: - last_write_checksum: sha1:12be163c36a132ff745d578a7c0d529682996a00 + last_write_checksum: sha1:f0b56069383999baf694f765fbb009907a36b921 src/polar_sdk/types/__init__.py: last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed src/polar_sdk/types/basemodel.py: @@ -8801,6 +8837,6 @@ trackedFiles: src/polar_sdk/utils/values.py: last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 src/polar_sdk/wallets.py: - last_write_checksum: sha1:321da1c05c5c49b2652c80b69ead90d0e2c59f69 + last_write_checksum: sha1:5d006efe7323ca9a2e0df4985e0f74311fabcd1e src/polar_sdk/webhooks.py: - last_write_checksum: sha1:9eb37df8fff61225cb0c163715bb3e2f87c1f7e5 + last_write_checksum: sha1:cbda8ebc49389d1ed864d515702f64e755d248e6 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c374ce6a..03add433 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: persistentEdits: {} versioningStrategy: automatic python: - version: 0.31.4 + version: 0.31.5 additionalDependencies: dev: pydantic-ai-slim: ^0.1.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 080317ab..40bc09d8 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.648.0 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:f4ed1b0e8ba20110fa6bfa0440ab486f438448c62520635598a45f137676f462 - sourceBlobDigest: sha256:a6208a3d9294882d01bd19e44857edc22a01ed2dc85c54f7e5d1fd05ca90b43b + sourceRevisionDigest: sha256:1fecaea8a8fd0024142da10a82bae79ed641ff640b024eee7d7d2241c8e88be9 + sourceBlobDigest: sha256:7701e3888f8668ba9dfe91f9485b33aa28c0abceb88122948ebcee3937168b62 tags: - latest - - speakeasy-sdk-regen-1776212983 + - speakeasy-sdk-regen-1777422844 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:f4ed1b0e8ba20110fa6bfa0440ab486f438448c62520635598a45f137676f462 - sourceBlobDigest: sha256:a6208a3d9294882d01bd19e44857edc22a01ed2dc85c54f7e5d1fd05ca90b43b + sourceRevisionDigest: sha256:1fecaea8a8fd0024142da10a82bae79ed641ff640b024eee7d7d2241c8e88be9 + sourceBlobDigest: sha256:7701e3888f8668ba9dfe91f9485b33aa28c0abceb88122948ebcee3937168b62 codeSamplesNamespace: polar-oas-py-code-samples - codeSamplesRevisionDigest: sha256:39d6dcf721458118aa44243181ec6d9b4ede8a195f17f2d81b6d547cc153e5d1 + codeSamplesRevisionDigest: sha256:a791c3b7bba191161bcffe365fda6d1cdfb8e717c6bfd0e94a4962fe999fa8c1 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 1ad35711..8f9df901 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,7 @@ def webhook(): * [update](docs/sdks/polarorders/README.md#update) - Update Order * [generate_invoice](docs/sdks/polarorders/README.md#generate_invoice) - Generate Order Invoice * [invoice](docs/sdks/polarorders/README.md#invoice) - Get Order Invoice +* [receipt](docs/sdks/polarorders/README.md#receipt) - Get Order Receipt * [get_payment_status](docs/sdks/polarorders/README.md#get_payment_status) - Get Order Payment Status * [confirm_retry_payment](docs/sdks/polarorders/README.md#confirm_retry_payment) - Confirm Retry Payment @@ -434,6 +435,7 @@ def webhook(): * [update](docs/sdks/orders/README.md#update) - Update Order * [generate_invoice](docs/sdks/orders/README.md#generate_invoice) - Generate Order Invoice * [invoice](docs/sdks/orders/README.md#invoice) - Get Order Invoice +* [receipt](docs/sdks/orders/README.md#receipt) - Get Order Receipt ### [organization_access_tokens](docs/sdks/organizationaccesstokens/README.md) @@ -599,26 +601,26 @@ with Polar( **Inherit from [`PolarError`](./src/polar_sdk/models/polarerror.py)**: -* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 85 of 181 methods.* -* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 181 methods.* -* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 181 methods.* -* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 181 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 181 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 181 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 181 methods.* -* [`TrialAlreadyRedeemed`](./src/polar_sdk/models/trialalreadyredeemed.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 181 methods.* -* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 181 methods.* -* [`PaymentFailed`](./src/polar_sdk/models/paymentfailed.py): Payment required to apply the subscription update. Status code `402`. Applicable to 2 of 181 methods.* -* [`SubscriptionLocked`](./src/polar_sdk/models/subscriptionlocked.py): Subscription is pending an update. Status code `409`. Applicable to 2 of 181 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 181 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 181 methods.* -* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 181 methods.* -* [`CustomerNotReady`](./src/polar_sdk/models/customernotready.py): Customer is not ready to confirm a payment method. Status code `400`. Applicable to 1 of 181 methods.* -* [`PaymentMethodInUseByActiveSubscription`](./src/polar_sdk/models/paymentmethodinusebyactivesubscription.py): Payment method is used by active subscription(s). Status code `400`. Applicable to 1 of 181 methods.* -* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 181 methods.* -* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 181 methods.* -* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 181 methods.* -* [`ManualRetryLimitExceeded`](./src/polar_sdk/models/manualretrylimitexceeded.py): Manual retry limit exceeded. Status code `429`. Applicable to 1 of 181 methods.* +* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 87 of 183 methods.* +* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 183 methods.* +* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 183 methods.* +* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 183 methods.* +* [`AlreadyActiveSubscriptionError`](./src/polar_sdk/models/alreadyactivesubscriptionerror.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* +* [`NotOpenCheckout`](./src/polar_sdk/models/notopencheckout.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* +* [`PaymentNotReady`](./src/polar_sdk/models/paymentnotready.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* +* [`TrialAlreadyRedeemed`](./src/polar_sdk/models/trialalreadyredeemed.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 183 methods.* +* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 183 methods.* +* [`PaymentFailed`](./src/polar_sdk/models/paymentfailed.py): Payment required to apply the subscription update. Status code `402`. Applicable to 2 of 183 methods.* +* [`SubscriptionLocked`](./src/polar_sdk/models/subscriptionlocked.py): Subscription is pending an update. Status code `409`. Applicable to 2 of 183 methods.* +* [`MissingInvoiceBillingDetails`](./src/polar_sdk/models/missinginvoicebillingdetails.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 183 methods.* +* [`NotPaidOrder`](./src/polar_sdk/models/notpaidorder.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 183 methods.* +* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 183 methods.* +* [`CustomerNotReady`](./src/polar_sdk/models/customernotready.py): Customer is not ready to confirm a payment method. Status code `400`. Applicable to 1 of 183 methods.* +* [`PaymentMethodInUseByActiveSubscription`](./src/polar_sdk/models/paymentmethodinusebyactivesubscription.py): Payment method is used by active subscription(s). Status code `400`. Applicable to 1 of 183 methods.* +* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 183 methods.* +* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 183 methods.* +* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 183 methods.* +* [`ManualRetryLimitExceeded`](./src/polar_sdk/models/manualretrylimitexceeded.py): Manual retry limit exceeded. Status code `429`. Applicable to 1 of 183 methods.* * [`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. diff --git a/RELEASES.md b/RELEASES.md index 72ceabfd..f0bb41f8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1113,4 +1113,14 @@ Based on: ### Generated - [python v0.31.4] . ### Releases -- [PyPI v0.31.4] https://pypi.org/project/polar-sdk/0.31.4 - . \ No newline at end of file +- [PyPI v0.31.4] https://pypi.org/project/polar-sdk/0.31.4 - . + +## 2026-05-04 00:32:48 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.648.0 (2.737.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.31.5] . +### Releases +- [PyPI v0.31.5] https://pypi.org/project/polar-sdk/0.31.5 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 54ac8d7e..c160e2ee 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -357,6 +357,12 @@ actions: - "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.get_payment_status(security=polar_sdk.CustomerPortalOrdersGetPaymentStatusSecurity(\n customer_session=\"\",\n ), id=\"\")\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/customer-portal/orders/{id}/receipt"]["get"] + update: + "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.receipt(security=polar_sdk.CustomerPortalOrdersReceiptSecurity(\n customer_session=\"\",\n ), id=\"\")\n\n assert res is not None\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customer-portal/organizations/{slug}"]["get"] update: "x-codeSamples": @@ -548,7 +554,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.discounts.create(request={\n \"duration\": polar_sdk.DiscountDuration.ONCE,\n \"type\": polar_sdk.DiscountType.FIXED,\n \"basis_points\": 449604,\n \"name\": \"\",\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.discounts.create(request={\n \"name\": \"\",\n \"type\": \"percentage\",\n \"duration\": polar_sdk.DiscountDuration.ONCE,\n \"basis_points\": 419733,\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/discounts/{id}"]["delete"] update: "x-codeSamples": @@ -903,6 +909,12 @@ actions: - "lang": "python" "label": "Python (SDK)" "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.generate_invoice(id=\"\")\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/orders/{id}/receipt"]["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.orders.receipt(id=\"\")\n\n assert res is not None\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/organization-access-tokens/"]["get"] update: "x-codeSamples": @@ -1208,25 +1220,25 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n timestamp=parse_datetime(\"2025-08-21T06:55:49.348Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-01-02T23:31:01.991Z\"),\n modified_at=parse_datetime(\"2026-11-09T23:45:36.352Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.PURCHASE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": \"\",\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-08-09T17:02:40.706Z\"),\n modified_at=parse_datetime(\"2026-10-06T19:34:47.732Z\"),\n metadata={\n \"key\": 701529,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=None,\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-30T16:49:49.935Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2024-10-20T21:28:56.316Z\"),\n modified_at=parse_datetime(\"2025-06-10T22:36:12.736Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=703327,\n name=\"\",\n description=\"accidentally omelet statement\",\n visibility=polar_sdk.ProductVisibility.DRAFT,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=525458,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-03-11T18:30:15.526Z\"),\n modified_at=parse_datetime(\"2024-01-30T13:01:14.788Z\"),\n id=\"\",\n metadata={\n \"key\": True,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-01-18T04:35:27.509Z\"),\n ends_at=parse_datetime(\"2025-10-09T00:43:35.864Z\"),\n max_redemptions=623984,\n redemptions_count=564618,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[],\n description=\"Pro Plan\",\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n timestamp=parse_datetime(\"2025-08-21T06:55:49.348Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-01-02T23:31:01.991Z\"),\n modified_at=parse_datetime(\"2026-11-09T23:45:36.352Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.PURCHASE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-08-09T17:02:40.706Z\"),\n modified_at=parse_datetime(\"2026-10-06T19:34:47.732Z\"),\n metadata={\n \"key\": 701529,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=None,\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-30T16:49:49.935Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2024-10-20T21:28:56.316Z\"),\n modified_at=parse_datetime(\"2025-06-10T22:36:12.736Z\"),\n trial_interval=polar_sdk.TrialInterval.WEEK,\n trial_interval_count=703327,\n name=\"\",\n description=\"accidentally omelet statement\",\n visibility=polar_sdk.ProductVisibility.DRAFT,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=525458,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-03-11T18:30:15.526Z\"),\n modified_at=parse_datetime(\"2024-01-30T13:01:14.788Z\"),\n id=\"\",\n metadata={\n \"key\": True,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-01-18T04:35:27.509Z\"),\n ends_at=parse_datetime(\"2025-10-09T00:43:35.864Z\"),\n max_redemptions=623984,\n redemptions_count=564618,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.paid"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_paid_post(request=polar_sdk.WebhookOrderPaidPayload(\n timestamp=parse_datetime(\"2026-12-05T07:44:21.172Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-07-27T09:45:49.517Z\"),\n modified_at=parse_datetime(\"2025-12-13T20:55:19.644Z\"),\n status=polar_sdk.OrderStatus.VOID,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_UPDATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-08-31T00:54:53.749Z\"),\n modified_at=parse_datetime(\"2026-07-24T12:09:26.716Z\"),\n metadata={\n \"key\": \"\",\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2026-04-26T07:56:18.616Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2026-11-18T04:42:58.995Z\"),\n modified_at=parse_datetime(\"2026-11-08T22:37:42.911Z\"),\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=478110,\n name=\"\",\n description=\"relative gleefully mmm\",\n visibility=polar_sdk.ProductVisibility.PRIVATE,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=460165,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n amounts={\n \"eur\": 900,\n \"usd\": 1000,\n },\n created_at=parse_datetime(\"2026-09-16T00:05:27.975Z\"),\n modified_at=parse_datetime(\"2026-10-06T09:13:48.040Z\"),\n id=\"\",\n metadata={\n \"key\": 2937.65,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-04-06T01:56:18.511Z\"),\n ends_at=parse_datetime(\"2024-10-30T20:35:43.513Z\"),\n max_redemptions=688483,\n redemptions_count=707021,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2025-04-07T19:38:54.662Z\"),\n modified_at=parse_datetime(\"2024-07-13T10:53:56.818Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.WEEK,\n recurring_interval_count=859218,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2026-01-14T00:19:46.047Z\"),\n current_period_end=parse_datetime(\"2024-01-20T21:51:39.533Z\"),\n trial_start=parse_datetime(\"2025-04-10T18:11:00.918Z\"),\n trial_end=parse_datetime(\"2025-12-20T04:35:24.232Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2026-01-18T14:11:17.140Z\"),\n started_at=parse_datetime(\"2025-01-31T23:45:02.476Z\"),\n ends_at=parse_datetime(\"2025-04-02T05:18:08.981Z\"),\n ended_at=parse_datetime(\"2026-12-02T15:10:04.656Z\"),\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 ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2025-05-25T21:22:06.978Z\"),\n modified_at=parse_datetime(\"2024-11-14T15:18:02.031Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_paid_post(request=polar_sdk.WebhookOrderPaidPayload(\n timestamp=parse_datetime(\"2026-12-05T07:44:21.172Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-07-27T09:45:49.517Z\"),\n modified_at=parse_datetime(\"2025-12-13T20:55:19.644Z\"),\n status=polar_sdk.OrderStatus.VOID,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_UPDATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": \"\",\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-07-24T12:09:26.716Z\"),\n modified_at=parse_datetime(\"2024-04-03T05:45:29.640Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-20T08:16:19.561Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": False,\n },\n id=\"\",\n created_at=parse_datetime(\"2024-12-19T02:23:05.399Z\"),\n modified_at=parse_datetime(\"2024-05-17T09:50:39.456Z\"),\n trial_interval=polar_sdk.TrialInterval.YEAR,\n trial_interval_count=928538,\n name=\"\",\n description=\"peony um portray since frank rudely mask\",\n visibility=polar_sdk.ProductVisibility.PUBLIC,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=None,\n is_recurring=True,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=1000,\n created_at=parse_datetime(\"2026-01-18T14:11:17.140Z\"),\n modified_at=parse_datetime(\"2025-01-31T23:45:02.476Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2026-12-02T15:10:04.656Z\"),\n ends_at=parse_datetime(\"2025-10-30T18:07:50.242Z\"),\n max_redemptions=568756,\n redemptions_count=465215,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2024-11-23T17:59:56.836Z\"),\n modified_at=parse_datetime(\"2026-08-12T18:11:29.547Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=727805,\n status=polar_sdk.SubscriptionStatus.PAST_DUE,\n current_period_start=parse_datetime(\"2025-09-10T07:58:34.888Z\"),\n current_period_end=parse_datetime(\"2024-09-10T23:54:04.035Z\"),\n trial_start=parse_datetime(\"2024-09-15T09:43:57.152Z\"),\n trial_end=parse_datetime(\"2025-08-15T07:25:23.875Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2026-06-10T20:57:22.896Z\"),\n started_at=None,\n ends_at=parse_datetime(\"2024-12-06T15:09:08.144Z\"),\n ended_at=parse_datetime(\"2024-11-19T10:20:23.628Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=None,\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-12-01T06:46:04.196Z\"),\n modified_at=parse_datetime(\"2025-06-19T05:54:14.128Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.refunded"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_refunded_post(request=polar_sdk.WebhookOrderRefundedPayload(\n timestamp=parse_datetime(\"2025-07-23T18:00:11.615Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-03-19T11:53:59.744Z\"),\n modified_at=parse_datetime(\"2025-12-01T04:03:14.906Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-05-21T22:00:59.902Z\"),\n modified_at=parse_datetime(\"2025-08-24T07:48:58.778Z\"),\n metadata={\n \"key\": 647689,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-02-24T05:25:29.794Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n id=\"\",\n created_at=parse_datetime(\"2024-04-16T08:12:37.300Z\"),\n modified_at=parse_datetime(\"2026-11-16T15:53:42.571Z\"),\n trial_interval=None,\n trial_interval_count=13968,\n name=\"\",\n description=\"deflect wolf simplistic ick stealthily impartial equate for\",\n visibility=polar_sdk.ProductVisibility.DRAFT,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=950630,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.FIXED,\n amount=1000,\n currency=\"usd\",\n amounts={\n \"eur\": 900,\n \"usd\": 1000,\n },\n created_at=parse_datetime(\"2025-06-23T22:24:00.212Z\"),\n modified_at=parse_datetime(\"2026-09-20T03:04:20.355Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-09-22T11:17:00.498Z\"),\n ends_at=parse_datetime(\"2024-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(\"2024-12-27T02:40:16.151Z\"),\n modified_at=None,\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n recurring_interval_count=33996,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2026-10-10T09:17:34.526Z\"),\n current_period_end=parse_datetime(\"2026-12-13T00:18:40.316Z\"),\n trial_start=parse_datetime(\"2026-09-10T16:01:49.333Z\"),\n trial_end=parse_datetime(\"2026-09-27T14:10:27.053Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-11-06T04:39:52.000Z\"),\n started_at=parse_datetime(\"2025-06-22T23:44:00.447Z\"),\n ends_at=parse_datetime(\"2025-11-02T04:41:56.340Z\"),\n ended_at=parse_datetime(\"2024-07-14T14:19:42.078Z\"),\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 ),\n items=[],\n description=\"Pro Plan\",\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_refunded_post(request=polar_sdk.WebhookOrderRefundedPayload(\n timestamp=parse_datetime(\"2025-07-23T18:00:11.615Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2026-03-19T11:53:59.744Z\"),\n modified_at=parse_datetime(\"2025-12-01T04:03:14.906Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=False,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-03-10T03:56:20.855Z\"),\n modified_at=parse_datetime(\"2026-04-02T07:55:28.069Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-08-19T02:54:30.835Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=None,\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=310259,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=1000,\n currency=\"usd\",\n amounts={\n \"eur\": 900,\n \"usd\": 1000,\n },\n created_at=parse_datetime(\"2024-01-26T21:26:48.872Z\"),\n modified_at=parse_datetime(\"2024-01-16T07:26:04.196Z\"),\n id=\"\",\n metadata={\n \"key\": 4016.73,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2026-09-14T03:05:33.012Z\"),\n ends_at=None,\n max_redemptions=211875,\n redemptions_count=188354,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2025-12-08T10:40:25.472Z\"),\n modified_at=parse_datetime(\"2024-12-19T17:19:16.701Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.updated"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_updated_post(request=polar_sdk.WebhookOrderUpdatedPayload(\n timestamp=parse_datetime(\"2024-10-24T00:08:50.290Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-04-30T23:35:35.375Z\"),\n modified_at=parse_datetime(\"2026-06-01T02:02:46.580Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-12-13T17:38:07.808Z\"),\n modified_at=parse_datetime(\"2025-04-07T10:18:18.539Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.TEAM,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-06-08T09:14:51.318Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": 63183,\n },\n id=\"\",\n created_at=parse_datetime(\"2024-01-17T18:03:47.629Z\"),\n modified_at=None,\n trial_interval=polar_sdk.TrialInterval.DAY,\n trial_interval_count=507784,\n name=\"\",\n description=\"untrue round round duh despite thigh next\",\n visibility=polar_sdk.ProductVisibility.PRIVATE,\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.DAY,\n recurring_interval_count=785594,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n type=polar_sdk.DiscountType.FIXED,\n amount=1000,\n currency=\"usd\",\n amounts={\n \"eur\": 900,\n \"usd\": 1000,\n },\n created_at=parse_datetime(\"2025-01-08T22:41:47.998Z\"),\n modified_at=parse_datetime(\"2024-05-19T13:29:26.710Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-02-19T09:02:12.089Z\"),\n ends_at=parse_datetime(\"2024-05-17T03:21:52.194Z\"),\n max_redemptions=157670,\n redemptions_count=611252,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 844744,\n },\n created_at=parse_datetime(\"2025-03-12T02:07:55.904Z\"),\n modified_at=parse_datetime(\"2024-08-25T12:56:24.423Z\"),\n id=\"\",\n amount=10000,\n currency=\"usd\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n recurring_interval_count=366222,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=parse_datetime(\"2025-06-07T23:05:55.886Z\"),\n current_period_end=parse_datetime(\"2025-03-28T15:10:13.508Z\"),\n trial_start=parse_datetime(\"2024-11-02T05:13:30.202Z\"),\n trial_end=parse_datetime(\"2025-03-03T03:52:46.888Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-11-29T07:00:00.013Z\"),\n started_at=None,\n ends_at=parse_datetime(\"2025-02-18T19:25:59.986Z\"),\n ended_at=parse_datetime(\"2026-07-23T06:42:36.223Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=None,\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.CUSTOMER_SERVICE,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n description=\"Pro Plan\",\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_updated_post(request=polar_sdk.WebhookOrderUpdatedPayload(\n timestamp=parse_datetime(\"2024-10-24T00:08:50.290Z\"),\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-04-30T23:35:35.375Z\"),\n modified_at=parse_datetime(\"2026-06-01T02:02:46.580Z\"),\n status=polar_sdk.OrderStatus.PENDING,\n paid=True,\n subtotal_amount=10000,\n discount_amount=1000,\n net_amount=9000,\n tax_amount=720,\n total_amount=9720,\n applied_balance_amount=0,\n due_amount=0,\n refunded_amount=0,\n refunded_tax_amount=0,\n currency=\"usd\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n invoice_number=\"\",\n is_invoice_generated=True,\n receipt_number=\"\",\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n platform_fee_amount=500,\n platform_fee_currency=\"usd\",\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2026-12-03T13:57:13.515Z\"),\n modified_at=parse_datetime(\"2025-03-08T23:35:59.086Z\"),\n metadata={\n \"key\": False,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n type=polar_sdk.CustomerType.INDIVIDUAL,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=polar_sdk.AddressCountryAlpha2.US,\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-10-27T19:38:51.490Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n product=None,\n discount=None,\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-06-25T15:51:37.068Z\"),\n modified_at=parse_datetime(\"2025-07-10T12:45:44.731Z\"),\n id=\"\",\n label=\"Pro Plan\",\n amount=10000,\n tax_amount=720,\n proration=False,\n product_price_id=\"\",\n ),\n ],\n description=\"Pro Plan\",\n refundable_amount=9000,\n refundable_tax_amount=720,\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["organization.updated"]["post"] update: "x-codeSamples": diff --git a/docs/models/availablescope.md b/docs/models/availablescope.md index fe79f29d..1190bb38 100644 --- a/docs/models/availablescope.md +++ b/docs/models/availablescope.md @@ -10,8 +10,6 @@ | `EMAIL` | email | | `USER_READ` | user:read | | `USER_WRITE` | user:write | -| `WEB_READ` | web:read | -| `WEB_WRITE` | web:write | | `ORGANIZATIONS_READ` | organizations:read | | `ORGANIZATIONS_WRITE` | organizations:write | | `CUSTOM_FIELDS_READ` | custom_fields:read | diff --git a/docs/models/customerorder.md b/docs/models/customerorder.md index a8db63c5..5762a262 100644 --- a/docs/models/customerorder.md +++ b/docs/models/customerorder.md @@ -25,6 +25,7 @@ | `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | | `invoice_number` | *str* | :heavy_check_mark: | The invoice number associated with this order. | | | `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | +| `receipt_number` | *Nullable[str]* | :heavy_check_mark: | The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint. | | | `seats` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of seats purchased (for seat-based one-time orders). | | | `customer_id` | *str* | :heavy_check_mark: | N/A | | | `product_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | @@ -35,4 +36,6 @@ | `subscription` | [Nullable[models.CustomerOrderSubscription]](../models/customerordersubscription.md) | :heavy_check_mark: | N/A | | | `items` | List[[models.OrderItemSchema](../models/orderitemschema.md)] | :heavy_check_mark: | Line items composing the order. | | | `description` | *str* | :heavy_check_mark: | A summary description of the order. | Pro Plan | -| `next_payment_attempt_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the next payment retry is scheduled | | \ No newline at end of file +| `next_payment_attempt_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the next payment retry is scheduled | | +| `refundable_amount` | *int* | :heavy_check_mark: | Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds. | 9000 | +| `refundable_tax_amount` | *int* | :heavy_check_mark: | Sales tax in cents that would be refunded if the full refundable amount is refunded. | 720 | \ No newline at end of file diff --git a/docs/models/customerorderreceipt.md b/docs/models/customerorderreceipt.md new file mode 100644 index 00000000..77e2a5f2 --- /dev/null +++ b/docs/models/customerorderreceipt.md @@ -0,0 +1,10 @@ +# CustomerOrderReceipt + +Order's receipt data. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `url` | *str* | :heavy_check_mark: | The URL to the receipt PDF. | \ No newline at end of file diff --git a/docs/models/customerportalordersreceiptrequest.md b/docs/models/customerportalordersreceiptrequest.md new file mode 100644 index 00000000..4b6b573f --- /dev/null +++ b/docs/models/customerportalordersreceiptrequest.md @@ -0,0 +1,8 @@ +# CustomerPortalOrdersReceiptRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | The order ID. | \ No newline at end of file diff --git a/docs/models/customerportalordersreceiptsecurity.md b/docs/models/customerportalordersreceiptsecurity.md new file mode 100644 index 00000000..97cba675 --- /dev/null +++ b/docs/models/customerportalordersreceiptsecurity.md @@ -0,0 +1,9 @@ +# CustomerPortalOrdersReceiptSecurity + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `customer_session` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `member_session` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/discountcreate.md b/docs/models/discountcreate.md index 5b36398b..dbec2985 100644 --- a/docs/models/discountcreate.md +++ b/docs/models/discountcreate.md @@ -3,27 +3,15 @@ ## Supported Types -### `models.DiscountFixedOnceForeverDurationCreate` +### `models.DiscountFixedCreate` ```python -value: models.DiscountFixedOnceForeverDurationCreate = /* values here */ +value: models.DiscountFixedCreate = /* values here */ ``` -### `models.DiscountFixedRepeatDurationCreate` +### `models.DiscountPercentageCreate` ```python -value: models.DiscountFixedRepeatDurationCreate = /* values here */ -``` - -### `models.DiscountPercentageOnceForeverDurationCreate` - -```python -value: models.DiscountPercentageOnceForeverDurationCreate = /* values here */ -``` - -### `models.DiscountPercentageRepeatDurationCreate` - -```python -value: models.DiscountPercentageRepeatDurationCreate = /* values here */ +value: models.DiscountPercentageCreate = /* values here */ ``` diff --git a/docs/models/discountfixedrepeatdurationcreate.md b/docs/models/discountfixedcreate.md similarity index 95% rename from docs/models/discountfixedrepeatdurationcreate.md rename to docs/models/discountfixedcreate.md index 58792a77..65581976 100644 --- a/docs/models/discountfixedrepeatdurationcreate.md +++ b/docs/models/discountfixedcreate.md @@ -1,24 +1,23 @@ -# DiscountFixedRepeatDurationCreate +# DiscountFixedCreate -Schema to create a fixed amount discount that is applied on every invoice -for a certain number of months. +Schema to create a fixed amount discount. ## Fields | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `duration` | [models.DiscountDuration](../models/discountduration.md) | :heavy_check_mark: | N/A | | -| `duration_in_months` | *int* | :heavy_check_mark: | Number of months the discount should be applied.

For this to work on yearly pricing, you should multiply this by 12.
For example, to apply the discount for 2 years, set this to 24. | | -| `type` | [models.DiscountType](../models/discounttype.md) | :heavy_check_mark: | N/A | | -| ~~`amount`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| ~~`currency`~~ | [OptionalNullable[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| `amounts` | Dict[str, *int*] | :heavy_minus_sign: | N/A | | -| `metadata` | Dict[str, [models.DiscountFixedRepeatDurationCreateMetadata](../models/discountfixedrepeatdurationcreatemetadata.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**. | | +| `metadata` | Dict[str, [models.DiscountFixedCreateMetadata](../models/discountfixedcreatemetadata.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**. | | | `name` | *str* | :heavy_check_mark: | Name of the discount. Will be displayed to the customer when the discount is applied. | | | `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API. | | | `starts_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is redeemable. | | | `ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is no longer redeemable. | | | `max_redemptions` | *OptionalNullable[int]* | :heavy_minus_sign: | Optional maximum number of times the discount can be redeemed. | | | `products` | List[*str*] | :heavy_minus_sign: | N/A | | -| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the discount. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | \ No newline at end of file +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the discount. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `type` | *Optional[Literal["fixed"]]* | :heavy_minus_sign: | N/A | | +| `duration` | [models.DiscountDuration](../models/discountduration.md) | :heavy_check_mark: | N/A | | +| `duration_in_months` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of months the discount should be applied.

Required when `duration` is `repeating`. Must be omitted otherwise.

For this to work on yearly pricing, you should multiply this by 12.
For example, to apply the discount for 2 years, set this to 24. | | +| ~~`amount`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| ~~`currency`~~ | [OptionalNullable[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `amounts` | Dict[str, *int*] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/discountfixedrepeatdurationcreatemetadata.md b/docs/models/discountfixedcreatemetadata.md similarity index 85% rename from docs/models/discountfixedrepeatdurationcreatemetadata.md rename to docs/models/discountfixedcreatemetadata.md index 30c733e3..aaf13604 100644 --- a/docs/models/discountfixedrepeatdurationcreatemetadata.md +++ b/docs/models/discountfixedcreatemetadata.md @@ -1,4 +1,4 @@ -# DiscountFixedRepeatDurationCreateMetadata +# DiscountFixedCreateMetadata ## Supported Types diff --git a/docs/models/discountfixedonceforeverdurationcreate.md b/docs/models/discountfixedonceforeverdurationcreate.md deleted file mode 100644 index 65ae9452..00000000 --- a/docs/models/discountfixedonceforeverdurationcreate.md +++ /dev/null @@ -1,22 +0,0 @@ -# DiscountFixedOnceForeverDurationCreate - -Schema to create a fixed amount discount that is applied once or forever. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `duration` | [models.DiscountDuration](../models/discountduration.md) | :heavy_check_mark: | N/A | | -| `type` | [models.DiscountType](../models/discounttype.md) | :heavy_check_mark: | N/A | | -| ~~`amount`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| ~~`currency`~~ | [OptionalNullable[models.PresentmentCurrency]](../models/presentmentcurrency.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| `amounts` | Dict[str, *int*] | :heavy_minus_sign: | N/A | | -| `metadata` | Dict[str, [models.DiscountFixedOnceForeverDurationCreateMetadata](../models/discountfixedonceforeverdurationcreatemetadata.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**. | | -| `name` | *str* | :heavy_check_mark: | Name of the discount. Will be displayed to the customer when the discount is applied. | | -| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API. | | -| `starts_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is redeemable. | | -| `ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is no longer redeemable. | | -| `max_redemptions` | *OptionalNullable[int]* | :heavy_minus_sign: | Optional maximum number of times the discount can be redeemed. | | -| `products` | List[*str*] | :heavy_minus_sign: | N/A | | -| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the discount. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | \ No newline at end of file diff --git a/docs/models/discountpercentagerepeatdurationcreate.md b/docs/models/discountpercentagecreate.md similarity index 95% rename from docs/models/discountpercentagerepeatdurationcreate.md rename to docs/models/discountpercentagecreate.md index be5db5e1..63d664ae 100644 --- a/docs/models/discountpercentagerepeatdurationcreate.md +++ b/docs/models/discountpercentagecreate.md @@ -1,22 +1,21 @@ -# DiscountPercentageRepeatDurationCreate +# DiscountPercentageCreate -Schema to create a percentage discount that is applied on every invoice -for a certain number of months. +Schema to create a percentage discount. ## Fields | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `duration` | [models.DiscountDuration](../models/discountduration.md) | :heavy_check_mark: | N/A | | -| `duration_in_months` | *int* | :heavy_check_mark: | Number of months the discount should be applied.

For this to work on yearly pricing, you should multiply this by 12.
For example, to apply the discount for 2 years, set this to 24. | | -| `type` | [models.DiscountType](../models/discounttype.md) | :heavy_check_mark: | N/A | | -| `basis_points` | *int* | :heavy_check_mark: | Discount percentage in basis points.

A basis point is 1/100th of a percent.
For example, to create a 25.5% discount, set this to 2550. | | -| `metadata` | Dict[str, [models.DiscountPercentageRepeatDurationCreateMetadata](../models/discountpercentagerepeatdurationcreatemetadata.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**. | | +| `metadata` | Dict[str, [models.DiscountPercentageCreateMetadata](../models/discountpercentagecreatemetadata.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**. | | | `name` | *str* | :heavy_check_mark: | Name of the discount. Will be displayed to the customer when the discount is applied. | | | `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API. | | | `starts_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is redeemable. | | | `ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is no longer redeemable. | | | `max_redemptions` | *OptionalNullable[int]* | :heavy_minus_sign: | Optional maximum number of times the discount can be redeemed. | | | `products` | List[*str*] | :heavy_minus_sign: | N/A | | -| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the discount. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | \ No newline at end of file +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the discount. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `type` | *Optional[Literal["percentage"]]* | :heavy_minus_sign: | N/A | | +| `duration` | [models.DiscountDuration](../models/discountduration.md) | :heavy_check_mark: | N/A | | +| `duration_in_months` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of months the discount should be applied.

Required when `duration` is `repeating`. Must be omitted otherwise.

For this to work on yearly pricing, you should multiply this by 12.
For example, to apply the discount for 2 years, set this to 24. | | +| `basis_points` | *int* | :heavy_check_mark: | Discount percentage in basis points.

A basis point is 1/100th of a percent.
For example, to create a 25.5% discount, set this to 2550. | | \ No newline at end of file diff --git a/docs/models/discountfixedonceforeverdurationcreatemetadata.md b/docs/models/discountpercentagecreatemetadata.md similarity index 83% rename from docs/models/discountfixedonceforeverdurationcreatemetadata.md rename to docs/models/discountpercentagecreatemetadata.md index 51595c78..70de6e10 100644 --- a/docs/models/discountfixedonceforeverdurationcreatemetadata.md +++ b/docs/models/discountpercentagecreatemetadata.md @@ -1,4 +1,4 @@ -# DiscountFixedOnceForeverDurationCreateMetadata +# DiscountPercentageCreateMetadata ## Supported Types diff --git a/docs/models/discountpercentageonceforeverdurationcreate.md b/docs/models/discountpercentageonceforeverdurationcreate.md deleted file mode 100644 index 00368f14..00000000 --- a/docs/models/discountpercentageonceforeverdurationcreate.md +++ /dev/null @@ -1,20 +0,0 @@ -# DiscountPercentageOnceForeverDurationCreate - -Schema to create a percentage discount that is applied once or forever. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `duration` | [models.DiscountDuration](../models/discountduration.md) | :heavy_check_mark: | N/A | | -| `type` | [models.DiscountType](../models/discounttype.md) | :heavy_check_mark: | N/A | | -| `basis_points` | *int* | :heavy_check_mark: | Discount percentage in basis points.

A basis point is 1/100th of a percent.
For example, to create a 25.5% discount, set this to 2550. | | -| `metadata` | Dict[str, [models.DiscountPercentageOnceForeverDurationCreateMetadata](../models/discountpercentageonceforeverdurationcreatemetadata.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**. | | -| `name` | *str* | :heavy_check_mark: | Name of the discount. Will be displayed to the customer when the discount is applied. | | -| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API. | | -| `starts_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is redeemable. | | -| `ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional timestamp after which the discount is no longer redeemable. | | -| `max_redemptions` | *OptionalNullable[int]* | :heavy_minus_sign: | Optional maximum number of times the discount can be redeemed. | | -| `products` | List[*str*] | :heavy_minus_sign: | N/A | | -| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the discount. **Required unless you use an organization token.** | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | \ No newline at end of file diff --git a/docs/models/discountpercentageonceforeverdurationcreatemetadata.md b/docs/models/discountpercentageonceforeverdurationcreatemetadata.md deleted file mode 100644 index e9a42534..00000000 --- a/docs/models/discountpercentageonceforeverdurationcreatemetadata.md +++ /dev/null @@ -1,29 +0,0 @@ -# DiscountPercentageOnceForeverDurationCreateMetadata - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `int` - -```python -value: int = /* values here */ -``` - -### `float` - -```python -value: float = /* values here */ -``` - -### `bool` - -```python -value: bool = /* values here */ -``` - diff --git a/docs/models/discountpercentagerepeatdurationcreatemetadata.md b/docs/models/discountpercentagerepeatdurationcreatemetadata.md deleted file mode 100644 index 724b2fa9..00000000 --- a/docs/models/discountpercentagerepeatdurationcreatemetadata.md +++ /dev/null @@ -1,29 +0,0 @@ -# DiscountPercentageRepeatDurationCreateMetadata - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `int` - -```python -value: int = /* values here */ -``` - -### `float` - -```python -value: float = /* values here */ -``` - -### `bool` - -```python -value: bool = /* values here */ -``` - diff --git a/docs/models/eventtypewithstats.md b/docs/models/eventtypewithstats.md index 32b56b73..6da6446e 100644 --- a/docs/models/eventtypewithstats.md +++ b/docs/models/eventtypewithstats.md @@ -3,16 +3,16 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Creation timestamp of the object. | -| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Last modification timestamp of the object. | -| `id` | *str* | :heavy_check_mark: | The ID of the object. | -| `name` | *str* | :heavy_check_mark: | The name of the event type. | -| `label` | *str* | :heavy_check_mark: | The label for the event type. | -| `label_property_selector` | *OptionalNullable[str]* | :heavy_minus_sign: | Property path to extract dynamic label from event metadata. | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event type. | -| `source` | [models.EventSource](../models/eventsource.md) | :heavy_check_mark: | N/A | -| `occurrences` | *int* | :heavy_check_mark: | Number of times the event has occurred. | -| `first_seen` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The first time the event occurred. | -| `last_seen` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The last time the event occurred. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the event type. Null for system event types. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Creation timestamp of the event type. Null for system event types. | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Last modification timestamp of the event type. Null for system event types. | +| `name` | *str* | :heavy_check_mark: | The name of the event type. | +| `label` | *str* | :heavy_check_mark: | The label for the event type. | +| `label_property_selector` | *OptionalNullable[str]* | :heavy_minus_sign: | Property path to extract dynamic label from event metadata. | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event type. | +| `source` | [models.EventSource](../models/eventsource.md) | :heavy_check_mark: | N/A | +| `occurrences` | *int* | :heavy_check_mark: | Number of times the event has occurred. | +| `first_seen` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The first time the event occurred. | +| `last_seen` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The last time the event occurred. | \ No newline at end of file diff --git a/docs/models/membercreate.md b/docs/models/membercreate.md index 52009a38..4a174d57 100644 --- a/docs/models/membercreate.md +++ b/docs/models/membercreate.md @@ -5,10 +5,10 @@ Schema for creating a new member. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `customer_id` | *str* | :heavy_check_mark: | The ID of the customer this member belongs to. | | -| `email` | *str* | :heavy_check_mark: | The email address of the member. | member@example.com | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Jane Doe | -| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the member in your system. This must be unique within the customer. | usr_1337 | -| `role` | [Optional[models.MemberRole]](../models/memberrole.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `customer_id` | *str* | :heavy_check_mark: | The ID of the customer this member belongs to. | | +| `email` | *str* | :heavy_check_mark: | The email address of the member. | member@example.com | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Jane Doe | +| `external_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the member in your system. This must be unique within the customer. | usr_1337 | +| `role` | [Optional[models.Role]](../models/role.md) | :heavy_minus_sign: | The role of the member within the customer. To assign or transfer ownership, use the member update endpoint. | member | \ No newline at end of file diff --git a/docs/models/order.md b/docs/models/order.md index b1219a52..4b031823 100644 --- a/docs/models/order.md +++ b/docs/models/order.md @@ -25,6 +25,7 @@ | `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | | `invoice_number` | *str* | :heavy_check_mark: | The invoice number associated with this order. | | | `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | +| `receipt_number` | *Nullable[str]* | :heavy_check_mark: | The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint. | | | `seats` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of seats purchased (for seat-based one-time orders). | | | `customer_id` | *str* | :heavy_check_mark: | N/A | | | `product_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | @@ -40,4 +41,6 @@ | `discount` | [Nullable[models.OrderDiscount]](../models/orderdiscount.md) | :heavy_check_mark: | N/A | | | `subscription` | [Nullable[models.OrderSubscription]](../models/ordersubscription.md) | :heavy_check_mark: | N/A | | | `items` | List[[models.OrderItemSchema](../models/orderitemschema.md)] | :heavy_check_mark: | Line items composing the order. | | -| `description` | *str* | :heavy_check_mark: | A summary description of the order. | Pro Plan | \ No newline at end of file +| `description` | *str* | :heavy_check_mark: | A summary description of the order. | Pro Plan | +| `refundable_amount` | *int* | :heavy_check_mark: | Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds. | 9000 | +| `refundable_tax_amount` | *int* | :heavy_check_mark: | Sales tax in cents that would be refunded if the full refundable amount is refunded. | 720 | \ No newline at end of file diff --git a/docs/models/orderreceipt.md b/docs/models/orderreceipt.md new file mode 100644 index 00000000..5e1130a0 --- /dev/null +++ b/docs/models/orderreceipt.md @@ -0,0 +1,10 @@ +# OrderReceipt + +Order's receipt data. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `url` | *str* | :heavy_check_mark: | The URL to the receipt PDF. | \ No newline at end of file diff --git a/docs/models/ordersreceiptrequest.md b/docs/models/ordersreceiptrequest.md new file mode 100644 index 00000000..8b1abbcb --- /dev/null +++ b/docs/models/ordersreceiptrequest.md @@ -0,0 +1,8 @@ +# OrdersReceiptRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | The order ID. | \ No newline at end of file diff --git a/docs/models/organizationfeaturesettings.md b/docs/models/organizationfeaturesettings.md index 10b8d357..d5ffd1fe 100644 --- a/docs/models/organizationfeaturesettings.md +++ b/docs/models/organizationfeaturesettings.md @@ -9,8 +9,6 @@ | `seat_based_pricing_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has seat-based pricing enabled | | `wallets_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has Wallets enabled | | `member_model_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has the Member model enabled | -| `tinybird_read` | *Optional[bool]* | :heavy_minus_sign: | If this organization reads from Tinybird | -| `tinybird_compare` | *Optional[bool]* | :heavy_minus_sign: | If this organization compares Tinybird results with database | | `checkout_localization_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has checkout localization enabled | | `overview_metrics` | List[*str*] | :heavy_minus_sign: | Ordered list of metric slugs shown on the dashboard overview. | | `reset_proration_behavior_enabled` | *Optional[bool]* | :heavy_minus_sign: | If this organization has access to reset proration behavior. | \ No newline at end of file diff --git a/docs/models/role.md b/docs/models/role.md new file mode 100644 index 00000000..d948bd2d --- /dev/null +++ b/docs/models/role.md @@ -0,0 +1,11 @@ +# Role + +The role of the member within the customer. To assign or transfer ownership, use the member update endpoint. + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `MEMBER` | member | +| `BILLING_MANAGER` | billing_manager | \ No newline at end of file diff --git a/docs/sdks/discounts/README.md b/docs/sdks/discounts/README.md index 8888fc1e..56f464c9 100644 --- a/docs/sdks/discounts/README.md +++ b/docs/sdks/discounts/README.md @@ -78,11 +78,10 @@ with Polar( ) as polar: res = polar.discounts.create(request={ - "duration": polar_sdk.DiscountDuration.ONCE, - "type": polar_sdk.DiscountType.FIXED, - "basis_points": 449604, "name": "", "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", + "type": "fixed", + "duration": polar_sdk.DiscountDuration.ONCE, }) # Handle response diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index d3b7cb11..2058dcfd 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -11,6 +11,7 @@ * [update](#update) - Update Order * [generate_invoice](#generate_invoice) - Generate Order Invoice * [invoice](#invoice) - Get Order Invoice +* [receipt](#receipt) - Get Order Receipt ## list @@ -282,6 +283,51 @@ with Polar( ### Errors +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## receipt + +Get a presigned URL to download an order's receipt PDF. + +**Scopes**: `orders:read` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.orders.receipt(id="") + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.OrderReceipt](../../models/orderreceipt.md)** + +### Errors + | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | models.ResourceNotFound | 404 | application/json | diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index 97f9d9ae..1d6a528c 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -106,8 +106,6 @@ with Polar( Get an organization by ID. -**Scopes**: `organizations:read` `organizations:write` - ### Example Usage @@ -149,8 +147,6 @@ with Polar( Update an organization. -**Scopes**: `organizations:write` - ### Example Usage diff --git a/docs/sdks/polarorders/README.md b/docs/sdks/polarorders/README.md index 2350dcc2..452b8463 100644 --- a/docs/sdks/polarorders/README.md +++ b/docs/sdks/polarorders/README.md @@ -10,6 +10,7 @@ * [update](#update) - Update Order * [generate_invoice](#generate_invoice) - Generate Order Invoice * [invoice](#invoice) - Get Order Invoice +* [receipt](#receipt) - Get Order Receipt * [get_payment_status](#get_payment_status) - Get Order Payment Status * [confirm_retry_payment](#confirm_retry_payment) - Confirm Retry Payment @@ -240,6 +241,51 @@ with Polar() as polar: | models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | +## receipt + +Get a presigned URL to download an order's receipt PDF. + +### Example Usage + + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.orders.receipt(security=polar_sdk.CustomerPortalOrdersReceiptSecurity( + customer_session="", + ), id="") + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalOrdersReceiptSecurity](../../models/customerportalordersreceiptsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CustomerOrderReceipt](../../models/customerorderreceipt.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + ## get_payment_status Get the current payment status for an order. diff --git a/pyproject.toml b/pyproject.toml index 8b56dbd0..932e468f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "polar-sdk" -version = "0.31.4" +version = "0.31.5" description = "Polar SDK for Python" authors = [{ name = "Polar" },] readme = "README-PYPI.md" diff --git a/src/polar_sdk/_version.py b/src/polar_sdk/_version.py index 7789ad5f..9b9b869f 100644 --- a/src/polar_sdk/_version.py +++ b/src/polar_sdk/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "polar-sdk" -__version__: str = "0.31.4" +__version__: str = "0.31.5" __openapi_doc_version__: str = "0.1.0" __gen_version__: str = "2.737.0" -__user_agent__: str = "speakeasy-sdk/python 0.31.4 2.737.0 0.1.0 polar-sdk" +__user_agent__: str = "speakeasy-sdk/python 0.31.5 2.737.0 0.1.0 polar-sdk" try: if __package__ is not None: diff --git a/src/polar_sdk/models/__init__.py b/src/polar_sdk/models/__init__.py index 2e98b5cf..b1e801c4 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -855,6 +855,12 @@ CustomerPortalOrdersListSecurity, CustomerPortalOrdersListSecurityTypedDict, ) + from .customer_portal_orders_receiptop import ( + CustomerPortalOrdersReceiptRequest, + CustomerPortalOrdersReceiptRequestTypedDict, + CustomerPortalOrdersReceiptSecurity, + CustomerPortalOrdersReceiptSecurityTypedDict, + ) from .customer_portal_orders_updateop import ( CustomerPortalOrdersUpdateRequest, CustomerPortalOrdersUpdateRequestTypedDict, @@ -1111,6 +1117,10 @@ CustomerOrderProductPricesTypedDict, CustomerOrderProductTypedDict, ) + from .customerorderreceipt import ( + CustomerOrderReceipt, + CustomerOrderReceiptTypedDict, + ) from .customerordersortproperty import CustomerOrderSortProperty from .customerordersubscription import ( CustomerOrderSubscription, @@ -1455,6 +1465,12 @@ from .discount import Discount, DiscountTypedDict from .discountcreate import DiscountCreate, DiscountCreateTypedDict from .discountduration import DiscountDuration + from .discountfixedcreate import ( + DiscountFixedCreate, + DiscountFixedCreateMetadata, + DiscountFixedCreateMetadataTypedDict, + DiscountFixedCreateTypedDict, + ) from .discountfixedonceforeverduration import ( DiscountFixedOnceForeverDuration, DiscountFixedOnceForeverDurationTypedDict, @@ -1463,12 +1479,6 @@ DiscountFixedOnceForeverDurationBase, DiscountFixedOnceForeverDurationBaseTypedDict, ) - from .discountfixedonceforeverdurationcreate import ( - DiscountFixedOnceForeverDurationCreate, - DiscountFixedOnceForeverDurationCreateMetadata, - DiscountFixedOnceForeverDurationCreateMetadataTypedDict, - DiscountFixedOnceForeverDurationCreateTypedDict, - ) from .discountfixedrepeatduration import ( DiscountFixedRepeatDuration, DiscountFixedRepeatDurationTypedDict, @@ -1477,11 +1487,11 @@ DiscountFixedRepeatDurationBase, DiscountFixedRepeatDurationBaseTypedDict, ) - from .discountfixedrepeatdurationcreate import ( - DiscountFixedRepeatDurationCreate, - DiscountFixedRepeatDurationCreateMetadata, - DiscountFixedRepeatDurationCreateMetadataTypedDict, - DiscountFixedRepeatDurationCreateTypedDict, + from .discountpercentagecreate import ( + DiscountPercentageCreate, + DiscountPercentageCreateMetadata, + DiscountPercentageCreateMetadataTypedDict, + DiscountPercentageCreateTypedDict, ) from .discountpercentageonceforeverduration import ( DiscountPercentageOnceForeverDuration, @@ -1491,12 +1501,6 @@ DiscountPercentageOnceForeverDurationBase, DiscountPercentageOnceForeverDurationBaseTypedDict, ) - from .discountpercentageonceforeverdurationcreate import ( - DiscountPercentageOnceForeverDurationCreate, - DiscountPercentageOnceForeverDurationCreateMetadata, - DiscountPercentageOnceForeverDurationCreateMetadataTypedDict, - DiscountPercentageOnceForeverDurationCreateTypedDict, - ) from .discountpercentagerepeatduration import ( DiscountPercentageRepeatDuration, DiscountPercentageRepeatDurationTypedDict, @@ -1505,12 +1509,6 @@ DiscountPercentageRepeatDurationBase, DiscountPercentageRepeatDurationBaseTypedDict, ) - from .discountpercentagerepeatdurationcreate import ( - DiscountPercentageRepeatDurationCreate, - DiscountPercentageRepeatDurationCreateMetadata, - DiscountPercentageRepeatDurationCreateMetadataTypedDict, - DiscountPercentageRepeatDurationCreateTypedDict, - ) from .discountproduct import DiscountProduct, DiscountProductTypedDict from .discounts_deleteop import ( DiscountsDeleteRequest, @@ -1868,7 +1866,7 @@ ManualRetryLimitExceededData, ) from .member import Member, MemberTypedDict - from .membercreate import MemberCreate, MemberCreateTypedDict + from .membercreate import MemberCreate, MemberCreateTypedDict, Role from .memberownercreate import MemberOwnerCreate, MemberOwnerCreateTypedDict from .memberrole import MemberRole from .members_delete_member_by_external_idop import ( @@ -2305,6 +2303,7 @@ from .orderpaidevent import OrderPaidEvent, OrderPaidEventTypedDict from .orderpaidmetadata import OrderPaidMetadata, OrderPaidMetadataTypedDict from .orderproduct import OrderProduct, OrderProductTypedDict + from .orderreceipt import OrderReceipt, OrderReceiptTypedDict from .orderrefundedevent import OrderRefundedEvent, OrderRefundedEventTypedDict from .orderrefundedmetadata import ( OrderRefundedMetadata, @@ -2328,6 +2327,7 @@ ) from .orders_getop import OrdersGetRequest, OrdersGetRequestTypedDict from .orders_invoiceop import OrdersInvoiceRequest, OrdersInvoiceRequestTypedDict + from .orders_receiptop import OrdersReceiptRequest, OrdersReceiptRequestTypedDict from .orders_updateop import OrdersUpdateRequest, OrdersUpdateRequestTypedDict from .ordersortproperty import OrderSortProperty from .orderstatus import OrderStatus @@ -3844,6 +3844,8 @@ "CustomerOrderProductPrices", "CustomerOrderProductPricesTypedDict", "CustomerOrderProductTypedDict", + "CustomerOrderReceipt", + "CustomerOrderReceiptTypedDict", "CustomerOrderSortProperty", "CustomerOrderSubscription", "CustomerOrderSubscriptionTypedDict", @@ -4000,6 +4002,10 @@ "CustomerPortalOrdersListResponseTypedDict", "CustomerPortalOrdersListSecurity", "CustomerPortalOrdersListSecurityTypedDict", + "CustomerPortalOrdersReceiptRequest", + "CustomerPortalOrdersReceiptRequestTypedDict", + "CustomerPortalOrdersReceiptSecurity", + "CustomerPortalOrdersReceiptSecurityTypedDict", "CustomerPortalOrdersUpdateRequest", "CustomerPortalOrdersUpdateRequestTypedDict", "CustomerPortalOrdersUpdateSecurity", @@ -4189,39 +4195,31 @@ "DiscountCreate", "DiscountCreateTypedDict", "DiscountDuration", + "DiscountFixedCreate", + "DiscountFixedCreateMetadata", + "DiscountFixedCreateMetadataTypedDict", + "DiscountFixedCreateTypedDict", "DiscountFixedOnceForeverDuration", "DiscountFixedOnceForeverDurationBase", "DiscountFixedOnceForeverDurationBaseTypedDict", - "DiscountFixedOnceForeverDurationCreate", - "DiscountFixedOnceForeverDurationCreateMetadata", - "DiscountFixedOnceForeverDurationCreateMetadataTypedDict", - "DiscountFixedOnceForeverDurationCreateTypedDict", "DiscountFixedOnceForeverDurationTypedDict", "DiscountFixedRepeatDuration", "DiscountFixedRepeatDurationBase", "DiscountFixedRepeatDurationBaseTypedDict", - "DiscountFixedRepeatDurationCreate", - "DiscountFixedRepeatDurationCreateMetadata", - "DiscountFixedRepeatDurationCreateMetadataTypedDict", - "DiscountFixedRepeatDurationCreateTypedDict", "DiscountFixedRepeatDurationTypedDict", "DiscountIDFilter", "DiscountIDFilterTypedDict", + "DiscountPercentageCreate", + "DiscountPercentageCreateMetadata", + "DiscountPercentageCreateMetadataTypedDict", + "DiscountPercentageCreateTypedDict", "DiscountPercentageOnceForeverDuration", "DiscountPercentageOnceForeverDurationBase", "DiscountPercentageOnceForeverDurationBaseTypedDict", - "DiscountPercentageOnceForeverDurationCreate", - "DiscountPercentageOnceForeverDurationCreateMetadata", - "DiscountPercentageOnceForeverDurationCreateMetadataTypedDict", - "DiscountPercentageOnceForeverDurationCreateTypedDict", "DiscountPercentageOnceForeverDurationTypedDict", "DiscountPercentageRepeatDuration", "DiscountPercentageRepeatDurationBase", "DiscountPercentageRepeatDurationBaseTypedDict", - "DiscountPercentageRepeatDurationCreate", - "DiscountPercentageRepeatDurationCreateMetadata", - "DiscountPercentageRepeatDurationCreateMetadataTypedDict", - "DiscountPercentageRepeatDurationCreateTypedDict", "DiscountPercentageRepeatDurationTypedDict", "DiscountProduct", "DiscountProductTypedDict", @@ -4840,6 +4838,8 @@ "OrderPaidMetadataTypedDict", "OrderProduct", "OrderProductTypedDict", + "OrderReceipt", + "OrderReceiptTypedDict", "OrderRefundedEvent", "OrderRefundedEventTypedDict", "OrderRefundedMetadata", @@ -4885,6 +4885,8 @@ "OrdersListResponseTypedDict", "OrdersModel", "OrdersModelTypedDict", + "OrdersReceiptRequest", + "OrdersReceiptRequestTypedDict", "OrdersUpdateRequest", "OrdersUpdateRequestTypedDict", "Organization", @@ -5156,6 +5158,7 @@ "RevokeTokenRequestTypedDict", "RevokeTokenResponse", "RevokeTokenResponseTypedDict", + "Role", "S3DownloadURL", "S3DownloadURLTypedDict", "S3FileCreateMultipart", @@ -6033,6 +6036,10 @@ "CustomerPortalOrdersListResponseTypedDict": ".customer_portal_orders_listop", "CustomerPortalOrdersListSecurity": ".customer_portal_orders_listop", "CustomerPortalOrdersListSecurityTypedDict": ".customer_portal_orders_listop", + "CustomerPortalOrdersReceiptRequest": ".customer_portal_orders_receiptop", + "CustomerPortalOrdersReceiptRequestTypedDict": ".customer_portal_orders_receiptop", + "CustomerPortalOrdersReceiptSecurity": ".customer_portal_orders_receiptop", + "CustomerPortalOrdersReceiptSecurityTypedDict": ".customer_portal_orders_receiptop", "CustomerPortalOrdersUpdateRequest": ".customer_portal_orders_updateop", "CustomerPortalOrdersUpdateRequestTypedDict": ".customer_portal_orders_updateop", "CustomerPortalOrdersUpdateSecurity": ".customer_portal_orders_updateop", @@ -6187,6 +6194,8 @@ "CustomerOrderProductPrices": ".customerorderproduct", "CustomerOrderProductPricesTypedDict": ".customerorderproduct", "CustomerOrderProductTypedDict": ".customerorderproduct", + "CustomerOrderReceipt": ".customerorderreceipt", + "CustomerOrderReceiptTypedDict": ".customerorderreceipt", "CustomerOrderSortProperty": ".customerordersortproperty", "CustomerOrderSubscription": ".customerordersubscription", "CustomerOrderSubscriptionTypedDict": ".customerordersubscription", @@ -6414,38 +6423,30 @@ "DiscountCreate": ".discountcreate", "DiscountCreateTypedDict": ".discountcreate", "DiscountDuration": ".discountduration", + "DiscountFixedCreate": ".discountfixedcreate", + "DiscountFixedCreateMetadata": ".discountfixedcreate", + "DiscountFixedCreateMetadataTypedDict": ".discountfixedcreate", + "DiscountFixedCreateTypedDict": ".discountfixedcreate", "DiscountFixedOnceForeverDuration": ".discountfixedonceforeverduration", "DiscountFixedOnceForeverDurationTypedDict": ".discountfixedonceforeverduration", "DiscountFixedOnceForeverDurationBase": ".discountfixedonceforeverdurationbase", "DiscountFixedOnceForeverDurationBaseTypedDict": ".discountfixedonceforeverdurationbase", - "DiscountFixedOnceForeverDurationCreate": ".discountfixedonceforeverdurationcreate", - "DiscountFixedOnceForeverDurationCreateMetadata": ".discountfixedonceforeverdurationcreate", - "DiscountFixedOnceForeverDurationCreateMetadataTypedDict": ".discountfixedonceforeverdurationcreate", - "DiscountFixedOnceForeverDurationCreateTypedDict": ".discountfixedonceforeverdurationcreate", "DiscountFixedRepeatDuration": ".discountfixedrepeatduration", "DiscountFixedRepeatDurationTypedDict": ".discountfixedrepeatduration", "DiscountFixedRepeatDurationBase": ".discountfixedrepeatdurationbase", "DiscountFixedRepeatDurationBaseTypedDict": ".discountfixedrepeatdurationbase", - "DiscountFixedRepeatDurationCreate": ".discountfixedrepeatdurationcreate", - "DiscountFixedRepeatDurationCreateMetadata": ".discountfixedrepeatdurationcreate", - "DiscountFixedRepeatDurationCreateMetadataTypedDict": ".discountfixedrepeatdurationcreate", - "DiscountFixedRepeatDurationCreateTypedDict": ".discountfixedrepeatdurationcreate", + "DiscountPercentageCreate": ".discountpercentagecreate", + "DiscountPercentageCreateMetadata": ".discountpercentagecreate", + "DiscountPercentageCreateMetadataTypedDict": ".discountpercentagecreate", + "DiscountPercentageCreateTypedDict": ".discountpercentagecreate", "DiscountPercentageOnceForeverDuration": ".discountpercentageonceforeverduration", "DiscountPercentageOnceForeverDurationTypedDict": ".discountpercentageonceforeverduration", "DiscountPercentageOnceForeverDurationBase": ".discountpercentageonceforeverdurationbase", "DiscountPercentageOnceForeverDurationBaseTypedDict": ".discountpercentageonceforeverdurationbase", - "DiscountPercentageOnceForeverDurationCreate": ".discountpercentageonceforeverdurationcreate", - "DiscountPercentageOnceForeverDurationCreateMetadata": ".discountpercentageonceforeverdurationcreate", - "DiscountPercentageOnceForeverDurationCreateMetadataTypedDict": ".discountpercentageonceforeverdurationcreate", - "DiscountPercentageOnceForeverDurationCreateTypedDict": ".discountpercentageonceforeverdurationcreate", "DiscountPercentageRepeatDuration": ".discountpercentagerepeatduration", "DiscountPercentageRepeatDurationTypedDict": ".discountpercentagerepeatduration", "DiscountPercentageRepeatDurationBase": ".discountpercentagerepeatdurationbase", "DiscountPercentageRepeatDurationBaseTypedDict": ".discountpercentagerepeatdurationbase", - "DiscountPercentageRepeatDurationCreate": ".discountpercentagerepeatdurationcreate", - "DiscountPercentageRepeatDurationCreateMetadata": ".discountpercentagerepeatdurationcreate", - "DiscountPercentageRepeatDurationCreateMetadataTypedDict": ".discountpercentagerepeatdurationcreate", - "DiscountPercentageRepeatDurationCreateTypedDict": ".discountpercentagerepeatdurationcreate", "DiscountProduct": ".discountproduct", "DiscountProductTypedDict": ".discountproduct", "DiscountsDeleteRequest": ".discounts_deleteop", @@ -6724,6 +6725,7 @@ "MemberTypedDict": ".member", "MemberCreate": ".membercreate", "MemberCreateTypedDict": ".membercreate", + "Role": ".membercreate", "MemberOwnerCreate": ".memberownercreate", "MemberOwnerCreateTypedDict": ".memberownercreate", "MemberRole": ".memberrole", @@ -7111,6 +7113,8 @@ "OrderPaidMetadataTypedDict": ".orderpaidmetadata", "OrderProduct": ".orderproduct", "OrderProductTypedDict": ".orderproduct", + "OrderReceipt": ".orderreceipt", + "OrderReceiptTypedDict": ".orderreceipt", "OrderRefundedEvent": ".orderrefundedevent", "OrderRefundedEventTypedDict": ".orderrefundedevent", "OrderRefundedMetadata": ".orderrefundedmetadata", @@ -7131,6 +7135,8 @@ "OrdersGetRequestTypedDict": ".orders_getop", "OrdersInvoiceRequest": ".orders_invoiceop", "OrdersInvoiceRequestTypedDict": ".orders_invoiceop", + "OrdersReceiptRequest": ".orders_receiptop", + "OrdersReceiptRequestTypedDict": ".orders_receiptop", "OrdersUpdateRequest": ".orders_updateop", "OrdersUpdateRequestTypedDict": ".orders_updateop", "OrderSortProperty": ".ordersortproperty", diff --git a/src/polar_sdk/models/availablescope.py b/src/polar_sdk/models/availablescope.py index 9edf3fd7..a7506dd5 100644 --- a/src/polar_sdk/models/availablescope.py +++ b/src/polar_sdk/models/availablescope.py @@ -10,8 +10,6 @@ class AvailableScope(str, Enum): EMAIL = "email" USER_READ = "user:read" USER_WRITE = "user:write" - WEB_READ = "web:read" - WEB_WRITE = "web:write" ORGANIZATIONS_READ = "organizations:read" ORGANIZATIONS_WRITE = "organizations:write" CUSTOM_FIELDS_READ = "custom_fields:read" diff --git a/src/polar_sdk/models/customer_portal_orders_receiptop.py b/src/polar_sdk/models/customer_portal_orders_receiptop.py new file mode 100644 index 00000000..1b7d1663 --- /dev/null +++ b/src/polar_sdk/models/customer_portal_orders_receiptop.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata, SecurityMetadata +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CustomerPortalOrdersReceiptSecurityTypedDict(TypedDict): + customer_session: NotRequired[str] + member_session: NotRequired[str] + + +class CustomerPortalOrdersReceiptSecurity(BaseModel): + customer_session: Annotated[ + Optional[str], + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="http", + sub_type="bearer", + field_name="Authorization", + ) + ), + ] = None + + member_session: Annotated[ + Optional[str], + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="http", + sub_type="bearer", + field_name="Authorization", + ) + ), + ] = None + + +class CustomerPortalOrdersReceiptRequestTypedDict(TypedDict): + id: str + r"""The order ID.""" + + +class CustomerPortalOrdersReceiptRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The order ID.""" diff --git a/src/polar_sdk/models/customerorder.py b/src/polar_sdk/models/customerorder.py index 8c8a450c..e0879a66 100644 --- a/src/polar_sdk/models/customerorder.py +++ b/src/polar_sdk/models/customerorder.py @@ -54,6 +54,8 @@ class CustomerOrderTypedDict(TypedDict): r"""The invoice number associated with this order.""" is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" + receipt_number: Nullable[str] + r"""The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint.""" customer_id: str product_id: Nullable[str] discount_id: Nullable[str] @@ -65,6 +67,10 @@ class CustomerOrderTypedDict(TypedDict): r"""Line items composing the order.""" description: str r"""A summary description of the order.""" + refundable_amount: int + r"""Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.""" + refundable_tax_amount: int + r"""Sales tax in cents that would be refunded if the full refundable amount is refunded.""" seats: NotRequired[Nullable[int]] r"""Number of seats purchased (for seat-based one-time orders).""" next_payment_attempt_at: NotRequired[Nullable[datetime]] @@ -128,6 +134,9 @@ class CustomerOrder(BaseModel): is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" + receipt_number: Nullable[str] + r"""The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint.""" + customer_id: str product_id: Nullable[str] @@ -148,6 +157,12 @@ class CustomerOrder(BaseModel): description: str r"""A summary description of the order.""" + refundable_amount: int + r"""Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.""" + + refundable_tax_amount: int + r"""Sales tax in cents that would be refunded if the full refundable amount is refunded.""" + seats: OptionalNullable[int] = UNSET r"""Number of seats purchased (for seat-based one-time orders).""" @@ -161,6 +176,7 @@ def serialize_model(self, handler): "modified_at", "billing_name", "billing_address", + "receipt_number", "seats", "product_id", "discount_id", diff --git a/src/polar_sdk/models/customerorderreceipt.py b/src/polar_sdk/models/customerorderreceipt.py new file mode 100644 index 00000000..ea035f31 --- /dev/null +++ b/src/polar_sdk/models/customerorderreceipt.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from typing_extensions import TypedDict + + +class CustomerOrderReceiptTypedDict(TypedDict): + r"""Order's receipt data.""" + + url: str + r"""The URL to the receipt PDF.""" + + +class CustomerOrderReceipt(BaseModel): + r"""Order's receipt data.""" + + url: str + r"""The URL to the receipt PDF.""" diff --git a/src/polar_sdk/models/discountcreate.py b/src/polar_sdk/models/discountcreate.py index 0921b26a..3847100e 100644 --- a/src/polar_sdk/models/discountcreate.py +++ b/src/polar_sdk/models/discountcreate.py @@ -1,43 +1,27 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .discountfixedonceforeverdurationcreate import ( - DiscountFixedOnceForeverDurationCreate, - DiscountFixedOnceForeverDurationCreateTypedDict, -) -from .discountfixedrepeatdurationcreate import ( - DiscountFixedRepeatDurationCreate, - DiscountFixedRepeatDurationCreateTypedDict, -) -from .discountpercentageonceforeverdurationcreate import ( - DiscountPercentageOnceForeverDurationCreate, - DiscountPercentageOnceForeverDurationCreateTypedDict, -) -from .discountpercentagerepeatdurationcreate import ( - DiscountPercentageRepeatDurationCreate, - DiscountPercentageRepeatDurationCreateTypedDict, +from .discountfixedcreate import DiscountFixedCreate, DiscountFixedCreateTypedDict +from .discountpercentagecreate import ( + DiscountPercentageCreate, + DiscountPercentageCreateTypedDict, ) +from polar_sdk.utils import get_discriminator +from pydantic import Discriminator, Tag from typing import Union -from typing_extensions import TypeAliasType +from typing_extensions import Annotated, TypeAliasType DiscountCreateTypedDict = TypeAliasType( "DiscountCreateTypedDict", - Union[ - DiscountPercentageOnceForeverDurationCreateTypedDict, - DiscountPercentageRepeatDurationCreateTypedDict, - DiscountFixedOnceForeverDurationCreateTypedDict, - DiscountFixedRepeatDurationCreateTypedDict, - ], + Union[DiscountPercentageCreateTypedDict, DiscountFixedCreateTypedDict], ) -DiscountCreate = TypeAliasType( - "DiscountCreate", +DiscountCreate = Annotated[ Union[ - DiscountPercentageOnceForeverDurationCreate, - DiscountPercentageRepeatDurationCreate, - DiscountFixedOnceForeverDurationCreate, - DiscountFixedRepeatDurationCreate, + Annotated[DiscountFixedCreate, Tag("fixed")], + Annotated[DiscountPercentageCreate, Tag("percentage")], ], -) + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] diff --git a/src/polar_sdk/models/discountfixedrepeatdurationcreate.py b/src/polar_sdk/models/discountfixedcreate.py similarity index 81% rename from src/polar_sdk/models/discountfixedrepeatdurationcreate.py rename to src/polar_sdk/models/discountfixedcreate.py index b9e17f66..f2f001f2 100644 --- a/src/polar_sdk/models/discountfixedrepeatdurationcreate.py +++ b/src/polar_sdk/models/discountfixedcreate.py @@ -2,45 +2,34 @@ from __future__ import annotations from .discountduration import DiscountDuration -from .discounttype import DiscountType from .presentmentcurrency import PresentmentCurrency from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const import pydantic from pydantic import model_serializer -from typing import Dict, List, Optional, Union +from pydantic.functional_validators import AfterValidator +from typing import Dict, List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -DiscountFixedRepeatDurationCreateMetadataTypedDict = TypeAliasType( - "DiscountFixedRepeatDurationCreateMetadataTypedDict", Union[str, int, float, bool] +DiscountFixedCreateMetadataTypedDict = TypeAliasType( + "DiscountFixedCreateMetadataTypedDict", Union[str, int, float, bool] ) -DiscountFixedRepeatDurationCreateMetadata = TypeAliasType( - "DiscountFixedRepeatDurationCreateMetadata", Union[str, int, float, bool] +DiscountFixedCreateMetadata = TypeAliasType( + "DiscountFixedCreateMetadata", Union[str, int, float, bool] ) -class DiscountFixedRepeatDurationCreateTypedDict(TypedDict): - r"""Schema to create a fixed amount discount that is applied on every invoice - for a certain number of months. - """ +class DiscountFixedCreateTypedDict(TypedDict): + r"""Schema to create a fixed amount discount.""" - duration: DiscountDuration - duration_in_months: int - r"""Number of months the discount should be applied. - - For this to work on yearly pricing, you should multiply this by 12. - For example, to apply the discount for 2 years, set this to 24. - """ - type: DiscountType name: str r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - amount: NotRequired[Nullable[int]] - currency: NotRequired[Nullable[PresentmentCurrency]] - amounts: NotRequired[Nullable[Dict[str, int]]] - metadata: NotRequired[Dict[str, DiscountFixedRepeatDurationCreateMetadataTypedDict]] + duration: DiscountDuration + metadata: NotRequired[Dict[str, DiscountFixedCreateMetadataTypedDict]] r"""Key-value object allowing you to store additional information. The key must be a string with a maximum length of **40 characters**. @@ -64,44 +53,29 @@ class DiscountFixedRepeatDurationCreateTypedDict(TypedDict): products: NotRequired[Nullable[List[str]]] organization_id: NotRequired[Nullable[str]] r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" - - -class DiscountFixedRepeatDurationCreate(BaseModel): - r"""Schema to create a fixed amount discount that is applied on every invoice - for a certain number of months. - """ - - duration: DiscountDuration - - duration_in_months: int + type: Literal["fixed"] + duration_in_months: NotRequired[Nullable[int]] r"""Number of months the discount should be applied. + Required when `duration` is `repeating`. Must be omitted otherwise. + For this to work on yearly pricing, you should multiply this by 12. For example, to apply the discount for 2 years, set this to 24. """ + amount: NotRequired[Nullable[int]] + currency: NotRequired[Nullable[PresentmentCurrency]] + amounts: NotRequired[Nullable[Dict[str, int]]] - type: DiscountType + +class DiscountFixedCreate(BaseModel): + r"""Schema to create a fixed amount discount.""" name: str r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - amount: Annotated[ - OptionalNullable[int], - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ), - ] = UNSET - - currency: Annotated[ - OptionalNullable[PresentmentCurrency], - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ), - ] = UNSET - - amounts: OptionalNullable[Dict[str, int]] = UNSET + duration: DiscountDuration - metadata: Optional[Dict[str, DiscountFixedRepeatDurationCreateMetadata]] = None + metadata: Optional[Dict[str, DiscountFixedCreateMetadata]] = None r"""Key-value object allowing you to store additional information. The key must be a string with a maximum length of **40 characters**. @@ -132,12 +106,39 @@ class DiscountFixedRepeatDurationCreate(BaseModel): organization_id: OptionalNullable[str] = UNSET r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" + TYPE: Annotated[ + Annotated[Optional[Literal["fixed"]], AfterValidator(validate_const("fixed"))], + pydantic.Field(alias="type"), + ] = "fixed" + + duration_in_months: OptionalNullable[int] = UNSET + r"""Number of months the discount should be applied. + + Required when `duration` is `repeating`. Must be omitted otherwise. + + For this to work on yearly pricing, you should multiply this by 12. + For example, to apply the discount for 2 years, set this to 24. + """ + + amount: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + + currency: Annotated[ + OptionalNullable[PresentmentCurrency], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + + amounts: OptionalNullable[Dict[str, int]] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ - "amount", - "currency", - "amounts", "metadata", "code", "starts_at", @@ -145,17 +146,23 @@ def serialize_model(self, handler): "max_redemptions", "products", "organization_id", - ] - nullable_fields = [ + "type", + "duration_in_months", "amount", "currency", "amounts", + ] + nullable_fields = [ "code", "starts_at", "ends_at", "max_redemptions", "products", "organization_id", + "duration_in_months", + "amount", + "currency", + "amounts", ] null_default_fields = [] diff --git a/src/polar_sdk/models/discountfixedonceforeverdurationcreate.py b/src/polar_sdk/models/discountfixedonceforeverdurationcreate.py deleted file mode 100644 index 85636f1e..00000000 --- a/src/polar_sdk/models/discountfixedonceforeverdurationcreate.py +++ /dev/null @@ -1,170 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .discountduration import DiscountDuration -from .discounttype import DiscountType -from .presentmentcurrency import PresentmentCurrency -from datetime import datetime -from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -import pydantic -from pydantic import model_serializer -from typing import Dict, List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -DiscountFixedOnceForeverDurationCreateMetadataTypedDict = TypeAliasType( - "DiscountFixedOnceForeverDurationCreateMetadataTypedDict", - Union[str, int, float, bool], -) - - -DiscountFixedOnceForeverDurationCreateMetadata = TypeAliasType( - "DiscountFixedOnceForeverDurationCreateMetadata", Union[str, int, float, bool] -) - - -class DiscountFixedOnceForeverDurationCreateTypedDict(TypedDict): - r"""Schema to create a fixed amount discount that is applied once or forever.""" - - duration: DiscountDuration - type: DiscountType - name: str - r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - amount: NotRequired[Nullable[int]] - currency: NotRequired[Nullable[PresentmentCurrency]] - amounts: NotRequired[Nullable[Dict[str, int]]] - metadata: NotRequired[ - Dict[str, DiscountFixedOnceForeverDurationCreateMetadataTypedDict] - ] - r"""Key-value object allowing you to store additional information. - - The key must be a string with a maximum length of **40 characters**. - The value must be either: - - * A string with a maximum length of **500 characters** - * An integer - * A floating-point number - * A boolean - - You can store up to **50 key-value pairs**. - """ - code: NotRequired[Nullable[str]] - r"""Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API.""" - starts_at: NotRequired[Nullable[datetime]] - r"""Optional timestamp after which the discount is redeemable.""" - ends_at: NotRequired[Nullable[datetime]] - r"""Optional timestamp after which the discount is no longer redeemable.""" - max_redemptions: NotRequired[Nullable[int]] - r"""Optional maximum number of times the discount can be redeemed.""" - products: NotRequired[Nullable[List[str]]] - organization_id: NotRequired[Nullable[str]] - r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" - - -class DiscountFixedOnceForeverDurationCreate(BaseModel): - r"""Schema to create a fixed amount discount that is applied once or forever.""" - - duration: DiscountDuration - - type: DiscountType - - name: str - r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - - amount: Annotated[ - OptionalNullable[int], - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ), - ] = UNSET - - currency: Annotated[ - OptionalNullable[PresentmentCurrency], - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ), - ] = UNSET - - amounts: OptionalNullable[Dict[str, int]] = UNSET - - metadata: Optional[Dict[str, DiscountFixedOnceForeverDurationCreateMetadata]] = None - r"""Key-value object allowing you to store additional information. - - The key must be a string with a maximum length of **40 characters**. - The value must be either: - - * A string with a maximum length of **500 characters** - * An integer - * A floating-point number - * A boolean - - You can store up to **50 key-value pairs**. - """ - - code: OptionalNullable[str] = UNSET - r"""Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API.""" - - starts_at: OptionalNullable[datetime] = UNSET - r"""Optional timestamp after which the discount is redeemable.""" - - ends_at: OptionalNullable[datetime] = UNSET - r"""Optional timestamp after which the discount is no longer redeemable.""" - - max_redemptions: OptionalNullable[int] = UNSET - r"""Optional maximum number of times the discount can be redeemed.""" - - products: OptionalNullable[List[str]] = UNSET - - organization_id: OptionalNullable[str] = UNSET - r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "amount", - "currency", - "amounts", - "metadata", - "code", - "starts_at", - "ends_at", - "max_redemptions", - "products", - "organization_id", - ] - nullable_fields = [ - "amount", - "currency", - "amounts", - "code", - "starts_at", - "ends_at", - "max_redemptions", - "products", - "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/discountpercentagerepeatdurationcreate.py b/src/polar_sdk/models/discountpercentagecreate.py similarity index 77% rename from src/polar_sdk/models/discountpercentagerepeatdurationcreate.py rename to src/polar_sdk/models/discountpercentagecreate.py index ceca6a8d..89f05236 100644 --- a/src/polar_sdk/models/discountpercentagerepeatdurationcreate.py +++ b/src/polar_sdk/models/discountpercentagecreate.py @@ -2,49 +2,39 @@ from __future__ import annotations from .discountduration import DiscountDuration -from .discounttype import DiscountType from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import Dict, List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from pydantic.functional_validators import AfterValidator +from typing import Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -DiscountPercentageRepeatDurationCreateMetadataTypedDict = TypeAliasType( - "DiscountPercentageRepeatDurationCreateMetadataTypedDict", - Union[str, int, float, bool], +DiscountPercentageCreateMetadataTypedDict = TypeAliasType( + "DiscountPercentageCreateMetadataTypedDict", Union[str, int, float, bool] ) -DiscountPercentageRepeatDurationCreateMetadata = TypeAliasType( - "DiscountPercentageRepeatDurationCreateMetadata", Union[str, int, float, bool] +DiscountPercentageCreateMetadata = TypeAliasType( + "DiscountPercentageCreateMetadata", Union[str, int, float, bool] ) -class DiscountPercentageRepeatDurationCreateTypedDict(TypedDict): - r"""Schema to create a percentage discount that is applied on every invoice - for a certain number of months. - """ +class DiscountPercentageCreateTypedDict(TypedDict): + r"""Schema to create a percentage discount.""" + name: str + r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" duration: DiscountDuration - duration_in_months: int - r"""Number of months the discount should be applied. - - For this to work on yearly pricing, you should multiply this by 12. - For example, to apply the discount for 2 years, set this to 24. - """ - type: DiscountType basis_points: int r"""Discount percentage in basis points. A basis point is 1/100th of a percent. For example, to create a 25.5% discount, set this to 2550. """ - name: str - r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - metadata: NotRequired[ - Dict[str, DiscountPercentageRepeatDurationCreateMetadataTypedDict] - ] + metadata: NotRequired[Dict[str, DiscountPercentageCreateMetadataTypedDict]] r"""Key-value object allowing you to store additional information. The key must be a string with a maximum length of **40 characters**. @@ -68,23 +58,24 @@ class DiscountPercentageRepeatDurationCreateTypedDict(TypedDict): products: NotRequired[Nullable[List[str]]] organization_id: NotRequired[Nullable[str]] r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" + type: Literal["percentage"] + duration_in_months: NotRequired[Nullable[int]] + r"""Number of months the discount should be applied. + Required when `duration` is `repeating`. Must be omitted otherwise. -class DiscountPercentageRepeatDurationCreate(BaseModel): - r"""Schema to create a percentage discount that is applied on every invoice - for a certain number of months. + For this to work on yearly pricing, you should multiply this by 12. + For example, to apply the discount for 2 years, set this to 24. """ - duration: DiscountDuration - duration_in_months: int - r"""Number of months the discount should be applied. +class DiscountPercentageCreate(BaseModel): + r"""Schema to create a percentage discount.""" - For this to work on yearly pricing, you should multiply this by 12. - For example, to apply the discount for 2 years, set this to 24. - """ + name: str + r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - type: DiscountType + duration: DiscountDuration basis_points: int r"""Discount percentage in basis points. @@ -93,10 +84,7 @@ class DiscountPercentageRepeatDurationCreate(BaseModel): For example, to create a 25.5% discount, set this to 2550. """ - name: str - r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - - metadata: Optional[Dict[str, DiscountPercentageRepeatDurationCreateMetadata]] = None + metadata: Optional[Dict[str, DiscountPercentageCreateMetadata]] = None r"""Key-value object allowing you to store additional information. The key must be a string with a maximum length of **40 characters**. @@ -127,6 +115,23 @@ class DiscountPercentageRepeatDurationCreate(BaseModel): organization_id: OptionalNullable[str] = UNSET r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" + TYPE: Annotated[ + Annotated[ + Optional[Literal["percentage"]], + AfterValidator(validate_const("percentage")), + ], + pydantic.Field(alias="type"), + ] = "percentage" + + duration_in_months: OptionalNullable[int] = UNSET + r"""Number of months the discount should be applied. + + Required when `duration` is `repeating`. Must be omitted otherwise. + + For this to work on yearly pricing, you should multiply this by 12. + For example, to apply the discount for 2 years, set this to 24. + """ + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -137,6 +142,8 @@ def serialize_model(self, handler): "max_redemptions", "products", "organization_id", + "type", + "duration_in_months", ] nullable_fields = [ "code", @@ -145,6 +152,7 @@ def serialize_model(self, handler): "max_redemptions", "products", "organization_id", + "duration_in_months", ] null_default_fields = [] diff --git a/src/polar_sdk/models/discountpercentageonceforeverdurationcreate.py b/src/polar_sdk/models/discountpercentageonceforeverdurationcreate.py deleted file mode 100644 index 871a1508..00000000 --- a/src/polar_sdk/models/discountpercentageonceforeverdurationcreate.py +++ /dev/null @@ -1,158 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .discountduration import DiscountDuration -from .discounttype import DiscountType -from datetime import datetime -from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Dict, List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -DiscountPercentageOnceForeverDurationCreateMetadataTypedDict = TypeAliasType( - "DiscountPercentageOnceForeverDurationCreateMetadataTypedDict", - Union[str, int, float, bool], -) - - -DiscountPercentageOnceForeverDurationCreateMetadata = TypeAliasType( - "DiscountPercentageOnceForeverDurationCreateMetadata", Union[str, int, float, bool] -) - - -class DiscountPercentageOnceForeverDurationCreateTypedDict(TypedDict): - r"""Schema to create a percentage discount that is applied once or forever.""" - - duration: DiscountDuration - type: DiscountType - basis_points: int - r"""Discount percentage in basis points. - - A basis point is 1/100th of a percent. - For example, to create a 25.5% discount, set this to 2550. - """ - name: str - r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - metadata: NotRequired[ - Dict[str, DiscountPercentageOnceForeverDurationCreateMetadataTypedDict] - ] - r"""Key-value object allowing you to store additional information. - - The key must be a string with a maximum length of **40 characters**. - The value must be either: - - * A string with a maximum length of **500 characters** - * An integer - * A floating-point number - * A boolean - - You can store up to **50 key-value pairs**. - """ - code: NotRequired[Nullable[str]] - r"""Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API.""" - starts_at: NotRequired[Nullable[datetime]] - r"""Optional timestamp after which the discount is redeemable.""" - ends_at: NotRequired[Nullable[datetime]] - r"""Optional timestamp after which the discount is no longer redeemable.""" - max_redemptions: NotRequired[Nullable[int]] - r"""Optional maximum number of times the discount can be redeemed.""" - products: NotRequired[Nullable[List[str]]] - organization_id: NotRequired[Nullable[str]] - r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" - - -class DiscountPercentageOnceForeverDurationCreate(BaseModel): - r"""Schema to create a percentage discount that is applied once or forever.""" - - duration: DiscountDuration - - type: DiscountType - - basis_points: int - r"""Discount percentage in basis points. - - A basis point is 1/100th of a percent. - For example, to create a 25.5% discount, set this to 2550. - """ - - name: str - r"""Name of the discount. Will be displayed to the customer when the discount is applied.""" - - metadata: Optional[ - Dict[str, DiscountPercentageOnceForeverDurationCreateMetadata] - ] = None - r"""Key-value object allowing you to store additional information. - - The key must be a string with a maximum length of **40 characters**. - The value must be either: - - * A string with a maximum length of **500 characters** - * An integer - * A floating-point number - * A boolean - - You can store up to **50 key-value pairs**. - """ - - code: OptionalNullable[str] = UNSET - r"""Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API.""" - - starts_at: OptionalNullable[datetime] = UNSET - r"""Optional timestamp after which the discount is redeemable.""" - - ends_at: OptionalNullable[datetime] = UNSET - r"""Optional timestamp after which the discount is no longer redeemable.""" - - max_redemptions: OptionalNullable[int] = UNSET - r"""Optional maximum number of times the discount can be redeemed.""" - - products: OptionalNullable[List[str]] = UNSET - - organization_id: OptionalNullable[str] = UNSET - r"""The ID of the organization owning the discount. **Required unless you use an organization token.**""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "metadata", - "code", - "starts_at", - "ends_at", - "max_redemptions", - "products", - "organization_id", - ] - nullable_fields = [ - "code", - "starts_at", - "ends_at", - "max_redemptions", - "products", - "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/eventtypewithstats.py b/src/polar_sdk/models/eventtypewithstats.py index 309994fe..35b07abb 100644 --- a/src/polar_sdk/models/eventtypewithstats.py +++ b/src/polar_sdk/models/eventtypewithstats.py @@ -9,12 +9,6 @@ class EventTypeWithStatsTypedDict(TypedDict): - created_at: datetime - r"""Creation timestamp of the object.""" - modified_at: Nullable[datetime] - r"""Last modification timestamp of the object.""" - id: str - r"""The ID of the object.""" name: str r"""The name of the event type.""" label: str @@ -28,20 +22,17 @@ class EventTypeWithStatsTypedDict(TypedDict): r"""The first time the event occurred.""" last_seen: datetime r"""The last time the event occurred.""" + id: NotRequired[Nullable[str]] + r"""The ID of the event type. Null for system event types.""" + created_at: NotRequired[Nullable[datetime]] + r"""Creation timestamp of the event type. Null for system event types.""" + modified_at: NotRequired[Nullable[datetime]] + r"""Last modification timestamp of the event type. Null for system event types.""" label_property_selector: NotRequired[Nullable[str]] r"""Property path to extract dynamic label from event metadata.""" class EventTypeWithStats(BaseModel): - created_at: datetime - r"""Creation timestamp of the object.""" - - modified_at: Nullable[datetime] - r"""Last modification timestamp of the object.""" - - id: str - r"""The ID of the object.""" - name: str r"""The name of the event type.""" @@ -62,13 +53,22 @@ class EventTypeWithStats(BaseModel): last_seen: datetime r"""The last time the event occurred.""" + id: OptionalNullable[str] = UNSET + r"""The ID of the event type. Null for system event types.""" + + created_at: OptionalNullable[datetime] = UNSET + r"""Creation timestamp of the event type. Null for system event types.""" + + modified_at: OptionalNullable[datetime] = UNSET + r"""Last modification timestamp of the event type. Null for system event types.""" + label_property_selector: OptionalNullable[str] = UNSET r"""Property path to extract dynamic label from event metadata.""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["label_property_selector"] - nullable_fields = ["modified_at", "label_property_selector"] + optional_fields = ["id", "created_at", "modified_at", "label_property_selector"] + nullable_fields = ["id", "created_at", "modified_at", "label_property_selector"] null_default_fields = [] serialized = handler(self) diff --git a/src/polar_sdk/models/membercreate.py b/src/polar_sdk/models/membercreate.py index c06764d4..50642a3f 100644 --- a/src/polar_sdk/models/membercreate.py +++ b/src/polar_sdk/models/membercreate.py @@ -1,13 +1,20 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .memberrole import MemberRole +from enum import Enum from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer from typing import Optional from typing_extensions import NotRequired, TypedDict +class Role(str, Enum): + r"""The role of the member within the customer. To assign or transfer ownership, use the member update endpoint.""" + + MEMBER = "member" + BILLING_MANAGER = "billing_manager" + + class MemberCreateTypedDict(TypedDict): r"""Schema for creating a new member.""" @@ -18,7 +25,8 @@ class MemberCreateTypedDict(TypedDict): name: NotRequired[Nullable[str]] external_id: NotRequired[Nullable[str]] r"""The ID of the member in your system. This must be unique within the customer.""" - role: NotRequired[MemberRole] + role: NotRequired[Role] + r"""The role of the member within the customer. To assign or transfer ownership, use the member update endpoint.""" class MemberCreate(BaseModel): @@ -35,7 +43,8 @@ class MemberCreate(BaseModel): external_id: OptionalNullable[str] = UNSET r"""The ID of the member in your system. This must be unique within the customer.""" - role: Optional[MemberRole] = None + role: Optional[Role] = Role.MEMBER + r"""The role of the member within the customer. To assign or transfer ownership, use the member update endpoint.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/polar_sdk/models/order.py b/src/polar_sdk/models/order.py index 28a0f7b5..d343db95 100644 --- a/src/polar_sdk/models/order.py +++ b/src/polar_sdk/models/order.py @@ -101,6 +101,8 @@ class OrderTypedDict(TypedDict): r"""The invoice number associated with this order.""" is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" + receipt_number: Nullable[str] + r"""The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint.""" customer_id: str product_id: Nullable[str] discount_id: Nullable[str] @@ -119,6 +121,10 @@ class OrderTypedDict(TypedDict): r"""Line items composing the order.""" description: str r"""A summary description of the order.""" + refundable_amount: int + r"""Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.""" + refundable_tax_amount: int + r"""Sales tax in cents that would be refunded if the full refundable amount is refunded.""" seats: NotRequired[Nullable[int]] r"""Number of seats purchased (for seat-based one-time orders).""" custom_field_data: NotRequired[Dict[str, Nullable[OrderCustomFieldDataTypedDict]]] @@ -182,6 +188,9 @@ class Order(BaseModel): is_invoice_generated: bool r"""Whether an invoice has been generated for this order.""" + receipt_number: Nullable[str] + r"""The receipt number for this order. Set once the order is paid for organizations with receipts enabled. When set, a downloadable receipt PDF can be obtained via the receipt endpoint.""" + customer_id: str product_id: Nullable[str] @@ -214,6 +223,12 @@ class Order(BaseModel): description: str r"""A summary description of the order.""" + refundable_amount: int + r"""Amount in cents that can still be refunded (net, before taxes). Accounts for any applied customer balance and previous refunds.""" + + refundable_tax_amount: int + r"""Sales tax in cents that would be refunded if the full refundable amount is refunded.""" + seats: OptionalNullable[int] = UNSET r"""Number of seats purchased (for seat-based one-time orders).""" @@ -227,6 +242,7 @@ def serialize_model(self, handler): "modified_at", "billing_name", "billing_address", + "receipt_number", "seats", "product_id", "discount_id", diff --git a/src/polar_sdk/models/orderreceipt.py b/src/polar_sdk/models/orderreceipt.py new file mode 100644 index 00000000..5c0f05f9 --- /dev/null +++ b/src/polar_sdk/models/orderreceipt.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from typing_extensions import TypedDict + + +class OrderReceiptTypedDict(TypedDict): + r"""Order's receipt data.""" + + url: str + r"""The URL to the receipt PDF.""" + + +class OrderReceipt(BaseModel): + r"""Order's receipt data.""" + + url: str + r"""The URL to the receipt PDF.""" diff --git a/src/polar_sdk/models/orders_receiptop.py b/src/polar_sdk/models/orders_receiptop.py new file mode 100644 index 00000000..7d1b641b --- /dev/null +++ b/src/polar_sdk/models/orders_receiptop.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class OrdersReceiptRequestTypedDict(TypedDict): + id: str + r"""The order ID.""" + + +class OrdersReceiptRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The order ID.""" diff --git a/src/polar_sdk/models/organizationfeaturesettings.py b/src/polar_sdk/models/organizationfeaturesettings.py index 826754f0..d8076f5d 100644 --- a/src/polar_sdk/models/organizationfeaturesettings.py +++ b/src/polar_sdk/models/organizationfeaturesettings.py @@ -16,10 +16,6 @@ class OrganizationFeatureSettingsTypedDict(TypedDict): r"""If this organization has Wallets enabled""" member_model_enabled: NotRequired[bool] r"""If this organization has the Member model enabled""" - tinybird_read: NotRequired[bool] - r"""If this organization reads from Tinybird""" - tinybird_compare: NotRequired[bool] - r"""If this organization compares Tinybird results with database""" checkout_localization_enabled: NotRequired[bool] r"""If this organization has checkout localization enabled""" overview_metrics: NotRequired[Nullable[List[str]]] @@ -41,12 +37,6 @@ class OrganizationFeatureSettings(BaseModel): member_model_enabled: Optional[bool] = False r"""If this organization has the Member model enabled""" - tinybird_read: Optional[bool] = False - r"""If this organization reads from Tinybird""" - - tinybird_compare: Optional[bool] = False - r"""If this organization compares Tinybird results with database""" - checkout_localization_enabled: Optional[bool] = False r"""If this organization has checkout localization enabled""" @@ -63,8 +53,6 @@ def serialize_model(self, handler): "seat_based_pricing_enabled", "wallets_enabled", "member_model_enabled", - "tinybird_read", - "tinybird_compare", "checkout_localization_enabled", "overview_metrics", "reset_proration_behavior_enabled", diff --git a/src/polar_sdk/orders.py b/src/polar_sdk/orders.py index d280164a..eef1d3e0 100644 --- a/src/polar_sdk/orders.py +++ b/src/polar_sdk/orders.py @@ -1387,3 +1387,195 @@ async def invoice_async( raise models.SDKError("API error occurred", http_res, http_res_text) raise models.SDKError("Unexpected response received", http_res) + + def receipt( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.OrderReceipt]: + r"""Get Order Receipt + + Get a presigned URL to download an order's receipt PDF. + + **Scopes**: `orders:read` + + :param id: The order 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.OrdersReceiptRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/v1/orders/{id}/receipt", + 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=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="orders:receipt", + oauth2_scopes=None, + security_source=self.sdk_configuration.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.OrderReceipt, http_res) + if utils.match_response(http_res, "202", "*"): + return None + 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 receipt_async( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.OrderReceipt]: + r"""Get Order Receipt + + Get a presigned URL to download an order's receipt PDF. + + **Scopes**: `orders:read` + + :param id: The order 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.OrdersReceiptRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/orders/{id}/receipt", + 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=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="orders:receipt", + oauth2_scopes=None, + security_source=self.sdk_configuration.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.OrderReceipt, http_res) + if utils.match_response(http_res, "202", "*"): + return None + 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/organizations.py b/src/polar_sdk/organizations.py index 4769452e..34c3206a 100644 --- a/src/polar_sdk/organizations.py +++ b/src/polar_sdk/organizations.py @@ -465,8 +465,6 @@ def get( Get an organization by ID. - **Scopes**: `organizations:read` `organizations:write` - :param id: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -559,8 +557,6 @@ async def get_async( Get an organization by ID. - **Scopes**: `organizations:read` `organizations:write` - :param id: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -656,8 +652,6 @@ def update( Update an organization. - **Scopes**: `organizations:write` - :param id: :param organization_update: :param retries: Override the default retry configuration for this method @@ -767,8 +761,6 @@ async def update_async( Update an organization. - **Scopes**: `organizations:write` - :param id: :param organization_update: :param retries: Override the default retry configuration for this method diff --git a/src/polar_sdk/polar_orders.py b/src/polar_sdk/polar_orders.py index 6ed52d6c..b6a17173 100644 --- a/src/polar_sdk/polar_orders.py +++ b/src/polar_sdk/polar_orders.py @@ -1150,6 +1150,208 @@ async def invoice_async( raise models.SDKError("Unexpected response received", http_res) + def receipt( + self, + *, + security: Union[ + models.CustomerPortalOrdersReceiptSecurity, + models.CustomerPortalOrdersReceiptSecurityTypedDict, + ], + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CustomerOrderReceipt]: + r"""Get Order Receipt + + Get a presigned URL to download an order's receipt PDF. + + :param security: + :param id: The order 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.CustomerPortalOrdersReceiptRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/v1/customer-portal/orders/{id}/receipt", + 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.CustomerPortalOrdersReceiptSecurity + ), + 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:orders:receipt", + 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.CustomerOrderReceipt, http_res) + if utils.match_response(http_res, "202", "*"): + return None + 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 receipt_async( + self, + *, + security: Union[ + models.CustomerPortalOrdersReceiptSecurity, + models.CustomerPortalOrdersReceiptSecurityTypedDict, + ], + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CustomerOrderReceipt]: + r"""Get Order Receipt + + Get a presigned URL to download an order's receipt PDF. + + :param security: + :param id: The order 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.CustomerPortalOrdersReceiptRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/customer-portal/orders/{id}/receipt", + 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.CustomerPortalOrdersReceiptSecurity + ), + 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:orders:receipt", + 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.CustomerOrderReceipt, http_res) + if utils.match_response(http_res, "202", "*"): + return None + 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 get_payment_status( self, *,