diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 7cf5cae..ccfc148 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: f04f87e6f01948093445b7a6302d0fb4 + docChecksum: c3e31521376d2872da3cec5744b9c7a7 docVersion: 0.1.0 - speakeasyVersion: 1.601.3 - generationVersion: 2.680.0 - releaseVersion: 0.22.6 - configChecksum: 610805277490c2d086cae3f581bcd563 + speakeasyVersion: 1.606.0 + generationVersion: 2.686.7 + releaseVersion: 0.22.7 + configChecksum: dd36cd2f4d5bbac320d9f4d04b3f6c6c repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -14,7 +14,7 @@ features: python: additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.19.8 + core: 5.19.9 customCodeRegions: 0.1.1 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 @@ -278,7 +278,10 @@ generatedFiles: - docs/models/customermeterslistresponse.md - docs/models/customermetersortproperty.md - docs/models/customerorder.md + - docs/models/customerorderconfirmpayment.md - docs/models/customerorderinvoice.md + - docs/models/customerorderpaymentconfirmation.md + - docs/models/customerorderpaymentstatus.md - docs/models/customerorderproduct.md - docs/models/customerorderproductprices.md - docs/models/customerordersortproperty.md @@ -324,9 +327,13 @@ generatedFiles: - docs/models/customerportallicensekeyslistresponse.md - docs/models/customerportallicensekeyslistsecurity.md - docs/models/customerportaloauthaccount.md + - docs/models/customerportalordersconfirmretrypaymentrequest.md + - docs/models/customerportalordersconfirmretrypaymentsecurity.md - docs/models/customerportalordersgenerateinvoicerequest.md - docs/models/customerportalordersgenerateinvoiceresponse422customerportalordersgenerateinvoice.md - docs/models/customerportalordersgenerateinvoicesecurity.md + - docs/models/customerportalordersgetpaymentstatusrequest.md + - docs/models/customerportalordersgetpaymentstatussecurity.md - docs/models/customerportalordersgetrequest.md - docs/models/customerportalordersgetsecurity.md - docs/models/customerportalordersinvoicerequest.md @@ -338,8 +345,6 @@ generatedFiles: - docs/models/customerportalorderslistrequest.md - docs/models/customerportalorderslistresponse.md - docs/models/customerportalorderslistsecurity.md - - docs/models/customerportalordersretrypaymentrequest.md - - docs/models/customerportalordersretrypaymentsecurity.md - docs/models/customerportalordersupdaterequest.md - docs/models/customerportalordersupdatesecurity.md - docs/models/customerportalorganizationsgetrequest.md @@ -539,7 +544,6 @@ generatedFiles: - docs/models/filteroperator.md - docs/models/func.md - docs/models/genericpayment.md - - docs/models/genericpaymentprocessormetadata.md - docs/models/httpvalidationerror.md - docs/models/introspecttokenrequest.md - docs/models/introspecttokenrequesttokentypehint.md @@ -748,7 +752,6 @@ generatedFiles: - docs/models/permission.md - docs/models/previousproperties.md - docs/models/prices.md - - docs/models/processormetadata.md - docs/models/product.md - docs/models/productbenefitsupdate.md - docs/models/productbillingtype.md @@ -1113,11 +1116,12 @@ generatedFiles: - src/polar_sdk/models/customer_portal_downloadables_listop.py - src/polar_sdk/models/customer_portal_license_keys_getop.py - src/polar_sdk/models/customer_portal_license_keys_listop.py + - src/polar_sdk/models/customer_portal_orders_confirm_retry_paymentop.py - src/polar_sdk/models/customer_portal_orders_generate_invoiceop.py + - src/polar_sdk/models/customer_portal_orders_get_payment_statusop.py - 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_retry_paymentop.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_subscriptions_cancelop.py @@ -1150,7 +1154,10 @@ generatedFiles: - src/polar_sdk/models/customermeter.py - src/polar_sdk/models/customermetersortproperty.py - src/polar_sdk/models/customerorder.py + - src/polar_sdk/models/customerorderconfirmpayment.py - src/polar_sdk/models/customerorderinvoice.py + - src/polar_sdk/models/customerorderpaymentconfirmation.py + - src/polar_sdk/models/customerorderpaymentstatus.py - src/polar_sdk/models/customerorderproduct.py - src/polar_sdk/models/customerordersortproperty.py - src/polar_sdk/models/customerordersubscription.py @@ -1601,7 +1608,7 @@ examples: _endpointorder_created_post: speakeasy-default-endpointorder-created-post: requestBody: - application/json: {"type": "order.created", "data": {"id": "", "created_at": "2024-08-21T06:55:49.348Z", "modified_at": null, "status": "refunded", "paid": true, "subtotal_amount": 952546, "discount_amount": 47294, "net_amount": 220865, "amount": 835005, "tax_amount": 913636, "total_amount": 727987, "refunded_amount": 597376, "refunded_tax_amount": 864844, "currency": "Kip", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": true, "key1": 2184.01, "key2": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-11-07T09:52:21.455Z", "modified_at": "2025-06-03T19:46:15.179Z", "metadata": {"key": 526331}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-10-25T07:11:48.501Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-09T20:19:15.400Z", "modified_at": "2023-03-30T07:05:37.419Z", "id": "", "name": "", "description": "against outbid to petty yeast off meanwhile colonialism", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 425196, "type": "fixed", "amount": 778891, "currency": "Armenian Dram", "created_at": "2023-03-20T16:46:25.677Z", "modified_at": "2023-03-06T18:58:41.541Z", "id": "", "metadata": {"key": 298954}, "name": "", "code": "", "starts_at": "2023-04-08T15:39:19.572Z", "ends_at": "2024-01-04T15:31:18.185Z", "max_redemptions": 313467, "redemptions_count": 237254, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": [{"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}, {"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}]}} + application/json: {"type": "order.created", "data": {"id": "", "created_at": "2024-08-21T06:55:49.348Z", "modified_at": null, "status": "refunded", "paid": true, "subtotal_amount": 952546, "discount_amount": 47294, "net_amount": 220865, "tax_amount": 913636, "total_amount": 727987, "refunded_amount": 597376, "refunded_tax_amount": 864844, "currency": "Kip", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": true, "key1": 2184.01, "key2": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-11-07T09:52:21.455Z", "modified_at": "2025-06-03T19:46:15.179Z", "metadata": {"key": 526331}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-10-25T07:11:48.501Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-09T20:19:15.400Z", "modified_at": "2023-03-30T07:05:37.419Z", "id": "", "name": "", "description": "against outbid to petty yeast off meanwhile colonialism", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 425196, "type": "fixed", "amount": 778891, "currency": "Armenian Dram", "created_at": "2023-03-20T16:46:25.677Z", "modified_at": "2023-03-06T18:58:41.541Z", "id": "", "metadata": {"key": 298954}, "name": "", "code": "", "starts_at": "2023-04-08T15:39:19.572Z", "ends_at": "2024-01-04T15:31:18.185Z", "max_redemptions": 313467, "redemptions_count": 237254, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": [{"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}, {"created_at": "2023-10-09T05:35:46.860Z", "modified_at": "2025-11-19T12:55:15.055Z", "id": "", "label": "", "amount": 921740, "tax_amount": 964357, "proration": true, "product_price_id": ""}]}} responses: "200": application/json: "" @@ -1610,7 +1617,7 @@ examples: _endpointorder_updated_post: speakeasy-default-endpointorder-updated-post: requestBody: - application/json: {"type": "order.updated", "data": {"id": "", "created_at": "2023-10-25T00:08:50.290Z", "modified_at": "2024-01-08T20:00:47.692Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 198772, "discount_amount": 338283, "net_amount": 321919, "amount": 827864, "tax_amount": 380359, "total_amount": 596980, "refunded_amount": 404069, "refunded_tax_amount": 718668, "currency": "Nuevo Sol", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": false, "key1": 187509}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-12-03T05:16:11.415Z", "modified_at": "2023-03-11T05:58:05.184Z", "metadata": {}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-06-26T15:51:37.068Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2024-07-10T12:45:44.731Z", "modified_at": "2024-09-19T13:13:25.785Z", "id": "", "name": "", "description": "bossy direct reservation quaintly atop interestingly", "recurring_interval": "month", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 227959, "type": "fixed", "amount": 785594, "currency": "Barbados Dollar", "created_at": "2025-08-02T14:17:04.679Z", "modified_at": "2023-04-10T21:27:35.876Z", "id": "", "metadata": {"key": "", "key1": 330083}, "name": "", "code": "", "starts_at": "2023-09-01T14:56:03.459Z", "ends_at": "2024-10-01T02:03:16.161Z", "max_redemptions": 723901, "redemptions_count": 125128, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2024-10-31T22:22:01.280Z", "modified_at": "2025-05-03T18:27:32.620Z", "id": "", "amount": 405025, "currency": "Pa'anga", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-08-26T12:56:24.423Z", "current_period_end": "2024-02-06T09:06:51.703Z", "cancel_at_period_end": true, "canceled_at": "2024-03-28T15:10:13.508Z", "started_at": "2023-11-03T05:13:30.202Z", "ends_at": "2024-03-03T03:52:46.888Z", "ended_at": "2025-07-30T00:35:38.035Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": null, "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}]}} + application/json: {"type": "order.updated", "data": {"id": "", "created_at": "2023-10-25T00:08:50.290Z", "modified_at": "2024-01-08T20:00:47.692Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 198772, "discount_amount": 338283, "net_amount": 321919, "tax_amount": 380359, "total_amount": 596980, "refunded_amount": 404069, "refunded_tax_amount": 718668, "currency": "Nuevo Sol", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": false, "key1": 187509}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-12-03T05:16:11.415Z", "modified_at": "2023-03-11T05:58:05.184Z", "metadata": {}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-06-26T15:51:37.068Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {}, "created_at": "2024-07-10T12:45:44.731Z", "modified_at": "2024-09-19T13:13:25.785Z", "id": "", "name": "", "description": "bossy direct reservation quaintly atop interestingly", "recurring_interval": "month", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 227959, "type": "fixed", "amount": 785594, "currency": "Barbados Dollar", "created_at": "2025-08-02T14:17:04.679Z", "modified_at": "2023-04-10T21:27:35.876Z", "id": "", "metadata": {"key": "", "key1": 330083}, "name": "", "code": "", "starts_at": "2023-09-01T14:56:03.459Z", "ends_at": "2024-10-01T02:03:16.161Z", "max_redemptions": 723901, "redemptions_count": 125128, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2024-10-31T22:22:01.280Z", "modified_at": "2025-05-03T18:27:32.620Z", "id": "", "amount": 405025, "currency": "Pa'anga", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-08-26T12:56:24.423Z", "current_period_end": "2024-02-06T09:06:51.703Z", "cancel_at_period_end": true, "canceled_at": "2024-03-28T15:10:13.508Z", "started_at": "2023-11-03T05:13:30.202Z", "ends_at": "2024-03-03T03:52:46.888Z", "ended_at": "2025-07-30T00:35:38.035Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": null, "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}, {"created_at": "2025-01-03T16:01:28.999Z", "modified_at": null, "id": "", "label": "", "amount": 516134, "tax_amount": 41202, "proration": false, "product_price_id": ""}]}} responses: "200": application/json: "" @@ -1619,7 +1626,7 @@ examples: _endpointorder_paid_post: speakeasy-default-endpointorder-paid-post: requestBody: - application/json: {"type": "order.paid", "data": {"id": "", "created_at": "2025-12-05T07:44:21.172Z", "modified_at": "2024-12-11T22:14:44.762Z", "status": "refunded", "paid": true, "subtotal_amount": 806442, "discount_amount": 990825, "net_amount": 746396, "amount": 341385, "tax_amount": 486648, "total_amount": 562504, "refunded_amount": 314047, "refunded_tax_amount": 570780, "currency": "Norwegian Krone", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2023-08-30T09:47:22.437Z", "modified_at": "2025-04-20T14:41:24.727Z", "metadata": {"key": 154136, "key1": false, "key2": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2024-06-08T00:11:47.056Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": "", "key1": false, "key2": 1122.47}, "created_at": "2024-03-19T01:07:15.346Z", "modified_at": "2025-03-22T13:41:39.854Z", "id": "", "name": "", "description": "instead unnaturally curly scared but definite knowledgeably", "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 458129, "type": "fixed", "basis_points": 400985, "created_at": "2025-12-02T15:10:04.656Z", "modified_at": "2024-10-30T18:07:50.242Z", "id": "", "metadata": {"key": 4652.15}, "name": "", "code": "", "starts_at": "2023-11-24T17:59:56.836Z", "ends_at": "2025-08-12T18:11:29.547Z", "max_redemptions": 727805, "redemptions_count": 584469, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2025-07-17T03:39:23.964Z", "modified_at": "2025-10-30T20:20:46.051Z", "id": "", "amount": 540428, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-02-24T15:15:22.018Z", "current_period_end": "2023-12-07T15:09:08.144Z", "cancel_at_period_end": false, "canceled_at": "2023-07-01T03:36:16.430Z", "started_at": "2024-09-21T14:56:16.106Z", "ends_at": "2023-01-21T03:35:38.158Z", "ended_at": "2023-12-02T06:46:04.196Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}, "items": []}} + application/json: {"type": "order.paid", "data": {"id": "", "created_at": "2025-12-05T07:44:21.172Z", "modified_at": "2024-12-11T22:14:44.762Z", "status": "refunded", "paid": true, "subtotal_amount": 806442, "discount_amount": 990825, "net_amount": 746396, "tax_amount": 486648, "total_amount": 562504, "refunded_amount": 314047, "refunded_tax_amount": 570780, "currency": "Norwegian Krone", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2023-08-30T09:47:22.437Z", "modified_at": "2025-04-20T14:41:24.727Z", "metadata": {"key": 154136, "key1": false, "key2": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2024-06-08T00:11:47.056Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": "", "key1": false, "key2": 1122.47}, "created_at": "2024-03-19T01:07:15.346Z", "modified_at": "2025-03-22T13:41:39.854Z", "id": "", "name": "", "description": "instead unnaturally curly scared but definite knowledgeably", "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 458129, "type": "fixed", "basis_points": 400985, "created_at": "2025-12-02T15:10:04.656Z", "modified_at": "2024-10-30T18:07:50.242Z", "id": "", "metadata": {"key": 4652.15}, "name": "", "code": "", "starts_at": "2023-11-24T17:59:56.836Z", "ends_at": "2025-08-12T18:11:29.547Z", "max_redemptions": 727805, "redemptions_count": 584469, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2025-07-17T03:39:23.964Z", "modified_at": "2025-10-30T20:20:46.051Z", "id": "", "amount": 540428, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-02-24T15:15:22.018Z", "current_period_end": "2023-12-07T15:09:08.144Z", "cancel_at_period_end": false, "canceled_at": "2023-07-01T03:36:16.430Z", "started_at": "2024-09-21T14:56:16.106Z", "ends_at": "2023-01-21T03:35:38.158Z", "ended_at": "2023-12-02T06:46:04.196Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}, "items": []}} responses: "200": application/json: "" @@ -1628,7 +1635,7 @@ examples: _endpointorder_refunded_post: speakeasy-default-endpointorder-refunded-post: requestBody: - application/json: {"type": "order.refunded", "data": {"id": "", "created_at": "2024-07-23T18:00:11.615Z", "modified_at": "2024-08-23T03:13:11.383Z", "status": "refunded", "paid": true, "subtotal_amount": 678552, "discount_amount": 294178, "net_amount": 721778, "amount": 913001, "tax_amount": 518308, "total_amount": 820663, "refunded_amount": 472431, "refunded_tax_amount": 879331, "currency": "Hong Kong Dollar", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": 4542.91}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-08-11T17:50:11.031Z", "modified_at": "2023-02-24T05:25:29.794Z", "metadata": {"key": 97027, "key1": 958634}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-01-16T07:26:04.196Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 4016.73, "key1": 9058.31, "key2": true}, "created_at": "2024-10-26T18:25:25.517Z", "modified_at": "2023-07-26T10:28:20.791Z", "id": "", "name": "", "description": null, "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 333301, "type": "percentage", "amount": 985928, "currency": "Tunisian Dinar", "created_at": "2025-03-31T17:18:12.309Z", "modified_at": "2025-04-04T07:20:27.321Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": null, "ends_at": "2025-11-07T12:21:07.975Z", "max_redemptions": 986922, "redemptions_count": 691292, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2023-03-16T14:38:58.849Z", "modified_at": "2024-08-12T02:18:50.288Z", "id": "", "amount": 443730, "currency": "Pa'anga", "recurring_interval": "month", "status": "past_due", "current_period_start": "2025-08-22T13:19:25.286Z", "current_period_end": "2025-05-03T08:49:50.424Z", "cancel_at_period_end": true, "canceled_at": "2023-11-21T12:57:47.903Z", "started_at": "2023-09-21T04:07:05.991Z", "ends_at": "2023-10-30T23:29:28.584Z", "ended_at": "2025-05-20T18:28:46.249Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-01-22T05:05:29.797Z", "modified_at": "2025-11-07T21:20:59.535Z", "id": "", "label": "", "amount": 287841, "tax_amount": 922801, "proration": false, "product_price_id": ""}]}} + application/json: {"type": "order.refunded", "data": {"id": "", "created_at": "2024-07-23T18:00:11.615Z", "modified_at": "2024-08-23T03:13:11.383Z", "status": "refunded", "paid": true, "subtotal_amount": 678552, "discount_amount": 294178, "net_amount": 721778, "tax_amount": 518308, "total_amount": 820663, "refunded_amount": 472431, "refunded_tax_amount": 879331, "currency": "Hong Kong Dollar", "billing_reason": "subscription_create", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": 4542.91}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-08-11T17:50:11.031Z", "modified_at": "2023-02-24T05:25:29.794Z", "metadata": {"key": 97027, "key1": 958634}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-01-16T07:26:04.196Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 4016.73, "key1": 9058.31, "key2": true}, "created_at": "2024-10-26T18:25:25.517Z", "modified_at": "2023-07-26T10:28:20.791Z", "id": "", "name": "", "description": null, "recurring_interval": "year", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "forever", "duration_in_months": 333301, "type": "percentage", "amount": 985928, "currency": "Tunisian Dinar", "created_at": "2025-03-31T17:18:12.309Z", "modified_at": "2025-04-04T07:20:27.321Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": null, "ends_at": "2025-11-07T12:21:07.975Z", "max_redemptions": 986922, "redemptions_count": 691292, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {}, "created_at": "2023-03-16T14:38:58.849Z", "modified_at": "2024-08-12T02:18:50.288Z", "id": "", "amount": 443730, "currency": "Pa'anga", "recurring_interval": "month", "status": "past_due", "current_period_start": "2025-08-22T13:19:25.286Z", "current_period_end": "2025-05-03T08:49:50.424Z", "cancel_at_period_end": true, "canceled_at": "2023-11-21T12:57:47.903Z", "started_at": "2023-09-21T04:07:05.991Z", "ends_at": "2023-10-30T23:29:28.584Z", "ended_at": "2025-05-20T18:28:46.249Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-01-22T05:05:29.797Z", "modified_at": "2025-11-07T21:20:59.535Z", "id": "", "label": "", "amount": 287841, "tax_amount": 922801, "proration": false, "product_price_id": ""}]}} responses: "200": application/json: "" @@ -2130,7 +2137,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, "amount": 991685, "tax_amount": 449820, "total_amount": 375942, "refunded_amount": 70124, "refunded_tax_amount": 297395, "currency": "Balboa", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-16T14:29:40.056Z", "modified_at": "2024-12-01T04:46:22.222Z", "metadata": {"key": 7966.23}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2025-09-01T05:52:58.262Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=blank"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-24T18:51:29.694Z", "modified_at": "2025-04-13T23:14:41.573Z", "id": "", "name": "", "description": "expense pip blue furthermore gnash frail yet ugly", "recurring_interval": "year", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 782667, "type": "percentage", "basis_points": 224838, "created_at": "2024-11-05T22:56:54.203Z", "modified_at": "2024-08-14T13:19:22.767Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-03-15T19:46:41.506Z", "ends_at": "2025-06-29T08:50:29.569Z", "max_redemptions": 759343, "redemptions_count": 214063, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": false, "key1": 6606.6}, "created_at": "2024-07-13T07:19:52.472Z", "modified_at": "2023-05-30T18:04:05.234Z", "id": "", "amount": 941727, "currency": "CFA Franc BCEAO", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-08-06T07:04:45.093Z", "current_period_end": "2024-09-25T19:02:24.370Z", "cancel_at_period_end": true, "canceled_at": "2023-09-12T07:04:22.765Z", "started_at": "2023-01-18T06:49:58.589Z", "ends_at": "2023-10-25T10:02:37.340Z", "ended_at": "2023-07-26T14:27:14.451Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}, {"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}]}], "pagination": {"total_count": 754496, "max_page": 599128}} + application/json: {"items": [{"id": "", "created_at": "2023-03-26T01:22:53.189Z", "modified_at": "2024-02-10T15:29:33.963Z", "status": "refunded", "paid": true, "subtotal_amount": 15468, "discount_amount": 962179, "net_amount": 308936, "tax_amount": 449820, "total_amount": 375942, "refunded_amount": 70124, "refunded_tax_amount": 297395, "currency": "Balboa", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-03-16T14:29:40.056Z", "modified_at": "2024-12-01T04:46:22.222Z", "metadata": {"key": 7966.23}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2025-09-01T05:52:58.262Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=blank"}, "user_id": "", "product": {"metadata": {}, "created_at": "2025-02-24T18:51:29.694Z", "modified_at": "2025-04-13T23:14:41.573Z", "id": "", "name": "", "description": "expense pip blue furthermore gnash frail yet ugly", "recurring_interval": "year", "is_recurring": true, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "duration_in_months": 782667, "type": "percentage", "basis_points": 224838, "created_at": "2024-11-05T22:56:54.203Z", "modified_at": "2024-08-14T13:19:22.767Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-03-15T19:46:41.506Z", "ends_at": "2025-06-29T08:50:29.569Z", "max_redemptions": 759343, "redemptions_count": 214063, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": false, "key1": 6606.6}, "created_at": "2024-07-13T07:19:52.472Z", "modified_at": "2023-05-30T18:04:05.234Z", "id": "", "amount": 941727, "currency": "CFA Franc BCEAO", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-08-06T07:04:45.093Z", "current_period_end": "2024-09-25T19:02:24.370Z", "cancel_at_period_end": true, "canceled_at": "2023-09-12T07:04:22.765Z", "started_at": "2023-01-18T06:49:58.589Z", "ends_at": "2023-10-25T10:02:37.340Z", "ended_at": "2023-07-26T14:27:14.451Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}, {"created_at": "2024-02-19T18:25:16.033Z", "modified_at": "2025-09-17T15:07:41.764Z", "id": "", "label": "", "amount": 92904, "tax_amount": 275681, "proration": false, "product_price_id": ""}]}], "pagination": {"total_count": 754496, "max_page": 599128}} "422": application/json: {} orders:get: @@ -2140,7 +2147,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "created_at": "2023-12-28T18:05:05.494Z", "modified_at": "2025-08-19T01:46:15.037Z", "status": "paid", "paid": true, "subtotal_amount": 194509, "discount_amount": 199674, "net_amount": 462739, "amount": 815495, "tax_amount": 174590, "total_amount": 271911, "refunded_amount": 378922, "refunded_tax_amount": 960251, "currency": "Naira", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-07-30T11:43:08.034Z", "modified_at": "2025-11-17T01:23:41.514Z", "metadata": {"key": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-03-07T16:00:18.030Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 709557, "key1": true, "key2": 1589.86}, "created_at": "2024-06-13T05:22:39.981Z", "modified_at": "2025-08-06T17:05:37.045Z", "id": "", "name": "", "description": "tarry subexpression brr huzzah officially", "recurring_interval": "year", "is_recurring": false, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "type": "percentage", "basis_points": 815092, "created_at": "2025-09-19T21:21:56.106Z", "modified_at": "2024-05-14T12:13:50.338Z", "id": "", "metadata": {"key": false}, "name": "", "code": null, "starts_at": "2025-01-27T04:15:28.556Z", "ends_at": "2023-02-03T06:50:58.764Z", "max_redemptions": 31256, "redemptions_count": 737846, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": []} + application/json: {"id": "", "created_at": "2023-12-28T18:05:05.494Z", "modified_at": "2025-08-19T01:46:15.037Z", "status": "paid", "paid": true, "subtotal_amount": 194509, "discount_amount": 199674, "net_amount": 462739, "tax_amount": 174590, "total_amount": 271911, "refunded_amount": 378922, "refunded_tax_amount": 960251, "currency": "Naira", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {"key": ""}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-07-30T11:43:08.034Z", "modified_at": "2025-11-17T01:23:41.514Z", "metadata": {"key": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": null, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-03-07T16:00:18.030Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 709557, "key1": true, "key2": 1589.86}, "created_at": "2024-06-13T05:22:39.981Z", "modified_at": "2025-08-06T17:05:37.045Z", "id": "", "name": "", "description": "tarry subexpression brr huzzah officially", "recurring_interval": "year", "is_recurring": false, "is_archived": false, "organization_id": ""}, "discount": {"duration": "once", "type": "percentage", "basis_points": 815092, "created_at": "2025-09-19T21:21:56.106Z", "modified_at": "2024-05-14T12:13:50.338Z", "id": "", "metadata": {"key": false}, "name": "", "code": null, "starts_at": "2025-01-27T04:15:28.556Z", "ends_at": "2023-02-03T06:50:58.764Z", "max_redemptions": 31256, "redemptions_count": 737846, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": null, "items": []} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -2915,7 +2922,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, "amount": 63217, "tax_amount": 598982, "total_amount": 539673, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}, {"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "amount": 63217, "tax_amount": 598982, "total_amount": 539673, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}], "pagination": {"total_count": 449940, "max_page": 933681}} + application/json: {"items": [{"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "tax_amount": 598982, "total_amount": 539673, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": false, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}, {"id": "", "created_at": "2025-11-20T11:42:23.721Z", "modified_at": "2025-01-24T20:31:05.561Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 845676, "discount_amount": 924720, "net_amount": 71681, "tax_amount": 598982, "total_amount": 539673, "refunded_amount": 14405, "refunded_tax_amount": 988959, "currency": "Malagasy Ariary", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2025-05-15T00:41:31.862Z", "modified_at": "2023-04-25T06:37:58.723Z", "id": "", "name": "", "description": "planula breakable gee stranger", "recurring_interval": null, "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}, {"id": "", "created_at": "2023-07-13T14:06:15.505Z", "modified_at": "2023-04-04T23:25:06.964Z", "type": "meter_credit", "description": "preside because since alongside", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 438908, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": null, "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2025-08-19T15:18:48.324Z", "size_readable": "", "public_url": "https://perfumed-permafrost.info/"}], "organization": {"created_at": "2023-11-27T01:22:01.788Z", "modified_at": "2023-09-26T20:05:53.182Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://gaseous-quinoa.net/", "email": "Julia7@yahoo.com", "website": null, "socials": [{"platform": "youtube", "url": "https://classic-completion.org/"}], "details_submitted_at": "2025-06-17T11:44:40.024Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": true, "new_subscription": false}}}, "subscription": {"created_at": "2025-09-29T10:04:34.395Z", "modified_at": "2024-01-20T16:39:03.992Z", "id": "", "amount": 988367, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-07-15T00:27:45.241Z", "current_period_end": "2025-04-09T12:43:21.768Z", "cancel_at_period_end": true, "canceled_at": "2025-05-30T20:27:13.803Z", "started_at": "2025-12-27T13:19:34.629Z", "ends_at": "2023-04-24T07:47:19.900Z", "ended_at": "2025-12-29T09:10:52.742Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}, {"created_at": "2025-09-04T16:52:16.935Z", "modified_at": "2025-01-30T05:26:00.826Z", "id": "", "label": "", "amount": 807701, "tax_amount": 697997, "proration": true, "product_price_id": ""}]}], "pagination": {"total_count": 449940, "max_page": 933681}} "422": application/json: {} customer_portal:orders:get: @@ -2925,7 +2932,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "created_at": "2025-11-07T01:29:33.239Z", "modified_at": "2025-10-01T14:10:31.444Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 955067, "discount_amount": 688152, "net_amount": 70935, "amount": 506660, "tax_amount": 1252, "total_amount": 953506, "refunded_amount": 31567, "refunded_tax_amount": 929652, "currency": "CFP Franc", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2023-11-19T04:53:34.522Z", "modified_at": "2025-11-25T20:27:43.607Z", "id": "", "name": "", "description": "too jubilantly empty meh", "recurring_interval": "month", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-10-01T14:10:31.444Z", "modified_at": "2025-11-12T18:03:36.492Z", "id": "", "amount_type": "fixed", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "price_currency": "", "price_amount": 953506, "legacy": true}, {"created_at": "2025-11-13T23:04:52.208Z", "modified_at": "2023-07-18T15:45:42.662Z", "id": "", "amount_type": "free", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "legacy": true}], "benefits": [{"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-07-27T19:30:57.624Z", "modified_at": "2025-02-13T12:23:44.948Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://hot-amendment.biz/", "email": "Damaris4@hotmail.com", "website": "", "socials": [{"platform": "youtube", "url": "https://stupendous-advancement.name"}], "details_submitted_at": "2024-10-04T10:38:48.094Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": false, "new_subscription": true}}}, "subscription": {"created_at": "2025-03-12T22:14:21.224Z", "modified_at": "2024-03-29T21:03:44.806Z", "id": "", "amount": 726603, "currency": "Som", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-10-08T20:14:11.453Z", "current_period_end": "2023-01-11T05:31:47.928Z", "cancel_at_period_end": true, "canceled_at": "2024-11-02T16:16:11.516Z", "started_at": "2024-04-10T15:06:14.767Z", "ends_at": "2023-08-09T06:47:34.634Z", "ended_at": "2023-05-14T07:05:36.107Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}, {"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}]} + application/json: {"id": "", "created_at": "2025-11-07T01:29:33.239Z", "modified_at": "2025-10-01T14:10:31.444Z", "status": "partially_refunded", "paid": true, "subtotal_amount": 955067, "discount_amount": 688152, "net_amount": 70935, "tax_amount": 1252, "total_amount": 953506, "refunded_amount": 31567, "refunded_tax_amount": 929652, "currency": "CFP Franc", "billing_reason": "subscription_cycle", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2023-11-19T04:53:34.522Z", "modified_at": "2025-11-25T20:27:43.607Z", "id": "", "name": "", "description": "too jubilantly empty meh", "recurring_interval": "month", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-10-01T14:10:31.444Z", "modified_at": "2025-11-12T18:03:36.492Z", "id": "", "amount_type": "fixed", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "price_currency": "", "price_amount": 953506, "legacy": true}, {"created_at": "2025-11-13T23:04:52.208Z", "modified_at": "2023-07-18T15:45:42.662Z", "id": "", "amount_type": "free", "is_archived": false, "product_id": "", "type": "recurring", "recurring_interval": "month", "legacy": true}], "benefits": [{"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}, {"id": "", "created_at": "2025-07-23T03:55:01.103Z", "modified_at": "2025-05-14T03:22:06.100Z", "type": "meter_credit", "description": "ah coagulate not thankfully buzzing boohoo mask vulgarise far-off drat", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-07-27T19:30:57.624Z", "modified_at": "2025-02-13T12:23:44.948Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://hot-amendment.biz/", "email": "Damaris4@hotmail.com", "website": "", "socials": [{"platform": "youtube", "url": "https://stupendous-advancement.name"}], "details_submitted_at": "2024-10-04T10:38:48.094Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}, "notification_settings": {"new_order": false, "new_subscription": true}}}, "subscription": {"created_at": "2025-03-12T22:14:21.224Z", "modified_at": "2024-03-29T21:03:44.806Z", "id": "", "amount": 726603, "currency": "Som", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-10-08T20:14:11.453Z", "current_period_end": "2023-01-11T05:31:47.928Z", "cancel_at_period_end": true, "canceled_at": "2024-11-02T16:16:11.516Z", "started_at": "2024-04-10T15:06:14.767Z", "ends_at": "2023-08-09T06:47:34.634Z", "ended_at": "2023-05-14T07:05:36.107Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": ""}, "items": [{"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}, {"created_at": "2023-03-15T16:46:25.288Z", "modified_at": "2023-06-13T07:31:24.272Z", "id": "", "label": "", "amount": 846674, "tax_amount": 465593, "proration": true, "product_price_id": ""}]} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3182,7 +3189,7 @@ examples: application/json: {"billing_name": "", "billing_address": {"country": "US"}} responses: "200": - application/json: {"id": "", "created_at": "2023-07-07T02:27:33.933Z", "modified_at": "2025-12-06T08:14:38.290Z", "status": "pending", "paid": true, "subtotal_amount": 666528, "discount_amount": 690049, "net_amount": 679795, "amount": 384624, "tax_amount": 307125, "total_amount": 717730, "refunded_amount": 731967, "refunded_tax_amount": 29529, "currency": "Sri Lanka Rupee", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-05-10T23:50:32.891Z", "modified_at": "2023-02-18T10:28:10.963Z", "metadata": {"key": false}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-09-27T12:39:54.419Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 364993, "key1": true, "key2": true}, "created_at": "2023-04-12T21:30:23.720Z", "modified_at": "2025-07-30T06:39:42.272Z", "id": "", "name": "", "description": "yippee amid wire knowingly an er reproachfully mechanically who gym", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 919384, "type": "fixed", "basis_points": 485397, "created_at": "2023-04-20T01:15:36.927Z", "modified_at": "2025-08-12T14:50:46.554Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-06-20T13:39:02.935Z", "ends_at": "2024-06-17T01:44:44.306Z", "max_redemptions": 991144, "redemptions_count": 882356, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": true, "key1": false}, "created_at": "2025-05-14T12:37:49.790Z", "modified_at": "2023-07-19T20:08:36.520Z", "id": "", "amount": 328171, "currency": "Rand", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-06-29T04:23:47.957Z", "current_period_end": "2024-06-02T02:08:37.593Z", "cancel_at_period_end": true, "canceled_at": "2024-06-26T07:14:15.241Z", "started_at": "2025-06-03T07:15:00.193Z", "ends_at": "2023-09-17T15:31:40.614Z", "ended_at": "2024-06-15T15:33:26.067Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}]} + application/json: {"id": "", "created_at": "2023-07-07T02:27:33.933Z", "modified_at": "2025-12-06T08:14:38.290Z", "status": "pending", "paid": true, "subtotal_amount": 666528, "discount_amount": 690049, "net_amount": 679795, "tax_amount": 307125, "total_amount": 717730, "refunded_amount": 731967, "refunded_tax_amount": 29529, "currency": "Sri Lanka Rupee", "billing_reason": "subscription_update", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "metadata": {}, "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2025-05-10T23:50:32.891Z", "modified_at": "2023-02-18T10:28:10.963Z", "metadata": {"key": false}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-09-27T12:39:54.419Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "user_id": "", "product": {"metadata": {"key": 364993, "key1": true, "key2": true}, "created_at": "2023-04-12T21:30:23.720Z", "modified_at": "2025-07-30T06:39:42.272Z", "id": "", "name": "", "description": "yippee amid wire knowingly an er reproachfully mechanically who gym", "recurring_interval": "month", "is_recurring": true, "is_archived": true, "organization_id": ""}, "discount": {"duration": "repeating", "duration_in_months": 919384, "type": "fixed", "basis_points": 485397, "created_at": "2023-04-20T01:15:36.927Z", "modified_at": "2025-08-12T14:50:46.554Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-06-20T13:39:02.935Z", "ends_at": "2024-06-17T01:44:44.306Z", "max_redemptions": 991144, "redemptions_count": 882356, "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}, "subscription": {"metadata": {"key": true, "key1": false}, "created_at": "2025-05-14T12:37:49.790Z", "modified_at": "2023-07-19T20:08:36.520Z", "id": "", "amount": 328171, "currency": "Rand", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2025-06-29T04:23:47.957Z", "current_period_end": "2024-06-02T02:08:37.593Z", "cancel_at_period_end": true, "canceled_at": "2024-06-26T07:14:15.241Z", "started_at": "2025-06-03T07:15:00.193Z", "ends_at": "2023-09-17T15:31:40.614Z", "ended_at": "2024-06-15T15:33:26.067Z", "customer_id": "", "product_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": ""}, "items": [{"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}, {"created_at": "2025-11-07T03:04:15.446Z", "modified_at": "2024-02-25T04:48:42.731Z", "id": "", "label": "", "amount": 527788, "tax_amount": 941221, "proration": true, "product_price_id": ""}]} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3208,7 +3215,7 @@ examples: application/json: {"billing_name": "", "billing_address": {"country": "US"}} responses: "200": - application/json: {"id": "", "created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "status": "paid", "paid": true, "subtotal_amount": 779370, "discount_amount": 293701, "net_amount": 728297, "amount": 736066, "tax_amount": 459195, "total_amount": 683124, "refunded_amount": 579814, "refunded_tax_amount": 755690, "currency": "Cape Verde Escudo", "billing_reason": "purchase", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2024-02-03T21:16:03.609Z", "modified_at": null, "id": "", "name": "", "description": "gee present next brief till or", "recurring_interval": "year", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "id": "", "amount_type": "metered_unit", "is_archived": true, "product_id": "", "type": "recurring", "recurring_interval": "year", "price_currency": "", "unit_amount": "", "cap_amount": 459195, "meter_id": "", "meter": {"id": "", "name": ""}}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 245978, "storage_version": "", "checksum_etag": null, "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-02T01:31:39.639Z", "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2024-04-27T06:51:48.796Z", "size_readable": "", "public_url": "https://monthly-concentration.com"}], "organization": {"created_at": "2024-05-09T04:05:31.223Z", "modified_at": "2025-07-23T21:23:51.247Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://finished-language.org/", "email": "Junior80@hotmail.com", "website": "", "socials": [], "details_submitted_at": "2023-09-01T22:21:18.571Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}, "notification_settings": {"new_order": false, "new_subscription": false}}}, "subscription": {"created_at": "2025-08-10T03:04:21.532Z", "modified_at": "2024-08-23T05:41:16.519Z", "id": "", "amount": 210189, "currency": "Algerian Dinar", "recurring_interval": "month", "status": "incomplete_expired", "current_period_start": "2024-07-27T23:16:23.597Z", "current_period_end": "2025-01-04T16:08:44.590Z", "cancel_at_period_end": true, "canceled_at": "2025-03-10T21:35:49.211Z", "started_at": "2023-10-24T00:47:38.683Z", "ends_at": "2024-08-10T21:46:10.059Z", "ended_at": "2023-10-02T07:02:51.789Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}]} + application/json: {"id": "", "created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "status": "paid", "paid": true, "subtotal_amount": 779370, "discount_amount": 293701, "net_amount": 728297, "tax_amount": 459195, "total_amount": 683124, "refunded_amount": 579814, "refunded_tax_amount": 755690, "currency": "Cape Verde Escudo", "billing_reason": "purchase", "billing_name": "", "billing_address": {"country": "US"}, "is_invoice_generated": true, "customer_id": "", "product_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2024-02-03T21:16:03.609Z", "modified_at": null, "id": "", "name": "", "description": "gee present next brief till or", "recurring_interval": "year", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-06-18T23:40:50.214Z", "modified_at": "2023-01-14T22:55:27.186Z", "id": "", "amount_type": "metered_unit", "is_archived": true, "product_id": "", "type": "recurring", "recurring_interval": "year", "price_currency": "", "unit_amount": "", "cap_amount": 459195, "meter_id": "", "meter": {"id": "", "name": ""}}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 245978, "storage_version": "", "checksum_etag": null, "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-02T01:31:39.639Z", "version": "", "service": "product_media", "is_uploaded": false, "created_at": "2024-04-27T06:51:48.796Z", "size_readable": "", "public_url": "https://monthly-concentration.com"}], "organization": {"created_at": "2024-05-09T04:05:31.223Z", "modified_at": "2025-07-23T21:23:51.247Z", "id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "name": "", "slug": "", "avatar_url": "https://finished-language.org/", "email": "Junior80@hotmail.com", "website": "", "socials": [], "details_submitted_at": "2023-09-01T22:21:18.571Z", "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}, "notification_settings": {"new_order": false, "new_subscription": false}}}, "subscription": {"created_at": "2025-08-10T03:04:21.532Z", "modified_at": "2024-08-23T05:41:16.519Z", "id": "", "amount": 210189, "currency": "Algerian Dinar", "recurring_interval": "month", "status": "incomplete_expired", "current_period_start": "2024-07-27T23:16:23.597Z", "current_period_end": "2025-01-04T16:08:44.590Z", "cancel_at_period_end": true, "canceled_at": "2025-03-10T21:35:49.211Z", "started_at": "2023-10-24T00:47:38.683Z", "ends_at": "2024-08-10T21:46:10.059Z", "ended_at": "2023-10-02T07:02:51.789Z", "customer_id": "", "product_id": "", "discount_id": null, "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}, "items": [{"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}, {"created_at": "2024-10-06T01:05:33.969Z", "modified_at": "2024-09-29T23:53:44.892Z", "id": "", "label": "", "amount": 924277, "tax_amount": 651911, "proration": false, "product_price_id": ""}]} "404": application/json: {"error": "ResourceNotFound", "detail": ""} "422": @@ -3342,5 +3349,82 @@ examples: application/json: {"error": "PaymentAlreadyInProgress", "detail": ""} "422": application/json: {"error": "OrderNotEligibleForRetry", "detail": ""} + license_keys:validate: + speakeasy-default-license-keys:validate: + requestBody: + application/json: {"key": "", "organization_id": ""} + responses: + "200": + application/json: {"id": "", "created_at": "2024-06-29T07:51:16.664Z", "modified_at": "2024-07-22T07:53:05.781Z", "organization_id": "", "customer_id": "", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-11-08T06:59:11.054Z", "modified_at": "2024-10-16T11:42:16.289Z", "metadata": {"key": true}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2025-10-15T03:37:33.808Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 687171, "usage": 960507, "limit_usage": 710855, "validations": 792226, "last_validated_at": "2024-05-13T06:28:08.701Z", "expires_at": "2025-10-26T12:46:32.455Z"} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "422": + application/json: {} + license_keys:activate: + speakeasy-default-license-keys:activate: + requestBody: + application/json: {"key": "", "organization_id": "", "label": ""} + responses: + "200": + application/json: {"id": "", "license_key_id": "", "label": "", "meta": {}, "created_at": "2025-01-20T08:29:58.654Z", "modified_at": "2025-03-13T06:17:04.428Z", "license_key": {"id": "", "created_at": "2023-09-03T00:06:44.065Z", "modified_at": "2024-09-21T23:39:19.422Z", "organization_id": "", "customer_id": "", "customer": {"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b", "created_at": "2024-07-04T10:38:17.502Z", "modified_at": "2024-07-09T23:48:51.064Z", "metadata": {"key": ""}, "external_id": "usr_1337", "email": "customer@example.com", "email_verified": true, "name": "John Doe", "billing_address": {"country": "US"}, "tax_id": ["911144442", "us_ein"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737", "deleted_at": "2023-12-05T09:55:52.557Z", "avatar_url": "https://www.gravatar.com/avatar/xxx?d=404"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 553799, "usage": 817374, "limit_usage": 304304, "validations": 944013, "last_validated_at": null, "expires_at": "2024-09-12T22:51:35.915Z"}} + "403": + application/json: {"error": "NotPermitted", "detail": ""} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "422": + application/json: {} + license_keys:deactivate: + speakeasy-default-license-keys:deactivate: + requestBody: + application/json: {"key": "", "organization_id": "", "activation_id": ""} + responses: + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "422": + application/json: {} + customer_portal:orders:get_payment_status: + speakeasy-default-customer-portal:orders:get-payment-status: + parameters: + path: + id: "" + responses: + "200": + application/json: {"status": ""} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "422": + application/json: {} + customer_portal:orders:confirm_retry_payment: + speakeasy-default-customer-portal:orders:confirm-retry-payment: + parameters: + path: + id: "" + requestBody: + application/json: {"confirmation_token_id": ""} + responses: + "200": + application/json: {"status": ""} + "404": + application/json: {"error": "ResourceNotFound", "detail": ""} + "409": + application/json: {"error": "PaymentAlreadyInProgress", "detail": ""} + "422": + application/json: {"error": "OrderNotEligibleForRetry", "detail": ""} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: | + ## SDK Changes Detected: + * `polar.customer_portal.orders.list()`: `response.items.[].amount` **Removed** **Breaking** :warning: + * `polar.customer_portal.orders.get()`: `response.amount` **Removed** **Breaking** :warning: + * `polar.payments.get()`: `response` **Changed** **Breaking** :warning: + * `polar.orders.get()`: `response.amount` **Removed** **Breaking** :warning: + * `polar.customer_portal.orders.update()`: `response.amount` **Removed** **Breaking** :warning: + * `polar.orders.list()`: `response.items.[].amount` **Removed** **Breaking** :warning: + * `polar.orders.update()`: `response.amount` **Removed** **Breaking** :warning: + * `polar.payments.list()`: `response.items.[]` **Changed** **Breaking** :warning: + * `polar.license_keys.activate()`: **Added** + * `polar.license_keys.validate()`: **Added** + * `polar.customer_portal.orders.retry_payment()`: **Deleted** **Breaking** :warning: + * `polar.customer_portal.orders.confirm_retry_payment()`: **Added** + * `polar.customer_portal.orders.get_payment_status()`: **Added** + * `polar.license_keys.deactivate()`: **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1504820..9114d27 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -24,7 +24,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 0.22.6 + version: 0.22.7 additionalDependencies: dev: pydantic-ai-slim: ^0.1.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index fc19366..688a814 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.601.3 +speakeasyVersion: 1.606.0 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:2da912a77c24fdb0b275df1e53dfe92334351a9fb2567cc179b05a5860322c0d - sourceBlobDigest: sha256:05e8fa91b9e2cb35335966fe7ad176bc7033fcfcd77b64d5aa3f1531217d45d4 + sourceRevisionDigest: sha256:578ba1afc4207ccf7da46db9a2929f5cd30b4c38fa9dd42ace32bff88ab423f9 + sourceBlobDigest: sha256:d9756d2aba3459fc339415043d8b72eb3dbfeccc9119058a625d61c7f5a9c3df tags: - latest - - speakeasy-sdk-regen-1754957660 + - speakeasy-sdk-regen-1755044075 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:2da912a77c24fdb0b275df1e53dfe92334351a9fb2567cc179b05a5860322c0d - sourceBlobDigest: sha256:05e8fa91b9e2cb35335966fe7ad176bc7033fcfcd77b64d5aa3f1531217d45d4 + sourceRevisionDigest: sha256:578ba1afc4207ccf7da46db9a2929f5cd30b4c38fa9dd42ace32bff88ab423f9 + sourceBlobDigest: sha256:d9756d2aba3459fc339415043d8b72eb3dbfeccc9119058a625d61c7f5a9c3df codeSamplesNamespace: polar-oas-py-code-samples - codeSamplesRevisionDigest: sha256:58f27615585630c8ff1666c525a81612bbd0d2d42898d058322c5d54fa0cc2a9 + codeSamplesRevisionDigest: sha256:2ec4d204f97e8e12ba3d3782113d8301cdc963de8e5ab876b6d49b6a4a4a15a0 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 2d5494d..4d1d219 100644 --- a/README.md +++ b/README.md @@ -792,7 +792,8 @@ 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 -* [retry_payment](docs/sdks/polarorders/README.md#retry_payment) - Retry Payment +* [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 #### [customer_portal.organizations](docs/sdks/polarorganizations/README.md) @@ -851,6 +852,9 @@ def webhook(): * [get](docs/sdks/licensekeys/README.md#get) - Get License Key * [update](docs/sdks/licensekeys/README.md#update) - Update License Key * [get_activation](docs/sdks/licensekeys/README.md#get_activation) - Get Activation +* [validate](docs/sdks/licensekeys/README.md#validate) - Validate License Key +* [activate](docs/sdks/licensekeys/README.md#activate) - Activate License Key +* [deactivate](docs/sdks/licensekeys/README.md#deactivate) - Deactivate License Key ### [meters](docs/sdks/meters/README.md) @@ -1038,22 +1042,22 @@ with Polar( **Inherit from [`PolarError`](./src/polar_sdk/models/polarerror.py)**: -* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 72 of 124 methods.* -* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 9 of 124 methods.* -* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 124 methods.* -* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 124 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 124 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 124 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 124 methods.* -* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 124 methods.* -* [`InvoiceAlreadyExists`](./src/polar_sdk/models/invoicealreadyexists.py): Order already has an invoice. Status code `409`. Applicable to 2 of 124 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 124 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 124 methods.* -* [`RefundAmountTooHigh`](./src/polar_sdk/models/refundamounttoohigh.py): Refund amount exceeds remaining order balance. Status code `400`. Applicable to 1 of 124 methods.* -* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 124 methods.* -* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 124 methods.* -* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 124 methods.* -* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry. Status code `422`. Applicable to 1 of 124 methods.* +* [`ResourceNotFound`](./src/polar_sdk/models/resourcenotfound.py): Status code `404`. Applicable to 76 of 128 methods.* +* [`NotPermitted`](./src/polar_sdk/models/notpermitted.py): Status code `403`. Applicable to 10 of 128 methods.* +* [`Unauthorized`](./src/polar_sdk/models/unauthorized.py): Not authorized to manage license key. Status code `401`. Applicable to 5 of 128 methods.* +* [`AlreadyCanceledSubscription`](./src/polar_sdk/models/alreadycanceledsubscription.py): Status code `403`. Applicable to 4 of 128 methods.* +* [`AlreadyActiveSubscriptionError`](./src/polar_sdk/models/alreadyactivesubscriptionerror.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 128 methods.* +* [`NotOpenCheckout`](./src/polar_sdk/models/notopencheckout.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 128 methods.* +* [`PaymentNotReady`](./src/polar_sdk/models/paymentnotready.py): The checkout is expired, the customer already has an active subscription, or the organization is not ready to accept payments. Status code `403`. Applicable to 3 of 128 methods.* +* [`ExpiredCheckoutError`](./src/polar_sdk/models/expiredcheckouterror.py): The checkout session is expired. Status code `410`. Applicable to 3 of 128 methods.* +* [`InvoiceAlreadyExists`](./src/polar_sdk/models/invoicealreadyexists.py): Order already has an invoice. Status code `409`. Applicable to 2 of 128 methods.* +* [`MissingInvoiceBillingDetails`](./src/polar_sdk/models/missinginvoicebillingdetails.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 128 methods.* +* [`NotPaidOrder`](./src/polar_sdk/models/notpaidorder.py): Order is not paid or is missing billing name or address. Status code `422`. Applicable to 2 of 128 methods.* +* [`RefundAmountTooHigh`](./src/polar_sdk/models/refundamounttoohigh.py): Refund amount exceeds remaining order balance. Status code `400`. Applicable to 1 of 128 methods.* +* [`PaymentError`](./src/polar_sdk/models/paymenterror.py): The payment failed. Status code `400`. Applicable to 1 of 128 methods.* +* [`RefundedAlready`](./src/polar_sdk/models/refundedalready.py): Order is already fully refunded. Status code `403`. Applicable to 1 of 128 methods.* +* [`PaymentAlreadyInProgress`](./src/polar_sdk/models/paymentalreadyinprogress.py): Payment already in progress. Status code `409`. Applicable to 1 of 128 methods.* +* [`OrderNotEligibleForRetry`](./src/polar_sdk/models/ordernoteligibleforretry.py): Order not eligible for retry or payment confirmation failed. Status code `422`. Applicable to 1 of 128 methods.* * [`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 c974fcb..02a8ec8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -853,4 +853,14 @@ Based on: ### Generated - [python v0.22.6] . ### Releases -- [PyPI v0.22.6] https://pypi.org/project/polar-sdk/0.22.6 - . \ No newline at end of file +- [PyPI v0.22.6] https://pypi.org/project/polar-sdk/0.22.6 - . + +## 2025-08-20 00:13:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.606.0 (2.686.7) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.22.7] . +### Releases +- [PyPI v0.22.7] https://pypi.org/project/polar-sdk/0.22.7 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 1e5efb5..1b5a568 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -267,6 +267,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.update(security=polar_sdk.CustomerPortalOrdersUpdateSecurity(\n customer_session=\"\",\n ), id=\"\", customer_order_update={\n \"billing_name\": \"\",\n \"billing_address\": {\n \"country\": \"US\",\n },\n })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/customer-portal/orders/{id}/confirm-payment"]["post"] + 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.confirm_retry_payment(security=polar_sdk.CustomerPortalOrdersConfirmRetryPaymentSecurity(\n customer_session=\"\",\n ), id=\"\", customer_order_confirm_payment={\n \"confirmation_token_id\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customer-portal/orders/{id}/invoice"]["get"] update: "x-codeSamples": @@ -279,12 +285,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.generate_invoice(security=polar_sdk.CustomerPortalOrdersGenerateInvoiceSecurity(\n customer_session=\"\",\n ), id=\"\")\n\n # Handle response\n print(res)" - - target: $["paths"]["/v1/customer-portal/orders/{id}/retry-payment"]["post"] + - target: $["paths"]["/v1/customer-portal/orders/{id}/payment-status"]["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.retry_payment(security=polar_sdk.CustomerPortalOrdersRetryPaymentSecurity(\n customer_session=\"\",\n ), id=\"\")\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\n\nwith Polar() as polar:\n\n res = polar.customer_portal.orders.get_payment_status(security=polar_sdk.CustomerPortalOrdersGetPaymentStatusSecurity(\n customer_session=\"\",\n ), id=\"\")\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customer-portal/organizations/{slug}"]["get"] update: "x-codeSamples": @@ -471,6 +477,24 @@ 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.license_keys.list(organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\", page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + - target: $["paths"]["/v1/license-keys/activate"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.activate(request={\n \"key\": \"\",\n \"organization_id\": \"\",\n \"label\": \"\",\n })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/license-keys/deactivate"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n polar.license_keys.deactivate(request={\n \"key\": \"\",\n \"organization_id\": \"\",\n \"activation_id\": \"\",\n })\n\n # Use the SDK ..." + - target: $["paths"]["/v1/license-keys/validate"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.validate(request={\n \"key\": \"\",\n \"organization_id\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/license-keys/{id}"]["get"] update: "x-codeSamples": @@ -824,25 +848,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 data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-08-21T06:55:49.348Z\"),\n modified_at=None,\n status=polar_sdk.OrderStatus.REFUNDED,\n paid=True,\n subtotal_amount=952546,\n discount_amount=47294,\n net_amount=220865,\n amount=835005,\n tax_amount=913636,\n total_amount=727987,\n refunded_amount=597376,\n refunded_tax_amount=864844,\n currency=\"Kip\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CYCLE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-02-07T21:01:19.424Z\"),\n modified_at=parse_datetime(\"2023-03-27T11:03:51.570Z\"),\n metadata={\n \"key\": 807321,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-07-30T20:36:36.637Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n created_at=parse_datetime(\"2023-10-18T19:16:06.791Z\"),\n modified_at=parse_datetime(\"2023-07-25T14:06:55.496Z\"),\n id=\"\",\n name=\"\",\n description=\"hence hoof amid nimble\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=765577,\n created_at=parse_datetime(\"2025-12-27T11:04:16.188Z\"),\n modified_at=parse_datetime(\"2023-07-01T09:05:58.012Z\"),\n id=\"\",\n metadata={\n \"key\": 736909,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-11-14T21:15:37.421Z\"),\n ends_at=parse_datetime(\"2023-03-07T03:56:36.953Z\"),\n max_redemptions=28675,\n redemptions_count=967708,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2023-01-24T21:36:11.677Z\"),\n modified_at=parse_datetime(\"2025-12-03T03:30:23.797Z\"),\n id=\"\",\n amount=298671,\n currency=\"Boliviano boliviano\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2023-07-06T04:28:24.973Z\"),\n current_period_end=parse_datetime(\"2024-04-03T16:38:36.332Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-08-06T13:46:26.730Z\"),\n started_at=parse_datetime(\"2023-08-04T14:24:05.390Z\"),\n ends_at=parse_datetime(\"2023-01-25T10:47:26.689Z\"),\n ended_at=None,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=None,\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_created_post(request=polar_sdk.WebhookOrderCreatedPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-08-21T06:55:49.348Z\"),\n modified_at=None,\n status=polar_sdk.OrderStatus.REFUNDED,\n paid=True,\n subtotal_amount=952546,\n discount_amount=47294,\n net_amount=220865,\n tax_amount=835005,\n total_amount=913636,\n refunded_amount=727987,\n refunded_tax_amount=597376,\n currency=\"New Taiwan Dollar\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 701529,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-08-28T08:49:40.562Z\"),\n modified_at=None,\n metadata={\n \"key\": 807321,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-07-30T20:36:36.637Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n created_at=parse_datetime(\"2023-10-18T19:16:06.791Z\"),\n modified_at=parse_datetime(\"2023-07-25T14:06:55.496Z\"),\n id=\"\",\n name=\"\",\n description=\"hence hoof amid nimble\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageOnceForeverDurationBase(\n duration=polar_sdk.DiscountDuration.REPEATING,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=765577,\n created_at=parse_datetime(\"2025-12-27T11:04:16.188Z\"),\n modified_at=parse_datetime(\"2023-07-01T09:05:58.012Z\"),\n id=\"\",\n metadata={\n \"key\": 736909,\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-11-14T21:15:37.421Z\"),\n ends_at=parse_datetime(\"2023-03-07T03:56:36.953Z\"),\n max_redemptions=28675,\n redemptions_count=967708,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2023-01-24T21:36:11.677Z\"),\n modified_at=parse_datetime(\"2025-12-03T03:30:23.797Z\"),\n id=\"\",\n amount=298671,\n currency=\"Boliviano boliviano\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2023-07-06T04:28:24.973Z\"),\n current_period_end=parse_datetime(\"2024-04-03T16:38:36.332Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2025-08-06T13:46:26.730Z\"),\n started_at=parse_datetime(\"2023-08-04T14:24:05.390Z\"),\n ends_at=parse_datetime(\"2023-01-25T10:47:26.689Z\"),\n ended_at=None,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=None,\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.paid"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_paid_post(request=polar_sdk.WebhookOrderPaidPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-12-05T07:44:21.172Z\"),\n modified_at=parse_datetime(\"2024-12-11T22:14:44.762Z\"),\n status=polar_sdk.OrderStatus.REFUNDED,\n paid=True,\n subtotal_amount=806442,\n discount_amount=990825,\n net_amount=746396,\n amount=341385,\n tax_amount=486648,\n total_amount=562504,\n refunded_amount=314047,\n refunded_tax_amount=570780,\n currency=\"Norwegian Krone\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=None,\n checkout_id=\"\",\n metadata={\n \"key\": False,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-06-20T08:16:19.561Z\"),\n modified_at=parse_datetime(\"2025-11-18T04:42:58.995Z\"),\n metadata={\n \"key\": True,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2024-06-08T00:11:47.056Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": \"\",\n },\n created_at=parse_datetime(\"2025-10-14T16:14:37.497Z\"),\n modified_at=parse_datetime(\"2024-07-05T21:05:22.131Z\"),\n id=\"\",\n name=\"\",\n description=\"unlike hutch nor table reproachfully eulogise\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n is_recurring=False,\n is_archived=True,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=678845,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=307762,\n created_at=parse_datetime(\"2024-04-10T18:11:00.918Z\"),\n modified_at=parse_datetime(\"2024-12-20T04:35:24.232Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2025-05-13T02:34:59.052Z\"),\n ends_at=parse_datetime(\"2024-05-17T02:38:00.485Z\"),\n max_redemptions=400985,\n redemptions_count=973205,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 568756,\n },\n created_at=parse_datetime(\"2024-05-24T21:01:40.292Z\"),\n modified_at=parse_datetime(\"2024-05-25T21:22:06.978Z\"),\n id=\"\",\n amount=299042,\n currency=\"Pound Sterling\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n status=polar_sdk.SubscriptionStatus.ACTIVE,\n current_period_start=parse_datetime(\"2025-03-08T16:10:05.952Z\"),\n current_period_end=parse_datetime(\"2024-09-10T07:58:34.888Z\"),\n cancel_at_period_end=True,\n canceled_at=parse_datetime(\"2023-09-16T09:43:57.152Z\"),\n started_at=parse_datetime(\"2024-08-15T07:25:23.875Z\"),\n ends_at=parse_datetime(\"2025-02-12T23:41:13.290Z\"),\n ended_at=parse_datetime(\"2023-02-24T15:15:22.018Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-09-21T14:56:16.106Z\"),\n modified_at=parse_datetime(\"2023-01-21T03:35:38.158Z\"),\n id=\"\",\n label=\"\",\n amount=870773,\n tax_amount=305914,\n proration=True,\n product_price_id=\"\",\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_paid_post(request=polar_sdk.WebhookOrderPaidPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2025-12-05T07:44:21.172Z\"),\n modified_at=parse_datetime(\"2024-12-11T22:14:44.762Z\"),\n status=polar_sdk.OrderStatus.REFUNDED,\n paid=True,\n subtotal_amount=806442,\n discount_amount=990825,\n net_amount=746396,\n tax_amount=341385,\n total_amount=486648,\n refunded_amount=562504,\n refunded_tax_amount=314047,\n currency=\"Ouguiya\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CYCLE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=None,\n metadata={\n\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2025-10-27T20:31:30.562Z\"),\n modified_at=parse_datetime(\"2025-04-26T07:56:18.616Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2025-08-01T03:33:20.782Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": 179185,\n },\n created_at=parse_datetime(\"2023-05-18T09:50:39.456Z\"),\n modified_at=parse_datetime(\"2025-07-31T08:10:01.120Z\"),\n id=\"\",\n name=\"\",\n description=\"though rigidly gradient pure whimsical ew personalise exalt scorn gee\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=871130,\n type=polar_sdk.DiscountType.PERCENTAGE,\n amount=727805,\n currency=\"Kwacha\",\n created_at=parse_datetime(\"2024-09-10T07:58:34.888Z\"),\n modified_at=parse_datetime(\"2025-07-17T03:39:23.964Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-07-29T13:43:57.010Z\"),\n ends_at=parse_datetime(\"2025-06-10T20:57:22.896Z\"),\n max_redemptions=None,\n redemptions_count=499443,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": 165283,\n },\n created_at=parse_datetime(\"2025-08-05T06:11:40.745Z\"),\n modified_at=parse_datetime(\"2023-12-05T06:32:48.307Z\"),\n id=\"\",\n amount=18384,\n currency=\"Tanzanian Shilling\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE_EXPIRED,\n current_period_start=parse_datetime(\"2024-06-19T05:54:14.128Z\"),\n current_period_end=parse_datetime(\"2025-08-28T12:32:52.795Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-08-04T10:17:52.706Z\"),\n started_at=parse_datetime(\"2025-08-27T04:13:10.004Z\"),\n ends_at=None,\n ended_at=parse_datetime(\"2024-06-22T19:17:00.470Z\"),\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(\"2024-07-19T20:12:40.543Z\"),\n modified_at=None,\n id=\"\",\n label=\"\",\n amount=116439,\n tax_amount=200966,\n proration=True,\n product_price_id=\"\",\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.refunded"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_refunded_post(request=polar_sdk.WebhookOrderRefundedPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-07-23T18:00:11.615Z\"),\n modified_at=parse_datetime(\"2024-08-23T03:13:11.383Z\"),\n status=polar_sdk.OrderStatus.REFUNDED,\n paid=True,\n subtotal_amount=678552,\n discount_amount=294178,\n net_amount=721778,\n amount=913001,\n tax_amount=518308,\n total_amount=820663,\n refunded_amount=472431,\n refunded_tax_amount=879331,\n currency=\"Hong Kong Dollar\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-08-11T17:50:11.031Z\"),\n modified_at=parse_datetime(\"2023-02-24T05:25:29.794Z\"),\n metadata={\n \"key\": 97027,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2023-01-26T21:26:48.872Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n created_at=parse_datetime(\"2023-01-16T07:26:04.196Z\"),\n modified_at=parse_datetime(\"2025-01-18T16:58:42.976Z\"),\n id=\"\",\n name=\"\",\n description=\"anxiously notwithstanding softly wilderness drat helpless conservation ew\",\n recurring_interval=None,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=177173,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=175227,\n created_at=parse_datetime(\"2024-06-23T22:24:00.212Z\"),\n modified_at=parse_datetime(\"2025-09-20T03:04:20.355Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-22T11:17:00.498Z\"),\n ends_at=parse_datetime(\"2023-01-04T20:02:20.162Z\"),\n max_redemptions=477690,\n redemptions_count=429180,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": True,\n },\n created_at=parse_datetime(\"2023-12-28T02:40:16.151Z\"),\n modified_at=None,\n id=\"\",\n amount=801440,\n currency=\"Kwanza\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.UNPAID,\n current_period_start=parse_datetime(\"2025-12-13T00:18:40.316Z\"),\n current_period_end=parse_datetime(\"2025-09-10T16:01:49.333Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-11-12T03:39:13.416Z\"),\n started_at=parse_datetime(\"2024-11-06T04:39:52.000Z\"),\n ends_at=parse_datetime(\"2024-06-22T23:44:00.447Z\"),\n ended_at=parse_datetime(\"2024-11-02T04:41:56.340Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-06-01T22:10:54.514Z\"),\n modified_at=None,\n id=\"\",\n label=\"\",\n amount=584605,\n tax_amount=493789,\n proration=True,\n product_price_id=\"\",\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_refunded_post(request=polar_sdk.WebhookOrderRefundedPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2024-07-23T18:00:11.615Z\"),\n modified_at=parse_datetime(\"2024-08-23T03:13:11.383Z\"),\n status=polar_sdk.OrderStatus.REFUNDED,\n paid=True,\n subtotal_amount=678552,\n discount_amount=294178,\n net_amount=721778,\n tax_amount=913001,\n total_amount=518308,\n refunded_amount=820663,\n refunded_tax_amount=472431,\n currency=\"Hryvnia\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 537174,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-08-19T02:54:30.835Z\"),\n modified_at=None,\n metadata={\n \"key\": 97027,\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2023-01-26T21:26:48.872Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n created_at=parse_datetime(\"2023-01-16T07:26:04.196Z\"),\n modified_at=parse_datetime(\"2025-01-18T16:58:42.976Z\"),\n id=\"\",\n name=\"\",\n description=\"anxiously notwithstanding softly wilderness drat helpless conservation ew\",\n recurring_interval=None,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=177173,\n type=polar_sdk.DiscountType.PERCENTAGE,\n basis_points=175227,\n created_at=parse_datetime(\"2024-06-23T22:24:00.212Z\"),\n modified_at=parse_datetime(\"2025-09-20T03:04:20.355Z\"),\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2024-09-22T11:17:00.498Z\"),\n ends_at=parse_datetime(\"2023-01-04T20:02:20.162Z\"),\n max_redemptions=477690,\n redemptions_count=429180,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n \"key\": True,\n },\n created_at=parse_datetime(\"2023-12-28T02:40:16.151Z\"),\n modified_at=None,\n id=\"\",\n amount=801440,\n currency=\"Kwanza\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.UNPAID,\n current_period_start=parse_datetime(\"2025-12-13T00:18:40.316Z\"),\n current_period_end=parse_datetime(\"2025-09-10T16:01:49.333Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-11-12T03:39:13.416Z\"),\n started_at=parse_datetime(\"2024-11-06T04:39:52.000Z\"),\n ends_at=parse_datetime(\"2024-06-22T23:44:00.447Z\"),\n ended_at=parse_datetime(\"2024-11-02T04:41:56.340Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.MISSING_FEATURES,\n customer_cancellation_comment=\"\",\n ),\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-06-01T22:10:54.514Z\"),\n modified_at=None,\n id=\"\",\n label=\"\",\n amount=584605,\n tax_amount=493789,\n proration=True,\n product_price_id=\"\",\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["order.updated"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_updated_post(request=polar_sdk.WebhookOrderUpdatedPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2023-10-25T00:08:50.290Z\"),\n modified_at=parse_datetime(\"2024-01-08T20:00:47.692Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=198772,\n discount_amount=338283,\n net_amount=321919,\n amount=827864,\n tax_amount=380359,\n total_amount=596980,\n refunded_amount=404069,\n refunded_tax_amount=718668,\n currency=\"Nuevo Sol\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CREATE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=True,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 187509,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2024-12-03T05:16:11.415Z\"),\n modified_at=parse_datetime(\"2023-03-11T05:58:05.184Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=None,\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=parse_datetime(\"2023-06-26T15:51:37.068Z\"),\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n\n },\n created_at=parse_datetime(\"2024-07-10T12:45:44.731Z\"),\n modified_at=parse_datetime(\"2024-09-19T13:13:25.785Z\"),\n id=\"\",\n name=\"\",\n description=\"bossy direct reservation quaintly atop interestingly\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n is_recurring=True,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountFixedRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.ONCE,\n duration_in_months=227959,\n type=polar_sdk.DiscountType.FIXED,\n amount=785594,\n currency=\"Barbados Dollar\",\n created_at=parse_datetime(\"2025-08-02T14:17:04.679Z\"),\n modified_at=parse_datetime(\"2023-04-10T21:27:35.876Z\"),\n id=\"\",\n metadata={\n \"key\": \"\",\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-05-20T13:29:26.710Z\"),\n ends_at=parse_datetime(\"2023-09-01T14:56:03.459Z\"),\n max_redemptions=583107,\n redemptions_count=378993,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=polar_sdk.OrderSubscription(\n metadata={\n\n },\n created_at=parse_datetime(\"2025-11-15T17:24:36.671Z\"),\n modified_at=parse_datetime(\"2024-10-31T22:22:01.280Z\"),\n id=\"\",\n amount=531188,\n currency=\"Leone\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.CANCELED,\n current_period_start=parse_datetime(\"2024-03-12T02:07:55.904Z\"),\n current_period_end=parse_datetime(\"2023-08-26T12:56:24.423Z\"),\n cancel_at_period_end=False,\n canceled_at=parse_datetime(\"2023-02-18T06:04:41.480Z\"),\n started_at=parse_datetime(\"2024-03-28T15:10:13.508Z\"),\n ends_at=parse_datetime(\"2023-11-03T05:13:30.202Z\"),\n ended_at=parse_datetime(\"2024-03-03T03:52:46.888Z\"),\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.CUSTOMER_SERVICE,\n customer_cancellation_comment=\"\",\n ),\n items=[],\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\nfrom polar_sdk.utils import parse_datetime\n\n\nwith Polar() as polar:\n\n res = polar.endpointorder_updated_post(request=polar_sdk.WebhookOrderUpdatedPayload(\n data=polar_sdk.Order(\n id=\"\",\n created_at=parse_datetime(\"2023-10-25T00:08:50.290Z\"),\n modified_at=parse_datetime(\"2024-01-08T20:00:47.692Z\"),\n status=polar_sdk.OrderStatus.PARTIALLY_REFUNDED,\n paid=True,\n subtotal_amount=198772,\n discount_amount=338283,\n net_amount=321919,\n tax_amount=827864,\n total_amount=380359,\n refunded_amount=596980,\n refunded_tax_amount=404069,\n currency=\"Russian Ruble\",\n billing_reason=polar_sdk.OrderBillingReason.SUBSCRIPTION_CYCLE,\n billing_name=\"\",\n billing_address=polar_sdk.Address(\n country=\"US\",\n ),\n is_invoice_generated=False,\n customer_id=\"\",\n product_id=\"\",\n discount_id=\"\",\n subscription_id=\"\",\n checkout_id=\"\",\n metadata={\n \"key\": 4784.54,\n },\n customer=polar_sdk.OrderCustomer(\n id=\"992fae2a-2a17-4b7a-8d9e-e287cf90131b\",\n created_at=parse_datetime(\"2023-07-25T12:14:47.758Z\"),\n modified_at=parse_datetime(\"2023-10-28T19:38:51.490Z\"),\n metadata={\n\n },\n external_id=\"usr_1337\",\n email=\"customer@example.com\",\n email_verified=True,\n name=\"John Doe\",\n billing_address=None,\n tax_id=[\n \"911144442\",\n \"us_ein\",\n ],\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n deleted_at=None,\n avatar_url=\"https://www.gravatar.com/avatar/xxx?d=404\",\n ),\n user_id=\"\",\n product=polar_sdk.OrderProduct(\n metadata={\n \"key\": \"\",\n },\n created_at=parse_datetime(\"2023-09-09T23:29:46.282Z\"),\n modified_at=parse_datetime(\"2023-12-07T14:52:42.853Z\"),\n id=\"\",\n name=\"\",\n description=\"uniform waver pish coliseum consign absent drat cap including oof\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.YEAR,\n is_recurring=False,\n is_archived=False,\n organization_id=\"\",\n ),\n discount=polar_sdk.DiscountPercentageRepeatDurationBase(\n duration=polar_sdk.DiscountDuration.FOREVER,\n duration_in_months=860052,\n type=polar_sdk.DiscountType.FIXED,\n basis_points=650798,\n created_at=parse_datetime(\"2024-02-06T09:06:51.703Z\"),\n modified_at=None,\n id=\"\",\n metadata={\n\n },\n name=\"\",\n code=\"\",\n starts_at=parse_datetime(\"2023-11-03T05:13:30.202Z\"),\n ends_at=parse_datetime(\"2024-03-03T03:52:46.888Z\"),\n max_redemptions=858600,\n redemptions_count=637128,\n organization_id=\"1dbfc517-0bbf-4301-9ba8-555ca42b9737\",\n ),\n subscription=None,\n items=[\n polar_sdk.OrderItemSchema(\n created_at=parse_datetime(\"2024-02-19T19:25:59.986Z\"),\n modified_at=parse_datetime(\"2025-07-23T06:42:36.223Z\"),\n id=\"\",\n label=\"\",\n amount=669405,\n tax_amount=12321,\n proration=False,\n product_price_id=None,\n ),\n ],\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["organization.updated"]["post"] update: "x-codeSamples": diff --git a/docs/models/cardpayment.md b/docs/models/cardpayment.md index f39811d..1311f0e 100644 --- a/docs/models/cardpayment.md +++ b/docs/models/cardpayment.md @@ -20,5 +20,5 @@ Schema of a payment with a card payment method. | `organization_id` | *str* | :heavy_check_mark: | The ID of the organization that owns the payment. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | | `checkout_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the checkout session associated with this payment. | e4b478fa-cd25-4253-9f1f-8a41e6370ede | | `order_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the order associated with this payment. | e4b478fa-cd25-4253-9f1f-8a41e6370ede | -| `processor_metadata` | [Optional[models.ProcessorMetadata]](../models/processormetadata.md) | :heavy_minus_sign: | Additional metadata from the payment processor for internal use. | | +| `processor_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Additional metadata from the payment processor for internal use. | | | `method_metadata` | [models.CardPaymentMetadata](../models/cardpaymentmetadata.md) | :heavy_check_mark: | Additional metadata for a card payment method. | | \ No newline at end of file diff --git a/docs/models/customerorder.md b/docs/models/customerorder.md index f25f198..d3ebc4c 100644 --- a/docs/models/customerorder.md +++ b/docs/models/customerorder.md @@ -3,33 +3,32 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the object. | | -| `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. | | -| `status` | [models.OrderStatus](../models/orderstatus.md) | :heavy_check_mark: | N/A | | -| `paid` | *bool* | :heavy_check_mark: | Whether the order has been paid for. | true | -| `subtotal_amount` | *int* | :heavy_check_mark: | Amount in cents, before discounts and taxes. | | -| `discount_amount` | *int* | :heavy_check_mark: | Discount amount in cents. | | -| `net_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts but before taxes. | | -| ~~`amount`~~ | *int* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Amount in cents, after discounts but before taxes. | | -| `tax_amount` | *int* | :heavy_check_mark: | Sales tax amount in cents. | | -| `total_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts and taxes. | | -| `refunded_amount` | *int* | :heavy_check_mark: | Amount refunded in cents. | | -| `refunded_tax_amount` | *int* | :heavy_check_mark: | Sales tax refunded in cents. | | -| `currency` | *str* | :heavy_check_mark: | N/A | | -| `billing_reason` | [models.OrderBillingReason](../models/orderbillingreason.md) | :heavy_check_mark: | N/A | | -| `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. | | -| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | -| `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | -| `customer_id` | *str* | :heavy_check_mark: | N/A | | -| `product_id` | *str* | :heavy_check_mark: | N/A | | -| `discount_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `subscription_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `checkout_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| ~~`user_id`~~ | *str* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| `product` | [models.CustomerOrderProduct](../models/customerorderproduct.md) | :heavy_check_mark: | N/A | | -| `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. | | -| `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 +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `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. | | +| `status` | [models.OrderStatus](../models/orderstatus.md) | :heavy_check_mark: | N/A | | +| `paid` | *bool* | :heavy_check_mark: | Whether the order has been paid for. | true | +| `subtotal_amount` | *int* | :heavy_check_mark: | Amount in cents, before discounts and taxes. | | +| `discount_amount` | *int* | :heavy_check_mark: | Discount amount in cents. | | +| `net_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts but before taxes. | | +| `tax_amount` | *int* | :heavy_check_mark: | Sales tax amount in cents. | | +| `total_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts and taxes. | | +| `refunded_amount` | *int* | :heavy_check_mark: | Amount refunded in cents. | | +| `refunded_tax_amount` | *int* | :heavy_check_mark: | Sales tax refunded in cents. | | +| `currency` | *str* | :heavy_check_mark: | N/A | | +| `billing_reason` | [models.OrderBillingReason](../models/orderbillingreason.md) | :heavy_check_mark: | N/A | | +| `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. | | +| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | +| `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | +| `customer_id` | *str* | :heavy_check_mark: | N/A | | +| `product_id` | *str* | :heavy_check_mark: | N/A | | +| `discount_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `subscription_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `checkout_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| ~~`user_id`~~ | *str* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `product` | [models.CustomerOrderProduct](../models/customerorderproduct.md) | :heavy_check_mark: | N/A | | +| `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. | | +| `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 diff --git a/docs/models/customerorderconfirmpayment.md b/docs/models/customerorderconfirmpayment.md new file mode 100644 index 0000000..fe326bf --- /dev/null +++ b/docs/models/customerorderconfirmpayment.md @@ -0,0 +1,11 @@ +# CustomerOrderConfirmPayment + +Schema to confirm a retry payment using a Stripe confirmation token. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `confirmation_token_id` | *str* | :heavy_check_mark: | ID of the Stripe confirmation token. | +| `payment_processor` | [Optional[models.PaymentProcessor]](../models/paymentprocessor.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/customerorderpaymentconfirmation.md b/docs/models/customerorderpaymentconfirmation.md new file mode 100644 index 0000000..84127ae --- /dev/null +++ b/docs/models/customerorderpaymentconfirmation.md @@ -0,0 +1,12 @@ +# CustomerOrderPaymentConfirmation + +Response after confirming a retry payment. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `status` | *str* | :heavy_check_mark: | Payment status after confirmation. | +| `client_secret` | *OptionalNullable[str]* | :heavy_minus_sign: | Client secret for handling additional actions. | +| `error` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message if confirmation failed. | \ No newline at end of file diff --git a/docs/models/customerorderpaymentstatus.md b/docs/models/customerorderpaymentstatus.md new file mode 100644 index 0000000..c8f3fd6 --- /dev/null +++ b/docs/models/customerorderpaymentstatus.md @@ -0,0 +1,11 @@ +# CustomerOrderPaymentStatus + +Payment status for an order. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `status` | *str* | :heavy_check_mark: | Current payment status. | +| `error` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message if payment failed. | \ No newline at end of file diff --git a/docs/models/customerportalordersconfirmretrypaymentrequest.md b/docs/models/customerportalordersconfirmretrypaymentrequest.md new file mode 100644 index 0000000..e526d3f --- /dev/null +++ b/docs/models/customerportalordersconfirmretrypaymentrequest.md @@ -0,0 +1,9 @@ +# CustomerPortalOrdersConfirmRetryPaymentRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `customer_order_confirm_payment` | [models.CustomerOrderConfirmPayment](../models/customerorderconfirmpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/customerportalordersconfirmretrypaymentsecurity.md b/docs/models/customerportalordersconfirmretrypaymentsecurity.md new file mode 100644 index 0000000..a52f9fb --- /dev/null +++ b/docs/models/customerportalordersconfirmretrypaymentsecurity.md @@ -0,0 +1,8 @@ +# CustomerPortalOrdersConfirmRetryPaymentSecurity + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `customer_session` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/customerportalordersretrypaymentrequest.md b/docs/models/customerportalordersgetpaymentstatusrequest.md similarity index 85% rename from docs/models/customerportalordersretrypaymentrequest.md rename to docs/models/customerportalordersgetpaymentstatusrequest.md index ce71336..48d25c4 100644 --- a/docs/models/customerportalordersretrypaymentrequest.md +++ b/docs/models/customerportalordersgetpaymentstatusrequest.md @@ -1,4 +1,4 @@ -# CustomerPortalOrdersRetryPaymentRequest +# CustomerPortalOrdersGetPaymentStatusRequest ## Fields diff --git a/docs/models/customerportalordersretrypaymentsecurity.md b/docs/models/customerportalordersgetpaymentstatussecurity.md similarity index 85% rename from docs/models/customerportalordersretrypaymentsecurity.md rename to docs/models/customerportalordersgetpaymentstatussecurity.md index ea00bdf..daa247e 100644 --- a/docs/models/customerportalordersretrypaymentsecurity.md +++ b/docs/models/customerportalordersgetpaymentstatussecurity.md @@ -1,4 +1,4 @@ -# CustomerPortalOrdersRetryPaymentSecurity +# CustomerPortalOrdersGetPaymentStatusSecurity ## Fields diff --git a/docs/models/genericpayment.md b/docs/models/genericpayment.md index ecd0d0b..7ade227 100644 --- a/docs/models/genericpayment.md +++ b/docs/models/genericpayment.md @@ -5,19 +5,19 @@ Schema of a payment with a generic payment method. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `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. | | -| `processor` | [models.PaymentProcessor](../models/paymentprocessor.md) | :heavy_check_mark: | N/A | | -| `status` | [models.PaymentStatus](../models/paymentstatus.md) | :heavy_check_mark: | N/A | | -| `amount` | *int* | :heavy_check_mark: | The payment amount in cents. | 1000 | -| `currency` | *str* | :heavy_check_mark: | The payment currency. Currently, only `usd` is supported. | usd | -| `method` | *str* | :heavy_check_mark: | The payment method used. | card | -| `decline_reason` | *Nullable[str]* | :heavy_check_mark: | Error code, if the payment was declined. | insufficient_funds | -| `decline_message` | *Nullable[str]* | :heavy_check_mark: | Human-reasable error message, if the payment was declined. | Your card has insufficient funds. | -| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization that owns the payment. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | -| `checkout_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the checkout session associated with this payment. | e4b478fa-cd25-4253-9f1f-8a41e6370ede | -| `order_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the order associated with this payment. | e4b478fa-cd25-4253-9f1f-8a41e6370ede | -| `processor_metadata` | [Optional[models.GenericPaymentProcessorMetadata]](../models/genericpaymentprocessormetadata.md) | :heavy_minus_sign: | Additional metadata from the payment processor for internal use. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `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. | | +| `processor` | [models.PaymentProcessor](../models/paymentprocessor.md) | :heavy_check_mark: | N/A | | +| `status` | [models.PaymentStatus](../models/paymentstatus.md) | :heavy_check_mark: | N/A | | +| `amount` | *int* | :heavy_check_mark: | The payment amount in cents. | 1000 | +| `currency` | *str* | :heavy_check_mark: | The payment currency. Currently, only `usd` is supported. | usd | +| `method` | *str* | :heavy_check_mark: | The payment method used. | card | +| `decline_reason` | *Nullable[str]* | :heavy_check_mark: | Error code, if the payment was declined. | insufficient_funds | +| `decline_message` | *Nullable[str]* | :heavy_check_mark: | Human-reasable error message, if the payment was declined. | Your card has insufficient funds. | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization that owns the payment. | 1dbfc517-0bbf-4301-9ba8-555ca42b9737 | +| `checkout_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the checkout session associated with this payment. | e4b478fa-cd25-4253-9f1f-8a41e6370ede | +| `order_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the order associated with this payment. | e4b478fa-cd25-4253-9f1f-8a41e6370ede | +| `processor_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Additional metadata from the payment processor for internal use. | | \ No newline at end of file diff --git a/docs/models/genericpaymentprocessormetadata.md b/docs/models/genericpaymentprocessormetadata.md deleted file mode 100644 index 9e8dce7..0000000 --- a/docs/models/genericpaymentprocessormetadata.md +++ /dev/null @@ -1,9 +0,0 @@ -# GenericPaymentProcessorMetadata - -Additional metadata from the payment processor for internal use. - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/order.md b/docs/models/order.md index 121ff4a..28084a3 100644 --- a/docs/models/order.md +++ b/docs/models/order.md @@ -3,36 +3,35 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the object. | | -| `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. | | -| `status` | [models.OrderStatus](../models/orderstatus.md) | :heavy_check_mark: | N/A | | -| `paid` | *bool* | :heavy_check_mark: | Whether the order has been paid for. | true | -| `subtotal_amount` | *int* | :heavy_check_mark: | Amount in cents, before discounts and taxes. | | -| `discount_amount` | *int* | :heavy_check_mark: | Discount amount in cents. | | -| `net_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts but before taxes. | | -| ~~`amount`~~ | *int* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Amount in cents, after discounts but before taxes. | | -| `tax_amount` | *int* | :heavy_check_mark: | Sales tax amount in cents. | | -| `total_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts and taxes. | | -| `refunded_amount` | *int* | :heavy_check_mark: | Amount refunded in cents. | | -| `refunded_tax_amount` | *int* | :heavy_check_mark: | Sales tax refunded in cents. | | -| `currency` | *str* | :heavy_check_mark: | N/A | | -| `billing_reason` | [models.OrderBillingReason](../models/orderbillingreason.md) | :heavy_check_mark: | N/A | | -| `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. | | -| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | -| `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | -| `customer_id` | *str* | :heavy_check_mark: | N/A | | -| `product_id` | *str* | :heavy_check_mark: | N/A | | -| `discount_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `subscription_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `checkout_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `metadata` | Dict[str, [models.OrderMetadata](../models/ordermetadata.md)] | :heavy_check_mark: | N/A | | -| `custom_field_data` | Dict[str, [Nullable[models.OrderCustomFieldData]](../models/ordercustomfielddata.md)] | :heavy_minus_sign: | Key-value object storing custom field values. | | -| `customer` | [models.OrderCustomer](../models/ordercustomer.md) | :heavy_check_mark: | N/A | | -| ~~`user_id`~~ | *str* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| `product` | [models.OrderProduct](../models/orderproduct.md) | :heavy_check_mark: | N/A | | -| `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. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | | +| `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. | | +| `status` | [models.OrderStatus](../models/orderstatus.md) | :heavy_check_mark: | N/A | | +| `paid` | *bool* | :heavy_check_mark: | Whether the order has been paid for. | true | +| `subtotal_amount` | *int* | :heavy_check_mark: | Amount in cents, before discounts and taxes. | | +| `discount_amount` | *int* | :heavy_check_mark: | Discount amount in cents. | | +| `net_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts but before taxes. | | +| `tax_amount` | *int* | :heavy_check_mark: | Sales tax amount in cents. | | +| `total_amount` | *int* | :heavy_check_mark: | Amount in cents, after discounts and taxes. | | +| `refunded_amount` | *int* | :heavy_check_mark: | Amount refunded in cents. | | +| `refunded_tax_amount` | *int* | :heavy_check_mark: | Sales tax refunded in cents. | | +| `currency` | *str* | :heavy_check_mark: | N/A | | +| `billing_reason` | [models.OrderBillingReason](../models/orderbillingreason.md) | :heavy_check_mark: | N/A | | +| `billing_name` | *Nullable[str]* | :heavy_check_mark: | The name of the customer that should appear on the invoice. | | +| `billing_address` | [Nullable[models.Address]](../models/address.md) | :heavy_check_mark: | N/A | | +| `is_invoice_generated` | *bool* | :heavy_check_mark: | Whether an invoice has been generated for this order. | | +| `customer_id` | *str* | :heavy_check_mark: | N/A | | +| `product_id` | *str* | :heavy_check_mark: | N/A | | +| `discount_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `subscription_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `checkout_id` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `metadata` | Dict[str, [models.OrderMetadata](../models/ordermetadata.md)] | :heavy_check_mark: | N/A | | +| `custom_field_data` | Dict[str, [Nullable[models.OrderCustomFieldData]](../models/ordercustomfielddata.md)] | :heavy_minus_sign: | Key-value object storing custom field values. | | +| `customer` | [models.OrderCustomer](../models/ordercustomer.md) | :heavy_check_mark: | N/A | | +| ~~`user_id`~~ | *str* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `product` | [models.OrderProduct](../models/orderproduct.md) | :heavy_check_mark: | N/A | | +| `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. | | \ No newline at end of file diff --git a/docs/models/processormetadata.md b/docs/models/processormetadata.md deleted file mode 100644 index b39ee03..0000000 --- a/docs/models/processormetadata.md +++ /dev/null @@ -1,9 +0,0 @@ -# ProcessorMetadata - -Additional metadata from the payment processor for internal use. - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/sdks/licensekeys/README.md b/docs/sdks/licensekeys/README.md index a4d2f7d..3268369 100644 --- a/docs/sdks/licensekeys/README.md +++ b/docs/sdks/licensekeys/README.md @@ -9,6 +9,9 @@ * [get](#get) - Get License Key * [update](#update) - Update License Key * [get_activation](#get_activation) - Get Activation +* [validate](#validate) - Validate License Key +* [activate](#activate) - Activate License Key +* [deactivate](#deactivate) - Deactivate License Key ## list @@ -191,4 +194,140 @@ with Polar( | models.Unauthorized | 401 | application/json | | models.ResourceNotFound | 404 | application/json | | models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## validate + +Validate a license key. + +**Scopes**: `license_keys:write` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.license_keys.validate(request={ + "key": "", + "organization_id": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.LicenseKeyValidate](../../models/licensekeyvalidate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ValidatedLicenseKey](../../models/validatedlicensekey.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## activate + +Activate a license key instance. + +**Scopes**: `license_keys:write` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + res = polar.license_keys.activate(request={ + "key": "", + "organization_id": "", + "label": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.LicenseKeyActivate](../../models/licensekeyactivate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.LicenseKeyActivationRead](../../models/licensekeyactivationread.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.NotPermitted | 403 | application/json | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## deactivate + +Deactivate a license key instance. + +**Scopes**: `license_keys:write` + +### Example Usage + + +```python +from polar_sdk import Polar + + +with Polar( + access_token="", +) as polar: + + polar.license_keys.deactivate(request={ + "key": "", + "organization_id": "", + "activation_id": "", + }) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.LicenseKeyDeactivate](../../models/licensekeydeactivate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/polarlicensekeys/README.md b/docs/sdks/polarlicensekeys/README.md index e8b5871..da218bc 100644 --- a/docs/sdks/polarlicensekeys/README.md +++ b/docs/sdks/polarlicensekeys/README.md @@ -109,6 +109,11 @@ with Polar() as polar: Validate a license key. +> This endpoint doesn't require authentication and can be safely used on a public +> client, like a desktop application or a mobile app. +> If you plan to validate a license key on a server, use the `/v1/license-keys/validate` +> endpoint instead. + ### Example Usage @@ -151,6 +156,11 @@ with Polar() as polar: Activate a license key instance. +> This endpoint doesn't require authentication and can be safely used on a public +> client, like a desktop application or a mobile app. +> If you plan to validate a license key on a server, use the `/v1/license-keys/activate` +> endpoint instead. + ### Example Usage @@ -195,6 +205,11 @@ with Polar() as polar: Deactivate a license key instance. +> This endpoint doesn't require authentication and can be safely used on a public +> client, like a desktop application or a mobile app. +> If you plan to validate a license key on a server, use the `/v1/license-keys/deactivate` +> endpoint instead. + ### Example Usage diff --git a/docs/sdks/polarorders/README.md b/docs/sdks/polarorders/README.md index c1ca52b..9d9f6f0 100644 --- a/docs/sdks/polarorders/README.md +++ b/docs/sdks/polarorders/README.md @@ -10,7 +10,8 @@ * [update](#update) - Update Order * [generate_invoice](#generate_invoice) - Generate Order Invoice * [invoice](#invoice) - Get Order Invoice -* [retry_payment](#retry_payment) - Retry Payment +* [get_payment_status](#get_payment_status) - Get Order Payment Status +* [confirm_retry_payment](#confirm_retry_payment) - Confirm Retry Payment ## list @@ -252,15 +253,15 @@ with Polar() as polar: | models.HTTPValidationError | 422 | application/json | | models.SDKError | 4XX, 5XX | \*/\* | -## retry_payment +## get_payment_status -Manually retry payment for a failed order. +Get the current payment status for an order. -**Scopes**: `customer_portal:write` +**Scopes**: `customer_portal:read` `customer_portal:write` ### Example Usage - + ```python import polar_sdk from polar_sdk import Polar @@ -268,7 +269,7 @@ from polar_sdk import Polar with Polar() as polar: - res = polar.customer_portal.orders.retry_payment(security=polar_sdk.CustomerPortalOrdersRetryPaymentSecurity( + res = polar.customer_portal.orders.get_payment_status(security=polar_sdk.CustomerPortalOrdersGetPaymentStatusSecurity( customer_session="", ), id="") @@ -279,15 +280,63 @@ with Polar() as polar: ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `security` | [models.CustomerPortalOrdersRetryPaymentSecurity](../../models/customerportalordersretrypaymentsecurity.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. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalOrdersGetPaymentStatusSecurity](../../models/customerportalordersgetpaymentstatussecurity.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 -**[Any](../../models/.md)** +**[models.CustomerOrderPaymentStatus](../../models/customerorderpaymentstatus.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## confirm_retry_payment + +Confirm a retry payment using a Stripe confirmation token. + +**Scopes**: `customer_portal:write` + +### Example Usage + + +```python +import polar_sdk +from polar_sdk import Polar + + +with Polar() as polar: + + res = polar.customer_portal.orders.confirm_retry_payment(security=polar_sdk.CustomerPortalOrdersConfirmRetryPaymentSecurity( + customer_session="", + ), id="", customer_order_confirm_payment={ + "confirmation_token_id": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `security` | [models.CustomerPortalOrdersConfirmRetryPaymentSecurity](../../models/customerportalordersconfirmretrypaymentsecurity.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The order ID. | +| `customer_order_confirm_payment` | [models.CustomerOrderConfirmPayment](../../models/customerorderconfirmpayment.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CustomerOrderPaymentConfirmation](../../models/customerorderpaymentconfirmation.md)** ### Errors diff --git a/pyproject.toml b/pyproject.toml index 09fc41b..ba605e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "polar-sdk" -version = "0.22.6" +version = "0.22.7" description = "Polar SDK for Python" authors = [{ name = "Polar" },] readme = "README-PYPI.md" diff --git a/scripts/prepare_readme.py b/scripts/prepare_readme.py index 64c7160..c7cfb53 100644 --- a/scripts/prepare_readme.py +++ b/scripts/prepare_readme.py @@ -10,12 +10,14 @@ GITHUB_URL = ( GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL ) + REPO_SUBDIR = "" # links on PyPI should have absolute URLs readme_contents = re.sub( r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", lambda m: m.group(1) + GITHUB_URL + "/blob/master/" + + REPO_SUBDIR + m.group(2) + m.group(3), readme_contents, diff --git a/src/polar_sdk/_version.py b/src/polar_sdk/_version.py index 3494808..1442812 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.22.6" +__version__: str = "0.22.7" __openapi_doc_version__: str = "0.1.0" -__gen_version__: str = "2.680.0" -__user_agent__: str = "speakeasy-sdk/python 0.22.6 2.680.0 0.1.0 polar-sdk" +__gen_version__: str = "2.686.7" +__user_agent__: str = "speakeasy-sdk/python 0.22.7 2.686.7 0.1.0 polar-sdk" try: if __package__ is not None: diff --git a/src/polar_sdk/license_keys.py b/src/polar_sdk/license_keys.py index fd1faf3..923202a 100644 --- a/src/polar_sdk/license_keys.py +++ b/src/polar_sdk/license_keys.py @@ -4,9 +4,9 @@ from jsonpath import JSONPath from polar_sdk import models, utils from polar_sdk._hooks import HookContext -from polar_sdk.types import OptionalNullable, UNSET +from polar_sdk.types import BaseModel, OptionalNullable, UNSET from polar_sdk.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Dict, List, Mapping, Optional, Union +from typing import Any, Dict, List, Mapping, Optional, Union, cast class LicenseKeys(BaseSDK): @@ -919,3 +919,595 @@ async def get_activation_async( raise models.SDKError("API error occurred", http_res, http_res_text) raise models.SDKError("Unexpected response received", http_res) + + def validate( + self, + *, + request: Union[models.LicenseKeyValidate, models.LicenseKeyValidateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ValidatedLicenseKey: + r"""Validate License Key + + Validate a license key. + + **Scopes**: `license_keys:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.LicenseKeyValidate) + request = cast(models.LicenseKeyValidate, request) + + req = self._build_request( + method="POST", + path="/v1/license-keys/validate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.LicenseKeyValidate + ), + 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="license_keys:validate", + oauth2_scopes=[], + 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.ValidatedLicenseKey, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def validate_async( + self, + *, + request: Union[models.LicenseKeyValidate, models.LicenseKeyValidateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ValidatedLicenseKey: + r"""Validate License Key + + Validate a license key. + + **Scopes**: `license_keys:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.LicenseKeyValidate) + request = cast(models.LicenseKeyValidate, request) + + req = self._build_request_async( + method="POST", + path="/v1/license-keys/validate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.LicenseKeyValidate + ), + 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="license_keys:validate", + oauth2_scopes=[], + 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.ValidatedLicenseKey, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + def activate( + self, + *, + request: Union[models.LicenseKeyActivate, models.LicenseKeyActivateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.LicenseKeyActivationRead: + r"""Activate License Key + + Activate a license key instance. + + **Scopes**: `license_keys:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.LicenseKeyActivate) + request = cast(models.LicenseKeyActivate, request) + + req = self._build_request( + method="POST", + path="/v1/license-keys/activate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.LicenseKeyActivate + ), + 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="license_keys:activate", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["403", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.LicenseKeyActivationRead, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(models.NotPermittedData, http_res) + raise models.NotPermitted(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def activate_async( + self, + *, + request: Union[models.LicenseKeyActivate, models.LicenseKeyActivateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.LicenseKeyActivationRead: + r"""Activate License Key + + Activate a license key instance. + + **Scopes**: `license_keys:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.LicenseKeyActivate) + request = cast(models.LicenseKeyActivate, request) + + req = self._build_request_async( + method="POST", + path="/v1/license-keys/activate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.LicenseKeyActivate + ), + 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="license_keys:activate", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["403", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.LicenseKeyActivationRead, http_res) + if utils.match_response(http_res, "403", "application/json"): + response_data = unmarshal_json_response(models.NotPermittedData, http_res) + raise models.NotPermitted(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + def deactivate( + self, + *, + request: Union[ + models.LicenseKeyDeactivate, models.LicenseKeyDeactivateTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Deactivate License Key + + Deactivate a license key instance. + + **Scopes**: `license_keys:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.LicenseKeyDeactivate) + request = cast(models.LicenseKeyDeactivate, request) + + req = self._build_request( + method="POST", + path="/v1/license-keys/deactivate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.LicenseKeyDeactivate + ), + 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="license_keys:deactivate", + oauth2_scopes=[], + 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, "204", "*"): + return + 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 deactivate_async( + self, + *, + request: Union[ + models.LicenseKeyDeactivate, models.LicenseKeyDeactivateTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Deactivate License Key + + Deactivate a license key instance. + + **Scopes**: `license_keys:write` + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.LicenseKeyDeactivate) + request = cast(models.LicenseKeyDeactivate, request) + + req = self._build_request_async( + method="POST", + path="/v1/license-keys/deactivate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.LicenseKeyDeactivate + ), + 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="license_keys:deactivate", + oauth2_scopes=[], + 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, "204", "*"): + return + 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/models/__init__.py b/src/polar_sdk/models/__init__.py index 57853d5..41cf0be 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -338,12 +338,7 @@ from .benefittype import BenefitType from .benefitupdatedevent import BenefitUpdatedEvent, BenefitUpdatedEventTypedDict from .billingaddressfieldmode import BillingAddressFieldMode - from .cardpayment import ( - CardPayment, - CardPaymentTypedDict, - ProcessorMetadata, - ProcessorMetadataTypedDict, - ) + from .cardpayment import CardPayment, CardPaymentTypedDict from .cardpaymentmetadata import CardPaymentMetadata, CardPaymentMetadataTypedDict from .checkout import ( Checkout, @@ -692,6 +687,12 @@ CustomerPortalLicenseKeysListSecurity, CustomerPortalLicenseKeysListSecurityTypedDict, ) + from .customer_portal_orders_confirm_retry_paymentop import ( + CustomerPortalOrdersConfirmRetryPaymentRequest, + CustomerPortalOrdersConfirmRetryPaymentRequestTypedDict, + CustomerPortalOrdersConfirmRetryPaymentSecurity, + CustomerPortalOrdersConfirmRetryPaymentSecurityTypedDict, + ) from .customer_portal_orders_generate_invoiceop import ( CustomerPortalOrdersGenerateInvoiceRequest, CustomerPortalOrdersGenerateInvoiceRequestTypedDict, @@ -700,6 +701,12 @@ CustomerPortalOrdersGenerateInvoiceSecurity, CustomerPortalOrdersGenerateInvoiceSecurityTypedDict, ) + from .customer_portal_orders_get_payment_statusop import ( + CustomerPortalOrdersGetPaymentStatusRequest, + CustomerPortalOrdersGetPaymentStatusRequestTypedDict, + CustomerPortalOrdersGetPaymentStatusSecurity, + CustomerPortalOrdersGetPaymentStatusSecurityTypedDict, + ) from .customer_portal_orders_getop import ( CustomerPortalOrdersGetRequest, CustomerPortalOrdersGetRequestTypedDict, @@ -728,12 +735,6 @@ CustomerPortalOrdersListSecurity, CustomerPortalOrdersListSecurityTypedDict, ) - from .customer_portal_orders_retry_paymentop import ( - CustomerPortalOrdersRetryPaymentRequest, - CustomerPortalOrdersRetryPaymentRequestTypedDict, - CustomerPortalOrdersRetryPaymentSecurity, - CustomerPortalOrdersRetryPaymentSecurityTypedDict, - ) from .customer_portal_orders_updateop import ( CustomerPortalOrdersUpdateRequest, CustomerPortalOrdersUpdateRequestTypedDict, @@ -864,10 +865,22 @@ from .customermeter import CustomerMeter, CustomerMeterTypedDict from .customermetersortproperty import CustomerMeterSortProperty from .customerorder import CustomerOrder, CustomerOrderTypedDict + from .customerorderconfirmpayment import ( + CustomerOrderConfirmPayment, + CustomerOrderConfirmPaymentTypedDict, + ) from .customerorderinvoice import ( CustomerOrderInvoice, CustomerOrderInvoiceTypedDict, ) + from .customerorderpaymentconfirmation import ( + CustomerOrderPaymentConfirmation, + CustomerOrderPaymentConfirmationTypedDict, + ) + from .customerorderpaymentstatus import ( + CustomerOrderPaymentStatus, + CustomerOrderPaymentStatusTypedDict, + ) from .customerorderproduct import ( CustomerOrderProduct, CustomerOrderProductPrices, @@ -1342,12 +1355,7 @@ from .filterclause import FilterClause, FilterClauseTypedDict, Value, ValueTypedDict from .filterconjunction import FilterConjunction from .filteroperator import FilterOperator - from .genericpayment import ( - GenericPayment, - GenericPaymentProcessorMetadata, - GenericPaymentProcessorMetadataTypedDict, - GenericPaymentTypedDict, - ) + from .genericpayment import GenericPayment, GenericPaymentTypedDict from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData from .introspecttokenrequest import ( IntrospectTokenRequest, @@ -2848,8 +2856,14 @@ "CustomerMetersListResponse", "CustomerMetersListResponseTypedDict", "CustomerOrder", + "CustomerOrderConfirmPayment", + "CustomerOrderConfirmPaymentTypedDict", "CustomerOrderInvoice", "CustomerOrderInvoiceTypedDict", + "CustomerOrderPaymentConfirmation", + "CustomerOrderPaymentConfirmationTypedDict", + "CustomerOrderPaymentStatus", + "CustomerOrderPaymentStatusTypedDict", "CustomerOrderProduct", "CustomerOrderProductPrices", "CustomerOrderProductPricesTypedDict", @@ -2940,12 +2954,20 @@ "CustomerPortalLicenseKeysListSecurityTypedDict", "CustomerPortalOAuthAccount", "CustomerPortalOAuthAccountTypedDict", + "CustomerPortalOrdersConfirmRetryPaymentRequest", + "CustomerPortalOrdersConfirmRetryPaymentRequestTypedDict", + "CustomerPortalOrdersConfirmRetryPaymentSecurity", + "CustomerPortalOrdersConfirmRetryPaymentSecurityTypedDict", "CustomerPortalOrdersGenerateInvoiceRequest", "CustomerPortalOrdersGenerateInvoiceRequestTypedDict", "CustomerPortalOrdersGenerateInvoiceResponse422CustomerPortalOrdersGenerateInvoice", "CustomerPortalOrdersGenerateInvoiceResponse422CustomerPortalOrdersGenerateInvoiceUnion", "CustomerPortalOrdersGenerateInvoiceSecurity", "CustomerPortalOrdersGenerateInvoiceSecurityTypedDict", + "CustomerPortalOrdersGetPaymentStatusRequest", + "CustomerPortalOrdersGetPaymentStatusRequestTypedDict", + "CustomerPortalOrdersGetPaymentStatusSecurity", + "CustomerPortalOrdersGetPaymentStatusSecurityTypedDict", "CustomerPortalOrdersGetRequest", "CustomerPortalOrdersGetRequestTypedDict", "CustomerPortalOrdersGetSecurity", @@ -2968,10 +2990,6 @@ "CustomerPortalOrdersListResponseTypedDict", "CustomerPortalOrdersListSecurity", "CustomerPortalOrdersListSecurityTypedDict", - "CustomerPortalOrdersRetryPaymentRequest", - "CustomerPortalOrdersRetryPaymentRequestTypedDict", - "CustomerPortalOrdersRetryPaymentSecurity", - "CustomerPortalOrdersRetryPaymentSecurityTypedDict", "CustomerPortalOrdersUpdateRequest", "CustomerPortalOrdersUpdateRequestTypedDict", "CustomerPortalOrdersUpdateSecurity", @@ -3260,8 +3278,6 @@ "FilterTypedDict", "Func", "GenericPayment", - "GenericPaymentProcessorMetadata", - "GenericPaymentProcessorMetadataTypedDict", "GenericPaymentTypedDict", "HTTPValidationError", "HTTPValidationErrorData", @@ -3668,8 +3684,6 @@ "PreviousPropertiesTypedDict", "Prices", "PricesTypedDict", - "ProcessorMetadata", - "ProcessorMetadataTypedDict", "Product", "ProductBenefitsUpdate", "ProductBenefitsUpdateTypedDict", @@ -4208,8 +4222,6 @@ "BillingAddressFieldMode": ".billingaddressfieldmode", "CardPayment": ".cardpayment", "CardPaymentTypedDict": ".cardpayment", - "ProcessorMetadata": ".cardpayment", - "ProcessorMetadataTypedDict": ".cardpayment", "CardPaymentMetadata": ".cardpaymentmetadata", "CardPaymentMetadataTypedDict": ".cardpaymentmetadata", "Checkout": ".checkout", @@ -4461,12 +4473,20 @@ "CustomerPortalLicenseKeysListResponseTypedDict": ".customer_portal_license_keys_listop", "CustomerPortalLicenseKeysListSecurity": ".customer_portal_license_keys_listop", "CustomerPortalLicenseKeysListSecurityTypedDict": ".customer_portal_license_keys_listop", + "CustomerPortalOrdersConfirmRetryPaymentRequest": ".customer_portal_orders_confirm_retry_paymentop", + "CustomerPortalOrdersConfirmRetryPaymentRequestTypedDict": ".customer_portal_orders_confirm_retry_paymentop", + "CustomerPortalOrdersConfirmRetryPaymentSecurity": ".customer_portal_orders_confirm_retry_paymentop", + "CustomerPortalOrdersConfirmRetryPaymentSecurityTypedDict": ".customer_portal_orders_confirm_retry_paymentop", "CustomerPortalOrdersGenerateInvoiceRequest": ".customer_portal_orders_generate_invoiceop", "CustomerPortalOrdersGenerateInvoiceRequestTypedDict": ".customer_portal_orders_generate_invoiceop", "CustomerPortalOrdersGenerateInvoiceResponse422CustomerPortalOrdersGenerateInvoice": ".customer_portal_orders_generate_invoiceop", "CustomerPortalOrdersGenerateInvoiceResponse422CustomerPortalOrdersGenerateInvoiceUnion": ".customer_portal_orders_generate_invoiceop", "CustomerPortalOrdersGenerateInvoiceSecurity": ".customer_portal_orders_generate_invoiceop", "CustomerPortalOrdersGenerateInvoiceSecurityTypedDict": ".customer_portal_orders_generate_invoiceop", + "CustomerPortalOrdersGetPaymentStatusRequest": ".customer_portal_orders_get_payment_statusop", + "CustomerPortalOrdersGetPaymentStatusRequestTypedDict": ".customer_portal_orders_get_payment_statusop", + "CustomerPortalOrdersGetPaymentStatusSecurity": ".customer_portal_orders_get_payment_statusop", + "CustomerPortalOrdersGetPaymentStatusSecurityTypedDict": ".customer_portal_orders_get_payment_statusop", "CustomerPortalOrdersGetRequest": ".customer_portal_orders_getop", "CustomerPortalOrdersGetRequestTypedDict": ".customer_portal_orders_getop", "CustomerPortalOrdersGetSecurity": ".customer_portal_orders_getop", @@ -4489,10 +4509,6 @@ "CustomerPortalOrdersListResponseTypedDict": ".customer_portal_orders_listop", "CustomerPortalOrdersListSecurity": ".customer_portal_orders_listop", "CustomerPortalOrdersListSecurityTypedDict": ".customer_portal_orders_listop", - "CustomerPortalOrdersRetryPaymentRequest": ".customer_portal_orders_retry_paymentop", - "CustomerPortalOrdersRetryPaymentRequestTypedDict": ".customer_portal_orders_retry_paymentop", - "CustomerPortalOrdersRetryPaymentSecurity": ".customer_portal_orders_retry_paymentop", - "CustomerPortalOrdersRetryPaymentSecurityTypedDict": ".customer_portal_orders_retry_paymentop", "CustomerPortalOrdersUpdateRequest": ".customer_portal_orders_updateop", "CustomerPortalOrdersUpdateRequestTypedDict": ".customer_portal_orders_updateop", "CustomerPortalOrdersUpdateSecurity": ".customer_portal_orders_updateop", @@ -4573,8 +4589,14 @@ "CustomerMeterSortProperty": ".customermetersortproperty", "CustomerOrder": ".customerorder", "CustomerOrderTypedDict": ".customerorder", + "CustomerOrderConfirmPayment": ".customerorderconfirmpayment", + "CustomerOrderConfirmPaymentTypedDict": ".customerorderconfirmpayment", "CustomerOrderInvoice": ".customerorderinvoice", "CustomerOrderInvoiceTypedDict": ".customerorderinvoice", + "CustomerOrderPaymentConfirmation": ".customerorderpaymentconfirmation", + "CustomerOrderPaymentConfirmationTypedDict": ".customerorderpaymentconfirmation", + "CustomerOrderPaymentStatus": ".customerorderpaymentstatus", + "CustomerOrderPaymentStatusTypedDict": ".customerorderpaymentstatus", "CustomerOrderProduct": ".customerorderproduct", "CustomerOrderProductPrices": ".customerorderproduct", "CustomerOrderProductPricesTypedDict": ".customerorderproduct", @@ -4914,8 +4936,6 @@ "FilterConjunction": ".filterconjunction", "FilterOperator": ".filteroperator", "GenericPayment": ".genericpayment", - "GenericPaymentProcessorMetadata": ".genericpayment", - "GenericPaymentProcessorMetadataTypedDict": ".genericpayment", "GenericPaymentTypedDict": ".genericpayment", "HTTPValidationError": ".httpvalidationerror", "HTTPValidationErrorData": ".httpvalidationerror", diff --git a/src/polar_sdk/models/cardpayment.py b/src/polar_sdk/models/cardpayment.py index ceed361..b828016 100644 --- a/src/polar_sdk/models/cardpayment.py +++ b/src/polar_sdk/models/cardpayment.py @@ -10,18 +10,10 @@ import pydantic from pydantic import model_serializer from pydantic.functional_validators import AfterValidator -from typing import Literal, Optional +from typing import Any, Dict, Literal, Optional from typing_extensions import Annotated, NotRequired, TypedDict -class ProcessorMetadataTypedDict(TypedDict): - r"""Additional metadata from the payment processor for internal use.""" - - -class ProcessorMetadata(BaseModel): - r"""Additional metadata from the payment processor for internal use.""" - - class CardPaymentTypedDict(TypedDict): r"""Schema of a payment with a card payment method.""" @@ -51,7 +43,7 @@ class CardPaymentTypedDict(TypedDict): r"""Additional metadata for a card payment method.""" method: Literal["card"] r"""The payment method used.""" - processor_metadata: NotRequired[ProcessorMetadataTypedDict] + processor_metadata: NotRequired[Dict[str, Any]] r"""Additional metadata from the payment processor for internal use.""" @@ -101,7 +93,7 @@ class CardPayment(BaseModel): ] = "card" r"""The payment method used.""" - processor_metadata: Optional[ProcessorMetadata] = None + processor_metadata: Optional[Dict[str, Any]] = None r"""Additional metadata from the payment processor for internal use.""" @model_serializer(mode="wrap") diff --git a/src/polar_sdk/models/customer_portal_orders_confirm_retry_paymentop.py b/src/polar_sdk/models/customer_portal_orders_confirm_retry_paymentop.py new file mode 100644 index 0000000..88ae9d6 --- /dev/null +++ b/src/polar_sdk/models/customer_portal_orders_confirm_retry_paymentop.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .customerorderconfirmpayment import ( + CustomerOrderConfirmPayment, + CustomerOrderConfirmPaymentTypedDict, +) +from polar_sdk.types import BaseModel +from polar_sdk.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, + SecurityMetadata, +) +from typing_extensions import Annotated, TypedDict + + +class CustomerPortalOrdersConfirmRetryPaymentSecurityTypedDict(TypedDict): + customer_session: str + + +class CustomerPortalOrdersConfirmRetryPaymentSecurity(BaseModel): + customer_session: Annotated[ + str, + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="http", + sub_type="bearer", + field_name="Authorization", + ) + ), + ] + + +class CustomerPortalOrdersConfirmRetryPaymentRequestTypedDict(TypedDict): + id: str + r"""The order ID.""" + customer_order_confirm_payment: CustomerOrderConfirmPaymentTypedDict + + +class CustomerPortalOrdersConfirmRetryPaymentRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The order ID.""" + + customer_order_confirm_payment: Annotated[ + CustomerOrderConfirmPayment, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/polar_sdk/models/customer_portal_orders_retry_paymentop.py b/src/polar_sdk/models/customer_portal_orders_get_payment_statusop.py similarity index 73% rename from src/polar_sdk/models/customer_portal_orders_retry_paymentop.py rename to src/polar_sdk/models/customer_portal_orders_get_payment_statusop.py index 9dbadfc..ed959cd 100644 --- a/src/polar_sdk/models/customer_portal_orders_retry_paymentop.py +++ b/src/polar_sdk/models/customer_portal_orders_get_payment_statusop.py @@ -6,11 +6,11 @@ from typing_extensions import Annotated, TypedDict -class CustomerPortalOrdersRetryPaymentSecurityTypedDict(TypedDict): +class CustomerPortalOrdersGetPaymentStatusSecurityTypedDict(TypedDict): customer_session: str -class CustomerPortalOrdersRetryPaymentSecurity(BaseModel): +class CustomerPortalOrdersGetPaymentStatusSecurity(BaseModel): customer_session: Annotated[ str, FieldMetadata( @@ -24,12 +24,12 @@ class CustomerPortalOrdersRetryPaymentSecurity(BaseModel): ] -class CustomerPortalOrdersRetryPaymentRequestTypedDict(TypedDict): +class CustomerPortalOrdersGetPaymentStatusRequestTypedDict(TypedDict): id: str r"""The order ID.""" -class CustomerPortalOrdersRetryPaymentRequest(BaseModel): +class CustomerPortalOrdersGetPaymentStatusRequest(BaseModel): id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] diff --git a/src/polar_sdk/models/customerorder.py b/src/polar_sdk/models/customerorder.py index 3053bcc..5418962 100644 --- a/src/polar_sdk/models/customerorder.py +++ b/src/polar_sdk/models/customerorder.py @@ -34,8 +34,6 @@ class CustomerOrderTypedDict(TypedDict): r"""Discount amount in cents.""" net_amount: int r"""Amount in cents, after discounts but before taxes.""" - amount: int - r"""Amount in cents, after discounts but before taxes.""" tax_amount: int r"""Sales tax amount in cents.""" total_amount: int @@ -89,14 +87,6 @@ class CustomerOrder(BaseModel): net_amount: int r"""Amount in cents, after discounts but before taxes.""" - amount: Annotated[ - int, - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ), - ] - r"""Amount in cents, after discounts but before taxes.""" - tax_amount: int r"""Sales tax amount in cents.""" diff --git a/src/polar_sdk/models/customerorderconfirmpayment.py b/src/polar_sdk/models/customerorderconfirmpayment.py new file mode 100644 index 0000000..6030c1c --- /dev/null +++ b/src/polar_sdk/models/customerorderconfirmpayment.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .paymentprocessor import PaymentProcessor +from polar_sdk.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CustomerOrderConfirmPaymentTypedDict(TypedDict): + r"""Schema to confirm a retry payment using a Stripe confirmation token.""" + + confirmation_token_id: str + r"""ID of the Stripe confirmation token.""" + payment_processor: NotRequired[PaymentProcessor] + + +class CustomerOrderConfirmPayment(BaseModel): + r"""Schema to confirm a retry payment using a Stripe confirmation token.""" + + confirmation_token_id: str + r"""ID of the Stripe confirmation token.""" + + payment_processor: Optional[PaymentProcessor] = None diff --git a/src/polar_sdk/models/customerorderpaymentconfirmation.py b/src/polar_sdk/models/customerorderpaymentconfirmation.py new file mode 100644 index 0000000..1777d43 --- /dev/null +++ b/src/polar_sdk/models/customerorderpaymentconfirmation.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CustomerOrderPaymentConfirmationTypedDict(TypedDict): + r"""Response after confirming a retry payment.""" + + status: str + r"""Payment status after confirmation.""" + client_secret: NotRequired[Nullable[str]] + r"""Client secret for handling additional actions.""" + error: NotRequired[Nullable[str]] + r"""Error message if confirmation failed.""" + + +class CustomerOrderPaymentConfirmation(BaseModel): + r"""Response after confirming a retry payment.""" + + status: str + r"""Payment status after confirmation.""" + + client_secret: OptionalNullable[str] = UNSET + r"""Client secret for handling additional actions.""" + + error: OptionalNullable[str] = UNSET + r"""Error message if confirmation failed.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["client_secret", "error"] + nullable_fields = ["client_secret", "error"] + 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/customerorderpaymentstatus.py b/src/polar_sdk/models/customerorderpaymentstatus.py new file mode 100644 index 0000000..44eb453 --- /dev/null +++ b/src/polar_sdk/models/customerorderpaymentstatus.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CustomerOrderPaymentStatusTypedDict(TypedDict): + r"""Payment status for an order.""" + + status: str + r"""Current payment status.""" + error: NotRequired[Nullable[str]] + r"""Error message if payment failed.""" + + +class CustomerOrderPaymentStatus(BaseModel): + r"""Payment status for an order.""" + + status: str + r"""Current payment status.""" + + error: OptionalNullable[str] = UNSET + r"""Error message if payment failed.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["error"] + nullable_fields = ["error"] + 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/genericpayment.py b/src/polar_sdk/models/genericpayment.py index 68ca84b..1d6c945 100644 --- a/src/polar_sdk/models/genericpayment.py +++ b/src/polar_sdk/models/genericpayment.py @@ -6,18 +6,10 @@ from datetime import datetime from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL from pydantic import model_serializer -from typing import Optional +from typing import Any, Dict, Optional from typing_extensions import NotRequired, TypedDict -class GenericPaymentProcessorMetadataTypedDict(TypedDict): - r"""Additional metadata from the payment processor for internal use.""" - - -class GenericPaymentProcessorMetadata(BaseModel): - r"""Additional metadata from the payment processor for internal use.""" - - class GenericPaymentTypedDict(TypedDict): r"""Schema of a payment with a generic payment method.""" @@ -45,7 +37,7 @@ class GenericPaymentTypedDict(TypedDict): r"""The ID of the checkout session associated with this payment.""" order_id: Nullable[str] r"""The ID of the order associated with this payment.""" - processor_metadata: NotRequired[GenericPaymentProcessorMetadataTypedDict] + processor_metadata: NotRequired[Dict[str, Any]] r"""Additional metadata from the payment processor for internal use.""" @@ -89,7 +81,7 @@ class GenericPayment(BaseModel): order_id: Nullable[str] r"""The ID of the order associated with this payment.""" - processor_metadata: Optional[GenericPaymentProcessorMetadata] = None + processor_metadata: Optional[Dict[str, Any]] = None r"""Additional metadata from the payment processor for internal use.""" @model_serializer(mode="wrap") diff --git a/src/polar_sdk/models/order.py b/src/polar_sdk/models/order.py index f618f8f..f137d55 100644 --- a/src/polar_sdk/models/order.py +++ b/src/polar_sdk/models/order.py @@ -88,8 +88,6 @@ class OrderTypedDict(TypedDict): r"""Discount amount in cents.""" net_amount: int r"""Amount in cents, after discounts but before taxes.""" - amount: int - r"""Amount in cents, after discounts but before taxes.""" tax_amount: int r"""Sales tax amount in cents.""" total_amount: int @@ -146,14 +144,6 @@ class Order(BaseModel): net_amount: int r"""Amount in cents, after discounts but before taxes.""" - amount: Annotated[ - int, - pydantic.Field( - deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ), - ] - r"""Amount in cents, after discounts but before taxes.""" - tax_amount: int r"""Sales tax amount in cents.""" diff --git a/src/polar_sdk/polar_license_keys.py b/src/polar_sdk/polar_license_keys.py index f2ff349..6e9a52d 100644 --- a/src/polar_sdk/polar_license_keys.py +++ b/src/polar_sdk/polar_license_keys.py @@ -521,6 +521,11 @@ def validate( Validate a license key. + > This endpoint doesn't require authentication and can be safely used on a public + > client, like a desktop application or a mobile app. + > If you plan to validate a license key on a server, use the `/v1/license-keys/validate` + > endpoint instead. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -615,6 +620,11 @@ async def validate_async( Validate a license key. + > This endpoint doesn't require authentication and can be safely used on a public + > client, like a desktop application or a mobile app. + > If you plan to validate a license key on a server, use the `/v1/license-keys/validate` + > endpoint instead. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -709,6 +719,11 @@ def activate( Activate a license key instance. + > This endpoint doesn't require authentication and can be safely used on a public + > client, like a desktop application or a mobile app. + > If you plan to validate a license key on a server, use the `/v1/license-keys/activate` + > endpoint instead. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -806,6 +821,11 @@ async def activate_async( Activate a license key instance. + > This endpoint doesn't require authentication and can be safely used on a public + > client, like a desktop application or a mobile app. + > If you plan to validate a license key on a server, use the `/v1/license-keys/activate` + > endpoint instead. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -905,6 +925,11 @@ def deactivate( Deactivate a license key instance. + > This endpoint doesn't require authentication and can be safely used on a public + > client, like a desktop application or a mobile app. + > If you plan to validate a license key on a server, use the `/v1/license-keys/deactivate` + > endpoint instead. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1001,6 +1026,11 @@ async def deactivate_async( Deactivate a license key instance. + > This endpoint doesn't require authentication and can be safely used on a public + > client, like a desktop application or a mobile app. + > If you plan to validate a license key on a server, use the `/v1/license-keys/deactivate` + > endpoint instead. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/src/polar_sdk/polar_orders.py b/src/polar_sdk/polar_orders.py index 92af990..590f9c6 100644 --- a/src/polar_sdk/polar_orders.py +++ b/src/polar_sdk/polar_orders.py @@ -1198,27 +1198,234 @@ async def invoice_async( raise models.SDKError("Unexpected response received", http_res) - def retry_payment( + def get_payment_status( self, *, security: Union[ - models.CustomerPortalOrdersRetryPaymentSecurity, - models.CustomerPortalOrdersRetryPaymentSecurityTypedDict, + models.CustomerPortalOrdersGetPaymentStatusSecurity, + models.CustomerPortalOrdersGetPaymentStatusSecurityTypedDict, ], id: str, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Any: - r"""Retry Payment + ) -> models.CustomerOrderPaymentStatus: + r"""Get Order Payment Status + + Get the current payment status for an order. + + **Scopes**: `customer_portal:read` `customer_portal:write` + + :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.CustomerPortalOrdersGetPaymentStatusRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/v1/customer-portal/orders/{id}/payment-status", + 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.CustomerPortalOrdersGetPaymentStatusSecurity + ), + 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:get_payment_status", + 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.CustomerOrderPaymentStatus, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + async def get_payment_status_async( + self, + *, + security: Union[ + models.CustomerPortalOrdersGetPaymentStatusSecurity, + models.CustomerPortalOrdersGetPaymentStatusSecurityTypedDict, + ], + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerOrderPaymentStatus: + r"""Get Order Payment Status + + Get the current payment status for an order. + + **Scopes**: `customer_portal:read` `customer_portal:write` + + :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.CustomerPortalOrdersGetPaymentStatusRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/customer-portal/orders/{id}/payment-status", + 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.CustomerPortalOrdersGetPaymentStatusSecurity + ), + 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:get_payment_status", + 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.CustomerOrderPaymentStatus, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.ResourceNotFoundData, http_res + ) + raise models.ResourceNotFound(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.HTTPValidationErrorData, http_res + ) + raise models.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError("API error occurred", http_res, http_res_text) + + raise models.SDKError("Unexpected response received", http_res) + + def confirm_retry_payment( + self, + *, + security: Union[ + models.CustomerPortalOrdersConfirmRetryPaymentSecurity, + models.CustomerPortalOrdersConfirmRetryPaymentSecurityTypedDict, + ], + id: str, + customer_order_confirm_payment: Union[ + models.CustomerOrderConfirmPayment, + models.CustomerOrderConfirmPaymentTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerOrderPaymentConfirmation: + r"""Confirm Retry Payment - Manually retry payment for a failed order. + Confirm a retry payment using a Stripe confirmation token. **Scopes**: `customer_portal:write` :param security: :param id: The order ID. + :param customer_order_confirm_payment: :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 @@ -1234,24 +1441,34 @@ def retry_payment( else: base_url = self._get_url(base_url, url_variables) - request = models.CustomerPortalOrdersRetryPaymentRequest( + request = models.CustomerPortalOrdersConfirmRetryPaymentRequest( id=id, + customer_order_confirm_payment=utils.get_pydantic_model( + customer_order_confirm_payment, models.CustomerOrderConfirmPayment + ), ) req = self._build_request( method="POST", - path="/v1/customer-portal/orders/{id}/retry-payment", + path="/v1/customer-portal/orders/{id}/confirm-payment", base_url=base_url, url_variables=url_variables, request=request, - request_body_required=False, + request_body_required=True, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, security=utils.get_pydantic_model( - security, models.CustomerPortalOrdersRetryPaymentSecurity + security, models.CustomerPortalOrdersConfirmRetryPaymentSecurity + ), + get_serialized_body=lambda: utils.serialize_request_body( + request.customer_order_confirm_payment, + False, + False, + "json", + models.CustomerOrderConfirmPayment, ), timeout_ms=timeout_ms, ) @@ -1268,7 +1485,7 @@ def retry_payment( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="customer_portal:orders:retry_payment", + operation_id="customer_portal:orders:confirm_retry_payment", oauth2_scopes=None, security_source=security, ), @@ -1278,8 +1495,10 @@ def retry_payment( ) response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.CustomerOrderPaymentConfirmation, http_res + ) if utils.match_response(http_res, "404", "application/json"): response_data = unmarshal_json_response( models.ResourceNotFoundData, http_res @@ -1304,27 +1523,32 @@ def retry_payment( raise models.SDKError("Unexpected response received", http_res) - async def retry_payment_async( + async def confirm_retry_payment_async( self, *, security: Union[ - models.CustomerPortalOrdersRetryPaymentSecurity, - models.CustomerPortalOrdersRetryPaymentSecurityTypedDict, + models.CustomerPortalOrdersConfirmRetryPaymentSecurity, + models.CustomerPortalOrdersConfirmRetryPaymentSecurityTypedDict, ], id: str, + customer_order_confirm_payment: Union[ + models.CustomerOrderConfirmPayment, + models.CustomerOrderConfirmPaymentTypedDict, + ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> Any: - r"""Retry Payment + ) -> models.CustomerOrderPaymentConfirmation: + r"""Confirm Retry Payment - Manually retry payment for a failed order. + Confirm a retry payment using a Stripe confirmation token. **Scopes**: `customer_portal:write` :param security: :param id: The order ID. + :param customer_order_confirm_payment: :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 @@ -1340,24 +1564,34 @@ async def retry_payment_async( else: base_url = self._get_url(base_url, url_variables) - request = models.CustomerPortalOrdersRetryPaymentRequest( + request = models.CustomerPortalOrdersConfirmRetryPaymentRequest( id=id, + customer_order_confirm_payment=utils.get_pydantic_model( + customer_order_confirm_payment, models.CustomerOrderConfirmPayment + ), ) req = self._build_request_async( method="POST", - path="/v1/customer-portal/orders/{id}/retry-payment", + path="/v1/customer-portal/orders/{id}/confirm-payment", base_url=base_url, url_variables=url_variables, request=request, - request_body_required=False, + request_body_required=True, request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", http_headers=http_headers, security=utils.get_pydantic_model( - security, models.CustomerPortalOrdersRetryPaymentSecurity + security, models.CustomerPortalOrdersConfirmRetryPaymentSecurity + ), + get_serialized_body=lambda: utils.serialize_request_body( + request.customer_order_confirm_payment, + False, + False, + "json", + models.CustomerOrderConfirmPayment, ), timeout_ms=timeout_ms, ) @@ -1374,7 +1608,7 @@ async def retry_payment_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="customer_portal:orders:retry_payment", + operation_id="customer_portal:orders:confirm_retry_payment", oauth2_scopes=None, security_source=security, ), @@ -1384,8 +1618,10 @@ async def retry_payment_async( ) response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.CustomerOrderPaymentConfirmation, http_res + ) if utils.match_response(http_res, "404", "application/json"): response_data = unmarshal_json_response( models.ResourceNotFoundData, http_res